/* KIPP Delta Insights Dashboard v2 Styles */
/* Editorial Data Intelligence - Bold, Memorable, Professional */

:root {
    /* Colors */
    --slate: #1a1a2e;
    --slate-light: #2d2d44;
    --slate-medium: #252540;
    --amber: #E67E22;
    --amber-dark: #d35400;
    --amber-light: rgba(230, 126, 34, 0.12);
    --amber-glow: rgba(230, 126, 34, 0.25);
    --cream: #faf8f5;
    --cream-dark: #f0ebe3;
    --ink: #16213e;
    --muted: #6b7280;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 4rem;

    /* Shadows - Layered depth system */
    --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.04);
    --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.08);
    --shadow-lg: 0 12px 32px rgba(26, 26, 46, 0.12);
    --shadow-glow: 0 0 40px rgba(230, 126, 34, 0.15);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--slate);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   NAVIGATION
   ============================================ */
.dashboard-nav {
    background: var(--slate);
    color: var(--cream);
    padding: var(--space-sm) var(--space-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-nav .container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--cream);
    text-decoration: none;
}

.dashboard-logo span { color: var(--amber); }

.module-nav,
.nav-module {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--cream);
    font-size: 0.9rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--amber);
    color: var(--slate);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Auth UI elements */
.user-menu .sign-in-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--cream);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
}

.user-menu .sign-in-btn:hover {
    background: rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info .user-name {
    color: var(--cream);
    font-size: 0.9rem;
}

.user-info .sign-out-btn {
    padding: 0.3rem 0.75rem;
    background: transparent;
    color: var(--cream);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
}

.user-info .sign-out-btn:hover {
    background: rgba(255,255,255,0.1);
}

.module-selector {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
}

.module-selector label,
.module-selector > span {
    color: rgba(255,255,255,0.7);
}

.module-selector select {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: var(--cream);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23faf8f5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.module-selector select option {
    background: var(--slate);
    color: var(--cream);
}

.nav-links {
    display: flex;
    gap: var(--space-sm);
}

.nav-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--cream);
    background: rgba(255,255,255,0.1);
}

/* ============================================
   PAGE HEADER - Bold Editorial Statement
   ============================================ */
.page-header {
    background: var(--slate);
    color: white;
    padding: var(--space-xl) var(--space-md) var(--space-lg);
    position: relative;
    overflow: hidden;
}

/* Dynamic amber accent - BOLD diagonal stripe */
.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -5%;
    width: 45%;
    height: 200%;
    background: linear-gradient(180deg, var(--amber) 0%, var(--amber-dark) 100%);
    transform: rotate(-15deg);
    opacity: 0.15;
    pointer-events: none;
}

/* Secondary diagonal for depth */
.page-header .container::before {
    content: '';
    position: absolute;
    top: -100%;
    right: 15%;
    width: 20%;
    height: 300%;
    background: var(--amber);
    transform: rotate(-15deg);
    opacity: 0.05;
    pointer-events: none;
}

/* Bottom accent line - full width gradient */
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--amber) 0%, var(--amber-dark) 50%, transparent 100%);
}

.page-header .container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: white;
    letter-spacing: -0.03em;
    line-height: 1.05;
    animation: headerReveal 0.5s var(--ease-out-expo) both;
}

/* Amber highlight for key word */
.page-header h1 .highlight,
.page-header h1 strong {
    color: var(--amber);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    animation: headerReveal 0.5s var(--ease-out-expo) 0.05s both;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    animation: headerReveal 0.5s var(--ease-out-expo) 0.1s both;
}

.header-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.header-meta .separator {
    color: rgba(255, 255, 255, 0.3);
}

/* Fast entrance animation - speed to insight */
@keyframes headerReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .page-header h1,
    .page-subtitle,
    .header-meta {
        animation: none;
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.dashboard-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* ============================================
   KPI CARDS - Speed to Insight
   ============================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    margin-top: var(--space-sm);
    position: relative;
    z-index: 10;
}

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: var(--space-xs); }
}

@media (max-width: 900px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-card { padding: var(--space-sm) var(--space-md); }
}

.kpi-card {
    background: white;
    border-radius: 8px;
    padding: var(--space-md);
    border: none;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-fast) var(--ease-out-expo),
                box-shadow var(--duration-fast) var(--ease-out-expo);
    position: relative;
    overflow: hidden;

    /* Minimal stagger - speed matters */
    animation: kpiReveal 0.35s var(--ease-out-expo) both;
}

.kpi-card:nth-child(1) { animation-delay: 0s; }
.kpi-card:nth-child(2) { animation-delay: 0.03s; }
.kpi-card:nth-child(3) { animation-delay: 0.06s; }
.kpi-card:nth-child(4) { animation-delay: 0.09s; }

@keyframes kpiReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left accent bar - always visible, shows status */
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--amber);
    transition: width var(--duration-fast) var(--ease-out-expo);
}

/* Status-based accent colors */
.kpi-card.status-success::before { background: var(--success); }
.kpi-card.status-warning::before { background: var(--warning); }
.kpi-card.status-danger::before { background: var(--danger); }

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card:hover::before {
    width: 6px;
}

.kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--slate);
    line-height: 1;
    letter-spacing: -0.02em;
}

/* Value color states */
.kpi-value.text-success { color: var(--success); }
.kpi-value.text-warning { color: var(--warning); }
.kpi-value.text-danger { color: var(--danger); }

.kpi-change {
    font-size: 0.85rem;
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    background: var(--cream);
}

.kpi-change.positive {
    color: #047857;
    background: rgba(5, 150, 105, 0.15);
}
.kpi-change.positive::before {
    content: '▲';
    font-size: 0.65rem;
}

.kpi-change.negative {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.12);
}
.kpi-change.negative::before {
    content: '▼';
    font-size: 0.65rem;
}

.kpi-change.warning {
    color: #b45309;
    background: rgba(217, 119, 6, 0.12);
}
.kpi-change.warning::before {
    content: '●';
    font-size: 0.5rem;
}

.kpi-change.neutral {
    color: var(--muted);
    background: var(--cream);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .kpi-card {
        animation: none;
    }
}

/* ============================================
   SECTION CARDS
   ============================================ */
.section-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--cream-dark);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.section-header {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--cream-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cream);
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--slate);
}

.section-actions {
    display: flex;
    gap: var(--space-xs);
}

.section-body {
    padding: var(--space-md);
}

.section-body.no-padding {
    padding: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--slate);
    color: white;
}

.btn-primary:hover {
    background: var(--ink);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--slate);
    border: 1px solid var(--cream-dark);
}

.btn-secondary:hover {
    background: var(--cream);
}

.btn-small {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 4px;
    cursor: pointer;
    color: var(--slate);
    text-decoration: none;
}

.btn-small:hover {
    background: var(--cream-dark);
}

/* ============================================
   TABLES
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--cream-dark);
}

.data-table th {
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background: var(--cream);
}

.data-table tr:hover {
    background: rgba(212, 163, 115, 0.05);
}

.data-table tr.highlight {
    background: rgba(220, 38, 38, 0.05);
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(2, 132, 199, 0.1);
    color: var(--info);
}

.badge-neutral {
    background: var(--cream);
    color: var(--muted);
}

/* ============================================
   ALERT BOXES
   ============================================ */
.alert {
    padding: var(--space-sm) var(--space-md);
    border-radius: 6px;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.alert-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.alert-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-content p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--slate-light);
}

.alert-warning {
    background: rgba(217, 119, 6, 0.08);
    border-left: 3px solid var(--warning);
}
.alert-warning .alert-icon { color: var(--warning); }
.alert-warning h4 { color: var(--warning); }

.alert-danger {
    background: rgba(220, 38, 38, 0.08);
    border-left: 3px solid var(--danger);
}
.alert-danger .alert-icon { color: var(--danger); }
.alert-danger h4 { color: var(--danger); }

.alert-success {
    background: rgba(5, 150, 105, 0.08);
    border-left: 3px solid var(--success);
}
.alert-success .alert-icon { color: var(--success); }
.alert-success h4 { color: var(--success); }

.alert-info {
    background: rgba(2, 132, 199, 0.08);
    border-left: 3px solid var(--info);
}
.alert-info .alert-icon { color: var(--info); }
.alert-info h4 { color: var(--info); }

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

/* ============================================
   CHARTS (Chart.js containers)
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container.small {
    height: 200px;
}

.chart-container.large {
    height: 400px;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-bar {
    height: 8px;
    background: var(--cream-dark);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.info { background: var(--info); }

/* Labeled progress */
.progress-labeled {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.progress-labeled .progress-bar {
    flex: 1;
}

.progress-labeled .progress-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 3rem;
    text-align: right;
}

/* ============================================
   FOOTER
   ============================================ */
.dashboard-footer {
    padding: var(--space-md);
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--cream-dark);
    margin-top: var(--space-lg);
}

.dashboard-footer a {
    color: var(--amber);
    text-decoration: none;
}

.dashboard-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--muted); }

.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .module-nav {
        display: none;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .chart-container {
        height: 250px;
    }

    .page-header {
        padding: var(--space-sm);
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .dashboard-main {
        padding: var(--space-sm);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .header-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .header-meta .separator {
        display: none;
    }

    .chart-container {
        height: 220px;
    }

    /* Horizontal scroll for tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 500px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .dashboard-nav,
    .module-nav,
    .btn,
    .section-actions {
        display: none !important;
    }

    .section-card {
        break-inside: avoid;
    }

    body {
        background: white;
    }
}

/* ============================================
   STUDENT FILTER BAR
   ============================================ */
.filter-bar {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.filter-tabs {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--cream-dark);
    flex-shrink: 0;
}

.filter-tab {
    padding: 0.4rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    background: white;
    color: var(--muted);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-tab:not(:last-child) {
    border-right: 1px solid var(--cream-dark);
}

.filter-tab:hover {
    background: var(--cream-dark);
    color: var(--slate);
}

.filter-tab.active {
    background: var(--slate);
    color: white;
}

.filter-search {
    flex: 1;
    min-width: 160px;
}

.filter-search input {
    width: 100%;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    background: white;
    color: var(--slate);
    outline: none;
    transition: border-color var(--duration-fast);
}

.filter-search input::placeholder {
    color: var(--muted);
}

.filter-search input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-light);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-group label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
}

.filter-group select {
    padding: 0.4rem 1.75rem 0.4rem 0.5rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    background: white;
    color: var(--slate);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b7280' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    outline: none;
}

.filter-group select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-light);
}

.filter-range {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-range input[type="number"] {
    width: 52px;
    padding: 0.4rem 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    background: white;
    color: var(--slate);
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.filter-range input[type="number"]::-webkit-outer-spin-button,
.filter-range input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-range input[type="number"]:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-light);
}

.filter-range .range-sep {
    color: var(--muted);
    font-size: 0.75rem;
}

.filter-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--cream-dark);
    margin-top: 0.25rem;
}

.filter-status .status-count {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
}

.filter-status .status-count strong {
    color: var(--slate);
}

.filter-status .sort-control {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--muted);
}

.filter-status .sort-control select {
    padding: 0.25rem 1.5rem 0.25rem 0.4rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    border: 1px solid var(--cream-dark);
    border-radius: 4px;
    background: white;
    color: var(--slate);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b7280' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    outline: none;
}

/* Impact value color coding */
.impact-high {
    color: var(--success);
    font-weight: 600;
}

.impact-medium {
    color: var(--warning);
    font-weight: 600;
}

.impact-low {
    color: var(--muted);
    font-weight: 500;
}

/* Target column monospace */
.student-target {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Scrollable table wrapper for student roster */
.student-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        width: 100%;
    }

    .filter-tab {
        flex: 1;
        text-align: center;
    }

    .filter-search {
        width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
    }

    .filter-range {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-status {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .student-table-wrapper .data-table {
        min-width: 600px;
    }
}

/* ============================================
   LOGIN OVERLAY
   ============================================ */
.login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.login-overlay.visible {
    display: flex;
}

.login-overlay-content {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
}

.login-overlay-content h2 {
    font-family: var(--font-display);
    margin-bottom: 1rem;
    color: var(--slate);
}

.login-overlay-content p {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.sign-in-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--slate);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font-body);
}

.sign-in-btn:hover {
    background: var(--slate-light);
}
