/* =============================================================
   kiteclass-student — Mobile-first PWA-grade kit styles
   Persona: S. Student (mobile-primary 320–414px ~85% sessions,
   age 6-22 — K-12 + vocational, homework-hours peak 7-10pm,
   moderate tech literacy — digital native, sparse density,
   big tap targets, friendly empty states with emoji).
   Direction D pivot per dossier/08-direction-decisions.md §2:
   web responsive + PWA-grade, NOT native app.
   Sister kit: kiteclass-parent (mobile-first PWA pattern reused);
   key differences from parent:
     - 5-tab bottom nav (Today / Classes / Grades / Notif / Profile)
     - More playful: confetti on submit, celebratory empty states
     - Student vocab ("của bạn", "bạn", emoji-friendly)
     - Sparser density (1 column hero metric per screen)
   ============================================================= */

@import url("../_shared/colors_and_type.css");

/* ============================================================
   THEME — KiteClass student overlay (energetic teal)
   ============================================================ */
:root,
.theme-kiteclass-student {
  /* Brighter teal for younger persona, warmer than parent indigo */
  --primary: 168 76% 42%;            /* kite-teal */
  --primary-foreground: 0 0% 100%;
  --accent: 25 95% 53%;              /* keep kite-orange for streaks/CTAs */
  --accent-foreground: 0 0% 100%;
  --ring: 168 76% 42%;
  --radius: 1rem;                    /* friendly rounded */

  /* Hero gradient (teal → indigo for mood lift) */
  --hero-grad-start: 168 76% 42%;
  --hero-grad-end:   199 89% 48%;

  /* Brand-coloured surface backgrounds */
  --surface-soft:    168 76% 96%;
  --surface-success: 160 84% 96%;
  --surface-warning:  38 92% 96%;
  --surface-danger:    0 84% 97%;
  --surface-info:    217 91% 96%;
}

/* ============================================================
   BASE — mobile-first reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

/* iOS Safari safe-area support */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* All interactive targets ≥44×44 (WCAG 2.5.5 / Apple HIG) */
button, a, [role="button"], input:not([type="checkbox"]):not([type="radio"]), label[for] {
  min-height: 44px;
}
button:not(.tab-btn):not(.icon-btn):not(.chip), a:not(.tab-btn):not(.chip) {
  min-width: 44px;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

img { max-width: 100%; display: block; }

/* Visible focus ring */
:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   PHONE FRAME — for index.html click-thru viewer
   ============================================================ */
.phone-frame {
  width: 390px;
  height: 844px;
  border-radius: 48px;
  background: #111827;
  padding: 14px 12px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.25),
    0 0 0 2px rgba(255,255,255,0.08) inset;
  position: relative;
}
.phone-frame::before {
  content: "";
  position: absolute;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 34px;
  background: #000;
  border-radius: 20px;
  z-index: 30;
}
.phone-screen {
  width: 100%; height: 100%;
  background: hsl(var(--background));
  border-radius: 38px;
  overflow: hidden;
  position: relative;
}
.phone-screen iframe {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: hsl(var(--background));
  position: relative;
  padding-bottom: 96px; /* space for bottom-tab nav */
}

@media (min-width: 768px) {
  .app-shell {
    margin: 24px auto;
    border-radius: 28px;
    box-shadow: var(--shadow-soft-lg);
    overflow: hidden;
  }
}

/* ============================================================
   STATUS BAR (faux iOS)
   ============================================================ */
.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  background: transparent;
}
.status-bar .icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  padding: 12px 20px 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-header h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.app-header .subtitle {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}
.app-header .icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.app-header .icon-btn .badge-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 10px; height: 10px;
  background: hsl(var(--destructive));
  border-radius: 999px;
  border: 2px solid hsl(var(--card));
}

/* Back-button row */
.app-back {
  padding: 8px 12px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-back .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 999px;
}
.app-back .crumb {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

/* ============================================================
   HERO METRIC — large gradient card
   ============================================================ */
.hero-metric {
  margin: 12px 16px 16px 16px;
  padding: 24px;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg,
    hsl(var(--hero-grad-start)) 0%,
    hsl(var(--hero-grad-end)) 100%);
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.25);
  position: relative;
  overflow: hidden;
}
.hero-metric::before {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-metric .label {
  font-size: var(--text-sm);
  opacity: 0.92;
  font-weight: 500;
}
.hero-metric .value {
  font-size: 36px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 6px;
}
.hero-metric .delta {
  font-size: var(--text-sm);
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ============================================================
   NEXT-CLASS CARD (Today screen primary CTA)
   ============================================================ */
.next-class-card {
  margin: 12px 16px;
  padding: 18px;
  border-radius: 22px;
  background: hsl(var(--surface-soft));
  border: 1px solid hsl(var(--primary) / 0.2);
  position: relative;
}
.next-class-card .countdown {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  color: hsl(var(--primary));
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.next-class-card .name {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.next-class-card .meta {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
  margin-top: 6px;
  display: grid;
  gap: 4px;
}
.next-class-card .meta .row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   CARD — generic
   ============================================================ */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.card + .card { margin-top: 12px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px 20px;
}
.section-heading h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0;
}
.section-heading a {
  font-size: var(--text-sm);
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 600;
}

/* ============================================================
   CLASS-LIST ROW
   ============================================================ */
.class-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  margin: 0 16px 8px 16px;
  text-decoration: none;
  color: inherit;
}
.class-row .swatch {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
}
.class-row .swatch.toan       { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.class-row .swatch.van        { background: linear-gradient(135deg, #ec4899, #be185d); }
.class-row .swatch.anh        { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.class-row .swatch.ly         { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.class-row .swatch.hoa        { background: linear-gradient(135deg, #f59e0b, #b45309); }
.class-row .swatch.sinh       { background: linear-gradient(135deg, #10b981, #047857); }
.class-row .swatch.su         { background: linear-gradient(135deg, #f97316, #c2410c); }
.class-row .swatch.dia        { background: linear-gradient(135deg, #06b6d4, #0e7490); }

.class-row .info { flex: 1; min-width: 0; }
.class-row .name {
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}
.class-row .sub {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}
.class-row .meta {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  text-align: right;
  white-space: nowrap;
}

/* ============================================================
   ASSIGNMENT ROW
   ============================================================ */
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  margin: 0 16px 8px 16px;
  text-decoration: none;
  color: inherit;
}
.task-row .icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-row .icon.amber { background: hsl(var(--surface-warning)); color: hsl(var(--warning)); }
.task-row .icon.green { background: hsl(var(--surface-success)); color: hsl(var(--success)); }
.task-row .icon.blue  { background: hsl(var(--surface-info));    color: hsl(var(--info)); }
.task-row .icon.red   { background: hsl(var(--surface-danger));  color: hsl(var(--destructive)); }
.task-row .body { flex: 1; min-width: 0; }
.task-row .title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: hsl(var(--foreground));
}
.task-row .sub {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}
.task-row .trail {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* ============================================================
   BOTTOM TAB NAV — 5 tabs (student has more than parent's 4)
   ============================================================ */
.bottom-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: hsl(var(--card) / 0.95);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid hsl(var(--border));
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom)) 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  z-index: 50;
}

@media (min-width: 768px) {
  .bottom-tabs {
    position: absolute;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
  }
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  border-radius: 14px;
  padding: 6px 4px;
  text-decoration: none;
  min-height: 56px;
}
.tab-btn[aria-current="page"] {
  color: hsl(var(--primary));
  background: hsl(var(--surface-soft));
}
.tab-btn .tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  border-radius: 14px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  transition: transform .15s ease-out, box-shadow .15s ease-out, opacity .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft-lg); }
.btn-primary:active { transform: translateY(0); opacity: 0.92; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  border-radius: 14px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  font-weight: 600;
  font-size: var(--text-base);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  color: hsl(var(--foreground));
  font-weight: 500;
  font-size: var(--text-sm);
}

.btn-accent {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-row {
  display: grid;
  gap: 8px;
  margin: 16px;
}

/* ============================================================
   CHIPS / FILTERS
   ============================================================ */
.chip-row {
  display: flex;
  gap: 8px;
  padding: 8px 16px 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  font-size: var(--text-sm);
  font-weight: 500;
  color: hsl(var(--foreground));
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.chip[aria-pressed="true"] {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

/* ============================================================
   PILL / BADGE
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
}
.pill.success { background: hsl(var(--surface-success)); color: hsl(var(--success)); }
.pill.warning { background: hsl(var(--surface-warning)); color: hsl(var(--warning)); }
.pill.danger  { background: hsl(var(--surface-danger));  color: hsl(var(--destructive)); }
.pill.info    { background: hsl(var(--surface-info));    color: hsl(var(--info)); }
.pill.neutral { background: hsl(var(--muted));           color: hsl(var(--muted-foreground)); }

/* Grade pill — bold, used in grades + assignment-detail */
.grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 36px;
  border-radius: 12px;
  font-weight: 700;
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
}
.grade-pill.xuat-sac { background: hsl(160 84% 92%); color: hsl(160 84% 25%); }
.grade-pill.gioi     { background: hsl(168 76% 92%); color: hsl(168 76% 28%); }
.grade-pill.kha      { background: hsl(38 92% 92%);  color: hsl(38 92% 30%); }
.grade-pill.tb       { background: hsl(0 0% 92%);    color: hsl(0 0% 35%); }
.grade-pill.yeu      { background: hsl(0 84% 95%);   color: hsl(0 84% 35%); }

/* ============================================================
   FORMS
   ============================================================ */
.form-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.form-field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: hsl(var(--foreground));
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid hsl(var(--border));
  background: hsl(var(--card));
  font-size: var(--text-base);
  font-family: inherit;
  color: hsl(var(--foreground));
}
.form-field textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 1px;
  border-color: hsl(var(--primary));
}
.form-field .hint {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
}
.form-field .err {
  font-size: var(--text-xs);
  color: hsl(var(--destructive));
}

/* ============================================================
   ATTENDANCE CALENDAR
   ============================================================ */
.calendar {
  margin: 12px 16px;
  padding: 16px;
  border-radius: 20px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-grid .dow {
  text-align: center;
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  padding: 6px 0;
}
.day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 500;
}
.day.muted    { color: hsl(var(--muted-foreground)); opacity: 0.4; }
.day.present  { background: hsl(var(--surface-success)); color: hsl(var(--success)); font-weight: 700; }
.day.absent   { background: hsl(var(--surface-danger));  color: hsl(var(--destructive)); font-weight: 700; }
.day.late     { background: hsl(var(--surface-warning)); color: hsl(var(--warning)); font-weight: 700; }
.day.excused  { background: hsl(var(--surface-info));    color: hsl(var(--info)); font-weight: 700; }
.day.today    { outline: 2px solid hsl(var(--primary)); }
.day.weekend  { color: hsl(var(--muted-foreground)); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
}
.legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ============================================================
   STATS CARD (attendance rate, grade trend, etc.)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 16px 16px 16px;
}
.stats-card {
  padding: 14px;
  border-radius: 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}
.stats-card .label {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stats-card .value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   STATE CONTAINERS — empty / error / success
   ============================================================ */
.state {
  text-align: center;
  padding: 48px 24px;
}
.state .illu {
  width: 120px; height: 120px;
  margin: 0 auto 16px auto;
  border-radius: 999px;
  background: hsl(var(--surface-soft));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.state.success .illu { background: hsl(var(--surface-success)); }
.state.error   .illu { background: hsl(var(--surface-danger)); }
.state h3 { font-size: var(--text-lg); font-weight: 700; margin: 0 0 6px 0; }
.state p  { font-size: var(--text-sm); color: hsl(var(--muted-foreground)); margin: 0 0 20px 0; }

/* ============================================================
   SKELETON
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    hsl(var(--muted)) 0%,
    hsl(var(--border)) 40%,
    hsl(var(--muted)) 80%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 12px;
}

/* ============================================================
   PROFILE / SETTINGS
   ============================================================ */
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.settings-row:first-child { border-top-left-radius: 16px; border-top-right-radius: 16px; }
.settings-row:last-child  { border-bottom: 0; border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }

.settings-row .label { flex: 1; min-width: 0; }
.settings-row .title { font-weight: 600; font-size: var(--text-sm); }
.settings-row .hint  { font-size: var(--text-xs); color: hsl(var(--muted-foreground)); margin-top: 2px; }

.settings-group {
  margin: 12px 16px;
  border-radius: 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  overflow: hidden;
}

.toggle {
  width: 44px; height: 26px;
  background: hsl(var(--muted));
  border-radius: 999px;
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .2s ease-out;
}
.toggle.on { background: hsl(var(--primary)); }
.toggle.on::after { transform: translateX(18px); }

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 16px;
  text-align: center;
}
.profile-hero .avatar-lg {
  width: 96px; height: 96px;
  border-radius: 999px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}
.profile-hero .name {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.profile-hero .sub {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

/* ============================================================
   NOTIFICATION ROW
   ============================================================ */
.notif-row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
}
.notif-row.unread { background: hsl(var(--surface-soft)); }
.notif-row .ic {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-row .ic.green { background: hsl(var(--surface-success)); color: hsl(var(--success)); }
.notif-row .ic.amber { background: hsl(var(--surface-warning)); color: hsl(var(--warning)); }
.notif-row .ic.blue  { background: hsl(var(--surface-info));    color: hsl(var(--info)); }
.notif-row .ic.red   { background: hsl(var(--surface-danger));  color: hsl(var(--destructive)); }
.notif-row .body { flex: 1; min-width: 0; }
.notif-row .head {
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-row .head .unread-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: hsl(var(--primary));
  flex-shrink: 0;
}
.notif-row .msg {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
  line-height: 1.4;
}
.notif-row .ts {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
}

/* ============================================================
   TIMELINE ROW (for grade history, attendance day)
   ============================================================ */
.timeline {
  margin: 0 16px;
  padding: 0;
  list-style: none;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 19px; top: 8px; bottom: 8px;
  width: 2px;
  background: hsl(var(--border));
}
.timeline li {
  padding: 12px 0 12px 52px;
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 12px; top: 18px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 3px solid hsl(var(--primary));
  z-index: 1;
}
.timeline li .ttl {
  font-weight: 600;
  font-size: var(--text-sm);
}
.timeline li .meta {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

/* ============================================================
   TABS (3 wide)
   ============================================================ */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 8px 16px 16px 16px;
  padding: 4px;
  background: hsl(var(--muted));
  border-radius: 12px;
}
.tab {
  text-align: center;
  padding: 10px 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 9px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.tab[aria-selected="true"] {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-soft);
}

/* ============================================================
   PAYMENT METHOD SELECTOR (older student only)
   ============================================================ */
.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid hsl(var(--border));
  background: hsl(var(--card));
  margin-bottom: 8px;
  cursor: pointer;
}
.pay-method.selected {
  border-color: hsl(var(--primary));
  background: hsl(var(--surface-soft));
}
.pay-method .logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 12px;
}
.pay-method .logo.momo  { background: linear-gradient(135deg, #d82d8b, #a02168); }
.pay-method .logo.vnpay { background: linear-gradient(135deg, #0066b1, #003e6b); }
.pay-method .logo.zalo  { background: linear-gradient(135deg, #006af5, #0048b0); }
.pay-method .logo.bank  { background: linear-gradient(135deg, #475569, #1e293b); }
.pay-method .logo.cash  { background: linear-gradient(135deg, #15803d, #166534); }
.pay-method .info { flex: 1; min-width: 0; }
.pay-method .name { font-weight: 600; font-size: var(--text-sm); }
.pay-method .desc { font-size: var(--text-xs); color: hsl(var(--muted-foreground)); margin-top: 2px; }

/* ============================================================
   WEB PUSH PERMISSION (browser-style modal)
   ============================================================ */
.browser-modal {
  position: absolute;
  top: 80px; left: 16px; right: 16px;
  background: white;
  border-radius: 14px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.18),
    0 0 0 1px rgba(0,0,0,0.04);
  padding: 16px;
  z-index: 65;
}
.browser-modal .origin {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.browser-modal .ask {
  font-size: var(--text-base);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 12px;
}
.browser-modal .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ============================================================
   DARK MODE
   ============================================================ */
.dark {
  --primary: 168 76% 52%;
  --primary-foreground: 222 47% 11%;
  --hero-grad-start: 168 76% 50%;
  --hero-grad-end:   199 89% 58%;
  --surface-soft:    168 32% 14%;
  --surface-success: 160 60% 14%;
  --surface-warning:  38 60% 14%;
  --surface-danger:    0 60% 16%;
  --surface-info:    217 32% 14%;
}
.dark .grade-pill.xuat-sac { background: hsl(160 60% 14%); color: hsl(160 84% 70%); }
.dark .grade-pill.gioi     { background: hsl(168 60% 14%); color: hsl(168 76% 70%); }
.dark .grade-pill.kha      { background: hsl(38 60% 14%);  color: hsl(38 92% 70%); }
.dark .grade-pill.tb       { background: hsl(220 14% 18%); color: hsl(220 14% 75%); }
.dark .grade-pill.yeu      { background: hsl(0 60% 16%);   color: hsl(0 84% 70%); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-slide-up { animation: slideUp .35s ease-out forwards; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.text-center { text-align: center; }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mx-4 { margin-left: 16px; margin-right: 16px; }
.p-4 { padding: 16px; }
