/* ════════════════════════════════════════════════════
   OfficersPanel — Design System
   "Put more of your students on the panel."
   ════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────── */
:root {
    /* Brand palette */
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;
    --brand-900: #312e81;

    /* Accent */
    --accent-400: #a78bfa;
    --accent-500: #8b5cf6;
    --accent-600: #7c3aed;

    /* Semantic */
    --success-50:  #ecfdf5;
    --success-400: #34d399;
    --success-500: #10b981;
    --success-600: #059669;
    --warning-50:  #fffbeb;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --danger-50:   #fef2f2;
    --danger-400:  #f87171;
    --danger-500:  #ef4444;

    /* Dark theme surfaces */
    --bg-app:      #0a0a0f;
    --bg-sidebar:  #0f0f17;
    --bg-card:     #13131d;
    --bg-card-alt: #1a1a28;
    --bg-input:    #1a1a28;
    --bg-hover:    #1e1e2e;
    --bg-elevated: #22223a;

    /* Borders */
    --border:       #1e1e30;
    --border-hover: #2e2e48;
    --border-focus: var(--brand-500);

    /* Text */
    --text-primary:   #f1f1f6;
    --text-secondary: #9898b0;
    --text-muted:     #5e5e78;
    --text-inverse:   #0a0a0f;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0,0,0,.4);
    --shadow-md:  0 4px 12px rgba(0,0,0,.4);
    --shadow-lg:  0 8px 24px rgba(0,0,0,.5);
    --shadow-glow: 0 0 20px rgba(99,102,241,.15);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
    --transition-base: 250ms cubic-bezier(.4,0,.2,1);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}


/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--brand-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--brand-300); }

img { max-width: 100%; height: auto; }


/* ── App Shell ───────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}


/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
}

.brand-icon {
    flex-shrink: 0;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--brand-400), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.08));
    color: var(--brand-400);
    box-shadow: inset 3px 0 0 var(--brand-500);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}


/* ── Main Content ────────────────────────────────── */
.main-content {
    flex: 1;
    min-width: 0; /* let the flex item shrink instead of overflowing */
    padding: 32px 40px;
    max-width: 1280px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}


/* ── Cards ───────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* ── Stats Grid ──────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.brand::before   { background: linear-gradient(90deg, var(--brand-500), var(--accent-500)); }
.stat-card.success::before { background: var(--success-500); }
.stat-card.warning::before { background: var(--warning-500); }
.stat-card.danger::before  { background: var(--danger-500); }

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}


/* ── Buttons ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-500), var(--accent-600));
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-600), var(--accent-600));
    box-shadow: 0 4px 16px rgba(99,102,241,.4);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background: var(--success-500);
    color: white;
}
.btn-success:hover {
    background: var(--success-600);
    color: white;
}

.btn-danger {
    background: rgba(239,68,68,.12);
    color: var(--danger-400);
    border: 1px solid rgba(239,68,68,.2);
}
.btn-danger:hover {
    background: rgba(239,68,68,.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}


/* ── Forms ───────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%239898b0' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'><path d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}


/* ── Question Card (review queue) ────────────────── */
.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: all var(--transition-base);
}

.question-card:hover {
    border-color: var(--border-hover);
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.question-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.option {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.option.correct {
    border-color: var(--success-500);
    background: rgba(16,185,129,.08);
    color: var(--success-400);
}

.option-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 16px;
}

.question-explanation {
    background: var(--bg-card-alt);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    border-left: 3px solid var(--brand-500);
}

.question-explanation .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-400);
    margin-bottom: 6px;
}

.question-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}


/* ── Badges ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-pass    { background: rgba(16,185,129,.12); color: var(--success-400); }
.badge-flagged { background: rgba(245,158,11,.12);  color: var(--warning-400); }
.badge-failed  { background: rgba(239,68,68,.12);   color: var(--danger-400);  }
.badge-approved { background: rgba(99,102,241,.12); color: var(--brand-400);   }
.badge-draft   { background: rgba(94,94,120,.12);   color: var(--text-muted);  }
.badge-easy    { background: rgba(16,185,129,.08);   color: var(--success-400); }
.badge-medium  { background: rgba(245,158,11,.08);   color: var(--warning-400); }
.badge-hard    { background: rgba(239,68,68,.08);     color: var(--danger-400);  }


/* ── Validation Results ──────────────────────────── */
.validation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.validation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card-alt);
    font-size: 0.85rem;
}

.validation-item.pass { border-left: 3px solid var(--success-500); }
.validation-item.flag { border-left: 3px solid var(--warning-500); }
.validation-item.fail { border-left: 3px solid var(--danger-500); }


/* ── Login Page ──────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.08), transparent 70%);
    top: -150px;
    right: -100px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,.06), transparent 70%);
    bottom: -100px;
    left: -100px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-400), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.login-brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
}


/* ── Home / Landing ──────────────────────────────── */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.landing::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.06), transparent 60%);
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.landing h1 {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 20px;
    max-width: 700px;
}

.landing h1 .gradient {
    background: linear-gradient(135deg, var(--brand-400), var(--accent-400), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing .subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: 36px;
    line-height: 1.7;
}

.landing .cta-group {
    display: flex;
    gap: 14px;
}


/* ── HTMX Loading ────────────────────────────────── */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline-flex;
}
.htmx-request .htmx-hide-on-request {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--brand-400);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}


/* ── Toast / Notifications ───────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    animation: slideIn .3s ease-out;
    max-width: 360px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.toast.success { border-left: 3px solid var(--success-500); }
.toast.error   { border-left: 3px solid var(--danger-500);  }
.toast.warning { border-left: 3px solid var(--warning-500); }


/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        width: 64px;
    }
    .brand-name, .nav-item span, .user-info {
        display: none;
    }
    .sidebar-nav { padding: 8px 6px; }
    .nav-item { justify-content: center; padding: 10px; }
    .main-content { padding: 20px 16px; }
    .question-options { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .landing h1 { font-size: 2rem; }
}


/* ════════════════════════════════════════════════════
   v0.2 additions — review queue, checks, jobs, Odia
   ════════════════════════════════════════════════════ */

:root {
    --font-odia: 'Noto Sans Oriya', 'Kalinga', var(--font-sans);
}

.odia { font-family: var(--font-odia); line-height: 1.85; }
.muted { color: var(--text-muted); }
.small { font-size: .8rem; }
code {
    font-family: var(--font-mono);
    font-size: .82em;
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}

/* Sidebar */
.sidebar-brand { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-sub {
    font-size: .74rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px;
}
.nav-section {
    margin: 18px 14px 6px;
    font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-muted);
}
.nav-item.disabled { opacity: .45; cursor: default; }
.nav-item.disabled:hover { background: transparent; color: var(--text-secondary); }
.btn-icon.btn-ghost { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Page chrome */
.page-subtitle { color: var(--text-secondary); font-size: .9rem; margin-top: 4px; }
.page-header { align-items: flex-start; gap: 16px; }
.demo-banner {
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.25);
    color: var(--warning-400);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: .85rem;
    margin-bottom: 20px;
}
.demo-banner code { color: var(--text-primary); }
.notice {
    background: var(--bg-card-alt); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 16px;
    color: var(--text-secondary); font-size: .88rem;
}
.empty-state { text-align: center; padding: 56px 40px; }
.empty-state svg { margin-bottom: 14px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; font-size: 1.05rem; }
.empty-state p { color: var(--text-muted); font-size: .9rem; }
.empty-small { color: var(--text-muted); font-size: .9rem; padding: 12px 0; }

/* Layout grids */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.generate-grid { display: grid; grid-template-columns: minmax(340px, 1fr) 1.2fr; gap: 24px; align-items: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 6px; }
.label-muted { color: var(--text-muted); font-weight: 400; }
.form-error {
    background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); color: var(--danger-400);
    border-radius: var(--radius-md); padding: 10px 14px; font-size: .86rem; margin-bottom: 16px;
}
.form-select-sm { padding: 6px 30px 6px 10px; font-size: .8rem; width: auto; background-position: right 8px center; }
.login-foot { text-align: center; color: var(--text-muted); font-size: .78rem; margin-top: 24px; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--brand-400); }
.error-detail { color: var(--text-secondary); margin-top: 8px; }

/* Key-value list and table */
.kv { display: flex; flex-direction: column; gap: 12px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.kv dt { color: var(--text-secondary); font-size: .86rem; }
.kv dd { font-weight: 700; text-align: right; }
.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.check-status { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: .86rem; color: var(--text-secondary); }
.check-status li { display: flex; gap: 10px; align-items: baseline; }

/* Badges and chips */
.badge-lg { font-size: .85rem; padding: 6px 14px; }
.badge-demo { background: rgba(245,158,11,.12); color: var(--warning-400); }
.badge-private { background: rgba(139,92,246,.14); color: var(--accent-400); }
.badge-job-pending, .badge-job-running { background: rgba(139,92,246,.12); color: var(--accent-400); }
.badge-job-completed { background: rgba(16,185,129,.12); color: var(--success-400); }
.badge-job-failed { background: rgba(239,68,68,.12); color: var(--danger-400); }
.badge-rejected { background: rgba(239,68,68,.12); color: var(--danger-400); }
.chip {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px;
    font-size: .74rem; color: var(--text-secondary); background: var(--bg-card-alt); border: 1px solid var(--border);
}

/* Tabs */
.tabs {
    display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.tab {
    padding: 7px 14px; border-radius: var(--radius-sm); color: var(--text-secondary);
    font-size: .86rem; font-weight: 600; display: inline-flex; gap: 8px; align-items: center;
}
.tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab.active { background: linear-gradient(135deg, var(--brand-500), var(--accent-600)); color: white; }
.tab-count { font-size: .74rem; opacity: .8; }
.tabs { max-width: 100%; overflow-x: auto; }
.tab { white-space: nowrap; }
.badge-lg { white-space: nowrap; }

/* Question card details */
.question-card.status-flagged { border-left: 3px solid var(--warning-500); }
.question-card.status-failed { border-left: 3px solid var(--danger-500); opacity: .92; }
.question-text.odia { font-size: .98rem; color: var(--text-secondary); }
.option { align-items: flex-start; }
.option-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.option-body .odia { font-size: .84rem; color: var(--text-muted); }
.option.correct .option-body .odia { color: var(--success-400); opacity: .85; }
.key-mark { font-weight: 800; color: var(--success-400); }
.question-explanation p { color: var(--text-secondary); font-size: .88rem; }
.question-explanation p + p { margin-top: 6px; }
.sources { font-size: .76rem; color: var(--text-muted); margin-top: 8px; }
.question-note { font-size: .84rem; color: var(--text-muted); padding-top: 12px; border-top: 1px solid var(--border); }
.question-actions { flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.reject-form { margin-left: auto; }
.odia-check { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--text-secondary); cursor: pointer; }
.odia-check input { accent-color: var(--success-500); width: 15px; height: 15px; }

/* Automatic check results */
.checks { margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card-alt); }
.checks summary {
    cursor: pointer; padding: 9px 14px; font-size: .8rem; font-weight: 600; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none;
}
.checks summary::-webkit-details-marker { display: none; }
.dots { display: inline-flex; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-pass { background: var(--success-500); }
.dot-flag { background: var(--warning-500); }
.dot-fail { background: var(--danger-500); }
.dot-skip { background: var(--text-muted); opacity: .6; }
.check-list { list-style: none; padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.check {
    display: grid; grid-template-columns: 30px 150px 62px 1fr; gap: 10px; align-items: baseline;
    font-size: .8rem; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg-card);
    border-left: 3px solid var(--border);
}
.check-code { font-weight: 800; color: var(--text-muted); }
.check-name { color: var(--text-primary); font-weight: 600; }
.check-result { font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; }
.check-details { color: var(--text-secondary); }
.check-pass { border-left-color: var(--success-500); }
.check-pass .check-result { color: var(--success-400); }
.check-flag { border-left-color: var(--warning-500); }
.check-flag .check-result { color: var(--warning-400); }
.check-fail { border-left-color: var(--danger-500); }
.check-fail .check-result { color: var(--danger-400); }
.check-skip { opacity: .7; }
.check-skip .check-result { color: var(--text-muted); }

/* Reviewed rows */
.question-card.reviewed { padding: 14px 20px; opacity: .85; }
.reviewed-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.reviewed-stem { color: var(--text-secondary); font-size: .88rem; }
.reviewed .job-status { margin-top: 10px; }

/* Edit form */
.question-card.editing { border-color: var(--brand-500); box-shadow: var(--shadow-glow); }
.edit-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.edit-head h3 { font-size: 1rem; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 14px; }
.edit-grid .form-label, .edit-row .form-label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.edit-row { display: grid; grid-template-columns: auto 160px 220px; gap: 20px; align-items: end; margin-bottom: 8px; }
.key-picker { border: none; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.key-picker legend { margin-bottom: 6px; }
.key-picker label { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; cursor: pointer; }
.key-picker input { accent-color: var(--success-500); }

/* Job status */
.job-status.card { padding: 22px 24px; }
.job-status.compact { font-size: .84rem; }
.job-line { display: flex; gap: 10px; align-items: center; color: var(--text-secondary); }
.job-status .muted.small { margin-top: 8px; }
.job-headline { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.job-counts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.count { padding: 4px 12px; border-radius: 100px; font-size: .8rem; font-weight: 700; background: var(--bg-card-alt); border: 1px solid var(--border); }
.count-pass { color: var(--success-400); }
.count-flag { color: var(--warning-400); }
.count-fail { color: var(--danger-400); }
.job-error { color: var(--danger-400); }
.job-questions { list-style: none; margin: 14px 0; display: flex; flex-direction: column; gap: 6px; max-height: 440px; overflow: auto; }
.job-questions li { display: flex; gap: 10px; align-items: baseline; font-size: .84rem; color: var(--text-secondary); }
.job-questions .badge { min-width: 64px; justify-content: center; }
.job-actions { display: flex; gap: 10px; margin-top: 14px; }

/* Landing features */
.features { max-width: 1040px; margin: 0 auto; padding: 0 20px 80px; }
.features h2 { text-align: center; font-size: 1.5rem; margin-bottom: 28px; letter-spacing: -.02em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature p { color: var(--text-secondary); font-size: .9rem; }

/* htmx: the submit button is disabled while a request is in flight */
button[disabled] { opacity: .6; cursor: progress; }

@media (max-width: 1100px) {
    .generate-grid, .dash-grid { grid-template-columns: 1fr; }
    .check { grid-template-columns: 30px 1fr 62px; }
    .check-details { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .edit-grid, .edit-row, .form-row, .feature-grid { grid-template-columns: 1fr; }
    .reject-form { margin-left: 0; }
    .brand-text, .nav-section { display: none; }
}


/* ════════════════════════════════════════════════════
   v0.3 additions — test builder and exports
   ════════════════════════════════════════════════════ */

.narrow-card { max-width: 760px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.checks-inline { display: flex; flex-direction: column; gap: 8px; }

.builder-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.builder-side { position: sticky; top: 20px; }

.progress-row { display: flex; align-items: center; gap: 12px; font-size: .84rem; color: var(--text-secondary); margin-bottom: 10px; }
.progress { flex: 1; height: 8px; border-radius: 100px; background: var(--bg-card-alt); overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--accent-500)); border-radius: 100px; }

.item-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.item-section {
    font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--brand-400); margin: 10px 0 2px;
}
.item-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    background: var(--bg-card-alt); border: 1px solid var(--border); border-radius: var(--radius-md);
    font-size: .86rem;
}
.item-no { font-weight: 800; color: var(--text-muted); min-width: 24px; }
.item-stem { flex: 1; color: var(--text-primary); min-width: 0; }
.item-stem .chip { margin-left: 6px; }
.item-actions { display: inline-flex; gap: 2px; }
.btn-xs { width: 28px; height: 28px; font-size: .95rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; }
.btn-xs:hover:not([disabled]) { background: var(--bg-hover); color: var(--text-primary); }
.btn-xs[disabled] { opacity: .3; cursor: default; }
.btn-xs.danger:hover { color: var(--danger-400); border-color: rgba(239,68,68,.35); }

.search-row { display: flex; gap: 8px; }
.candidates { margin-top: 10px; max-height: 520px; overflow: auto; }
.candidate-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.candidate-list li {
    display: flex; gap: 10px; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-card-alt); border: 1px solid var(--border);
}
.cand-stem { font-size: .82rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.export-card { margin-bottom: 20px; }
.export-ready {
    background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25); border-radius: var(--radius-md);
    padding: 12px 14px; margin-bottom: 14px; color: var(--success-400); font-size: .88rem;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.export-ready .muted { flex-basis: 100%; }
.format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.format {
    display: flex; flex-direction: column; gap: 6px; padding: 14px; margin: 0;
    background: var(--bg-card-alt); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.format-name { font-weight: 700; font-size: .9rem; }
.format-help { font-size: .78rem; color: var(--text-muted); flex: 1; }
.format .btn { align-self: flex-start; }
.history-title { font-size: .85rem; margin: 20px 0 6px; color: var(--text-secondary); }

@media (max-width: 1100px) {
    .builder-grid { grid-template-columns: 1fr; }
    .builder-side { position: static; }
}
@media (max-width: 768px) {
    .form-row-3 { grid-template-columns: 1fr; }
    .item-row { flex-wrap: wrap; }
}


/* v0.4 — practice link card, results, admin */
.practice-card { margin-bottom: 20px; }
.link-row { display: flex; gap: 8px; margin: 10px 0; }
.link-row .form-input { font-family: var(--font-mono); font-size: .8rem; }
.practice-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.practice-off { margin-top: 12px; }
.stat-of { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.pos { color: var(--success-400); font-weight: 700; }
.neg { color: var(--danger-400); font-weight: 700; }
.cred-box { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.3); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 16px; }
.cred-box code { font-size: .9rem; }
.cred-box .muted { margin-top: 6px; }
.inline-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.inline-row .form-group { margin-bottom: 0; }
.status-pill { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 100px; background: var(--bg-card-alt); border: 1px solid var(--border); }
