/* ============================================================
   MDM Sahayak — Design System
   Palette pinned by brief: pink / purple / yellow on white.
   Display: Plus Jakarta Sans · Body: Inter
   ============================================================ */

:root {
  /* Brand */
  --pink: #E91E63;
  --pink-600: #D81557;
  --pink-50: #FCE4EC;
  --purple: #7B1FA2;
  --purple-700: #6A1B9A;
  --purple-50: #F3E5F5;
  --yellow: #FFC107;
  --yellow-600: #FFA000;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #E91E63 0%, #9C27B0 55%, #7B1FA2 100%);
  --grad-brand-soft: linear-gradient(135deg, #F8326510 0%, #7B1FA210 100%);
  --grad-sun: linear-gradient(135deg, #FFC107 0%, #FF8A3D 100%);
  --grad-mint: linear-gradient(135deg, #16C79A 0%, #0FB3C9 100%);
  --grad-sky: linear-gradient(135deg, #5B7CFA 0%, #8E5BFA 100%);

  /* Neutrals */
  --ink: #1A1326;
  --ink-2: #4A4458;
  --ink-3: #8A8595;
  --line: #ECE8F0;
  --line-2: #F4F1F8;
  --bg: #F7F5FB;
  --card: #FFFFFF;
  --white: #FFFFFF;

  /* Status */
  --green: #16A34A;
  --green-bg: #E7F7EE;
  --red: #E11D48;
  --red-bg: #FDE7EC;
  --amber: #B45309;
  --amber-bg: #FEF3C7;

  /* Shadow */
  --sh-sm: 0 1px 2px rgba(26,19,38,.06), 0 1px 3px rgba(26,19,38,.05);
  --sh-md: 0 4px 14px rgba(123,31,162,.08), 0 2px 6px rgba(26,19,38,.05);
  --sh-lg: 0 18px 40px rgba(123,31,162,.16), 0 6px 14px rgba(26,19,38,.06);
  --sh-pink: 0 10px 26px rgba(233,30,99,.32);

  /* Radius */
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  --nav-h: 68px;
  --max: 980px;

  --ff-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --ff-body: "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 { font-family: var(--ff-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.18; }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--pink-50); }

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

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.gap-8 { gap: 8px; } .gap-16 { gap: 16px; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SPLASH
   ============================================================ */
#splash {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--grad-brand);
  display: grid; place-items: center;
  transition: opacity .5s ease, visibility .5s;
}
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; color: #fff; animation: rise .7s cubic-bezier(.2,.8,.2,1); }
.splash-logo {
  width: 108px; height: 108px; margin: 0 auto 22px; border-radius: 30px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(8px);
  display: grid; place-items: center; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.28);
  animation: pop .6s cubic-bezier(.2,1.4,.4,1) both;
}
.splash-logo svg { width: 64px; height: 64px; }
.splash-inner h1 { font-size: 34px; color: #fff; }
.splash-inner p { opacity: .85; margin-top: 6px; font-size: 14px; letter-spacing: .04em; }
.splash-dots { display: flex; gap: 7px; justify-content: center; margin-top: 28px; }
.splash-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.6); animation: bob 1s infinite ease-in-out; }
.splash-dots i:nth-child(2){ animation-delay: .15s } .splash-dots i:nth-child(3){ animation-delay: .3s }
@keyframes bob { 0%,100%{ transform: translateY(0); opacity:.5 } 50%{ transform: translateY(-7px); opacity:1 } }
@keyframes pop { from { transform: scale(.6); opacity: 0 } }
@keyframes rise { from { transform: translateY(16px); opacity: 0 } }

/* ============================================================
   APP SHELL
   ============================================================ */
#app { min-height: 100dvh; }
.screen { display: none; animation: fade .35s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* Top app bar */
.appbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--grad-brand); color: #fff;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 16px;
}
.appbar.simple { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); }
.appbar .bar-top { display: flex; align-items: center; gap: 12px; }
.appbar h2 { font-size: 20px; }
.appbar .sub { opacity: .85; font-size: 13px; margin-top: 2px; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); color: #fff; transition: transform .15s, background .2s;
}
.iconbtn:active { transform: scale(.92); }
.appbar.simple .iconbtn { background: var(--line-2); color: var(--ink); }
.iconbtn svg { width: 22px; height: 22px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--purple-700); font-family: var(--ff-display); font-weight: 800; font-size: 16px;
  border: 2px solid rgba(255,255,255,.5);
}

/* Content area */
.view { max-width: var(--max); margin: 0 auto; padding: 18px 18px calc(var(--nav-h) + 36px); }
.view.flush { padding-top: 0; }
.section-title { font-size: 16px; margin: 22px 4px 12px; display: flex; align-items: center; gap: 8px; }
.section-title .more { margin-left: auto; font-size: 13px; color: var(--pink); font-weight: 600; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-md); padding: 18px; border: 1px solid var(--line-2); }
.card.flat { box-shadow: var(--sh-sm); }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
  position: relative; border-radius: var(--r); padding: 16px; color: #fff; overflow: hidden;
  box-shadow: var(--sh-md); min-height: 116px; display: flex; flex-direction: column; justify-content: space-between;
}
.stat.g1 { background: var(--grad-brand); }
.stat.g2 { background: var(--grad-sun); }
.stat.g3 { background: var(--grad-mint); }
.stat.g4 { background: var(--grad-sky); }
.stat .ico { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.22); display: grid; place-items: center; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .big { font-family: var(--ff-display); font-weight: 800; font-size: 28px; line-height: 1; }
.stat .lbl { font-size: 12.5px; opacity: .92; margin-top: 4px; }
.stat .blob { position: absolute; right: -22px; bottom: -28px; width: 96px; height: 96px; border-radius: 50%; background: rgba(255,255,255,.12); }

/* Hero welcome */
.welcome { background: var(--card); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-md); display: flex; align-items: center; gap: 14px; border: 1px solid var(--line-2); }
.welcome .art { width: 70px; height: 70px; flex: none; }
.welcome h3 { font-size: 18px; }
.welcome p { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* Quick actions */
.qa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa { background: var(--card); border-radius: var(--r); padding: 14px 8px; text-align: center; box-shadow: var(--sh-sm); border: 1px solid var(--line-2); transition: transform .15s; }
.qa:active { transform: scale(.94); }
.qa .qi { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 8px; display: grid; place-items: center; }
.qa .qi svg { width: 24px; height: 24px; color: #fff; }
.qa span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); display: block; line-height: 1.25; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.litem { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--sh-sm); border: 1px solid var(--line-2); display: flex; align-items: center; gap: 13px; transition: transform .12s; }
.litem:active { transform: scale(.99); }
.litem .lthumb { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center; font-size: 22px; }
.litem .ltitle { font-weight: 600; font-size: 14.5px; }
.litem .lsub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.litem .lright { margin-left: auto; text-align: right; }
.litem .lamt { font-family: var(--ff-display); font-weight: 700; }

.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); display: inline-block; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.pink { background: var(--pink-50); color: var(--pink-600); }
.tag.purple { background: var(--purple-50); color: var(--purple-700); }

/* Chart */
.bars { display: flex; align-items: flex-end; gap: 9px; height: 140px; padding-top: 10px; }
.bars .bar { flex: 1; background: var(--grad-brand); border-radius: 8px 8px 4px 4px; min-height: 6px; position: relative; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.bars .bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--ink-3); }
.bars .bar b { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ink-2); font-weight: 700; }
.chart-legend { display: flex; gap: 16px; margin-top: 30px; flex-wrap: wrap; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.donut { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut .hole { width: 84px; height: 84px; background: var(--card); border-radius: 50%; display: grid; place-items: center; text-align: center; }
.donut .hole b { font-family: var(--ff-display); font-size: 22px; }
.donut .hole span { font-size: 11px; color: var(--ink-3); }

/* ============================================================
   BUTTONS / FORMS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 20px; border-radius: var(--r-pill); font-weight: 700; font-family: var(--ff-display);
  font-size: 15px; transition: transform .14s, box-shadow .2s, opacity .2s; width: auto;
}
.btn svg { width: 19px; height: 19px; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-pink); }
.btn.ghost { background: var(--card); color: var(--purple-700); border: 1.5px solid var(--line); box-shadow: var(--sh-sm); }
.btn.soft { background: var(--pink-50); color: var(--pink-600); }
.btn.sun { background: var(--grad-sun); color: #4a2c00; box-shadow: 0 8px 20px rgba(255,160,0,.3); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.sm { padding: 9px 15px; font-size: 13px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; padding-left: 4px; }
.input {
  width: 100%; padding: 14px 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  background: var(--white); transition: border-color .2s, box-shadow .2s; font-size: 15.5px;
}
.input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-50); }
.input.has-ico { padding-left: 46px; }
.input-wrap { position: relative; }
.input-wrap .fi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 20px; height: 20px; }
.input-wrap .toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); padding: 6px; }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%238A8595' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 10 13 14 9'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; padding-left: 4px; }
.err-msg { color: var(--red); font-size: 12.5px; margin-top: 6px; padding-left: 4px; }

/* Segmented */
.segment { display: flex; background: var(--line-2); border-radius: var(--r-pill); padding: 4px; gap: 4px; }
.segment button { flex: 1; padding: 9px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; color: var(--ink-3); transition: .2s; }
.segment button.on { background: var(--card); color: var(--pink); box-shadow: var(--sh-sm); }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 15px; border-radius: var(--r-pill); background: var(--card); border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--grad-brand); color: #fff; border-color: transparent; }

/* ============================================================
   AUTH SCREENS
   ============================================================ */
.auth { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-hero { background: var(--grad-brand); color: #fff; padding: calc(env(safe-area-inset-top) + 40px) 26px 54px; border-radius: 0 0 34px 34px; text-align: center; position: relative; overflow: hidden; }
.auth-hero::after { content:""; position: absolute; width: 220px; height: 220px; background: rgba(255,255,255,.08); border-radius: 50%; right: -60px; top: -60px; }
.auth-hero .logo-sm { width: 64px; height: 64px; border-radius: 19px; background: rgba(255,255,255,.18); display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid rgba(255,255,255,.3); }
.auth-hero .logo-sm svg { width: 38px; height: 38px; }
.auth-hero h1 { font-size: 26px; }
.auth-hero p { opacity: .88; font-size: 14px; margin-top: 6px; }
.auth-card { background: var(--card); margin: -30px 20px 0; border-radius: var(--r-lg); padding: 24px 20px; box-shadow: var(--sh-lg); position: relative; z-index: 2; }
.auth-foot { text-align: center; padding: 22px; font-size: 14px; color: var(--ink-2); }
.auth-foot a { color: var(--pink); font-weight: 700; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-3); font-size: 12.5px; }
.divider::before,.divider::after { content:""; flex: 1; height: 1px; background: var(--line); }
.disclaimer-box { background: var(--purple-50); border: 1px solid var(--purple-50); border-radius: var(--r-sm); padding: 12px 14px; font-size: 11.5px; color: var(--purple-700); line-height: 1.5; margin-top: 18px; display: flex; gap: 9px; }
.disclaimer-box svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* OTP */
.otp-row { display: flex; gap: 10px; justify-content: center; margin: 8px 0 6px; }
.otp-row input { width: 50px; height: 58px; text-align: center; font-size: 22px; font-weight: 800; font-family: var(--ff-display); border-radius: 14px; border: 1.5px solid var(--line); background: var(--white); }
.otp-row input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-50); }

/* Onboarding */
.onb { min-height: 100dvh; display: flex; flex-direction: column; background: var(--card); }
.onb-slide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 30px; }
.onb-art { width: 240px; max-width: 70vw; margin-bottom: 30px; }
.onb-slide h2 { font-size: 26px; max-width: 320px; }
.onb-slide p { color: var(--ink-2); margin-top: 12px; max-width: 320px; font-size: 15px; }
.onb-dots { display: flex; gap: 8px; justify-content: center; margin: 6px 0 20px; }
.onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: .3s; }
.onb-dots i.on { width: 26px; border-radius: 6px; background: var(--pink); }
.onb-foot { padding: 18px 26px calc(env(safe-area-inset-bottom) + 26px); display: flex; gap: 12px; align-items: center; }

/* ============================================================
   BOTTOM NAV + FAB
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom);
  max-width: var(--max); margin: 0 auto;
}
.bottom-nav .nav-i { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 10.5px; font-weight: 600; transition: color .2s; position: relative; }
.bottom-nav .nav-i svg { width: 24px; height: 24px; transition: transform .2s; }
.bottom-nav .nav-i.on { color: var(--pink); }
.bottom-nav .nav-i.on svg { transform: translateY(-1px); }
.bottom-nav .nav-i.on::before { content:""; position: absolute; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--pink); }
.bottom-nav .nav-spacer { flex: 1; }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) - 26px);
  z-index: 75; width: 58px; height: 58px; border-radius: 50%; background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; box-shadow: var(--sh-pink); transition: transform .18s;
}
.fab:active { transform: translateX(-50%) scale(.9); }
.fab svg { width: 28px; height: 28px; }
@media (min-width: 781px) { .fab { left: auto; right: 30px; transform: none; bottom: 30px; } .fab:active { transform: scale(.9); } }

/* ============================================================
   DRAWER / SHEET / MODAL / TOAST
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(26,19,38,.5); z-index: 90; opacity: 0; visibility: hidden; transition: .3s; }
.scrim.show { opacity: 1; visibility: visible; }

.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 320px; background: var(--card); z-index: 95; transform: translateX(-100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer.show { transform: none; }
.drawer-head { background: var(--grad-brand); color: #fff; padding: calc(env(safe-area-inset-top) + 26px) 22px 22px; }
.drawer-head .avatar { width: 56px; height: 56px; font-size: 22px; margin-bottom: 12px; }
.drawer-head h3 { font-size: 19px; }
.drawer-head p { opacity: .85; font-size: 13px; }
.drawer-nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.drawer-nav a { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 14px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: background .2s; }
.drawer-nav a svg { width: 22px; height: 22px; color: var(--ink-3); }
.drawer-nav a.on, .drawer-nav a:active { background: var(--pink-50); color: var(--pink-600); }
.drawer-nav a.on svg { color: var(--pink); }
.drawer-nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 16px 14px 6px; font-weight: 700; }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; background: var(--card); border-radius: 26px 26px 0 0; transform: translateY(100%); transition: transform .34s cubic-bezier(.2,.8,.2,1); max-height: 92dvh; display: flex; flex-direction: column; max-width: var(--max); margin: 0 auto; }
.sheet.show { transform: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 12px auto 4px; }
.sheet-head { padding: 8px 20px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-2); }
.sheet-head h3 { font-size: 18px; }
.sheet-body { padding: 20px; overflow-y: auto; }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 24px); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; box-shadow: var(--sh-lg); display: flex; align-items: center; gap: 10px; animation: toastin .3s cubic-bezier(.2,.8,.2,1); max-width: 100%; }
.toast.ok { background: var(--green); } .toast.err { background: var(--red); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toastin { from { transform: translateY(20px); opacity: 0; } }

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */
.empty { text-align: center; padding: 44px 24px; }
.empty .eart { width: 150px; margin: 0 auto 18px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--ink-3); margin-top: 7px; font-size: 14px; max-width: 280px; margin-left: auto; margin-right: auto; }
.empty .btn { margin-top: 18px; }

.skel { background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 37%, var(--line-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
.spinner { width: 26px; height: 26px; border: 3px solid var(--pink-50); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
.page-loader { display: grid; place-items: center; padding: 60px 0; }

/* ============================================================
   PLANS
   ============================================================ */
.plan { border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-md); border: 2px solid var(--line-2); background: var(--card); position: relative; }
.plan.feat { border-color: var(--pink); box-shadow: var(--sh-lg); }
.plan .ribbon { position: absolute; top: -12px; right: 18px; background: var(--grad-sun); color: #4a2c00; font-size: 11px; font-weight: 800; padding: 5px 13px; border-radius: var(--r-pill); }
.plan h3 { font-size: 19px; }
.plan .price { font-family: var(--ff-display); font-size: 34px; font-weight: 800; margin: 8px 0 2px; }
.plan .price small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.plan ul { list-style: none; margin: 16px 0; display: flex; flex-direction: column; gap: 11px; }
.plan li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.plan li svg { width: 18px; height: 18px; color: var(--green); flex: none; }

/* Profile header */
.profile-head { background: var(--grad-brand); margin: -18px -18px 0; padding: 24px 18px 30px; color: #fff; text-align: center; border-radius: 0 0 28px 28px; }
.profile-head .avatar { width: 84px; height: 84px; font-size: 32px; margin: 0 auto 12px; }
.profile-head h2 { font-size: 22px; }
.profile-head p { opacity: .88; font-size: 13.5px; margin-top: 3px; }

/* MDCF rows */
.mdcf-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.mdcf-row:last-child { border-bottom: none; }
.mdcf-row .ml { font-size: 14px; }
.mdcf-row .ml small { display: block; color: var(--ink-3); font-size: 12px; }
.mdcf-row input { width: 96px; text-align: right; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); }
.mdcf-row input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-50); }
.mdcf-row input[readonly] { background: var(--line-2); font-weight: 700; color: var(--purple-700); }

/* Footer disclaimer */
.app-foot { padding: 20px 18px; text-align: center; font-size: 11px; color: var(--ink-3); line-height: 1.6; border-top: 1px solid var(--line-2); }
.app-foot strong { color: var(--ink-2); }

/* ============================================================
   DESKTOP — sidebar layout
   ============================================================ */
@media (min-width: 781px) {
  body { background: var(--bg); }
  .has-sidebar { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }
  .desk-side { position: sticky; top: 0; height: 100dvh; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
  .bottom-nav { display: none; }
  .view { padding-bottom: 40px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .qa-grid { grid-template-columns: repeat(4, 1fr); max-width: 560px; }
  .menu-btn { display: none; }
  .dash-2col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
}
@media (max-width: 780px) {
  .desk-side { display: none; }
  .has-sidebar { display: block; }
}
.desk-side { display: none; }

/* ============================================================
   APP-SHELL GLUE (entry/router)
   ============================================================ */
.auth-root { min-height: 100dvh; }
.app-col { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.bell-badge {
  position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--yellow); color: var(--purple-700);
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--pink-600); line-height: 1;
}
.appbar.simple .bell-badge { border-color: var(--card); }
.appbar .back-btn[hidden], .appbar .menu-btn[hidden], .bell-badge[hidden] { display: none; }
.drawer-nav a span, .drawer-nav a { cursor: pointer; }
@media (min-width: 781px) {
  .appbar .menu-btn { display: none; }
  .desk-side .drawer-nav a.on { background: var(--pink-50); color: var(--pink-600); }
}

/* ============================================================
   SCHOOL SETUP WIZARD
   ============================================================ */
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237a7a85' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.wiz { max-width: 640px; margin: 0 auto; }
.wiz-top { display: flex; align-items: center; gap: 12px; padding: 4px 2px 12px; }
.wiz-school { display: flex; flex-direction: column; min-width: 0; }
.wiz-school strong { font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.wiz-school span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-help { margin-left: auto; width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #25D366; color: #fff; }
.wiz-help svg { width: 22px; height: 22px; }
.wiz-progress { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-bottom: 18px; }
.wiz-progress span { display: block; height: 100%; width: 0; background: var(--grad-brand); border-radius: 99px; transition: width .35s ease; }
.wiz-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.wiz-guide { display: flex; gap: 10px; background: var(--pink-50); border: 1px solid var(--pink-100, #fbd5e4); border-radius: 14px; padding: 13px 14px; margin-bottom: 18px; }
.wiz-guide svg { width: 20px; height: 20px; flex: none; color: var(--pink-600); margin-top: 1px; }
.wiz-guide p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.wiz-list { list-style: none; display: grid; gap: 10px; margin: 4px 0 8px; }
.wiz-list li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--ink-2); }
.wiz-list li svg { width: 20px; height: 20px; color: var(--green, #16a34a); flex: none; }
.wiz-foot { display: flex; gap: 10px; margin-top: 22px; padding-top: 6px; }
.wiz-foot .btn { white-space: nowrap; }
.req { color: var(--pink-600); font-weight: 700; }
.bili { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bili .bl { flex: none; width: 38px; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--line-2); border-radius: 8px; padding: 8px 2px; }
.bili .input { margin: 0; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.enr-head, .enr-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; align-items: center; }
.enr-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 0 2px 8px; }
.enr-row { margin-bottom: 8px; }
.enr-row .input { margin: 0; }
.enr-c { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.enr-mdm { font-style: normal; font-size: 9px; font-weight: 800; background: var(--grad-mint, #d1fae5); color: #047857; padding: 2px 5px; border-radius: 5px; }
.enr-total { margin-top: 10px; padding: 12px 14px; background: var(--card-2, #f7f7fa); border-radius: 12px; font-size: 14px; color: var(--ink-2); text-align: right; }
.enr-total strong { color: var(--pink-600); font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { padding: 9px 15px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.chip.on { background: var(--grad-brand); color: #fff; border-color: transparent; }
.vcat { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.vcat-h { font-family: var(--font-display); font-weight: 700; color: var(--pink-600); margin-bottom: 10px; }
.sum { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sum-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.sum-row:last-child { border-bottom: none; }
.sum-row span { color: var(--ink-3); }
.sum-row strong { color: var(--ink); text-align: right; }

/* Menu-of-the-day chip inside the daily entry form */
.menu-day { background: var(--pink-50); border: 1px solid var(--pink-100, #fbd5e4); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.menu-day .md-day { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--pink-600); }
.menu-day .md-menu { font-size: 14.5px; color: var(--ink); margin: 3px 0 8px; line-height: 1.4; }
.menu-day .md-tag { display: inline-block; font-size: 11.5px; font-weight: 700; background: var(--grad-brand); color: #fff; padding: 3px 10px; border-radius: 99px; }

/* Weekly menu reference (dashboard) */
.wk-menu { display: grid; gap: 8px; }
.wk-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.wk-row:last-child { border-bottom: none; }
.wk-row.today { background: var(--pink-50); margin: 0 -12px; padding: 9px 12px; border-radius: 10px; border-bottom: none; }
.wk-day { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.wk-menu-txt { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.wk-tag { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.wk-tag.egg { background: #fde68a; color: #92400e; }
.wk-tag.lad { background: #bbf7d0; color: #166534; }
.wk-tag.any { background: #e9d5ff; color: #6b21a8; }
