/* ============================================================
   FONTS
   ============================================================ */
@font-face {
  font-family: 'TH Sarabun New';
  src: local('TH Sarabun New'), local('THSarabunNew'),
       url('https://cdn.jsdelivr.net/gh/Phonbopit/sarabun-webfont@master/fonts/thsarabunnew-webfont.woff') format('woff');
  font-weight: normal;
}
@font-face {
  font-family: 'TH Sarabun New';
  src: local('TH Sarabun New Bold'), local('THSarabunNew-Bold'),
       url('https://cdn.jsdelivr.net/gh/Phonbopit/sarabun-webfont@master/fonts/thsarabunnew_bold-webfont.woff') format('woff');
  font-weight: bold;
}

/* ============================================================
   DESIGN TOKENS — Dark hi-tech palette
   ============================================================ */
:root {
  /* Brand */
  --blue:    #3B82F6;
  --indigo:  #6366F1;
  --violet:  #8B5CF6;
  --cyan:    #06B6D4;
  --emerald: #10B981;
  --rose:    #F43F5E;
  --amber:   #F59E0B;
  --slate:   #64748B;

  /* Semantic */
  --primary:    var(--indigo);
  --success:    var(--emerald);
  --danger:     var(--rose);
  --warning:    var(--amber);
  --info:       var(--cyan);

  /* Activity colors */
  --att-color:   #10B981; --att-bg:   #D1FAE5;
  --milk-color:  #3B82F6; --milk-bg:  #DBEAFE;
  --brush-color: #F59E0B; --brush-bg: #FEF3C7;
  --bmi-color:   #EC4899;
  --report-color:#8B5CF6;
  --number-color:#06B6D4;
  --student-color:#6366F1;

  /* Surface */
  --bg:       #F4F6FA;
  --bg-card:  #FFFFFF;
  --border:   #E4E7EE;
  --border-lt:#F0F2F7;
  --text:     #0F172A;
  --muted:    #64748B;
  --muted-lt: #94A3B8;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-sm: 0 1px 4px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 2px 10px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.05);

  /* Radii */
  --r-sm:  7px;
  --r:    11px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Fonts */
  --font: 'Prompt', 'Sarabun', sans-serif;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14.5px;
  line-height: 1.5;
}
h1,h2,h3,h4,h5,p { margin: 0; }
button { font-family: inherit; border: none; outline: none; cursor: pointer; background: none; }
a { text-decoration: none; }
.hidden { display: none !important; }
.cloud-bg { display: none !important; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-container {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding-bottom: 60px;
}

/* ============================================================
   HEADER SYSTEM
   ============================================================ */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

/* Home header */
.main-header {
  padding: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.main-header .header-content {
  padding: 15px 16px 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  z-index: 2;
}

/* Top accent bar */
.header-decor {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--indigo) 0%, var(--cyan) 60%, var(--emerald) 100%);
}

.app-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.header-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.header-text p {
  font-size: 0.68rem;
  color: var(--slate);
  font-weight: 600;
  letter-spacing: 0.1px;
  margin-top: 2px;
}

/* Sub-headers (sticky) */
.sticky-header {
  position: sticky;
  top: 0; z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.header-info { display: flex; flex-direction: column; gap: 2px; }
.header-info h2 { font-size: 0.95rem; font-weight: 700; color: #0F172A; letter-spacing: -.2px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge-secondary {
  display: inline-block;
  background: var(--border-lt);
  color: var(--muted);
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 600;
}

/* ============================================================
   BUTTONS — Premium hi-tech style
   ============================================================ */

/* Back button — Beautiful 3D Red Button */
.back-btn {
  background: linear-gradient(135deg, #FEE2E2 0%, #FCA5A5 100%);
  color: #B91C1C;
  border: 1px solid #F87171;
  border-radius: var(--r-sm);
  min-width: 65px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 
    0 3px 0 #DC2626, 
    0 4px 8px rgba(220, 38, 38, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s cubic-bezier(.34,1.56,.64,1);
}
.back-btn:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 0 #DC2626, 
    0 6px 10px rgba(220, 38, 38, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.back-btn:active {
  transform: translateY(2px);
  box-shadow: 
    0 1px 0 #DC2626, 
    0 2px 4px rgba(220, 38, 38, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.back-btn .material-icons-round { font-size: 0.95rem; }

/* Primary CTA — Highly Raised 3D Indigo Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #fff;
  border-radius: var(--r);
  padding: 10px 18px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: .2px;
  border: 1px solid #818CF8;
  box-shadow: 
    0 4px 0 #312E81, 
    0 6px 12px rgba(49, 46, 129, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s cubic-bezier(.34,1.56,.64,1);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 0 #312E81, 
    0 9px 16px rgba(49, 46, 129, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 
    0 1px 0 #312E81, 
    0 3px 6px rgba(49, 46, 129, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary.full-width { width: 100%; }

/* Success variant — Highly Raised 3D Green Button */
.btn-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: 1px solid #34D399;
  box-shadow: 
    0 4px 0 #046A4C, 
    0 6px 12px rgba(4, 106, 76, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 0 #046A4C, 
    0 9px 16px rgba(4, 106, 76, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-success:active {
  transform: translateY(3px);
  box-shadow: 
    0 1px 0 #046A4C, 
    0 3px 6px rgba(4, 106, 76, 0.25);
}

/* Ghost / text button */
.btn-text {
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: var(--r-sm);
  transition: background .12s;
}
.btn-text:hover { background: var(--border-lt); }

/* ============================================================
   STEP VIEWS + ANIMATIONS
   ============================================================ */
.step-view { display: none; width: 100%; }
.step-view.active {
  display: flex;
  flex-direction: column;
  animation: fadeUp .2s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}
.content-wrapper  { padding: 14px 16px; width: 100%; }
.home-content     { padding: 12px 0; }
.centered-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  padding: 16px;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted-lt);
  margin: 0 16px 9px;
}

/* ============================================================
   MENU GRID — Vivid 3-D icon cards
   ============================================================ */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 18px;
}

.menu-card {
  border-radius: var(--r-lg);
  padding: 16px 10px 13px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s cubic-bezier(.34,1.56,.64,1);
}

/* Top gloss shine strip */
.menu-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 100%);
  border-radius: 0 0 50% 50%;
  pointer-events: none;
}

.menu-card h3 {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1.5px 3px rgba(0,0,0,.35);
}

/* Icon box — white circle on colored bg */
.icon-box {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.28);
  box-shadow: 0 2px 8px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.4);
}
.icon-box .material-icons-round {
  font-size: 1.45rem;
  color: #fff;
  filter: drop-shadow(0 1.5px 2px rgba(0,0,0,.3));
}

/* ── Individual card gradients + 3D raised physical depth ── */

/* เช็คชื่อ — Emerald/Green */
.card-attendance {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: 1.5px solid #34D399;
  box-shadow: 
    0 6px 0 #046A4C, 
    0 8px 18px rgba(4,106,76, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-attendance:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #046A4C, 
    0 14px 26px rgba(4,106,76, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-attendance:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #046A4C, 
    0 4px 8px rgba(4,106,76, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ดื่มนม — Blue */
.card-milk {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  border: 1.5px solid #60A5FA;
  box-shadow: 
    0 6px 0 #113A9F, 
    0 8px 18px rgba(17,58,159, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-milk:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #113A9F, 
    0 14px 26px rgba(17,58,159, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-milk:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #113A9F, 
    0 4px 8px rgba(17,58,159, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* แปรงฟัน — Amber */
.card-brushing {
  background: linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
  border: 1.5px solid #FDE047;
  box-shadow: 
    0 6px 0 #A15203, 
    0 8px 18px rgba(161,82,3, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.card-brushing:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #A15203, 
    0 14px 26px rgba(161,82,3, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.5);
}
.card-brushing:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #A15203, 
    0 4px 8px rgba(161,82,3, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* น้ำหนัก-ส่วนสูง — Pink */
.card-bmi {
  background: linear-gradient(135deg, #EC4899 0%, #C2185B 100%);
  border: 1.5px solid #F472B6;
  box-shadow: 
    0 6px 0 #8A0F3D, 
    0 8px 18px rgba(138,15,61, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-bmi:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #8A0F3D, 
    0 14px 26px rgba(138,15,61, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-bmi:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #8A0F3D, 
    0 4px 8px rgba(138,15,61, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* รายงาน — Violet */
.card-report {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border: 1.5px solid #A78BFA;
  box-shadow: 
    0 6px 0 #4C1D95, 
    0 8px 18px rgba(76,29,149, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-report:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #4C1D95, 
    0 14px 26px rgba(76,29,149, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-report:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #4C1D95, 
    0 4px 8px rgba(76,29,149, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* จัดการเลขที่ — Cyan */
.card-number {
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  border: 1.5px solid #22D3EE;
  box-shadow: 
    0 6px 0 #055C72, 
    0 8px 18px rgba(5,92,114, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-number:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #055C72, 
    0 14px 26px rgba(5,92,114, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-number:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #055C72, 
    0 4px 8px rgba(5,92,114, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* จัดการนักเรียน — Indigo */
.card-student {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  border: 1.5px solid #818CF8;
  box-shadow: 
    0 6px 0 #2D28A2, 
    0 8px 18px rgba(45,40,162, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-student:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #2D28A2, 
    0 14px 26px rgba(45,40,162, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-student:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #2D28A2, 
    0 4px 8px rgba(45,40,162, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ตรวจประวัติ — Orange */
.card-audit {
  background: linear-gradient(135deg, #FF7A00 0%, #EA580C 100%);
  border: 1.5px solid #FF9D42;
  box-shadow: 
    0 6px 0 #993300, 
    0 8px 18px rgba(153,51,0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-audit:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #993300, 
    0 14px 26px rgba(153,51,0, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-audit:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #993300, 
    0 4px 8px rgba(153,51,0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ตั้งค่า — Slate */
.card-settings {
  background: linear-gradient(135deg, #64748B 0%, #475569 100%);
  border: 1.5px solid #94A3B8;
  box-shadow: 
    0 6px 0 #2F3A4B, 
    0 8px 18px rgba(47,58,75, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.card-settings:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #2F3A4B, 
    0 14px 26px rgba(47,58,75, 0.4),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.4);
}
.card-settings:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #2F3A4B, 
    0 4px 8px rgba(47,58,75, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ส่งแจ้งเตือน LINE — Green */
.card-line-notify {
  background: linear-gradient(135deg, #06C755 0%, #05B34C 100%);
  border: 1.5px solid #34E57D;
  box-shadow: 
    0 6px 0 #037A33, 
    0 8px 18px rgba(3,122,51, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-line-notify:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 11px 0 #037A33, 
    0 14px 26px rgba(3,122,51, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45);
}
.card-line-notify:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #037A33, 
    0 4px 8px rgba(3,122,51, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}



/* ============================================================
   CLASS SELECTION GRID
   ============================================================ */
.class-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.class-card {
  border-radius: var(--r);
  padding: 13px 10px;
  text-align: center;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  letter-spacing: -.1px;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s cubic-bezier(.34,1.56,.64,1);
}
.card-level-anuban { 
  background: linear-gradient(135deg, #FFF5F5 0%, #FFF0F0 100%); 
  border: 1.5px solid #FCA5A5; 
  color: #B91C1C;
  box-shadow: 
    0 4px 0 #EF4444, 
    0 6px 12px rgba(239, 68, 68, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.card-level-anuban:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 7px 0 #EF4444, 
    0 10px 18px rgba(239, 68, 68, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.card-level-anuban:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #EF4444, 
    0 4px 8px rgba(239, 68, 68, 0.15);
}

.card-level-prathom { 
  background: linear-gradient(135deg, #EFF6FF 0%, #E0F2FE 100%); 
  border: 1.5px solid #93C5FD; 
  color: #1D4ED8; 
  box-shadow: 
    0 4px 0 #3B82F6, 
    0 6px 12px rgba(59, 130, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.card-level-prathom:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 7px 0 #3B82F6, 
    0 10px 18px rgba(59, 130, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.card-level-prathom:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #3B82F6, 
    0 4px 8px rgba(59, 130, 246, 0.15);
}

.card-level-mattayom { 
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%); 
  border: 1.5px solid #FCD34D; 
  color: #92400E; 
  box-shadow: 
    0 4px 0 #F59E0B, 
    0 6px 12px rgba(245, 158, 11, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.card-level-mattayom:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 7px 0 #F59E0B, 
    0 10px 18px rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.card-level-mattayom:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #F59E0B, 
    0 4px 8px rgba(245, 158, 11, 0.15);
}

/* ============================================================
   OPTIONS / DATE PICKER
   ============================================================ */
.options-container { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.option-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border-radius: var(--r);
  padding: 15px 8px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #CBD5E1;
  box-shadow: 
    0 4px 0 #94A3B8, 
    0 6px 12px rgba(148, 163, 184, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s cubic-bezier(.34,1.56,.64,1), border-color .15s;
  cursor: pointer;
}
.option-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 
    0 7px 0 var(--primary), 
    0 10px 18px rgba(99, 102, 241, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}
.option-card:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 var(--primary), 
    0 4px 8px rgba(99, 102, 241, 0.12);
}

.big-num { font-size: 2rem; font-weight: 900; color: var(--primary); line-height: 1; }

.date-select-wrapper {
  display: flex; flex-direction: column; gap: 9px;
  width: 100%; max-width: 280px; margin: 0 auto;
}
.date-select-wrapper label { font-weight: 700; font-size: 0.8rem; color: #475569; }
.big-date-picker {
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  font-family: inherit;
  background: #F8FAFC;
  width: 100%;
  transition: border-color .15s;
  color: var(--primary);
}
.big-date-picker:focus { border-color: var(--primary); }
.btn-large { padding: 12px; font-size: 0.95rem; }

/* ============================================================
   WORKSPACE — Attendance/Milk/Brush lists
   ============================================================ */
.workspace-content { padding: 11px 14px; }
.toolbar-wrapper { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.toolbar { display: flex; gap: 5px; flex-wrap: wrap; }

/* Chips — filter tags */
.chip {
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--muted);
  transition: all .12s;
  letter-spacing: .1px;
}
.chip:hover  { border-color: var(--primary); color: var(--primary); background: var(--border-lt); }
.chip:active { transform: scale(.95); }
.chip-secondary { background: var(--border-lt); border-color: var(--border-lt); }
.chip-success   { background: #ECFDF5; color: #059669; border-color: #6EE7B7; }
.chip-info      { background: #EFF6FF; color: #2563EB; border-color: #93C5FD; }
.chip-danger    { background: #FFF1F2; color: #E11D48; border-color: #FDA4AF; }

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 7px 11px;
  background: #F8FAFC;
  gap: 7px;
  transition: border-color .15s;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-bar .material-icons-round { color: var(--muted-lt); font-size: 1.05rem; }
.search-bar input {
  border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 0.85rem; width: 100%; color: var(--text);
}

/* Data list */
.data-list-container {
  display: flex; flex-direction: column; gap: 7px;
  max-height: 480px; overflow-y: auto;
  padding-bottom: 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ============================================================
   STUDENT ROWS
   ============================================================ */
.student-row {
  background: #fff;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color .12s;
}
.student-row:hover { border-color: #c7d2fe; }

.row-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.row-num  { font-size: 0.82rem; font-weight: 800; color: var(--muted-lt); width: 20px; flex-shrink: 0; }
.row-name { font-weight: 700; font-size: 0.84rem; color: #0F172A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-class-badge {
  display: inline-block;
  background: var(--border-lt);
  border-radius: 4px;
  font-size: 0.58rem;
  padding: 1px 5px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.row-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Status buttons inside rows */
.status-btn {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  transition: all .12s;
  line-height: 1.3;
}
.status-btn:active { transform: scale(.88); }
.status-btn.success  { color: #059669; }
.status-btn.warning  { color: #D97706; }
.status-btn.danger   { color: #E11D48; }
.status-btn.info     { color: #2563EB; }
.status-btn.secondary{ color: var(--muted); }

.status-btn.success.active  { background:#059669; color:#fff; border-color:#059669; box-shadow:0 2px 6px rgba(5,150,105,.3); }
.status-btn.warning.active  { background:#D97706; color:#fff; border-color:#D97706; box-shadow:0 2px 6px rgba(217,119,6,.3); }
.status-btn.danger.active   { background:#E11D48; color:#fff; border-color:#E11D48; box-shadow:0 2px 6px rgba(225,29,72,.3); }
.status-btn.info.active     { background:#2563EB; color:#fff; border-color:#2563EB; box-shadow:0 2px 6px rgba(37,99,235,.3); }
.status-btn.secondary.active{ background:#475569; color:#fff; border-color:#475569; }

/* BMI inputs */
.input-xs {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  font-size: 0.8rem;
  width: 50px;
  text-align: center;
  font-family: inherit;
  font-weight: 700;
  background: #F8FAFC;
  outline: none;
  transition: border-color .12s;
}
.input-xs:focus { border-color: var(--primary); }

.bmi-result {
  width: 60px; text-align: center;
  font-size: 0.78rem; font-weight: 700;
  color: var(--primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bmi-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 100px;
  width: 62px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bmi-badge.thin       { background:#FEF3C7; color:#B45309; }
.bmi-badge.normal     { background:#D1FAE5; color:#065F46; }
.bmi-badge.overweight { background:#EDE9FE; color:#5B21B6; }
.bmi-badge.obese1     { background:#FCE7F3; color:#9D174D; }
.bmi-badge.obese2     { background:#FEE2E2; color:#991B1B; }
.bmi-badge.none       { background:#F1F5F9; color:#94A3B8; }

.info-banner {
  font-size: 0.78rem; padding: 7px 10px; border-radius: var(--r-sm);
  margin-bottom: 6px; text-align: center;
}

/* Student card (manage view) */
.student-card {
  background: #fff;
  padding: 11px 13px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   FAB — Floating Save Button
   ============================================================ */
.fab {
  position: fixed;
  bottom: 18px; right: 18px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  border-radius: 100px;
  padding: 11px 22px;
  font-weight: 800;
  font-size: 0.84rem;
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid #34D399;
  box-shadow: 
    0 5px 0 #046A4C, 
    0 8px 16px rgba(4, 106, 76, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s cubic-bezier(.34,1.56,.64,1);
  z-index: 99;
  letter-spacing: .1px;
}
.fab:hover  {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 8px 0 #046A4C, 
    0 12px 20px rgba(4, 106, 76, 0.45);
}
.fab:active {
  transform: translateY(3px) scale(.98);
  box-shadow: 
    0 2px 0 #046A4C, 
    0 4px 8px rgba(4, 106, 76, 0.25);
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-section { padding: 0 16px; margin-bottom: 14px; }

.dashboard-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-card {
  background: #fff;
  border-radius: var(--r);
  padding: 10px 6px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.stat-num {
  font-size: 1.5rem; font-weight: 900;
  display: block; line-height: 1;
  letter-spacing: -.5px;
}
.stat-label { font-size: 0.64rem; color: var(--muted); font-weight: 600; margin-top: 2px; }

.stat-card.blue  { border-top: 3px solid #3B82F6; }
.stat-card.blue  .stat-num { color: #2563EB; }
.stat-card.green { border-top: 3px solid #10B981; }
.stat-card.green .stat-num { color: #059669; }
.stat-card.red   { border-top: 3px solid #F43F5E; }
.stat-card.red   .stat-num { color: #E11D48; }

/* Panel card */
.card-panel {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 13px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin-bottom: 10px;
  transition: border-color .15s;
}
.card-panel:hover { border-color: #c7d2fe; }
.card-panel h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  letter-spacing: -.1px;
}

.absent-list-scroll { max-height: 130px; overflow-y: auto; }

/* ============================================================
   REPORTS
   ============================================================ */
.report-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 7px;
}
.report-btn {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border-radius: var(--r);
  padding: 12px 6px;
  font-weight: 800;
  font-size: 0.68rem;
  border: 1.5px solid #CBD5E1;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s cubic-bezier(.34,1.56,.64,1), background-color .15s;
  outline: none;
  color: var(--muted);
  letter-spacing: .1px;
  box-shadow: 
    0 4px 0 #94A3B8, 
    0 6px 12px rgba(148, 163, 184, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}
.report-btn:hover {
  transform: translateY(-2px);
  border-color: #6366F1;
  color: #6366F1;
  box-shadow: 
    0 6px 0 #4F46E5, 
    0 8px 14px rgba(79, 70, 229, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}
.report-btn:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #4F46E5, 
    0 4px 8px rgba(79, 70, 229, 0.12);
}
.report-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 100%) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 
    0 4px 0 #312E81 !important,
    0 6px 12px rgba(49, 46, 129, 0.3) !important,
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}
.report-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 0 #312E81 !important, 
    0 8px 16px rgba(49, 46, 129, 0.35) !important;
}
.report-btn.active:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #312E81 !important, 
    0 4px 8px rgba(49, 46, 129, 0.2) !important;
}

.report-preview-container { margin-top: 12px; }
.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
  box-shadow: var(--shadow-xs);
}
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; background: #fff; }
th, td { border: 1px solid #E2E8F0; padding: 6px 7px; text-align: center; color: var(--text); }
th {
  background: #F8FAFC;
  font-weight: 700;
  border-bottom: 2px solid #CBD5E1;
  font-size: 0.76rem;
  color: #334155;
  letter-spacing: .1px;
}
td.left { text-align: left; }
tr:nth-child(even) { background: #FAFBFC; }

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 11px; text-align: left; }
.form-group label { font-size: 0.76rem; font-weight: 700; color: #475569; letter-spacing: .1px; }
.form-group input, .form-group select {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  background: #F8FAFC;
  font-size: 0.85rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,15,30,.5);
  backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: center;
  padding: 16px;
  animation: modalBg .15s ease forwards;
}
@keyframes modalBg { from{opacity:0} to{opacity:1} }

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 370px;
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.15), 0 4px 16px rgba(0,0,0,.08);
  border: 1px solid var(--border);
  animation: modalPop .18s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes modalPop { from{transform:scale(.94)} to{transform:scale(1)} }
.modal-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 14px; letter-spacing: -.2px; }

.form-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; }

/* ============================================================
   LOADER
   ============================================================ */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex; justify-content: center; align-items: center;
}
.loader-content { text-align: center; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 10px;
}
#loader-message { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  text-align: center;
  padding: 12px 16px 55px;
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--muted-lt);
  border-top: 1px solid var(--border-lt);
  margin-top: auto;
}
.app-footer a { color: var(--primary); font-weight: 700; display: inline-block; margin-top: 2px; }

/* ============================================================
   DASHBOARD ALERT BANNERS
   ============================================================ */
.dashboard-alert-banner {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}
.dashboard-alert-banner .banner-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.dashboard-alert-banner.holiday    { border-left: 3px solid #F59E0B; }
.dashboard-alert-banner.holiday .banner-icon    { background:#FEF3C7; color:#B45309; }
.dashboard-alert-banner.weekend    { border-left: 3px solid #6366F1; }
.dashboard-alert-banner.weekend .banner-icon    { background:#EEF2FF; color:#4338CA; }
.dashboard-alert-banner.out-of-term{ border-left: 3px solid #F43F5E; }
.dashboard-alert-banner.out-of-term .banner-icon{ background:#FFF1F2; color:#BE123C; }
.banner-text-col h5 { font-size: 0.84rem; font-weight: 800; color:#0F172A; margin:0 0 1px; }
.banner-text-col p  { font-size: 0.68rem; color:var(--muted); font-weight:500; margin:0; }

/* ============================================================
   AUDIT VIEW
   ============================================================ */
.audit-row {
  background: #fff;
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 11px;
  margin-bottom: 7px;
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color .15s;
}
.audit-row:hover { border-color: #c7d2fe; }
.audit-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px; }
.audit-date  { font-weight: 800; font-size: 0.88rem; color: #0F172A; }
.audit-badge { font-size: 0.64rem; font-weight: 700; padding: 2px 7px; border-radius: 100px; }
.audit-badge.complete   { background:#DCFCE7; color:#14532D; }
.audit-badge.incomplete { background:#FEE2E2; color:#7F1D1D; }
.audit-body  { font-size: 0.78rem; }
.audit-unchecked-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.audit-unchecked-pill {
  background: #FFF1F2; color: #BE123C;
  border: 1px solid #FECDD3;
  font-weight: 600; font-size: 0.67rem;
  padding: 2px 8px; border-radius: 100px;
}

/* ============================================================
   TERM SETTINGS
   ============================================================ */
.term-block {
  border-radius: var(--r);
  padding: 12px;
  margin-bottom: 10px;
  border: 1.5px solid transparent;
}
.term1-block { background:linear-gradient(135deg,#EFF6FF,#E0E7FF); border-color:#C7D2FE; }
.term2-block { background:linear-gradient(135deg,#F0FDF4,#DCFCE7); border-color:#BBF7D0; }
.term-block-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:9px; flex-wrap:wrap; gap:6px; }
.term-badge { font-size: 0.76rem; font-weight: 800; padding: 3px 11px; border-radius: 100px; letter-spacing: .2px; }
.term-badge.t1 { background:var(--primary); color:#fff; box-shadow:0 2px 6px rgba(99,102,241,.3); }
.term-badge.t2 { background:var(--success);  color:#fff; box-shadow:0 2px 6px rgba(16,185,129,.3); }
.term-day-count {
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 100px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.07);
  color: #374151;
}
.term-date-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
@media (max-width: 360px) { .term-date-grid { grid-template-columns: 1fr; } }

/* ============================================================
   HOLIDAY CALENDAR
   ============================================================ */
.holiday-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 3px; text-align: center; margin-top: 7px;
}
.calendar-header-cell {
  font-weight: 700; font-size: 0.6rem; color: var(--muted-lt);
  padding: 3px 0; text-transform: uppercase; letter-spacing: .5px;
}
.calendar-day-cell {
  background: #fff; border: 1px solid var(--border);
  border-radius: 6px; min-height: 38px;
  padding: 2px 3px; display: flex; flex-direction: column;
  justify-content: space-between; cursor: pointer; transition: all .12s;
}
.calendar-day-cell:hover { border-color: var(--primary); }
.calendar-day-num { font-weight: 700; font-size: 0.68rem; color: #334155; text-align: right; }
.calendar-day-label {
  font-size: 0.48rem; font-weight: 700; line-height: 1.1;
  color: #fff; background: #F43F5E; border-radius: 3px;
  padding: 1px 2px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: auto; max-width: 100%;
}
.calendar-day-cell.weekend { background:#F8FAFC; border-color:#E2E8F0; }
.calendar-day-cell.weekend .calendar-day-num { color:#94A3B8; }
.calendar-day-cell.holiday { background:#FFF1F2; border-color:#FECDD3; }
.calendar-day-cell.holiday .calendar-day-num { color:#BE123C; }
.calendar-day-cell.empty { background:transparent; border:none; cursor:default; pointer-events:none; }
.calendar-day-cell.out-of-term { background:#FAFAFA; opacity:.4; }
.calendar-day-cell.school-day.term1-day { background:linear-gradient(135deg,#EFF6FF,#E0E7FF); border-color:#A5B4FC; }
.calendar-day-cell.school-day.term2-day { background:linear-gradient(135deg,#F0FDF4,#D1FAE5); border-color:#6EE7B7; }
.calendar-day-cell.school-day.term1-day .calendar-day-num { color:#3730A3; }
.calendar-day-cell.school-day.term2-day .calendar-day-num { color:#064E3B; }

/* Calendar Legend */
.calendar-legend { display:flex; flex-wrap:wrap; gap:6px 12px; margin-bottom:7px; }
.legend-item { display:flex; align-items:center; gap:3px; font-size:0.64rem; font-weight:600; color:var(--muted); }
.legend-dot { width:9px; height:9px; border-radius:3px; flex-shrink:0; }
.legend-dot.school     { background:#A5F3FC; border:1px solid #67E8F9; }
.legend-dot.holiday    { background:#FFE4E6; border:1px solid #FECDD3; }
.legend-dot.weekend    { background:#F1F5F9; border:1px solid #CBD5E1; }
.legend-dot.out-of-term{ background:#FAFAFA; border:1px solid #E2E8F0; opacity:.5; }

/* ============================================================
   RESPONSIVE — TABLET & PC (≥768px)
   ============================================================ */
@media (min-width: 768px) {
  body {
    background: #ECEEF4;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
  }

  .app-container {
    max-width: 900px;
    margin: 24px auto;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(15,23,42,.09), 0 2px 8px rgba(15,23,42,.05);
    min-height: calc(100vh - 48px);
    overflow: hidden;
    padding-bottom: 40px;
  }

  .main-header .header-content { padding: 18px 24px 16px; }
  .app-logo     { width: 44px; height: 44px; }
  .header-text h1 { font-size: 1.15rem; }

  .content-wrapper  { padding: 16px 24px; }
  .home-content     { padding: 16px 0; }
  .section-title    { margin: 0 24px 9px; }

  .menu-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
    padding: 0 24px;
  }
  .menu-card { padding: 14px 8px 12px; }
  .icon-box  { width: 40px; height: 40px; }

  .class-grid { grid-template-columns: repeat(4,1fr); }
  .grid-2     { grid-template-columns: repeat(4,1fr); }

  .workspace-content { padding: 12px 24px; }
  .dashboard-section { padding: 0 24px; }
  .dashboard-stats   { gap: 9px; }
  .stat-num { font-size: 1.65rem; }

  .dashboard-details {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
    align-items: start;
  }
  .trend-chart-panel { grid-column: span 2; }

  .modal-card { max-width: 420px; padding: 24px; }
  .student-row { padding: 9px 14px; }
  .status-btn  { padding: 5px 13px; font-size: 0.76rem; }
}

@media (min-width: 1100px) {
  .app-container { max-width: 1060px; }
}

/* ============================================================
   BMI PERIOD TABS
   ============================================================ */
.bmi-period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.bmi-tab {
  padding: 5px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font);
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.bmi-tab:hover {
  border-color: var(--bmi-color);
  color: var(--bmi-color);
  background: #fdf2f8;
}
.bmi-tab.active {
  background: var(--bmi-color);
  border-color: var(--bmi-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

/* ============================================================
   PRINT — A4 Portrait / Landscape Clean Government Layout
   ============================================================ */
@media print {
  @page { margin: 12mm 12mm; }

  body, html {
    background: white !important;
    font-family: 'TH Sarabun New', 'Sarabun', sans-serif !important;
    margin: 0 !important; padding: 0 !important; color: black !important;
  }

  .print-hidden, .cloud-bg, header, footer,
  .back-btn, .preview-actions, .card-panel:first-of-type, #loader, .fab, .app-header {
    display: none !important;
  }

  .app-container {
    width: 100% !important; max-width: none !important;
    margin: 0 !important; border: none !important;
    box-shadow: none !important; border-radius: 0 !important;
    background: transparent !important; overflow: visible !important;
  }

  #step-reports   { display: block !important; }
  #report-preview { display: block !important; }

  .table-responsive {
    border: none !important; box-shadow: none !important;
    border-radius: 0 !important; overflow: visible !important; width: 100% !important;
  }

  table, .print-clean-table {
    border-collapse: collapse !important; width: 100% !important;
    font-family: 'TH Sarabun New', 'Sarabun', sans-serif !important; font-size: 11pt !important;
    background: white !important;
    border: 1.5px solid black !important;
  }
  th, td {
    border: 1.5px solid black !important; padding: 5px 6px !important;
    font-size: 11pt !important; color: black !important;
    background: transparent !important;
  }
  th {
    font-weight: bold !important; font-size: 11.5pt !important;
    background: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  h2, h3, p, .report-header-print * {
    font-family: 'TH Sarabun New', 'Sarabun', sans-serif !important;
    color: black !important;
  }
}

/* Customized outstanding header with background gradient */
.app-header {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%) !important;
  color: #ffffff !important;
  border-bottom: none !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15) !important;
}

.sticky-header h2, .header-info h2 {
  color: #ffffff !important;
}

.header-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.header-text p {
  font-size: 0.68rem;
  color: #e0e7ff !important;
  font-weight: 500;
  letter-spacing: 0.1px;
  margin-top: 2px;
}

.sticky-header .back-btn {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow: none !important;
}

.sticky-header .back-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
  transform: translateY(-1px);
}
