:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #ff9900; /* Amazon orange */
    --success: #16a34a;
    --danger: #dc3545;
    --border: #e5e7eb;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --container-max: 1200px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
 }

 @media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0f17;
        --surface: #0f172a;
        --surface-2: #0b1220;
        --text: #e5e7eb;
        --muted: #94a3b8;
        --border: #1f2937;
        --shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
    }
 }

 @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
 }

 body {
    font-family: var(--font);
    margin: 0;
    padding: var(--space-6);
    background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 85%, #ffffff 15%));
    color: var(--text);
 }
 .container {
    max-width: var(--container-max);
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
 }
 .header {
    background: linear-gradient(135deg, #232f3e 0%, #1b2533 100%);
    color: #ffffff;
    padding: var(--space-6);
    text-align: center;
    border-bottom: 1px solid var(--border);
 }
 .header h1 {
    margin: 0 0 var(--space-2);
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 700;
    letter-spacing: 0.2px;
 }
 .header p {
    margin: 0;
    color: var(--muted);
 }
 .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
 }
 .stat {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
 }
 .stat-number {
    font-size: 24px;
    font-weight: 800;
    color: #232f3e;
 }
 .stat-label {
    font-size: 13px;
    color: var(--muted);
 }
 .table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 65vh;
    position: relative;
    padding: 0 var(--space-2) var(--space-2); /* reduced gutters for a modern, tighter look */
}
 table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
 }
 th, td {
    padding: 10px 12px; /* compact */
    text-align: left;
    border-bottom: 1px solid var(--border);
}
 thead th {
    /* subtle translucent header over scrolling content */
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.1) blur(6px);
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0,0,0,0.04);
}
/* smooth rounded header corners */
thead th:first-child { border-top-left-radius: var(--radius-sm); }
thead th:last-child { border-top-right-radius: var(--radius-sm); }

/* zebra rows for readability */
tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--surface-2) 10%, var(--surface));
}

th.sorted-asc::after {
    content: " ▲";
}
th.sorted-desc::after {
    content: " ▼";
}
tr.job-row:hover {
    background: color-mix(in srgb, var(--surface-2) 22%, var(--surface));
    cursor: pointer;
    transition: background-color .18s ease;
}
 .hidden {
    display: none;
 }
 .filter-controls {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    padding: var(--space-5);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
 }
 .filter-controls label {
    font-weight: 600;
    color: #495057;
 }
 .filter-controls input, .filter-controls select {
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
 }
 .filter-controls input,
 .filter-controls select,
 .filter-controls .multi-select {
    flex: 0 0 auto; /* Do not stretch */
 }

/* Company multiselect */
.multi-select {
    position: relative;
    display: inline-block;
}
.multi-select-toggle {
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    min-width: 220px;
    text-align: left;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.multi-select-toggle:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.35);
}
.multi-select-toggle:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.35);
}
.multi-select-toggle:hover {
    background: var(--surface-2);
}
.multi-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 280px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    padding: var(--space-2);
}
.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: var(--radius-xs);
}
.multi-select-option:hover {
    background: var(--surface-2);
}
.multi-select-option input {
    margin: 0;
}
.multi-select-option .option-label {
    flex: 1 1 auto;
}
.multi-select-option .option-count {
    color: var(--muted);
    font-size: 12px;
}
.active {
    color: var(--success);
    font-weight: bold;
}
.inactive {
    color: var(--danger);
}
.footer {
    padding: var(--space-5);
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
}
.job-url {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
.job-url:hover {
    text-decoration-thickness: 2px;
}
.details-container {
    padding: 10px 0;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}
.details-container h4 {
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #232f3e;
}
.details-container p {
    margin: 0 0 10px;
}
.skills-container {
    padding: var(--space-5);
}
.skills-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.skill-item {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.skill-item-text {
    flex-grow: 1;
    font-weight: 600;
}
.skill-count-bar {
    background-color: #e9ecef;
    border-radius: var(--radius-xs);
    height: 10px;
    flex-grow: 1;
    margin: 0 10px;
    overflow: hidden;
}
.skill-count-fill {
    height: 100%;
    background-color: var(--accent);
    transition: width .25s ease;
}
.skill-count-label {
    font-size: 12px;
    color: var(--muted);
}
.sankey-container {
    padding: var(--space-5);
    background: var(--surface);
    border-top: 1px solid var(--border);
}
