/* ============================================================
   AIDI Training UI — Design System
   Brand: #6366f1 indigo, Inter font, dark-first theme
   ============================================================ */

/* ---------- CSS Variables: Dark Theme (default) ---------- */
:root, [data-theme="dark"] {
    --bg: #0f1117;
    --bg-secondary: #161822;
    --bg-tertiary: #1e2030;
    --bg-hover: #252840;
    --bg-elevated: #212338;
    --surface: #1a1d2e;
    --surface-hover: #22253a;
    --border: #2a2d42;
    --border-light: #353856;
    --text: #e4e4ed;
    --text-secondary: #9898b0;
    --text-muted: #6b6b82;
    --primary: #6366f1;
    --primary-hover: #5558e6;
    --primary-light: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.3);
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.15);
    --danger: #ef4444;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --topbar-h: 52px;
    --bottom-nav-h: 60px;
    --transition: 0.2s ease;
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
    --bg: #f4f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eeeef4;
    --bg-hover: #e8e8f0;
    --bg-elevated: #f0f0f7;
    --surface: #ffffff;
    --surface-hover: #f5f5fb;
    --border: #dcdce8;
    --border-light: #e8e8f0;
    --text: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8888a0;
    --primary: #6366f1;
    --primary-hover: #5558e6;
    --primary-light: rgba(99, 102, 241, 0.1);
    --primary-glow: rgba(99, 102, 241, 0.2);
    --success: #16a34a;
    --success-light: rgba(22, 163, 74, 0.1);
    --warning: #d97706;
    --warning-light: rgba(217, 119, 6, 0.1);
    --error: #dc2626;
    --error-light: rgba(220, 38, 38, 0.1);
    --danger: #dc2626;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.16);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

input, select, textarea, button { font-family: inherit; font-size: 14px; }

input, select, textarea {
    background: var(--bg-tertiary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    width: 100%;
    outline: none;
    transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }

.hidden { display: none !important; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-send {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-active { background: var(--success-light); color: var(--success); }
.badge-paused { background: var(--warning-light); color: var(--warning); }
.badge-removed { background: var(--error-light); color: var(--error); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

#page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.login-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
}

.login-glow-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.login-glow-2 {
    width: 300px;
    height: 300px;
    background: #818cf8;
    bottom: -80px;
    right: -80px;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.login-logo-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.login-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: var(--shadow-xl);
}

.login-card-header {
    margin-bottom: 24px;
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.auth-error {
    background: var(--error-light);
    color: var(--error);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    padding-left: 38px;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.login-form .btn-lg {
    height: 44px;
    font-size: 15px;
    font-weight: 600;
}

.login-footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */

#page-app { display: none; }
#page-app.visible { display: flex; flex-direction: column; min-height: 100vh; }

/* ============================================================
   TOPBAR
   ============================================================ */

.training-topbar {
    height: var(--topbar-h);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    gap: 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.topbar-logo-mark {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-brand {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.topbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-user-chip {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.topbar-user-label {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Session info bar in topbar */
.session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.session-label {
    font-weight: 500;
    color: var(--text);
}

.session-sep {
    color: var(--text-muted);
}

/* ============================================================
   CONTENT AREA
   ============================================================ */

.training-content-area {
    flex: 1;
    padding-top: var(--topbar-h);
    padding-bottom: var(--bottom-nav-h);
    overflow-y: auto;
}

/* ============================================================
   PAGE SECTIONS
   ============================================================ */

.page-section { display: none; }
.page-section.active { display: block; }

.page-header-bar {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 50;
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: color var(--transition);
    background: transparent;
    border: none;
    border-top: 2px solid transparent;
    padding: 8px 4px 6px;
}

.nav-tab:hover { color: var(--text); }
.nav-tab.active {
    color: var(--primary);
    border-top-color: var(--primary);
}

/* ============================================================
   PLAN PAGE
   ============================================================ */

#page-plan { padding: 0; }
#page-plan .page-header-bar { }

.plan-content-inner { padding: 0 16px 24px; }

.plan-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 0 16px 20px;
}

.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.plan-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

.section-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 16px 12px;
}

/* ============================================================
   SESSION SETUP
   ============================================================ */

#session-setup { padding: 0; }

.setup-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.setup-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.setup-actions {
    padding: 16px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    bottom: var(--bottom-nav-h);
}

/* ============================================================
   SCENARIO & PERSONA CARDS
   ============================================================ */

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.scenario-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
}
.scenario-card:hover { border-color: var(--primary); background: var(--surface-hover); }
.scenario-card.selected { border-color: var(--primary); background: var(--primary-light); }

.persona-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition);
}
.persona-card:hover { border-color: var(--primary); }
.persona-card.selected { border-color: var(--primary); background: var(--primary-light); }

.card-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }

/* Difficulty labels */
.difficulty-easy { color: var(--success); font-size: 12px; font-weight: 500; }
.difficulty-medium { color: var(--warning); font-size: 12px; font-weight: 500; }
.difficulty-hard { color: var(--error); font-size: 12px; font-weight: 500; }

/* ============================================================
   CHAT
   ============================================================ */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-h) - var(--bottom-nav-h));
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-input-bar {
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    padding: 10px 12px;
    gap: 10px;
}

.chat-input-bar textarea {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    padding: 10px 14px;
    border-radius: var(--radius);
    line-height: 1.4;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
}

.chat-input-bar textarea:focus { border-color: var(--primary); }

/* ============================================================
   MESSAGES
   ============================================================ */

.message {
    max-width: 78%;
}

.message.user {
    align-self: flex-end;
}

.message.user .message-text {
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px 4px 12px 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message.ai {
    align-self: flex-start;
}

.message.ai .message-text {
    background: var(--surface);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 4px 12px 12px 12px;
    border: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================================
   TYPING INDICATOR
   ============================================================ */

.typing-indicator {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px 12px 12px 12px;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: bounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* ============================================================
   EVALUATION
   ============================================================ */

.evaluation-wrap {
    padding: 16px;
}

.evaluation-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 640px;
    margin: 0 auto;
}

.eval-header {
    margin-bottom: 24px;
    text-align: center;
}

.eval-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.eval-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Score Circle */
.score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.score-circle-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 12px;
}

.score-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg { stroke: var(--border); }

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}

.score-label-text {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.score-label-text.pass { color: var(--success); }
.score-label-text.fail { color: var(--error); }

/* Score color classes for table */
.score-good { color: var(--success); font-weight: 600; }
.score-avg { color: var(--warning); font-weight: 600; }
.score-bad { color: var(--error); font-weight: 600; }

/* Eval Sections */
.eval-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.eval-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.eval-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.eval-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eval-list li {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
}

.eval-list-success li { border-left-color: var(--success); }
.eval-list-warning li { border-left-color: var(--warning); }

.eval-feedback-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.eval-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   CRITERIA ROWS
   ============================================================ */

.criteria-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.criteria-label {
    flex: 0 0 180px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.criteria-score {
    font-size: 13px;
    font-weight: 600;
    flex: 0 0 36px;
    text-align: right;
}

.progress-bar {
    flex: 1;
    background: var(--bg-tertiary);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.fill-good { background: var(--success); }
.fill-avg { background: var(--warning); }
.fill-bad { background: var(--error); }

/* ============================================================
   HISTORY PAGE
   ============================================================ */

.data-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 16px;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.data-table td {
    font-size: 13px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-overlay .modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
}

.modal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header-bar h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-body-pad {
    padding: 16px 24px;
}

.confirm-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   TOAST
   ============================================================ */

#toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 12px);
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   PLAN CONTENT (rendered by JS)
   ============================================================ */

#plan-content {
    padding: 0 16px 24px;
}

/* ============================================================
   SECTION HEADING (used in JS-rendered HTML)
   ============================================================ */

.section-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ============================================================
   SPINNER
   ============================================================ */

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    .criteria-label { flex: 0 0 120px; }
    .scenario-grid { grid-template-columns: 1fr; }
    .persona-grid { grid-template-columns: 1fr; }
    .eval-actions { flex-direction: column; }
    .topbar-user-label { display: none; }
    .login-card { padding: 24px 20px; }
}
