/*
 * Presendika web app (/app): untuk guru, petugas, dan orang tua di HP, termasuk iPhone
 * yang memasangnya ke layar utama. Gaya sengaja sederhana dan besar supaya mudah diketuk.
 */
:root {
    --navy: #01377A; --blue: #0169B4; --blue-dark: #01569A; --teal: #02CDCD;
    --ink: #0F2747; --text: #334155; --muted: #5A6B80; --line: #E2E8F0; --bg: #F4F7FB; --white: #FFFFFF;
    --h: #16A34A; --t: #D97706; --i: #7C3AED; --s: #0891B2; --a: #DC2626;
    --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5; }
a { color: var(--blue); }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.25; }
p { margin: 0; }
button { font: inherit; }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.app-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-top)) 16px 10px; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.app-bar__logo { height: 30px; }
.app-bar__back { font-size: 24px; text-decoration: none; color: var(--ink); padding: 0 6px; }
.app-bar__title { flex: 1; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar__avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 700; text-decoration: none; }
.app-main { flex: 1; padding: 16px 16px calc(96px + var(--safe-bottom)); display: grid; gap: 14px; align-content: start; }
.tab-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); z-index: 10; }
.tab-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tab-bar a svg { width: 24px; height: 24px; }
.tab-bar a.active { color: var(--blue); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.card--hero { border: 0; color: #DCEAF8; background: linear-gradient(135deg, var(--navy), var(--blue) 70%, #0291B8); }
.card--hero h1, .card--hero h2 { color: #fff; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8193A8; }
.card--hero .eyebrow { color: rgba(255,255,255,.75); }
.muted { color: var(--muted); font-size: 14px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:active { background: var(--blue-dark); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--light { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); }
.btn--sm { width: auto; padding: 9px 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; }
.google-btn { min-height: 44px; display: flex; justify-content: center; }

.field { display: grid; gap: 6px; align-content: start; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink); }
.field input, .field select { width: 100%; height: 50px; padding: 12px 14px; border: 1px solid #CBD5E1; border-radius: 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.field input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.error { color: #B42318; font-size: 14px; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; color: #8193A8; font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #F1F5F9; color: #475569; }
.status--1 { background: #DCF5E8; color: #15803D; }
.status--2 { background: #FFF1DB; color: #B45309; }
.status--3 { background: #EFE7FD; color: #6D28D9; }
.status--4 { background: #DDF5FA; color: #0E7490; }
.status--5 { background: #FDE3E3; color: #B91C1C; }

.child { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.child__avatar { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #E6F1FB; color: var(--blue); font-weight: 800; font-size: 20px; flex: none; }
.child__name { font-weight: 700; color: var(--ink); }
.child__body { flex: 1; min-width: 0; }

.checkin { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; text-decoration: none; }
.checkin small { font-size: 13px; opacity: .85; }
.checkin__icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.checkin > span:nth-child(2) { flex: 1; }
.checkin--done { background: #E8F7EF; color: #0E5A32; }
.checkin--done .checkin__icon { background: var(--h); }
.checkin--todo { background: #FFF4E5; color: #7A4A00; border: 1px solid #FAD9A6; }
.checkin--todo .checkin__icon { background: var(--t); }
.meter { height: 10px; border-radius: 999px; background: #EEF2F7; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--h)); }
.mini-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mini-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-stats > div { display: grid; gap: 2px; padding: 10px 6px; border-radius: 12px; background: #F6F8FB; text-align: center; }
.mini-stats b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 11px; color: var(--muted); line-height: 1.25; }
.mini-stats .t b { color: var(--t); } .mini-stats .i b { color: var(--i); } .mini-stats .a b { color: var(--a); }
.ring { --p: 0; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--h) calc(var(--p) * 1%), #EEF2F7 0); }
.ring b { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 13px; color: var(--ink); }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: #F6F8FB; font-size: 13px; font-weight: 600; color: var(--ink); }
.person .status { padding: 2px 7px; font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid #BFDBF5; background: #EEF6FD; color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; }
.chip--done { border-color: #BDE5CC; background: #E8F7EF; color: #0E5A32; }
.watch { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: #FDF2F2; font-size: 14px; color: var(--ink); }
.kid { display: grid; gap: 14px; }
.kid__head { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.kid__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.today { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; }
.today__icon { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 800; background: rgba(255,255,255,.7); }
.today__title { display: block; font-size: 17px; font-weight: 800; line-height: 1.3; }
.today__sub { display: block; margin-top: 2px; font-size: 14px; line-height: 1.4; }
.today--ok { background: #E3F6EA; color: #0E5A32; }
.today--ok .today__icon { background: var(--h); color: #fff; }
.today--late { background: #FFF2DE; color: #7A4300; }
.today--late .today__icon { background: var(--t); color: #fff; }
.today--sick { background: #DDF3F8; color: #0B4F60; }
.today--leave { background: #F0E9FD; color: #4C1D95; }
.today--absent { background: #FDE6E6; color: #8A1C1C; }
.today--absent .today__icon { background: var(--a); color: #fff; }
.today--wait { background: #EEF4FB; color: #0B3F73; }
.today--off { background: #F1F5F9; color: #334155; }
.alert-lessons { padding: 12px 14px; border-radius: 12px; background: #FDF2F2; border: 1px solid #F6CFCF; color: #7F1D1D; font-size: 14px; }
.alert-lessons ul { margin: 6px 0 0; padding-left: 18px; }
.leave-pill { padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.leave-pill--pending { background: #FFF7E6; color: #7A4A00; }
.leave-pill--approved { background: #E8F7EF; color: #0E5A32; }
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.week__day { display: grid; gap: 4px; text-align: center; }
.week__dow { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.week__day--today .week__dow { color: var(--blue); font-weight: 800; }
.week__box { display: grid; place-items: center; height: 38px; border-radius: 10px; font-weight: 800; font-size: 15px; background: #F1F5F9; color: #94A3B8; }
.week__day--today .week__box { outline: 2px solid var(--blue); outline-offset: 1px; }
.week__box--1 { background: #DCF5E8; color: #15803D; }
.week__box--2 { background: #FFF1DB; color: #B45309; }
.week__box--3 { background: #EFE7FD; color: #6D28D9; }
.week__box--4 { background: #DDF5FA; color: #0E7490; }
.week__box--5 { background: #FDE3E3; color: #B91C1C; }
.kid__month { display: flex; align-items: center; gap: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.counts { display: flex; flex-wrap: wrap; gap: 6px; }
.counts__item { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 9px; border-radius: 999px; background: #F6F8FB; font-size: 12px; color: var(--muted); }
.counts__item b { font-size: 15px; color: var(--ink); }
.counts__item--T b { color: var(--t); } .counts__item--I b { color: var(--i); } .counts__item--S b { color: var(--s); } .counts__item--A b { color: var(--a); }
.kid__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kid__actions .btn { width: 100%; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; }
.tile__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #E6F1FB; color: var(--blue); }
.tile__icon svg { width: 24px; height: 24px; }
.tile small { font-weight: 500; color: var(--muted); }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.calendar__dow { font-size: 11px; font-weight: 700; color: #8193A8; }
.calendar__day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-size: 13px; font-weight: 700; background: #F8FAFC; color: #94A3B8; }
.calendar__day--1 { background: #DCF5E8; color: #15803D; }
.calendar__day--2 { background: #FFF1DB; color: #B45309; }
.calendar__day--3 { background: #EFE7FD; color: #6D28D9; }
.calendar__day--4 { background: #DDF5FA; color: #0E7490; }
.calendar__day--5 { background: #FDE3E3; color: #B91C1C; }
.calendar__day--today { outline: 2px solid var(--blue); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; text-align: center; }
.summary div { padding: 10px 4px; border-radius: 12px; background: #F8FAFC; }
.summary b { display: block; font-size: 20px; color: var(--ink); }
.summary span { font-size: 11px; color: var(--muted); }

.scan-result { min-height: 170px; display: grid; align-content: center; gap: 4px; padding: 20px; border-radius: 18px; border: 2px solid var(--line); background: #fff; transition: background .2s; }
.scan-result--success { background: #E8F7EF; border-color: #8FD6AE; color: #0E5A32; }
.scan-result--warning { background: #FFF5E0; border-color: #F3C46B; color: #7A4A00; }
.scan-result--danger { background: #FDECEC; border-color: #F1A5A5; color: #8A1C1C; }
.scan-result--muted { background: #F1F5F9; border-color: #CBD5E1; }
.scan-result__name { font-size: 26px; font-weight: 800; line-height: 1.2; }
.scan-result__status { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.reader { width: 100%; border-radius: 16px; overflow: hidden; background: #0F172A; }

.student { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.student:first-child { border-top: 0; }
.student__name { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.student__name small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.codes { display: flex; gap: 4px; }
.codes button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 800; font-size: 13px; color: var(--muted); cursor: pointer; }
.codes button.on-1 { background: var(--h); border-color: var(--h); color: #fff; }
.codes button.on-2 { background: var(--t); border-color: var(--t); color: #fff; }
.codes button.on-3 { background: var(--i); border-color: var(--i); color: #fff; }
.codes button.on-4 { background: var(--s); border-color: var(--s); color: #fff; }
.codes button.on-5 { background: var(--a); border-color: var(--a); color: #fff; }

.codes--radio label { position: relative; }
.codes--radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.codes--radio span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 800; font-size: 13px; color: var(--muted); cursor: pointer; }
.codes--radio input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 1px; }
.codes--radio input:checked + span.on-1 { background: var(--h); border-color: var(--h); color: #fff; }
.codes--radio input:checked + span.on-2 { background: var(--t); border-color: var(--t); color: #fff; }
.codes--radio input:checked + span.on-3 { background: var(--i); border-color: var(--i); color: #fff; }
.codes--radio input:checked + span.on-4 { background: var(--s); border-color: var(--s); color: #fff; }
.codes--radio input:checked + span.on-5 { background: var(--a); border-color: var(--a); color: #fff; }
.codes--radio input:disabled + span { opacity: .5; cursor: not-allowed; }
.field textarea { width: 100%; padding: 12px 14px; border: 1px solid #CBD5E1; border-radius: 12px; font: inherit; font-size: 16px; color: var(--ink); resize: vertical; }
.field textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.field input.file { height: auto; padding: 10px; font-size: 14px; color: var(--muted); }
.field input.file::file-selector-button { margin-right: 12px; padding: 9px 14px; border: 0; border-radius: 10px; background: #EEF6FD; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-align: center; font-weight: 700; color: var(--muted); cursor: pointer; }
.choice input:checked + span { border-color: var(--blue); background: #EEF6FD; color: var(--blue); }
.choice input:focus-visible + span { outline: 3px solid var(--teal); }
.preview { max-width: 100%; max-height: 260px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; }
.leave { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.leave:first-of-type { border-top: 0; }
.leave__top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.leave__title { font-weight: 700; color: var(--ink); }
.leave__reason { font-size: 14px; color: var(--text); }
.leave__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn--danger { background: #fff; color: #B42318; border-color: #F3C4C4; }
.badge-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--a); color: #fff; font-size: 12px; font-weight: 800; }
.profile-hero { display: flex; align-items: center; gap: 14px; }
.profile-hero__avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.45); color: #fff; font-size: 20px; font-weight: 800; }
.profile-hero__name { display: block; color: #fff; font-size: 18px; }
.profile-hero__meta { display: block; font-size: 13px; color: #DCEAF8; overflow-wrap: anywhere; }
.field input:disabled { background: #F4F7FB; color: var(--muted); }
.section-title { margin: 4px 0 0; font-size: 15px; font-weight: 800; color: var(--ink); }
.field__error { color: #B42318; font-size: 13px; }
.notice { padding: 14px 16px; border-radius: 14px; font-size: 14px; }
.notice--info { background: #EEF6FD; color: #0B3F73; }
.notice--warning { background: #FFF7E6; color: #7A4A00; }
.notice--success { background: #E8F7EF; color: #0E5A32; }
.notice--danger { background: #FDEEEE; color: #8A1C1C; }
.steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%); max-width: 520px; width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; z-index: 20; }
.auth { min-height: 100vh; display: grid; align-content: center; gap: 16px; padding: calc(24px + var(--safe-top)) 0 24px; }
.auth__logo { justify-self: center; display: block; padding: 6px; border-radius: 12px; }
.auth__logo img { height: 44px; display: block; }
.auth__logo:focus-visible, .auth__home:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.auth__home { justify-self: center; padding: 8px 12px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 10px; }
.auth__home:hover { color: var(--blue); }
.auth__legal { margin: 0; text-align: center; color: var(--muted); font-size: 12px; }
.auth h1 { font-size: 26px; }
