/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f7f8fa;
    --bg-card: #ffffff;
    --bg-hover: #f4f6f9;
    --bg-inset: #f0f2f5;
    --border: #e0e4ea;
    --border-light: #eceef2;
    --border-focus: rgba(37, 99, 235, 0.35);
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px -1px rgba(0,0,0,0.03);
    --shadow: 0 2px 6px -1px rgba(0,0,0,0.06), 0 1px 4px -2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 6px -2px rgba(0,0,0,0.04);
    --transition: 0.18s cubic-bezier(0.25, 0.1, 0.25, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ===== Navbar ===== */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 0 32px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand a {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.navbar-logo { flex-shrink: 0; }
.navbar-links { display: flex; gap: 2px; align-items: center; }
.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all var(--transition);
}
.navbar-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-user {
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 12px;
    font-weight: 500;
    border-left: 1px solid var(--border-light);
    margin-left: 4px;
}
.nav-logout {
    color: var(--text-muted) !important;
    font-size: 12px !important;
}

/* ===== Notification Bell (Basecamp-style) ===== */
.notif-wrapper { position: relative; }
.notif-bell {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-secondary);
    position: relative;
    transition: all var(--transition);
}
.notif-bell:hover { background: var(--bg-hover); color: var(--text); }
.notif-badge {
    position: absolute;
    top: 2px;
    right: 0;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 24px -4px rgba(0,0,0,0.1), 0 4px 8px -2px rgba(0,0,0,0.04);
    width: 380px;
    z-index: 200;
    margin-top: 4px;
}
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}
.notif-dropdown-header strong { font-size: 14px; }
.notif-mark-all {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-scroll { max-height: 420px; overflow-y: auto; }
.notif-section { border-bottom: 1px solid var(--border-light); }
.notif-section:last-child { border-bottom: none; }
.notif-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 16px 4px;
}
.notif-section-pinned-label { color: var(--warning); }
.notif-section-previous-label { color: var(--text-muted); }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    flex-shrink: 0;
    margin-top: 5px;
}
.notif-pin-icon {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 2px;
}
.notif-content { flex: 1; min-width: 0; }
.notif-message { line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition);
}
.notif-item:hover .notif-actions { opacity: 1; }
.notif-action-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-action-btn:hover { background: var(--bg-inset); color: var(--text); }
.notif-dismiss:hover { color: var(--danger); }
.notif-item-previous { opacity: 0.7; }
.notif-item-previous:hover { opacity: 1; }
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Container ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: var(--bg-hover); box-shadow: var(--shadow-sm); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #047857; }
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-create {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
    font-weight: 600;
    padding: 8px 20px;
}
.btn-create:hover { background: #15803d; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }

/* ===== Login ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-md);
}
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
}
.login-divider hr { flex: 1; border: none; border-top: 1px solid #ddd; }
.login-divider span { color: #888; font-size: 13px; }

/* ===== Dashboard ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.dashboard-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.6px;
}
.dashboard-actions { display: flex; gap: 10px; }

/* Action Buttons (Anthony-style) */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.btn-action-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.btn-action-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.btn-action-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-action-secondary:hover {
    background: var(--bg-hover);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Stats Cards (left-border accent like Anthony's) */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-card.stat-blue { border-left: 3px solid var(--primary); }
.stat-card.stat-yellow { border-left: 3px solid var(--warning); }
.stat-card.stat-green { border-left: 3px solid var(--success); }
.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Filter Bar (Anthony-style dropdown filters) */
.filter-bar {
    margin-bottom: 16px;
}
.filter-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-group { position: relative; }
.filter-group .form-select {
    padding: 7px 32px 7px 10px;
    font-size: 13px;
    min-width: 130px;
    border-radius: 6px;
}
.filter-search {
    position: relative;
    flex: 1;
    min-width: 160px;
    max-width: 280px;
}
.filter-search .form-input {
    padding: 7px 10px 7px 32px;
    font-size: 13px;
    border-radius: 6px;
}
.filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Question Cards (3-column grid like Anthony's) */
.question-cards { display: flex; flex-direction: column; gap: 8px; }
.question-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 24px;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
}
.question-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
    transform: translateY(-1px);
}

/* Card main content */
.qcard-main { min-width: 0; }
.qcard-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.qcard-exam-tag {
    display: inline-flex;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.qcard-topic {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qcard-subtopic {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Step Progress Dots */
.qcard-progress {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}
.qcard-step {
    display: flex;
    align-items: center;
}
.qcard-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-card);
    flex-shrink: 0;
    transition: all var(--transition);
}
.step-done .qcard-step-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.step-current .qcard-step-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.qcard-step-line {
    width: 12px;
    height: 2px;
    background: var(--border);
    transition: background var(--transition);
}
.qcard-step-line.line-done { background: var(--success); }

/* Spinner for generating steps */
.spinner-xs {
    width: 10px;
    height: 10px;
    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); } }

/* Card score & meta */
.qcard-right {
    text-align: right;
    flex-shrink: 0;
    min-width: 60px;
}
.qcard-score {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}
.qcard-score.score-good { color: var(--success); }
.qcard-score.score-ok { color: var(--warning); }
.qcard-score.score-low { color: var(--danger); }
.qcard-score-empty { color: var(--border); }
.qcard-score-max { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.qcard-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    margin-top: 4px;
}
.qcard-author { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.qcard-time { font-size: 11px; color: var(--text-muted); }

/* Badges (Anthony-style) */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-green { background: #d1fae5; color: #065f46; }

/* Empty State Card */
.empty-state-card {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 16px;
}
.empty-state-icon { color: var(--text-muted); margin-bottom: 16px; }
.empty-state-card h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* Form section title */
.form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Status badge (used in detail page) */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-gray { background: #f3f4f6; color: #6b7280; }
.status-blue { background: #dbeafe; color: #1d4ed8; }
.status-yellow { background: #fef3c7; color: #92400e; }
.status-green { background: #d1fae5; color: #065f46; }

/* ===== Question Detail ===== */
.detail-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

/* Sidebar */
.detail-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 76px;
}
.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.3;
}
.sidebar-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.sidebar-meta { margin-bottom: 20px; }
.sidebar-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-meta-row:last-child { border-bottom: none; }
.sidebar-meta-label { color: var(--text-muted); font-weight: 500; }
.sidebar-meta-value { color: var(--text); font-weight: 500; }

/* Workflow Stepper */
.stepper { margin-top: 20px; border-top: 1px solid var(--border-light); padding-top: 16px; }
.stepper-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-muted);
}
.stepper-item.active { color: var(--primary); font-weight: 600; }
.stepper-item.completed { color: var(--success); }
.stepper-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.stepper-item.completed .stepper-icon {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.stepper-item.active .stepper-icon {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Stepper label & comment badge */
.stepper-label { flex: 1; }
.stepper-comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 10px;
    text-decoration: none;
    transition: background var(--transition);
}
.stepper-comment-badge:hover { background: #dbeafe; }
.stepper-comment-badge svg { opacity: 0.7; }

/* Quality Score */
.quality-score {
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    text-align: center;
}
.quality-score-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }
.quality-score-value { font-size: 36px; font-weight: 800; color: var(--success); }
.quality-score-max { font-size: 16px; color: var(--text-muted); font-weight: 500; }

/* Main content */
.detail-main { min-width: 0; }

/* Phase sections */
.phase-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.phase-title { font-size: 16px; font-weight: 700; }
.phase-status {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.phase-status.approved { color: var(--success); }
.phase-status.awaiting { color: var(--warning); }
.phase-status.generating { color: var(--primary); }

/* Question content display */
.question-stem {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    white-space: pre-wrap;
}
.answer-choices { list-style: none; margin-bottom: 20px; }
.answer-choice {
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid var(--border-light);
}
.answer-choice.correct {
    background: var(--success-light);
    border-color: #a7f3d0;
    font-weight: 600;
}
.answer-choice .choice-letter {
    font-weight: 700;
    margin-right: 8px;
}

/* Explanation display */
.explanation-content {
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Eval scores grid */
.eval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}
.eval-card {
    background: var(--bg-inset);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.eval-card-score {
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
}
.eval-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}
.eval-summary-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
    margin: 0 auto 8px;
}
.eval-summary-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
    text-align: center;
}

/* Actions */
.phase-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Feedback form */
.feedback-form { margin-top: 16px; }
.feedback-toggle {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.feedback-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-top: 8px;
}

/* Comments section */
.comments-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.comments-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}
.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.comment-author { font-size: 13px; font-weight: 600; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-phase { font-size: 11px; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 10px; }
.comment-body { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.comment-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* Phase-grouped comments */
.phase-comment-group {
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}
.phase-comment-group:last-of-type { margin-bottom: 0; }
.phase-comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-inset);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.phase-comment-header svg { opacity: 0.5; }
.phase-comment-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1px 7px;
    border-radius: 10px;
}
.phase-comment-group .comment-item {
    padding: 12px 14px;
}

/* Generating animation */
.generating-banner {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}
.generating-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Empty state (legacy) */
.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: 14px; margin-bottom: 16px; }

/* Complete banner */
.error-banner {
    background: var(--danger-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

.complete-banner {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--success);
    font-weight: 600;
    font-size: 15px;
}

/* Inline editing */
.edit-choice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.choice-letter-label {
    font-weight: 700;
    font-size: 14px;
    min-width: 20px;
}
.edit-choice-input { flex: 1; }
.edit-correct-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}

/* Revision history */
.revision-history {
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}
.revision-history-title {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-inset);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.revision-history-title:hover { background: var(--bg-hover); }
.history-entry {
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    line-height: 1.5;
}
.history-reviewer { background: #fffbeb; }
.history-ai { background: #eff6ff; }
.history-role {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.history-content { color: var(--text-secondary); white-space: pre-wrap; }

/* Phase completion badges */
.phase-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}
.phase-badge.approved {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

/* ===== Workshop & Duplicate Check ===== */
.workshop-idea {
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.workshop-idea-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.workshop-idea-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
}

.dupe-results-card {
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 12px;
}
.dupe-results-card.dupe-loading {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    color: var(--primary);
}
.dupe-results-card.dupe-found {
    background: var(--warning-light);
    border: 1px solid #fde68a;
    color: #92400e;
}
.dupe-results-card.dupe-clear {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    color: var(--success);
}
.dupe-results-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}
.dupe-results-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual matched question card */
.dupe-match-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dupe-match-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.dupe-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.dupe-source-bank {
    background: #dbeafe;
    color: #1d4ed8;
}
.dupe-source-local {
    background: #f3e8ff;
    color: #7c3aed;
}
.dupe-match-reason {
    font-size: 12px;
    color: #92400e;
    font-weight: 500;
    line-height: 1.4;
    padding-top: 2px;
}
.dupe-match-stem {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 12px;
    white-space: pre-wrap;
}
.dupe-match-answers {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dupe-match-answer {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.dupe-match-answer:last-child { margin-bottom: 0; }
.dupe-answer-letter {
    font-weight: 700;
    margin-right: 6px;
    color: var(--text);
}

.tag-joel-btn {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}
.tag-joel-btn:hover {
    background: #047857;
}

/* ===== Draft Form (Phase 3) ===== */
.draft-form {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    background: var(--bg-card);
}
.draft-choice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.draft-choice-letter {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 22px;
}
.draft-choice-input {
    flex: 1;
}
.draft-correct-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}
.draft-correct-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--success);
}
.draft-correct-indicator {
    display: none;
}

/* ===== Evaluation Results (Phase 4) ===== */
.eval-overview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.eval-quality-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}
.eval-quality-badge.eval-good {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #a7f3d0;
}
.eval-quality-badge.eval-minor {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid #fde68a;
}
.eval-quality-badge.eval-major {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fca5a5;
}
.eval-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.eval-stat {
    font-size: 13px;
    font-weight: 600;
}
.severity-critical { color: var(--danger); }
.severity-moderate { color: var(--warning); }
.severity-minor { color: #6b7280; }

.eval-issues-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.eval-issue {
    border-radius: var(--radius);
    padding: 14px 16px;
    border-left: 4px solid;
}
.eval-issue-critical {
    background: var(--danger-light);
    border-left-color: var(--danger);
}
.eval-issue-moderate {
    background: var(--warning-light);
    border-left-color: var(--warning);
}
.eval-issue-minor {
    background: var(--bg-inset);
    border-left-color: #d1d5db;
}
.eval-issue-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.eval-issue-severity {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.eval-issue-domain {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.eval-issue-problem {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 6px;
}
.eval-issue-original {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
    margin-bottom: 4px;
}
.eval-issue-revision {
    font-size: 13px;
    color: var(--success);
    padding: 6px 10px;
    background: rgba(5, 150, 105, 0.05);
    border-radius: 4px;
}

.submitted-question-preview {
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .navbar { padding: 0 16px; }
    .container { padding: 16px; }
    .edit-choice-row { flex-wrap: wrap; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .dashboard-actions { width: 100%; }
    .question-card { grid-template-columns: 1fr; gap: 12px; }
    .qcard-right { text-align: left; }
    .qcard-progress { justify-content: flex-start; }
    .filter-form { flex-direction: column; }
    .filter-search { max-width: 100%; }
}
