/* ==========================================================================
   Latih Tubi Peperiksaan E1 (Teknologi Maklumat) - LHDNM Style Sheet
   Includes Multi-User Authentication, Historical Tracking, and Personalized Insights
   ========================================================================== */

:root {
  --primary: #0b3b60;        /* Official Corporate Navy */
  --primary-light: #16568a;
  --primary-dark: #07253d;
  --accent: #2563eb;         /* Vibrant Cobalt */
  --accent-light: #e0e7ff;
  --amber: #f59e0b;          /* Alert / Warning */
  --amber-light: #fef3c7;
  --success: #10b981;        /* Correct Answer */
  --success-light: #d1fae5;
  --danger: #ef4444;         /* Incorrect / Weakness */
  --danger-light: #fee2e2;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
  gap: 14px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-org {
  background: var(--amber);
  color: #1e293b;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-text .sub-brand {
  font-size: 12px;
  color: #cbd5e1;
}

/* Header User Profile Area */
.header-user-area {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f59e0b;
  color: #1e293b;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.user-email {
  font-size: 11px;
  color: #cbd5e1;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.3);
}

.header-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-tab {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.25);
}

.nav-tab.active {
  background: #ffffff;
  color: var(--primary);
  border-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Main Content Area */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px 20px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* PERSONALIZED RECOMMENDATION BANNER */
.personalized-recommendation-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.rec-icon {
  font-size: 38px;
  flex-shrink: 0;
  background: #ffffff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.rec-content {
  flex: 1;
}

.rec-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.18);
  padding: 3px 8px;
  border-radius: 4px;
}

.rec-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #78350f;
  margin-top: 4px;
  margin-bottom: 12px;
}

.rec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

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

.rec-box {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #fde68a;
}

.rec-label {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  display: block;
  margin-bottom: 6px;
}

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-item-pill {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-item-pill::before {
  content: "•";
  color: #ef4444;
  font-weight: bold;
}

.rec-action-bar {
  display: flex;
  gap: 10px;
}

/* Section Titles */
.section-title {
  margin: 28px 0 16px 0;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
}

.section-title p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Dashboard Hero */
.dashboard-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.4fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .dashboard-hero {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }
}

.hero-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card .stat-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.hero-card .stat-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.overall-stat .stat-value {
  color: var(--accent);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 999px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.5s ease-in-out;
}

.alert-card {
  background: var(--amber-light);
  border-color: #fde68a;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.alert-icon {
  font-size: 32px;
}

.weakness-title {
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
}

/* Modes Grid */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.mode-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.mode-card.highlight-card {
  border: 2px solid var(--danger);
  background: #fffafa;
}

.mode-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.mode-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.mode-card p {
  font-size: 14px;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 18px;
}

.topic-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mock-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-main);
}

.mock-controls select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 4px;
  background-color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-light);
}

.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #475569;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #334155;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-warning {
  background-color: #d97706;
  color: #ffffff;
}

.btn-warning:hover {
  background-color: #b45309;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 12px;
  padding: 8px 10px;
}

.btn-outline:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

/* Topics Breakdown Grid */
.topics-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.topic-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.topic-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.topic-id-pill {
  font-size: 11px;
  font-weight: 800;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.topic-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
}

.topic-acc-percent {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.topic-meta-counts {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* HISTORICAL SUMMARY VIEW */
.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.hist-stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.hist-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hist-stat-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

.hist-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.hist-badge.pass {
  background: var(--success-light);
  color: #065f46;
}

.hist-badge.fail {
  background: var(--danger-light);
  color: #991b1b;
}

/* ACTIVE DRILL UI */
.drill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.badge-mode {
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.drill-sub-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
}

.drill-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timer-display {
  font-size: 16px;
  font-weight: 800;
  color: var(--danger);
  background: var(--danger-light);
  padding: 4px 12px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.question-progress {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Exam Palette Navigator */
.exam-nav-drawer {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 16px;
}

.nav-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.badge-summary {
  background: #e2e8f0;
  color: #334155;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.palette-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pal-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pal-btn:hover {
  background: #f1f5f9;
}

.pal-btn.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
  font-weight: 800;
}

.pal-btn.answered {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

/* Question Box */
.question-container {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.question-header-info {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.q-difficulty, .q-type, .q-id {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.q-difficulty {
  background: #f1f5f9;
  color: #475569;
}

.q-type {
  background: #ecfdf5;
  color: #047857;
}

.q-id {
  background: #eff6ff;
  color: #1d4ed8;
}

.question-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background-color: #ffffff;
  transition: all 0.15s ease;
}

.option-item:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

.option-item.selected {
  border-color: var(--accent);
  background-color: #eff6ff;
}

.option-item.correct-reveal {
  border-color: var(--success);
  background-color: var(--success-light);
}

.option-item.incorrect-reveal {
  border-color: var(--danger);
  background-color: var(--danger-light);
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.option-item.selected .option-letter {
  background: var(--accent);
  color: #ffffff;
}

.option-item.correct-reveal .option-letter {
  background: var(--success);
  color: #ffffff;
}

.option-item.incorrect-reveal .option-letter {
  background: var(--danger);
  color: #ffffff;
}

.option-content {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-main);
  padding-top: 3px;
}

/* Drill Actions */
.drill-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Feedback Card */
.feedback-card {
  margin-top: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.2s ease-out;
}

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

.feedback-status {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.feedback-status.correct {
  background: #059669;
}

.feedback-status.incorrect {
  background: #dc2626;
}

.fb-body {
  background: #ffffff;
  padding: 20px;
}

.fb-row {
  margin-bottom: 12px;
}

.fb-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.highlight-ans {
  font-size: 16px;
  font-weight: 800;
  color: #065f46;
}

.fb-explanation {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
}

.fb-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.fb-evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.fb-meta-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.fb-meta-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.fb-meta-val.source-file {
  color: var(--primary);
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
}

/* Ctrl+F Special Box */
.ctrl-f-box {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  border: 2px dashed #60a5fa;
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.ctrl-f-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ctrl-f-tag {
  font-size: 13px;
  font-weight: 800;
  color: #1e40af;
  letter-spacing: 0.5px;
}

.btn-copy {
  background: #ffffff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background: #1d4ed8;
  color: #ffffff;
}

.ctrl-f-keyword {
  font-size: 20px;
  font-weight: 800;
  color: #0c4a6e;
  font-family: Consolas, monospace;
  background: #ffffff;
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #bae6fd;
  margin-bottom: 6px;
}

.ctrl-f-hint {
  display: block;
  font-size: 12px;
  color: #475569;
}

.ctrl-f-hint code {
  background: #ffffff;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-weight: 700;
}

/* MOCK EXAM RESULTS */
.result-hero {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}

.result-hero h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 20px;
}

.result-score-circle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 6px solid var(--primary);
  background: #f8fafc;
  margin-bottom: 16px;
}

.score-percent {
  font-size: 40px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.score-ratio {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.result-status {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.result-status.pass {
  background: var(--success-light);
  color: #065f46;
}

.result-status.fail {
  background: var(--danger-light);
  color: #991b1b;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.exam-topic-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.exam-review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.review-item.correct {
  border-left: 6px solid var(--success);
}

.review-item.incorrect {
  border-left: 6px solid var(--danger);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.review-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.review-badge.correct {
  background: var(--success-light);
  color: #065f46;
}

.review-badge.incorrect {
  background: var(--danger-light);
  color: #991b1b;
}

/* OPEN-BOOK SEARCH VIEW */
.search-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-toolbar input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.search-toolbar select {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #ffffff;
}

.search-results-stats {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-res-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.search-res-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.res-topic-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.res-page-pill {
  font-size: 12px;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.res-filename {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.res-snippet {
  font-size: 13px;
  color: var(--text-main);
  background: #f8fafc;
  padding: 10px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

/* QUESTION BANK TABLE */
.bank-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.bank-filters input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.bank-filters select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #ffffff;
}

.bank-table-wrapper {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.bank-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.bank-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.bank-table tr:hover {
  background-color: #f8fafc;
}

/* SETTINGS VIEW */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.settings-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.settings-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* MODAL STYLES (LOGIN & USER SWITCHER) */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  background: var(--primary);
  color: #ffffff;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-brand h3 {
  font-size: 16px;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.fast-user-picker {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}

.picker-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.picker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-pill {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-pill:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-hint code {
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  color: #0f172a;
}

/* ==========================================================================
   EXAM TIP & PINPOINT BOX STYLES
   ========================================================================== */
.exam-tip-box {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0;
}

.exam-tip-tag {
  font-size: 11px;
  font-weight: 800;
  color: #1e40af;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.exam-tip-text {
  font-size: 13px;
  color: #1e3a8a;
  line-height: 1.5;
  font-weight: 500;
}

.pinpoint-box {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 10px 16px;
  border-radius: 6px;
  margin: 10px 0;
}

.pinpoint-tag {
  font-size: 11px;
  font-weight: 800;
  color: #065f46;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.pinpoint-text {
  font-size: 12px;
  color: #047857;
  font-weight: 600;
  display: block;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   AUTH FIRST SCREEN STYLES
   ========================================================================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1e3a8a 0%, #0b3b60 60%, #061929 100%);
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: fadeInAuth 0.3s ease-out;
}

@keyframes fadeInAuth {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  background: linear-gradient(135deg, #0b3b60 0%, #16568a 100%);
  color: #ffffff;
  padding: 32px 36px 26px;
  text-align: center;
}

.badge-org-lg {
  display: inline-block;
  background: #f59e0b;
  color: #0b3b60;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.auth-header h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 6px;
}

.auth-header h3 {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: #cbd5e1;
}

.auth-body {
  padding: 28px 36px 24px;
}

.auth-instruction {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.auth-instruction strong {
  display: block;
  font-size: 13px;
  color: #065f46;
  margin-bottom: 2px;
}

.auth-instruction p {
  font-size: 12px;
  color: #047857;
  margin: 0;
}

.picker-pills-auth {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.user-pill-auth {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.user-pill-auth:hover {
  background: #eff6ff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15);
}

.pill-avatar {
  background: #0b3b60;
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-pill-auth:hover .pill-avatar {
  background: #2563eb;
}

.pill-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.btn-auth-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  margin-top: 10px;
  background: linear-gradient(135deg, #0b3b60 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
}

.btn-auth-submit:hover {
  filter: brightness(1.1);
}

.auth-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 14px 36px;
  text-align: center;
  font-size: 11px;
  color: #64748b;
}
