/* ==========================================================================
   Hệ thống Đăng ký & Quản lý Thi — Bộ môn Vật lý · Khoa GDĐC · HaUI
   Đồng bộ 100% thiết kế với App Quản lý hoạt động Thí nghiệm Vật lý
   ========================================================================== */

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;

  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-soft: #eff6ff;

  --success: #047857;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --purple: #6d28d9;
  --purple-soft: #f5f3ff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 28px rgba(15, 23, 42, 0.14);
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.18);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

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

.header-user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px;
}

.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-subtitle {
  margin: -6px 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Thẻ Hero Lịch Thi & Đồng hồ đếm ngược (Yêu cầu 2) */
.exam-hero-card {
  border-radius: 16px;
  padding: 20px 22px;
  color: #ffffff;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 52%, #0284c7 100%);
  box-shadow: 0 10px 26px rgba(30, 58, 138, 0.24);
  position: relative;
  overflow: hidden;
}

.exam-hero-card.ongoing {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #0d9488 100%);
}

.exam-hero-card.passed {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.exam-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.exam-hero-badge {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
}

.exam-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  align-items: center;
}

.exam-room-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin: 4px 0 8px;
}

.exam-meta-line {
  font-size: 14.5px;
  margin: 4px 0;
  opacity: 0.96;
}

.exam-countdown-panel {
  background: rgba(15, 23, 42, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}

.exam-countdown-caption {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #e0f2fe;
  margin-bottom: 6px;
  font-weight: 600;
}

.exam-countdown-clock {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fef08a;
}

/* Khung hạn đăng ký lần đầu & đồng hồ nhỏ gọn (Kế thừa V4.0 3YC) */
.deadline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #93c5fd;
  margin-bottom: 16px;
}

.deadline-countdown-pill {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 8px 14px;
  text-align: right;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.06);
}

.deadline-countdown-pill small {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.deadline-countdown-pill output {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
}

.deadline-countdown-pill output.expired {
  color: var(--danger);
}

/* Nút chế độ Sinh viên phân biệt rõ màu sắc (Kế thừa V4.0 3v3) */
.stu-mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stu-mode-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.stu-mode-btn.mode-register {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}
.stu-mode-btn.mode-register.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.stu-mode-btn.mode-change {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}
.stu-mode-btn.mode-change.active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.stu-mode-btn.mode-link {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.stu-mode-btn.mode-link.active {
  background: #6d28d9;
  border-color: #6d28d9;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25);
}

/* Thẻ lựa chọn Ca/Nhóm đăng ký */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 12px;
}

.reg-choice-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border-radius: var(--radius);
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
}

.reg-choice-card:hover:not(:disabled) {
  border-color: #60a5fa;
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.reg-choice-card.selected {
  border: 2.5px solid var(--success);
  background: #ecfdf5;
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.16);
}

.reg-choice-card.full {
  background: #fef2f2;
  border-color: #fca5a5;
}

.reg-choice-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.reg-choice-card.selected .reg-choice-title {
  color: #065f46;
}

.reg-choice-meta {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Khung nổi bật Mở đợt bổ sung / Đổi lựa chọn (Kế thừa V4.0 2v3) */
.supplement-highlight-card {
  border: 2px solid #f59e0b;
  border-left: 7px solid #d97706;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 110px);
}

/* Nút Tạo / cập nhật danh sách ca/nhóm to và nền xanh dương (Kế thừa V4.0 5YC) */
.btn-generate-large {
  background: #1565c0;
  border: 2px solid #0d47a1;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(21, 101, 192, 0.22);
}
.btn-generate-large:hover:not(:disabled) {
  background: #0d47a1;
}

/* Phiếu báo điểm cá nhân cho Sinh viên (Yêu cầu 3) */
.score-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.score-kpi-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}

.score-kpi-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.score-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border-left: 4px solid transparent;
  font-size: 14px;
}

.alert-danger { background: var(--danger-soft); border-left-color: var(--danger); color: #7f1d1d; }
.alert-warning { background: var(--warning-soft); border-left-color: var(--warning); color: #78350f; }
.alert-success { background: var(--success-soft); border-left-color: var(--success); color: #064e3b; }
.alert-info { background: var(--primary-soft); border-left-color: var(--primary); color: #1e3a8a; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 5px 11px; font-size: 13px; }

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover:not(:disabled) { background: #065f46; }

.btn-warning { background: #d97706; color: #ffffff; }
.btn-warning:hover:not(:disabled) { background: var(--warning); }

.btn-purple { background: var(--purple); color: #ffffff; }
.btn-purple:hover:not(:disabled) { background: #5b21b6; }

.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger:hover:not(:disabled) { background: #991b1b; }

.btn-outline { background: #ffffff; color: var(--text); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-alt); }

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-ghost-light:hover:not(:disabled) { background: rgba(255, 255, 255, 0.24); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-muted { background: #e2e8f0; color: #334155; }

.tabs-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--surface);
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.tab-btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn:hover { background: var(--surface-alt); color: var(--text); }
.tab-btn.active { background: var(--primary); color: #ffffff; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
}

.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.input-sm { min-height: 36px; padding: 5px 8px; font-size: 13px; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data-table th, table.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: middle;
}

table.data-table th {
  background: #f8fafc;
  color: #1e293b;
  font-weight: 700;
  white-space: nowrap;
}

table.data-table tr:hover td { background: #f8fafc; }

.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #0d9488);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.reg-choice-card.full .progress-fill {
  background: var(--danger);
}

.login-container {
  max-width: 520px;
  margin: 32px auto;
  text-align: center;
}

.google-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  min-height: 44px;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3.5px solid #cbd5e1;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 12px;
}

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

.toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(410px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.toast-text { flex: 1; }
.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: #b45309; }
.toast-info { background: var(--primary); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: #ffffff;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.modal-box.modal-lg { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title { font-size: 17px; font-weight: 700; margin: 0; }

.survey-scale-group { display: flex; gap: 8px; flex-wrap: wrap; }
.survey-scale-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 52px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 600;
  cursor: pointer;
  flex: 1 1 52px;
}
.survey-scale-pill:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.global-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.global-busy-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px 26px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 340px;
  width: 100%;
  border: 1px solid var(--border-light);
}

.global-busy-text { font-size: 14.5px; font-weight: 600; color: var(--text); }

.stu-guide-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  margin-bottom: 14px;
  font-size: 13.5px;
}

/* PWA Install & Sponsor Slot */
.pwa-install-banner {
  background: linear-gradient(90deg, #eff6ff 0%, #e0f2fe 100%);
  border-bottom: 1px solid #bfdbfe;
  padding: 10px 16px;
}
.pwa-install-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pwa-install-text { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--text); }
.pwa-install-text span { font-size: 12.5px; color: var(--text-muted); }
.pwa-install-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pwa-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pwa-footer-btn:hover { background: #dbeafe; }

.sponsor-slot { max-width: 1280px; width: 100%; margin: 0 auto 14px; padding: 0 20px; }
.sponsor-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
.sponsor-heading {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
}
.sponsor-list { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 10px; }
.sponsor-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
  max-width: 340px;
}
a.sponsor-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.sponsor-logo { max-height: 40px; max-width: 96px; width: auto; height: auto; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.sponsor-name { font-size: 13.5px; font-weight: 700; color: var(--primary-dark); line-height: 1.3; }
.sponsor-tagline { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.sponsor-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--surface-alt);
  margin-bottom: 12px;
}

.mobile-bottom-nav { display: none; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-main { padding: 12px 10px 92px; }
  .app-footer { padding: 14px 12px 86px; font-size: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .brand-title { font-size: 14.5px; }
  .card { padding: 14px; }
  .exam-room-title { font-size: 20px; }
  .exam-countdown-clock { font-size: 20px; }
  .student-desktop-tabs { display: none; }
  .stu-mode-btn, .btn-generate-large, .stu-action-btn { width: 100%; }
  .input, .select, .textarea { font-size: 16px; }
  .toast-container { left: 10px; right: 10px; top: 64px; max-width: none; }
  .modal-backdrop { padding: 8px; align-items: flex-end; }
  .modal-box { max-height: 92vh; padding: 16px 14px; border-radius: 16px 16px 10px 10px; }
  .header-inner { padding: 10px 12px; gap: 8px; }
  .brand-badge { width: 34px; height: 34px; font-size: 14px; }
  .user-pill { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; padding: 4px 10px; }
  .btn { white-space: normal; line-height: 1.3; }
  .pwa-install-actions { width: 100%; }
  .pwa-install-actions .btn { flex: 1; }
  .sponsor-slot { padding: 0 12px; }
  .sponsor-card { width: 100%; max-width: 100%; }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid var(--border);
    z-index: 60;
    padding: 4px 4px env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.08);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 2px;
    border-radius: 8px;
  }

  .mobile-nav-item.active {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .mobile-nav-icon {
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 2px;
  }
}

@media (max-width: 480px) {
  .brand-sub { display: none; }
  .card-title { font-size: 16px; }
}
