/* ──────────────────────────────────────────────────────────────────
   Excel Display – Frontend Styles
   ────────────────────────────────────────────────────────────────── */

/* Wrapper */
.exd-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: .95rem;
    color: #333;
    margin: 24px 0;
}

/* Notices */
.exd-notice {
    padding: 14px 18px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #555;
}
.exd-no-file { border-left: 4px solid #6c757d; }
.exd-error   { border-left: 4px solid #dc3545; background: #fff5f5; color: #842029; }

/* ── Header bar ─────────────────────────────────────────────────── */
.exd-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.exd-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .84rem;
    color: #666;
}
.exd-filename { font-weight: 600; color: #333; }
.exd-count {
    background: #e9ecef;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .8rem;
}

/* Search */
.exd-search-wrap { flex-shrink: 0; }
.exd-search {
    padding: 7px 12px 7px 32px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: .88rem;
    width: 220px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 10px center no-repeat;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.exd-search:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,.15);
}

/* ── Table wrap ─────────────────────────────────────────────────── */
.exd-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ── Base table ─────────────────────────────────────────────────── */
.exd-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: auto;
}
.exd-table th,
.exd-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exd-table tbody tr:last-child td { border-bottom: none; }
.exd-table tbody tr:hover { background: #f8f9fa; transition: background .15s; }

/* Sortable headers */
.exd-table thead th {
    background: #f1f3f5;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
    border-bottom: 2px solid #dee2e6;
}
.exd-table thead th:hover { background: #e9ecef; }
.exd-sort-icon { margin-left: 4px; font-size: .8rem; opacity: .4; }
.exd-table th.exd-sorted-asc  .exd-sort-icon,
.exd-table th.exd-sorted-desc .exd-sort-icon { opacity: 1; }
.exd-table th.exd-sorted-asc  .exd-sort-icon::before { content: '↑'; }
.exd-table th.exd-sorted-desc .exd-sort-icon::before { content: '↓'; }
.exd-table th.exd-sorted-asc  .exd-sort-icon,
.exd-table th.exd-sorted-desc .exd-sort-icon { font-size: .9rem; }

/* Hidden rows (pagination / search) */
.exd-row.exd-hidden { display: none; }

/* No results */
.exd-no-results {
    padding: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* ── Style: Striped ─────────────────────────────────────────────── */
.exd-style-striped .exd-table tbody tr:nth-child(even) { background: #f8f9fa; }
.exd-style-striped .exd-table tbody tr:hover { background: #e8f4fd; }

/* ── Style: Bordered ────────────────────────────────────────────── */
.exd-style-bordered .exd-table th,
.exd-style-bordered .exd-table td {
    border: 1px solid #dee2e6;
}

/* ── Style: Dark Header ─────────────────────────────────────────── */
.exd-style-dark .exd-table thead th {
    background: #2c3e50;
    color: #fff;
    border-bottom-color: #1a252f;
}
.exd-style-dark .exd-table thead th:hover { background: #34495e; }
.exd-style-dark .exd-table thead th .exd-sort-icon { color: #adb5bd; }

/* ── Style: Minimal ─────────────────────────────────────────────── */
.exd-style-minimal .exd-table-wrap {
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.exd-style-minimal .exd-table th,
.exd-style-minimal .exd-table td {
    border-bottom: 1px solid #dee2e6;
    border-left: none;
    border-right: none;
}
.exd-style-minimal .exd-table thead th {
    background: transparent;
    border-top: 2px solid #333;
    border-bottom: 1px solid #333;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Pagination ─────────────────────────────────────────────────── */
.exd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.exd-page-btn {
    padding: 7px 18px;
    border: 1px solid #ced4da;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: .88rem;
    transition: background .15s, border-color .15s;
}
.exd-page-btn:hover:not(:disabled) {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}
.exd-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.exd-page-info {
    font-size: .88rem;
    color: #666;
    min-width: 120px;
    text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .exd-header-bar { flex-direction: column; align-items: flex-start; }
    .exd-search { width: 100%; }
    .exd-table th, .exd-table td { padding: 8px 10px; font-size: .85rem; }
}

/* ── Highlight matched search text ──────────────────────────────── */
.exd-highlight {
    background: #fff176;
    border-radius: 2px;
    padding: 0 1px;
}
