/* Portal Orang Tua Tutur Tumbuh — tata letak mengikuti GTOS v3 (kartu bulat, hero, pil navigasi mengambang), warna Tutur Tumbuh. */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/fonts/jakarta-latin.woff2') format('woff2'); }
:root {
  /* Palet Tutur Tumbuh */
  /* Palet Tutur Tumbuh — sama dengan situs & aplikasi klinik */
  --green: #276500; --green-2: #51a471; --green-ink: #013b11; --green-soft: #E5F2DC; --green-tint: #F6FCF5; --lime: #95c603;
  --sage: #51a471; --sage-ink: #2F6B47; --sage-soft: #E4F2EA; --leaf: #C6E3B4;
  --bg: #F6FCF5; --surface: #FFFFFF; --surface-2: #FAFDF8; --border: #E0E8DB;
  --text: #1F2A24; --text-muted: #5F6E66; --text-subtle: #97A39C;
  --danger: #C8372B; --danger-soft: #FBE4E0; --warn-soft: #FFF3DC; --warn-ink: #7A5200;
  --p1: #D9534F; --p2: #E0A030; --p3: #8DB84A; --p4: #51a471; --p5: #276500;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 26px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 28px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(1,59,17,0.05), 0 2px 8px rgba(1,59,17,0.05);
  --shadow-md: 0 8px 24px rgba(1,59,17,0.14);
  --tap: 44px; --nav-h: 64px; --ease: 160ms ease;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-space: calc(var(--nav-h) + 12px + var(--safe-b));
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-md); line-height: 24px; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--green-ink); }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; border-radius: var(--r-sm); }
.main { max-width: 640px; margin: 0 auto; padding: var(--s-4) var(--s-4) calc(var(--nav-space) + var(--s-6)); }
.main.no-nav { padding-bottom: var(--s-8); }
.muted { color: var(--text-muted); } .small { font-size: 13px; line-height: 19px; } .center { text-align: center; }
.mt0 { margin-top: 0; } .m0 { margin: 0; }

/* ---------- Hero hijau (branding) ---------- */
.hero { position: relative; overflow: hidden; background: var(--green); color: #fff; border-radius: var(--r-xl); padding: var(--s-4) var(--s-5) var(--s-5); margin-bottom: var(--s-4); }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 190px; height: 190px; right: -64px; top: -78px; background: rgba(255,255,255,0.13); }
.hero::after { width: 150px; height: 150px; left: -60px; bottom: -90px; background: var(--lime); opacity: 0.35; }
.hero > * { position: relative; z-index: 1; }
.brand-row { display: flex; align-items: center; gap: var(--s-3); }
.brand-logo { width: 42px; height: 42px; flex: none; }
.brand-txt { flex: 1; min-width: 0; }
.brand-name { font-weight: 800; font-size: 19px; line-height: 23px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12.5px; line-height: 17px; opacity: 0.92; font-weight: 500; }
.hero-hello { font-size: var(--fs-sm); opacity: 0.9; margin: var(--s-5) 0 0; }
.hero h1 { margin: 2px 0 2px; font-size: 32px; line-height: 38px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.hero .page-title { font-size: 26px; line-height: 32px; margin-top: var(--s-5); }
.hero-sum { font-size: var(--fs-sm); opacity: 0.92; margin: 0; }
.hero .btn-light { margin-top: var(--s-4); background: #fff; color: var(--green-ink); box-shadow: var(--shadow-sm); }
.hero.center { text-align: center; padding: var(--s-6) var(--s-5); }
.hero.center .brand-logo { width: 64px; height: 64px; margin: 0 auto var(--s-2); display: block; }
.hero.center .brand-name { font-size: 24px; line-height: 30px; }
.icon-btn { width: var(--tap); height: var(--tap); display: grid; place-items: center; border-radius: var(--r-full); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); flex-shrink: 0; transition: background var(--ease), transform var(--ease); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.on-dark { background: rgba(255,255,255,0.2); color: #fff; box-shadow: none; }
.icon-btn.on-dark:hover { background: rgba(255,255,255,0.3); }

/* ---------- Label kelompok, kartu ---------- */
.group-label { font-size: var(--fs-xs); line-height: 16px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin: var(--s-6) var(--s-1) var(--s-2); }
.group-label:first-child { margin-top: 0; }
.card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-sm); margin-bottom: var(--s-3); }
.list { display: flex; flex-direction: column; gap: var(--s-2); }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
.stat { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-4); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 28px; line-height: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.stat.is-green { background: var(--green); color: #fff; } .stat.is-green span { color: rgba(255,255,255,0.9); }
.stat.is-soft { background: var(--sage-soft); }
.chart svg { width: 100%; height: auto; display: block; }

/* ---------- Kartu sesi ---------- */
.sess-head { display: flex; align-items: center; gap: var(--s-3); }
.tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--green-tint); color: var(--green-ink); }
.sess-head .body { flex: 1; min-width: 0; }
.sess-date { font-weight: 700; font-size: 15px; line-height: 21px; }
.sess-ter { font-size: 13px; line-height: 18px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); font-size: 13px; font-weight: 600; color: var(--text-muted); }
.meter { display: flex; gap: 3px; } .meter i { width: 22px; height: 7px; border-radius: 4px; background: #E3E9E0; }
.meter i.on1 { background: var(--p1); } .meter i.on2 { background: var(--p2); } .meter i.on3 { background: var(--p3); } .meter i.on4 { background: var(--p4); } .meter i.on5 { background: var(--p5); }
.field-h { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 20px; font-weight: 800; color: var(--green-ink); margin: var(--s-4) 0 6px; padding-top: var(--s-3); border-top: 1px solid var(--border); }
.field-h::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--green); flex: none; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }

/* ---------- Chip & pil ---------- */
.chip { display: inline-flex; align-items: center; font-size: 11.5px; line-height: 16px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-full); background: var(--green-soft); color: var(--green-ink); flex-shrink: 0; }
.chip.sage { background: var(--sage-soft); color: var(--sage-ink); }
.chips { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 calc(var(--s-4) * -1) var(--s-4); padding: 2px var(--s-4) var(--s-1); }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--r-full); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-sm); transition: background var(--ease), color var(--ease); }
.chips button .n { font-size: var(--fs-xs); color: var(--text-subtle); font-weight: 700; }
.chips button[aria-pressed="true"] { background: var(--green-ink); color: #fff; }
.chips button[aria-pressed="true"] .n { color: var(--leaf); }

/* ---------- Baris daftar (artikel, riwayat) ---------- */
.srow { display: flex; align-items: center; gap: var(--s-3); min-height: 64px; background: var(--surface); border-radius: var(--r-md); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-3); box-shadow: var(--shadow-sm); text-align: left; width: 100%; }
button.srow:active { opacity: 0.7; }
.srow .body { flex: 1; min-width: 0; }
.srow .name { font-weight: 700; font-size: 15px; line-height: 21px; }
.srow .sub { font-size: 13px; line-height: 18px; color: var(--text-muted); margin-top: 2px; display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.srow .chev { color: var(--text-subtle); }
.srow.top { align-items: flex-start; }
.score-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex-shrink: 0; color: #fff; }
.sk1 { background: var(--p1); } .sk2 { background: var(--p2); } .sk3 { background: var(--p3); } .sk4 { background: var(--p4); } .sk5 { background: var(--p5); } .sk0 { background: var(--text-subtle); }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: 0 var(--s-5); border-radius: var(--r-full); font-weight: 700; transition: background var(--ease), opacity var(--ease), transform var(--ease); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(39,101,0,0.28); }
.btn-primary:hover { background: var(--green-ink); }
.btn-ghost { border: 1.5px solid var(--border); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--green-2); background: var(--green-tint); }
.btn-block { width: 100%; }
.link-back { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); color: var(--green-ink); font-weight: 700; font-size: var(--fs-sm); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-4); }
.field > span, .field > label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.input, .textarea, .select { width: 100%; min-height: 48px; padding: 12px var(--s-4); font-size: 16px; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--r-md); transition: border-color var(--ease), background var(--ease); -webkit-appearance: none; appearance: none; }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.textarea { min-height: 96px; resize: vertical; line-height: 24px; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--green-2); background: var(--surface); }
.hint { font-size: var(--fs-xs); color: var(--text-subtle); line-height: 16px; }
.err { color: var(--danger); font-size: var(--fs-sm); min-height: 1em; margin: 0 0 var(--s-2); }
.rate { display: flex; flex-direction: column; gap: var(--s-2); }
.rate button { display: flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: 6px var(--s-3) 6px 6px; border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface); text-align: left; transition: border-color var(--ease), background var(--ease); }
.rate button .score-tile { width: 38px; height: 38px; font-size: 16px; }
.rate button .t { font-size: 14px; line-height: 19px; font-weight: 600; }
.rate button .t small { display: block; font-weight: 500; color: var(--text-muted); font-size: 12px; line-height: 16px; }
.rate button[aria-pressed="true"] { border-color: var(--green); background: var(--green-tint); box-shadow: inset 0 0 0 1px var(--green); }

/* ---------- Catatan, bacaan ---------- */
.note { background: var(--warn-soft); color: var(--warn-ink); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); line-height: 20px; margin-bottom: var(--s-3); }
.art-body p { margin: 0 0 var(--s-3); line-height: 1.65; } .art-body ul { margin: 0 0 var(--s-3); padding-left: 20px; line-height: 1.6; }
.art-body h3 { font-size: 16px; margin: var(--s-4) 0 6px; color: var(--green-ink); }
.art-title { font-size: 22px; line-height: 29px; font-weight: 800; letter-spacing: -0.01em; margin: var(--s-1) 0 6px; }
.empty { text-align: center; color: var(--text-muted); padding: var(--s-8) var(--s-4); font-size: var(--fs-sm); }

/* ---------- Footer & slogan ---------- */
.foot { margin-top: var(--s-8); text-align: center; color: var(--text-muted); font-size: 12.5px; line-height: 18px; }
.foot .foot-site { display: inline-block; margin-top: 6px; color: var(--green); font-weight: 700; text-decoration: none; padding: 6px 10px; }
.foot .foot-site:hover { text-decoration: underline; }
.foot .slogan { font-style: italic; color: var(--green-ink); font-weight: 600; font-size: 14px; margin-bottom: 2px; }

/* ---------- Pil navigasi mengambang ---------- */
.tab-bar { position: fixed; left: var(--s-3); right: var(--s-3); bottom: calc(10px + var(--safe-b)); z-index: 30; display: flex; gap: 2px; height: var(--nav-h); padding: 6px; border-radius: var(--r-full); background: var(--surface); box-shadow: var(--shadow-md); max-width: 520px; margin: 0 auto; }
.tab-bar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: var(--r-full); color: var(--text-subtle); font-size: 11px; line-height: 13px; font-weight: 700; transition: background var(--ease), color var(--ease); }
.tab-bar button .ic { line-height: 0; }
.tab-bar button[aria-current="page"] { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(39,101,0,0.3); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-space) + var(--s-3)); z-index: 60; display: flex; justify-content: center; padding: 0 var(--s-4); pointer-events: none; }
.toast { max-width: 480px; width: 100%; background: var(--text); color: #fff; border-radius: var(--r-full); padding: 12px var(--s-5); font-size: var(--fs-sm); box-shadow: var(--shadow-md); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
.sp { height: 10px; }
@media (max-width: 400px) { .brand-sub { font-size: 11.5px; } .brand-name { font-size: 18px; } }

/* ================= Dashboard admin ================= */
body.admin .main { max-width: 980px; }
body.admin .tab-bar { max-width: 420px; }
.row-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.btn-sm { min-height: 38px; padding: 0 var(--s-4); font-size: 13.5px; }
.btn-danger { border: 1.5px solid #F0C5BF; background: var(--surface); color: var(--danger); }
.btn-light { background: #fff; color: var(--green-ink); box-shadow: var(--shadow-sm); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
@media (min-width: 820px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 > .span2 { grid-column: 1 / -1; } .stats.s4 { grid-template-columns: repeat(4, 1fr); } }
.pill { display: inline-flex; align-items: center; font-size: 11.5px; line-height: 16px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-muted); }
.pill.uji { background: #FFF1D6; color: #8A5A00; } .pill.aktif { background: var(--green-soft); color: var(--green-ink); } .pill.nonaktif { background: var(--danger-soft); color: var(--danger); }
.pill.draf { background: var(--surface-2); color: var(--text-muted); } .pill.terkirim { background: #E3EEF8; color: #2D5F86; } .pill.lunas { background: var(--green-soft); color: var(--green-ink); } .pill.batal { background: var(--danger-soft); color: var(--danger); }
.hero .pill { background: rgba(255,255,255,0.22); color: #fff; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px var(--s-3); font-size: 14px; }
.kv dt { color: var(--text-muted); font-weight: 600; font-size: 13px; } .kv dd { margin: 0; overflow-wrap: anywhere; }
.tline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: var(--s-4); }
.tline .it { position: relative; padding: 0 0 var(--s-3); font-size: 13.5px; line-height: 19px; }
.tline .it::before { content: ''; position: absolute; left: -23px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--green-2); border: 2px solid var(--surface); }
.tline .it small { display: block; color: var(--text-muted); font-size: 12px; }
.mini { font-size: 12.5px; line-height: 18px; color: var(--text-muted); }
.legend { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-k { background: var(--green); } .lg-o { background: #E0A030; }
.search-in { width: 100%; min-height: 46px; padding: 0 var(--s-4); border-radius: var(--r-full); border: 0; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 15px; margin-bottom: var(--s-3); }
.search-in:focus { outline: 2px solid var(--green-2); }
.secret { font: 700 18px/1.35 ui-monospace, Consolas, monospace; letter-spacing: .04em; padding: 10px 12px; background: var(--green-tint); border-radius: var(--r-md); word-break: break-all; user-select: all; margin: 6px 0 10px; }
.rtab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rtab td, .rtab th { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.rtab th { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.rtab input { width: 100%; min-height: 38px; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); }
.rtab .num { text-align: right; white-space: nowrap; }
.total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 17px; padding: var(--s-3) 4px 0; }
/* lembar (sheet) */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(20,35,25,0.38); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-md); padding: var(--s-2) var(--s-5) calc(var(--s-6) + var(--safe-b)); }
.sheet .grip { width: 40px; height: 5px; border-radius: var(--r-full); background: var(--border); margin: 0 auto var(--s-3); }
.sheet-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.sheet-head h2 { flex: 1; margin: 0; font-size: var(--fs-lg); line-height: 28px; }
.sheet-head .icon-btn { box-shadow: none; background: var(--surface-2); }
.sheet-foot { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); } .sheet-foot .btn { flex: 1; }
@media (min-width: 640px) { .sheet-bg { align-items: center; padding: var(--s-6); } .sheet { max-width: 560px; border-radius: var(--r-xl); padding: var(--s-6); } .sheet .grip { display: none; } }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); } .f2 > .field { min-width: 0; }
.pill.demo { background: #EDE7F6; color: #5B3F8C; }
.btn[hidden] { display: none; } .btn-block + .btn-block { margin-top: 8px; }

/* ---------- Hero foto (login & sambutan portal) ---------- */
.hero.photo { padding: 0; min-height: 0; }
.hero.photo::before { display: none; }
.hero.photo::after { z-index: 1; }
.hero.photo .hero-img { position: static; display: block; width: 100%; aspect-ratio: 3 / 2; max-height: 300px; object-fit: cover; }
.hero.photo .hero-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 64px var(--s-5) var(--s-5); text-align: center;
  background: linear-gradient(180deg, rgba(1,59,17,0) 0%, rgba(1,59,17,.78) 45%, rgba(1,59,17,.95) 100%); }
.hero.photo .brand-logo { width: 52px; height: 52px; margin: 0 auto 4px; display: block; }
.hero.photo .brand-name { font-size: 22px; line-height: 28px; }
.hero.photo .hero-tag { margin: 6px 0 0; font-size: var(--fs-sm); font-weight: 700; color: #E2F0D8; }
