/* =============================================================
   GCA – Graduate Career Accelerator | Main Stylesheet
   Dark-first, mobile-first, CSS Custom Properties theming.
   ============================================================= */

/* ── 1. CUSTOM PROPERTIES ────────────────────────────────────── */
:root {
    /* Layout */
    --sidebar-width: 260px;
    --topbar-h:      60px;
    --radius-sm:     6px;
    --radius:        12px;
    --radius-lg:     16px;
    --shadow:        0 2px 12px rgba(0,0,0,.35);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.45);
    --transition:    .2s ease;

    /* Typography */
    --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --text-xs:   .72rem;
    --text-sm:   .85rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.375rem;
    --text-2xl:  1.75rem;
    --text-3xl:  2.25rem;
}

/* DARK THEME (default) */
[data-theme="dark"], :root {
    --bg-base:       #0d1117;
    --bg-elevated:   #161b22;
    --bg-card:       #1c2333;
    --bg-hover:      #21262d;
    --bg-input:      #0d1117;
    --border:        rgba(240,246,252,.1);
    --border-focus:  rgba(88,166,255,.4);
    --text-primary:  #e6edf3;
    --text-secondary:#8b949e;
    --text-muted:    #484f58;
    --accent:        #6366f1;
    --accent-h:      #818cf8;
    --accent-glow:   rgba(99,102,241,.25);
    --success:       #3fb950;
    --success-bg:    rgba(63,185,80,.12);
    --warning:       #d29922;
    --warning-bg:    rgba(210,153,34,.12);
    --danger:        #f85149;
    --danger-bg:     rgba(248,81,73,.12);
    --info:          #58a6ff;
    --info-bg:       rgba(88,166,255,.12);
    --scrollbar:     #30363d;
    --sidebar-bg:    #010409;
}

/* LIGHT THEME */
[data-theme="light"] {
    --bg-base:       #f6f8fa;
    --bg-elevated:   #ffffff;
    --bg-card:       #ffffff;
    --bg-hover:      #f0f2f5;
    --bg-input:      #ffffff;
    --border:        #d0d7de;
    --border-focus:  rgba(79,70,229,.45);
    --text-primary:  #1f2328;
    --text-secondary:#57606a;
    --text-muted:    #8c959f;
    --accent:        #4f46e5;
    --accent-h:      #6366f1;
    --accent-glow:   rgba(79,70,229,.15);
    --success:       #1a7f37;
    --success-bg:    rgba(26,127,55,.08);
    --warning:       #9a6700;
    --warning-bg:    rgba(154,103,0,.08);
    --danger:        #cf222e;
    --danger-bg:     rgba(207,34,46,.08);
    --info:          #0969da;
    --info-bg:       rgba(9,105,218,.08);
    --scrollbar:     #cdd0d4;
    --sidebar-bg:    #ffffff;
}

/* ── 2. RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family:      var(--font-sans);
    background-color: var(--bg-base);
    color:            var(--text-primary);
    line-height:      1.6;
    min-height:       100vh;
    transition:       background-color var(--transition), color var(--transition);
}

img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
button { cursor: pointer; font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track  { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb  { background: var(--scrollbar); border-radius: 4px; }

/* ── 3. LAYOUT ───────────────────────────────────────────────── */
.sidebar {
    position:   fixed;
    inset:      0 auto 0 0;
    width:      var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display:    flex;
    flex-direction: column;
    z-index:    100;
    transition: transform var(--transition);
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height:  100vh;
    display:     flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

.topbar {
    position:   sticky;
    top:        0;
    height:     var(--topbar-h);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display:    flex;
    align-items: center;
    gap:         12px;
    padding:    0 24px;
    z-index:    90;
}

.page-content { padding: 24px; flex: 1; max-width: 1400px; width: 100%; }

/* Sidebar collapsed (mobile) */
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-wrapper { margin-left: 0; }

/* ── 4. SIDEBAR ──────────────────────────────────────────────── */
.sidebar-logo {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     20px 18px;
    border-bottom: 1px solid var(--border);
}
.logo-icon {
    width:  38px; height: 38px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    flex-shrink: 0;
}
.logo-text { font-size: 1.2rem; font-weight: 700; letter-spacing: .04em; }

.sidebar-nav {
    flex:    1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     10px 12px;
    border-radius: var(--radius-sm);
    color:       var(--text-secondary);
    font-size:   var(--text-sm);
    font-weight: 500;
    transition:  background var(--transition), color var(--transition);
}
.nav-item i { font-size: 1.1rem; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item:hover  { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-glow); color: var(--accent-h);
                   border-left: 3px solid var(--accent); padding-left: 9px; }

.nav-section-label {
    font-size:    var(--text-xs);
    font-weight:  600;
    color:        var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 16px 12px 6px;
}

.sidebar-user {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     14px 12px;
    border-top:  1px solid var(--border);
}
.user-avatar {
    width:  36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color:   #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
    flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name  { display: block; font-size: var(--text-sm); font-weight: 600;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { display: block; font-size: var(--text-xs); color: var(--text-secondary); }
.btn-logout { color: var(--text-secondary); font-size: 1.1rem; padding: 4px;
               transition: color var(--transition); }
.btn-logout:hover { color: var(--danger); }

/* ── 5. TOPBAR ───────────────────────────────────────────────── */
.page-heading { font-size: var(--text-lg); font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle, .theme-toggle {
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 1.1rem;
    transition: background var(--transition), color var(--transition);
}
.sidebar-toggle:hover, .theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle { display: none; }

/* ── 6. CARDS ────────────────────────────────────────────────── */
.card {
    background:    var(--bg-card);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       20px;
    transition:    border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card-header {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title { font-size: var(--text-base); font-weight: 600; }
.card-subtitle { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }

.stat-card {
    background:    var(--bg-card);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       20px;
    display:       flex;
    align-items:   center;
    gap:           16px;
}
.stat-icon {
    width:  48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.accent   { background: var(--accent-glow);  color: var(--accent-h); }
.stat-icon.success  { background: var(--success-bg);   color: var(--success); }
.stat-icon.warning  { background: var(--warning-bg);   color: var(--warning); }
.stat-icon.danger   { background: var(--danger-bg);    color: var(--danger); }
.stat-icon.info     { background: var(--info-bg);      color: var(--info); }

.stat-value { font-size: var(--text-2xl); font-weight: 700; line-height: 1.1; }
.stat-label { font-size: var(--text-sm);  color: var(--text-secondary); margin-top: 2px; }

/* ── 7. SCORE CARDS (dashboard) ─────────────────────────────── */
.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.score-card {
    background:    var(--bg-card);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       16px;
    text-align:    center;
    transition:    border-color var(--transition);
}
.score-card:hover { border-color: var(--accent); }
.score-card .score-value {
    font-size:   var(--text-2xl);
    font-weight: 800;
    line-height: 1.1;
    color:       var(--accent-h);
}
.score-card .score-label {
    font-size:  var(--text-xs);
    color:      var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.score-card .score-badge { font-size: var(--text-xs); margin-top: 8px; }

/* ── 8. CIRCULAR PROGRESS ────────────────────────────────────── */
.circle-progress-wrapper {
    display:       flex;
    flex-direction: column;
    align-items:   center;
    gap:           12px;
}
.circle-progress {
    position: relative;
    width:  160px; height: 160px;
}
.circle-progress svg { transform: rotate(-90deg); }
.circle-track { fill: none; stroke: var(--border); stroke-width: 10; }
.circle-fill  { fill: none; stroke-width: 10; stroke-linecap: round;
                transition: stroke-dashoffset .8s ease; }
.circle-fill.accent  { stroke: var(--accent); }
.circle-fill.success { stroke: var(--success); }
.circle-fill.warning { stroke: var(--warning); }
.circle-fill.danger  { stroke: var(--danger); }
.circle-center {
    position: absolute;
    inset: 0;
    display:       flex;
    flex-direction: column;
    align-items:   center;
    justify-content: center;
}
.circle-pct   { font-size: var(--text-2xl); font-weight: 800; line-height: 1; }
.circle-sub   { font-size: var(--text-xs);  color: var(--text-secondary); margin-top: 2px; }

/* ── 9. PROGRESS BARS ────────────────────────────────────────── */
.progress-bar-wrap { width: 100%; }
.progress-bar-label {
    display: flex; justify-content: space-between;
    font-size: var(--text-xs); color: var(--text-secondary);
    margin-bottom: 4px;
}
.progress-bar-track {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%; border-radius: 99px;
    background: var(--accent);
    transition: width .6s ease;
}
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger  { background: var(--danger); }

/* ── 10. BUTTONS ─────────────────────────────────────────────── */
.btn {
    display:     inline-flex;
    align-items: center;
    gap:         7px;
    padding:     9px 18px;
    border-radius: var(--radius-sm);
    font-size:   var(--text-sm);
    font-weight: 600;
    border:      1px solid transparent;
    transition:  background var(--transition), opacity var(--transition), transform .1s;
    line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary  { background: var(--accent);   color: #fff; }
.btn-primary:hover  { background: var(--accent-h); color: #fff; }

.btn-success  { background: var(--success);  color: #fff; }
.btn-success:hover  { filter: brightness(1.1); color: #fff; }

.btn-danger   { background: var(--danger);   color: #fff; }
.btn-danger:hover   { filter: brightness(1.1); color: #fff; }

.btn-outline  { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn-outline:hover  { background: var(--bg-hover); }

.btn-ghost    { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover    { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: var(--text-xs); }
.btn-lg { padding: 13px 26px; font-size: var(--text-base); }
.btn-full { width: 100%; justify-content: center; }

/* ── 11. FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: var(--text-sm); font-weight: 500;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding:       10px 14px;
    background:    var(--bg-input);
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    color:         var(--text-primary);
    font-size:     var(--text-sm);
    font-family:   inherit;
    transition:    border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline:      none;
    border-color: var(--accent);
    box-shadow:   0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { opacity: .6; cursor: not-allowed; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint    { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.form-error   { font-size: var(--text-xs); color: var(--danger);     margin-top: 4px; }

/* ── 12. TABLES ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

/* ── 13. BADGES ─────────────────────────────────────────────── */
.badge {
    display:     inline-flex;
    align-items: center;
    gap:         4px;
    padding:     3px 8px;
    border-radius: 99px;
    font-size:   var(--text-xs);
    font-weight: 600;
    letter-spacing: .03em;
}
.badge-accent  { background: var(--accent-glow);  color: var(--accent-h); }
.badge-success { background: var(--success-bg);   color: var(--success); }
.badge-warning { background: var(--warning-bg);   color: var(--warning); }
.badge-danger  { background: var(--danger-bg);    color: var(--danger); }
.badge-info    { background: var(--info-bg);       color: var(--info); }
.badge-muted   { background: var(--bg-hover);      color: var(--text-secondary); }

/* ── 14. ALERTS ─────────────────────────────────────────────── */
.alert {
    display:       flex;
    align-items:   flex-start;
    gap:           10px;
    padding:       14px 16px;
    border-radius: var(--radius-sm);
    font-size:     var(--text-sm);
    border:        1px solid transparent;
}
.alert i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info); }

/* ── 15. TOASTS ─────────────────────────────────────────────── */
.toast-container {
    position: fixed; bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 9999; max-width: 360px;
}
.toast {
    display:       flex;
    align-items:   flex-start;
    gap:           10px;
    padding:       14px 16px;
    border-radius: var(--radius);
    font-size:     var(--text-sm);
    background:    var(--bg-card);
    border:        1px solid var(--border);
    box-shadow:    var(--shadow-lg);
    animation:     toastIn .25s ease;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info    { border-left: 4px solid var(--info); }
@keyframes toastIn { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }

/* ── 16. MODAL ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background:    var(--bg-card);
    border:        1px solid var(--border);
    border-radius: var(--radius-lg);
    width:  100%; max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease;
}
.modal-header {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    padding:       20px 24px 0;
}
.modal-title { font-size: var(--text-lg); font-weight: 700; }
.modal-body  { padding: 20px 24px; }
.modal-footer {
    padding: 0 24px 20px;
    display: flex; justify-content: flex-end; gap: 10px;
}
.btn-close { background: none; border: none; color: var(--text-secondary); font-size: 1.3rem; padding: 4px; }
.btn-close:hover { color: var(--danger); }
@keyframes modalIn { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:none; } }

/* ── 17. UPLOAD ZONE ─────────────────────────────────────────── */
.upload-zone {
    border:        2px dashed var(--border);
    border-radius: var(--radius);
    padding:       48px 24px;
    text-align:    center;
    cursor:        pointer;
    transition:    border-color var(--transition), background var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent);
    background:   var(--accent-glow);
}
.upload-zone i  { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 12px; }
.upload-zone p  { color: var(--text-secondary); font-size: var(--text-sm); }
.upload-zone strong { color: var(--accent-h); }

/* ── 18. ANALYSIS RESULTS ────────────────────────────────────── */
.score-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.breakdown-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}
.breakdown-score { font-size: var(--text-xl); font-weight: 700; }
.breakdown-label { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }

.insight-section { margin-top: 20px; }
.insight-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary);
                  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.insight-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.insight-list li {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: var(--text-sm); color: var(--text-primary);
}
.insight-list li::before { font-family: 'Bootstrap-Icons'; flex-shrink: 0; margin-top: 2px; }
.insight-list.strengths li::before { content: "\F26E"; color: var(--success); }
.insight-list.weaknesses li::before { content: "\F623"; color: var(--warning); }
.insight-list.suggestions li::before { content: "\F4F1"; color: var(--info); }

/* ── 19. INTERVIEW UI ────────────────────────────────────────── */
.interview-stage {
    display:       flex;
    flex-direction: column;
    align-items:   center;
    gap:           24px;
    text-align:    center;
    max-width:     680px;
    margin:        0 auto;
}
.question-bubble {
    background:    var(--bg-card);
    border:        1px solid var(--border);
    border-radius: var(--radius-lg);
    padding:       24px 28px;
    font-size:     var(--text-lg);
    line-height:   1.7;
    width:         100%;
}
.round-counter {
    display:     flex;
    gap:         8px;
    align-items: center;
}
.round-dot {
    width:  10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background .3s;
}
.round-dot.done    { background: var(--success); }
.round-dot.current { background: var(--accent); }

.recording-controls { display: flex; gap: 16px; align-items: center; }

/* TTS Speaking Indicator */
.tts-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tts-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 28px;
}
.tts-wave span {
    display: block;
    width: 4px;
    border-radius: 2px;
    background: var(--accent);
    animation: ttsBar .8s ease-in-out infinite;
}
.tts-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.tts-wave span:nth-child(2) { height: 16px; animation-delay: .1s; }
.tts-wave span:nth-child(3) { height: 26px; animation-delay: .2s; }
.tts-wave span:nth-child(4) { height: 16px; animation-delay: .3s; }
.tts-wave span:nth-child(5) { height: 8px;  animation-delay: .4s; }
@keyframes ttsBar {
    0%,100% { transform: scaleY(.35); opacity: .55; }
    50%      { transform: scaleY(1);  opacity: 1; }
}
.record-btn {
    width:  72px; height: 72px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    transition: all .2s;
}
.record-btn.start { background: var(--accent);  color: #fff; }
.record-btn.start:hover { background: var(--accent-h); }
.record-btn.stop  { background: var(--danger); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(248,81,73,.4)} 50%{box-shadow:0 0 0 12px rgba(248,81,73,0)} }

.timer-display {
    font-size: var(--text-xl); font-weight: 700;
    font-family: var(--font-mono); color: var(--danger);
    min-width: 70px; text-align: center;
}
.processing-indicator {
    display:     none;
    align-items: center;
    gap:         12px;
    color:       var(--text-secondary);
    font-size:   var(--text-sm);
}
.spinner {
    width:  22px; height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 20. CHECKLIST ───────────────────────────────────────────── */
.checklist-item {
    display:     flex;
    align-items: center;
    gap:         12px;
    padding:     14px 0;
    border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-check {
    width:  22px; height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), border-color var(--transition);
}
.checklist-check.checked { background: var(--success); border-color: var(--success); color: #fff; }
.checklist-check.checked::after { content: '✓'; font-size: .85rem; font-weight: 700; }
.checklist-text { flex: 1; }
.checklist-title { font-size: var(--text-sm); font-weight: 500; }
.checklist-title.done { text-decoration: line-through; color: var(--text-muted); }
.checklist-desc { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.checklist-points { font-size: var(--text-xs); color: var(--text-secondary); flex-shrink: 0; }

/* ── 21. LOGIN PAGE ─────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display:    flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    padding:    24px;
}
.login-card {
    width:         100%; max-width: 420px;
    background:    var(--bg-card);
    border:        1px solid var(--border);
    border-radius: var(--radius-lg);
    padding:       40px 36px;
    box-shadow:    var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { margin: 0 auto 10px; width: 56px; height: 56px; border-radius: 14px; font-size: 24px; }
.login-logo h1 { font-size: var(--text-2xl); font-weight: 800; }
.login-logo p  { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; }

.otp-inputs {
    display: flex; gap: 10px; justify-content: center; margin: 8px 0;
}
.otp-input {
    width:  48px; height: 56px;
    text-align: center; font-size: var(--text-xl); font-weight: 700;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: var(--font-mono);
}
.otp-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; }

.step-indicator {
    display:         flex;
    justify-content: center;
    gap:             6px;
    margin-bottom:   24px;
}
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .3s, width .3s; }
.step-dot.active { background: var(--accent); width: 20px; border-radius: 4px; }
.step-dot.done   { background: var(--success); }

/* ── 22. GRID UTILS ──────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm { gap: 8px; }
.flex-gap { gap: 16px; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.flex-1 { flex: 1; }

/* ── 23. TYPOGRAPHY UTILS ────────────────────────────────────── */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent-h); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-info      { color: var(--info); }
.text-sm  { font-size: var(--text-sm); }
.text-xs  { font-size: var(--text-xs); }
.text-lg  { font-size: var(--text-lg); }
.text-xl  { font-size: var(--text-xl); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ── 24. SPACING UTILS ───────────────────────────────────────── */
.mt-0 { margin-top: 0; }     .mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; } .mt-2xl { margin-top: 48px; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.gap-sm  { gap: 8px; }  .gap-md { gap: 16px; } .gap-lg { gap: 24px; }
.p-sm { padding: 8px; } .p-md { padding: 16px; } .p-lg { padding: 24px; }

/* ── 25. EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
    display:       flex;
    flex-direction: column;
    align-items:   center;
    padding:       48px 24px;
    text-align:    center;
    color:         var(--text-secondary);
}
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; }
.empty-state h3 { font-size: var(--text-lg); color: var(--text-primary); margin-bottom: 6px; }

/* ── 26. PAGINATION ─────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; align-items: center; }
.page-btn {
    width:   36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border:  1px solid var(--border);
    font-size: var(--text-sm); font-weight: 500;
    background: transparent; color: var(--text-secondary);
    transition: all var(--transition);
}
.page-btn:hover   { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active  { background: var(--accent);   color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── 27. SEARCH BAR ─────────────────────────────────────────── */
.search-bar {
    display:     flex;
    align-items: center;
    gap:         8px;
    background:  var(--bg-input);
    border:      1px solid var(--border);
    border-radius: var(--radius-sm);
    padding:     0 12px;
}
.search-bar i { color: var(--text-muted); }
.search-bar input {
    flex: 1; background: none; border: none;
    color: var(--text-primary); font-size: var(--text-sm);
    padding: 9px 0; outline: none;
}

/* ── 28. ANIMATIONS ─────────────────────────────────────────── */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-elevated) 50%, var(--bg-hover) 75%);
    background-size: 400% 100%;
    border-radius: var(--radius-sm);
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

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

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .page-content { padding: 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .score-grid { grid-template-columns: repeat(2, 1fr); }
    .modal { max-width: 100%; }
    .login-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
    .score-grid { grid-template-columns: 1fr 1fr; }
    .otp-inputs { gap: 6px; }
    .otp-input  { width: 40px; height: 50px; font-size: var(--text-lg); }
    .toast-container { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ── 30. PRINT ───────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .toast-container { display: none; }
    .main-wrapper { margin-left: 0; }
    body { background: white; color: black; }
    .card { border: 1px solid #ccc; break-inside: avoid; }
}
