/* Earlier Figma snapshot; the current prototype values are applied by prototype.css. */
:root {
  --primary: #0866ff;
  --primary-hover: #0759dc;
  --primary-ink: #0759dc;
  --primary-soft: #eaf3ff;
  --hero: #eaf3ff;
  --ink: #192b44;
  --muted: #586b82;
  --line: #dadde1;
  --surface: #fff;
  --background: #fff;
  --subtle-surface: #f3f4f6;
  --green: #107454;
  --green-soft: #eaf8f1;
  --red: #aa473e;
  --red-soft: #fff0ec;
  --orange: #984a15;
  --orange-soft: #fff4e5;
  --shadow: 0 1px 2px #192b4405;
}
:root[data-theme='dark'] {
  --primary-ink: #91baff;
  --primary: #91baff; --primary-hover: #b0cdff; --primary-soft: #233652;
  --hero: #233652; --ink: #edf1f7; --muted: #a2aec0; --line: #3b4454;
  --surface: #202635; --background: #171e2b; --subtle-surface: #293242;
  --green: #88d8b8; --green-soft: #213e36; --red: #f0a29a;
  --red-soft: #442e32; --orange: #e6b276; --orange-soft: #40352b;
}
body { font-size: 14px; line-height: 2; }
h1 { font-size: 28px; line-height: 2; font-weight: 700; letter-spacing: 0; }
h2 { font-size: 16px; line-height: 2; }
h3 { font-size: 15px; line-height: 2; }
strong { font-weight: 600; }
small { line-height: 2; }
.mobile-only { display: none !important; }
.sidebar { width: 256px; padding: 16px; }
.sidebar .brand { height: 32px; padding: 0 8px; margin: 0 0 20px; }
.brand { gap: 8px; }
.brand strong { font-size: 16px; font-weight: 700; line-height: 2; letter-spacing: 0; }
.sidebar-nav { gap: 4px; }
.nav-item, .sidebar .nav-item { min-height: 44px; gap: 12px; padding: 8px 12px; font-size: 14px; border-radius: 8px; color: var(--ink); font-weight: 400; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-ink); }
.sidebar-settings { margin-top: 4px; }
.sidebar-bottom { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.sidebar-profile { display: block; border: 0; margin: 0; padding: 0; }
.sidebar-profile strong { font-size: 14px; font-weight: 400; }
.sidebar-profile small { font-size: 12px; }
.workspace { margin-left: 256px; }
.topbar { display: none; }
main, .page-home, .page-settings { width: calc(100% - 64px); max-width: 960px; min-height: 100dvh; margin: 0 auto; padding: 40px 0 48px; }
.page-home, .page-settings { max-width: 672px; }
.page-heading { gap: 16px; margin-bottom: 12px; }
.page-heading p { margin-top: -12px; font-size: 12px; line-height: 2; }
.button { min-height: 42px; padding: 6px 16px; gap: 8px; border-radius: 8px; font-size: 13px; line-height: 2; box-shadow: none; }
.primary:hover { box-shadow: none; }
.button .icon { width: 16px; height: 16px; }
.outline { border-color: var(--line); }
.card { border-radius: 12px; }
.section { margin-top: 28px; }
.section-heading { margin-bottom: 8px; }
.section-heading h2 { font-size: 16px; }
.next-lesson { min-height: 176px; padding: 16px; border-radius: 16px; }
.hero-desktop-top { display: flex; align-items: center; justify-content: space-between; color: var(--primary); font-size: 12px; }
.hero-desktop-top .badge { border-radius: 16px; background: var(--surface); padding: 0 18px; color: var(--primary); }
.next-lesson h3 { font-size: 24px; line-height: 2; }
.next-lesson .hero-desktop-status { margin: -7px 0 0; color: var(--primary); font-size: 12px; font-weight: 600; }
.hero-desktop-bottom { display: flex; align-items: flex-end; gap: 24px; margin-top: 8px; }
.hero-desktop-bottom > .button { min-width: 152px; min-height: 42px; }
.hero-desktop-bottom > .button > .desktop-only { display: inline-flex; align-items: center; gap: 7px; }
.hero-progress { flex: 1; padding-bottom: 2px; }
.hero-progress progress { height: 6px; }
.hero-progress small { margin-top: 5px; font-size: 11px; }
.lesson-row { padding: 12px; gap: 16px; min-height: 68px; }
.lesson-row strong { font-size: 14px; margin-bottom: 0; }
.lesson-row small { font-size: 12px; margin-top: -4px; }
.time-tile { width: 62px; height: 44px; border-radius: 6px; font-size: 12px; background: var(--subtle-surface); }
.lesson-row > .desktop-only .icon { width: 16px; height: 16px; color: var(--muted); }
.quick-links { margin-top: 20px; }
.quick-link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-link { border: 1px solid var(--line); min-height: 64px; padding: 12px; font-size: 12px; gap: 10px; }
.feature-icon { width: 32px; height: 36px; border-radius: 6px; }
.quick-link:hover { border-color: var(--primary); }
.week-panel { max-width: none; padding: 12px; background: var(--surface); color: var(--ink); border-radius: 12px; }
.week-heading { margin-bottom: 10px; padding: 0; }
.week-heading h2 { font-size: 14px; }
.week-actions { gap: 7px; }
.week-actions .icon-button { width: 34px; height: 34px; color: var(--ink); border: 1px solid var(--line); }
.week-actions .icon-button:hover { background: var(--primary-soft); }
.week-actions .icon { width: 16px; height: 16px; }
.week-today { min-height: 34px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); padding: 0 14px; font-size: 12px; font-weight: 600; }
.week-days { gap: 8px; margin-top: 0; }
.day { justify-content: center; gap: 0; min-height: 104px; padding: 10px 2px; background: var(--subtle-surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.day strong { font-size: 22px; line-height: 2; font-weight: 700; }
.day small { color: inherit; font-size: 10px; }
.day.selected, .day.selected:hover { color: white; background: var(--primary); border-color: var(--primary); box-shadow: none; }
.schedule-list { display: block; padding: 0 12px; }
.timeline-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; min-height: 82px; }
.timeline-row + .timeline-row { border-top: 1px solid var(--line); }
.timeline-time { min-width: 50px; padding: 0; color: var(--primary); border-right: 1px solid var(--line); font-size: 13px; }
.timeline-time small { color: var(--muted); font-weight: 400; font-size: 11px; }
.timeline-row strong { font-size: 14px; }
.timeline-row .grow > small { font-size: 11px; margin-top: -3px; }
.timeline-row > .icon { width: 16px; color: var(--muted); }
.timeline-row:hover .grow { color: var(--primary); }
.badge { padding: 1px 9px; border: 0; border-radius: 12px; line-height: 2; }
.badge.pending, .badge.neutral { background: var(--subtle-surface); border: 0; }
.warning-badge { color: var(--orange); background: var(--orange-soft); }
input, select, textarea { min-width: 0; border-color: #b8c3d2; border-radius: 8px; line-height: 2; }
.search-box { margin-bottom: 12px; }
.search-box .icon { top: 15px; left: 12px; }
.search-box input { min-height: 48px; padding-left: 40px; border-color: var(--line); }
.filter-tabs { max-width: none; padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 16px; }
:root[data-theme='dark'] .filter-tabs { background: var(--surface); }
.filter-tabs button { min-height: 40px; border-radius: 6px; color: var(--ink); }
.filter-tabs button.active { color: white; background: var(--primary); box-shadow: none; }
.table-frame { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { font-size: 12px; font-weight: 400; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: 0; }
.table-person { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.table-person strong { font-size: 13px; }
.table-person:hover strong, .table-link { color: var(--primary); }
.table-link:hover { text-decoration: underline; }
.avatar, .avatar.color-1, .avatar.color-2 { width: 34px; height: 34px; border-radius: 50%; font-size: 11px; background: var(--primary-soft); color: var(--primary); }
.student-code, .student-contact { color: var(--muted); }
.student-package-status .badge { min-width: 92px; justify-content: center; }
.report-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; margin-bottom: 14px; align-items: start; }
.report-filters .field { font-size: 12px; gap: 4px; }
.field-optional { font-size: 11px; color: var(--muted); font-weight: 400; }
.report-filters input, .report-filters select { min-height: 40px; height: auto; padding: 5px 10px; font-size: 12px; }
.report-filters .apply-report { grid-column: 1 / -1; justify-self: end; min-height: 32px; height: auto; padding: 2px 14px; font-size: 11px; }
.report-stats { gap: 12px; margin-bottom: 14px; }
.report-stats .stat-card { padding: 8px 12px; }
.report-stats .stat-card > span { font-size: 12px; }
.report-stats .stat-card > strong { margin: 0; font-size: 26px; line-height: 1.5; }
.report-stats .stat-card.pending > strong { color: var(--primary); }
.report-table th:not(:first-child), .report-table td:not(:first-child) { text-align: center; }
.report-table td { padding: 7px 12px; }
.report-caption { color: var(--muted); font-size: 11px; margin-top: 12px; }
.report-expiring { margin-top: 20px; }
.report-expiry-row { display: flex; align-items: center; gap: 24px; padding: 10px 12px; font-size: 12px; }
.report-expiry-row + .report-expiry-row { border-top: 1px solid var(--line); }
.report-expiry-row .badge { min-width: 94px; justify-content: center; }
.report-footnote { margin-top: 12px; }
.settings-grid { grid-template-columns: 1fr; gap: 0; }
.settings-grid > div:first-child, .settings-data { max-width: 520px; }
.settings-data { margin-top: 24px; }
.theme-options { grid-template-columns: 1fr 1fr; max-width: none; gap: 12px; }
.theme-option { padding: 10px; }
.theme-preview { height: 65px; padding: 10px; gap: 8px; }
.theme-preview b:last-child { background: #0866ff; }
.theme-option > span:last-child { font-size: 13px; margin-top: 10px; }
.theme-option > span:last-child > .icon { width: 17px; height: 17px; }
.system-theme { margin-top: 10px; font-size: 11px; color: var(--muted); }
.empty-state { border-style: solid; }
#toast { left: calc(50% + 128px); }
/* Home: a single, readable attendance action on both phone and desktop. */
.home-lesson-eyebrow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: var(--primary); font-size: 13px; font-weight: 600; line-height: 1.6; }
.page-home .next-lesson .home-lesson-time { font-size: 32px; line-height: 1.3; font-weight: 700; margin: 14px 0 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.page-home .next-lesson .home-lesson-title { height: auto; margin: 0; font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.page-home .next-lesson .home-lesson-context { height: auto; margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.home-attendance-progress { margin: 16px 0; }
.home-attendance-progress > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; line-height: 1.6; }
.home-attendance-progress > div > span { color: var(--muted); }
.home-attendance-progress progress { display: block; width: 100%; height: 6px; margin-top: 8px; }
.home-attendance-action { min-height: 48px; font-size: 15px; }
.page-home .lesson-row .grow { min-width: 0; }
.page-home .lesson-row strong { overflow-wrap: anywhere; line-height: 1.5; }
.page-home .home-lesson-status { color: var(--primary); }
.page-home .page-heading h1 { line-height: 1.4; margin-bottom: 6px; }
.page-home .page-heading p { color: var(--muted); margin-top: 0; line-height: 1.6; font-size: 13px; }
.page-home .expiry-line { font-size: 14px; }
.page-home .expiry-line > span { font-size: 12px; }
.page-home .expiry-widget .button { font-size: 14px; }

@media (max-width: 1100px) and (min-width: 1024px) {
  .sidebar { width: 224px; }
  .workspace { margin-left: 224px; }
  main { width: calc(100% - 48px); }
  .detail-grid, .attendance-grid, .expiry-grid { grid-template-columns: 1fr; }
  .student-table .student-contact, .student-table th:nth-child(3) { display: none; }
  .data-table th, .data-table td { padding-inline: 10px; }
  #toast { left: calc(50% + 112px); }
}
@media (width < 1024px) {
  .mobile-only { display: block !important; }
  .workspace { margin-left: 0; }
  .topbar { display: flex; min-height: 60px; height: 60px; padding: 0 16px; }
  .topbar .brand strong { font-size: 16px; }
  main, .page-home, .page-settings { width: 100%; max-width: 580px; min-height: calc(100dvh - 60px); padding: 17px 16px calc(90px + env(safe-area-inset-bottom)); }
  h1, .page-heading:has(.compact) h1 { font-size: 26px; line-height: 2; }
  .page-heading { margin-bottom: 16px; }
  .page-heading p { font-size: 12px; margin-top: -15px; }
  .page-heading:has(.compact) p { font-size: 11px; }
  .page-heading .compact { min-height: 44px; padding: 5px 12px; gap: 6px; font-size: 12px; }
  .page-heading .compact .icon { width: 16px; height: 16px; }
  .page-home .page-heading { margin-bottom: 9px; }
  .next-lesson { min-height: 0; padding: 18px 16px; border-radius: 16px; }
  .hero-desktop-top, .hero-desktop-status { display: none; }
  .page-home .page-heading { margin-bottom: 14px; }
  .home-lesson-eyebrow { font-size: 12px; }
  .page-home .next-lesson .home-lesson-time { font-size: 28px; }
  .page-home .next-lesson .home-lesson-title { font-size: 18px; }
  .home-attendance-progress > div { font-size: 12px; }
  .home-attendance-action { width: 100%; }
  .section { margin-top: 24px; }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: 16px; }
  .section-heading .subtle { font-size: 10px; }
  .home-schedule { margin-top: 20px; }
  .home-schedule .section-heading { margin-bottom: 0; }
  .home-schedule h2 { height: 32px; }
  .lesson-row { min-height: 83px; padding: 15px 12px; gap: 14px; border-radius: 12px; }
  .time-tile { width: 66px; height: 50px; font-size: 14px; }
  .lesson-row strong { font-size: 14px; margin-bottom: 0; }
  .page-home .lesson-row small { font-size: 12px; margin-top: 3px; line-height: 1.6; }
  .lesson-row small > .mobile-only { display: inline !important; }
  .expiry-widget { min-height: 126px; margin-top: 23px; padding: 12px 14px; border-radius: 12px; }
  .expiry-widget .section-heading { margin-bottom: 0; }
  .expiry-widget h2 { font-size: 14px; line-height: 2; }
  .count-badge { padding: 0; color: var(--orange); background: transparent; font-size: 12px; }
  .expiry-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin: 0; font-size: 14px; line-height: 1.5; }
  .expiry-line a { display: flex; align-items: center; min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
  .expiry-line a { font-weight: 600; }
  .expiry-line > span { color: var(--orange); font-size: 12px; white-space: nowrap; }
  .expiry-widget .button { min-height: 44px; margin-top: 8px; padding: 8px 12px; border-radius: 8px; color: var(--primary); font-size: 14px; }
  .bottom-nav { min-height: calc(69px + env(safe-area-inset-bottom)); padding: 7px max(0px, calc((100vw - 580px) / 2)) calc(7px + env(safe-area-inset-bottom)); }
  .bottom-nav .nav-item { min-height: 54px; gap: 0; font-size: 11px; }
  .bottom-nav .nav-item { background: transparent; color: var(--muted); }
  .bottom-nav .nav-item.active { background: transparent; color: var(--primary); }
  .bottom-nav .nav-symbol { width: 50px; height: 29px; padding: 4px 14px; border-radius: 11px; }
  .bottom-nav .nav-item.active .nav-symbol { background: var(--primary-soft); }
  .bottom-nav .icon { width: 21px; height: 21px; }
  .week-panel { padding: 12px 10px; }
  .week-heading { margin-bottom: 10px; padding: 0; }
  .week-heading h2 { font-size: 14px; }
  .week-actions { gap: 5px; }
  .week-actions .icon-button { width: 30px; height: 32px; }
  .week-today { min-height: 32px; padding: 0 10px; font-size: 11px; }
  .week-days { gap: 4px; margin: 0; }
  .day { min-height: 92px; padding: 8px 0; gap: 0; font-size: 9px; }
  .day strong { font-size: 19px; }
  .day small { font-size: 8px; }
  .timeline-row { min-height: 82px; gap: 10px; }
  .timeline-time { min-width: 43px; font-size: 12px; }
  .timeline-time small { font-size: 10px; }
  .timeline-row strong { font-size: 13px; }
  .timeline-row .grow > small { font-size: 10px; }
  .schedule-status { display: none; }
  .search-box { margin-bottom: 12px; }
  .search-box input { min-height: 48px; font-size: 16px; }
  .search-box input::placeholder { font-size: 13px; }
  .filter-tabs { margin-bottom: 16px; gap: 2px; }
  .filter-tabs button { min-height: 36px; padding: 4px 1px; font-size: 10px; }
  .filter-tabs button.active { color: var(--primary); background: var(--primary-soft); }
  .student-table, .student-table tbody { display: block; }
  .student-table thead { display: none; }
  .student-table tr { display: grid; grid-template-columns: 1fr auto; padding: 14px 12px; gap: 0 8px; border-bottom: 1px solid var(--line); }
  .student-table tr:last-child { border-bottom: 0; }
  .student-table td { display: block; padding: 0; border: 0; }
  .student-table td:first-child { grid-column: 1; grid-row: 1; }
  .table-person { gap: 9px; min-width: 0; }
  .table-person strong { font-size: 12px; }
  .table-person .avatar { width: 32px; height: 32px; font-size: 10px; }
  .student-code { grid-column: 1; grid-row: 2; padding-left: 41px !important; margin-top: -4px; font-size: 10px; }
  .student-contact { display: none !important; }
  .student-balance { grid-column: 2; grid-row: 1; align-self: center; font-size: 11px; }
  .student-balance .mobile-only { display: inline !important; }
  .student-package-status { grid-column: 2; grid-row: 2; }
  .student-package-status .badge { min-width: 0; padding: 0; background: transparent; font-size: 9px; }
  .report-filters { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .report-filters .field { font-size: 13px; }
  .report-filters .field:nth-child(3) { grid-column: auto; }
  .report-filters input, .report-filters select { min-height: 46px; padding: 8px 12px; font-size: 13px; }
  .report-filters .apply-report { min-height: 34px; justify-self: stretch; font-size: 12px; }
  .report-stats .stat-card { padding: 10px; }
  .report-stats .stat-card > span { font-size: 10px; }
  .table-frame:has(.report-table) { overflow-x: auto; }
  .report-table { min-width: 550px; }
  .report-table th { font-size: 10px; }
  .report-table td { font-size: 11px; }
  .report-caption { font-size: 10px; }
  .report-expiring h2 { font-size: 14px; }
  .report-expiry-row { gap: 8px; font-size: 10px; }
  .report-expiry-row .badge { min-width: 0; font-size: 9px; }
  .report-expiry-row .subtle { font-size: 10px; }
  .theme-options { gap: 10px; }
  .theme-option { padding: 9px; }
  .theme-preview { height: 70px; padding: 10px; gap: 7px; }
  .theme-option > span:last-child { font-size: 13px; }
  .settings-data { margin-top: 64px; }
  #toast { left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .page-heading .compact { padding-inline: 8px; font-size: 10px; gap: 4px; }
  .page-heading h1, .page-heading:has(.compact) h1 { font-size: 24px; }
  .page-heading:has(.compact) p { font-size: 10px; }
  .week-heading h2 { font-size: 12px; }
  .week-actions { gap: 4px; }
  .week-today { padding-inline: 7px; }
  .day { min-height: 84px; }
  .table-person strong { font-size: 11px; }
  .report-stats .stat-card > span { font-size: 9px; }
}
@media print {
  main, .page-home, .page-settings { width: 100%; max-width: none; min-height: 0; padding: 0; }
}
