:root {
    --bg: #ffffff;
    --panel: #ffffff;
    --border: #e0e3e8;
    --text: #000000;
    --muted: #6b7280;
    --accent: #3366cc;
    --good: #1a7f37;
    --bad: #cf222e;
    --warn: #9a6700;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

nav a.active, nav a:hover { color: var(--text); }

nav .brand { color: var(--text); font-weight: 700; margin-right: auto; }

main {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

h1 { font-size: 20px; margin: 0 0 4px; }
.subtitle { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--muted);
}

.legend dt {
    display: inline;
    font-weight: 700;
    color: var(--text);
}

.legend dt::after { content: ' — '; font-weight: 400; color: var(--muted); }

.legend dd {
    display: inline;
    margin: 0;
}

.legend .legend-item { display: block; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 18px;
}

.filters label {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    color: var(--muted);
    gap: 4px;
}

.filters input, .filters select {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
}

.filters button, .btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    /* no overflow:hidden here — that would make the table its own (non-scrolling)
       scroll container and break position:sticky on th, since sticky would then
       track the table's own never-moving viewport instead of the page's scroll */
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

th, td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 44px; /* sits just below the sticky top pagination bar */
    background: var(--panel);
    box-shadow: inset 0 -1px 0 var(--border), 0 2px 4px rgba(16, 24, 40, .06);
    z-index: 2;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f0f3f9; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge.scored { background: rgba(63,185,80,.15); color: var(--good); }
.badge.enriched { background: rgba(91,141,239,.15); color: var(--accent); }
.badge.new { background: rgba(154,161,172,.15); color: var(--muted); }
.badge.disqualified { background: rgba(248,81,73,.15); color: var(--bad); }

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #f0f3f9;
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 12px;
}

.empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.score-bar {
    width: 90px;
    height: 6px;
    background: #e8ebf0;
    border-radius: 999px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.score-bar span {
    display: block;
    height: 100%;
    background: var(--accent);
}

.note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
}

.pagination.sticky-top {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
    height: 44px;
    box-sizing: border-box;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    margin-top: 0;
    flex-wrap: nowrap;
}

.pagination .pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination a.page-link, .pagination span.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}

.pagination a.page-link:hover { background: #f0f3f9; }

.pagination span.page-link.disabled {
    color: var(--muted);
    opacity: .5;
}

.pagination span.page-link.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.per-page-form {
    display: inline-flex;
}

.per-page-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.per-page-form select {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 13px;
}
