/* AIM Swimming School — gaya aplikasi (mobile-first). Warna diambil dari referensi desain:
   navy gelap #011c36, biru aksen #0493fe, kartu putih, status hijau/merah/oranye. */
:root {
  --navy-950: #00101f;
  --navy-900: #011c36;
  --navy-800: #06284a;
  --navy-700: #0c3a6a;
  --blue-700: #0459b0;
  --blue-600: #0667cc;
  --blue-500: #0493fe;
  --blue-300: #6cc2ff;
  --blue-100: #e3f1ff;
  --bg: #edf3f9;
  --surface: #ffffff;
  --text: #0b1b2e;
  --muted: #4d5f77;
  --border: #d6e1ed;
  --green: #137a3a;
  --green-bg: #e3f6ea;
  --red: #bb2219;
  --red-bg: #fdecea;
  --orange: #9a4a06;
  --orange-bg: #fff2df;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(1, 28, 54, .06), 0 6px 18px rgba(1, 28, 54, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue Condensed", system-ui, sans-serif;
  --tabbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); }
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-600); text-underline-offset: 2px; }
a:hover { color: var(--blue-700); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; }
:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.text-danger { color: var(--red); }
.text-warn { color: var(--orange); }
.ic { width: 22px; height: 22px; flex: none; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn .ic { width: 20px; height: 20px; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--blue-700); border-color: #b9d3ee; }
.btn-secondary:hover { background: var(--blue-100); color: var(--blue-700); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #9a1b14; color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--red); border-color: #efb8b3; }
.btn-danger-outline:hover { background: var(--red-bg); color: var(--red); }
.btn-wa { background: #0b7a3d; color: #fff; }
.btn-wa:hover { background: #075c2d; color: #fff; }
.btn-link { background: none; border: 0; padding: 8px 4px; color: var(--blue-600); font: inherit; text-decoration: underline; cursor: pointer; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.icon-btn { background: none; border: 0; color: inherit; padding: 8px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Formulir ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; margin: 0; min-width: 0; }
fieldset.field { border: 0; padding: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: 6px; }
label { font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); font-size: .875rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="search"], input[type="file"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--text);
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
}
input[type="file"] { padding: 9px; }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); outline: 3px solid rgba(4, 147, 254, .25); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--red) !important; }
.field-error { color: var(--red); font-size: .9rem; font-weight: 600; margin: 0; }
.hint { color: var(--muted); font-size: .875rem; margin: 0; }
.check, .check-block { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input, .check-block input, .role-opt input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--blue-600); }
.check-block { padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.check-block small, .role-opt small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.role-grid { display: grid; gap: 8px; }
.role-opt { display: flex; gap: 10px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: #fff; }
.role-opt:has(input:checked), .check-block:has(input:checked) { border-color: var(--blue-500); background: var(--blue-100); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-toggle[aria-pressed="true"] { color: var(--blue-600); }
.code-input { font-size: 1.5rem !important; letter-spacing: .25em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.grid-2 { display: grid; gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-inline input[type="file"] { flex: 1 1 200px; }
.js [data-hidden="1"] { display: none; }

/* ---------- Pesan ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 550; }
.flash .ic { margin-top: 1px; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }
.flash-info, .flash-warning { background: var(--orange-bg); color: var(--orange); }
.flash-info { background: var(--blue-100); color: var(--blue-700); }
.note { position: relative; padding: 12px 14px 12px 44px; border-radius: var(--radius-sm); background: var(--blue-100); color: #0b3f75; margin: 0 0 14px; }
.note > .ic { position: absolute; left: 13px; top: 13px; width: 20px; height: 20px; }
.note.warn { background: var(--orange-bg); color: var(--orange); }

/* ---------- Kartu & daftar ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.card-title .ic { color: var(--blue-600); }
.card-accent { border: 2px solid var(--blue-500); }
.card-link { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.card-link small { display: block; color: var(--muted); }
.card-link > span { flex: 1; }
.card-link .ic:first-child { color: var(--blue-600); }
.sub { font-size: .95rem; margin-top: 14px; color: var(--muted); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; flex: 1 1 auto; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; min-height: 44px; flex: 0 0 100%; }
.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { text-align: right; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0 0 16px; }
.card.list { padding: 4px 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.list li:last-child .list-item, .list li.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: #f6f9fd; }
.list-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list-main small { color: var(--muted); overflow-wrap: anywhere; }
.list-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); text-align: right; }
.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--blue-500), var(--navy-700)); color: #fff; font-weight: 700; font-size: .95rem; }
.avatar-sm { width: 34px; height: 34px; font-size: .8rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
.badge, .pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge { background: var(--blue-100); color: var(--blue-700); }
.badge-admin { background: var(--navy-900); color: #fff; }
.badge-staf { background: #e7e6fb; color: #3b2fa0; }
.badge-coach { background: var(--orange-bg); color: var(--orange); }
.badge-wali { background: var(--green-bg); color: var(--green); }
.badge-murid { background: var(--blue-100); color: var(--blue-700); }
.pill-ok { background: var(--green-bg); color: var(--green); }
.pill-warn { background: var(--orange-bg); color: var(--orange); }
.pill-muted { background: #e8edf3; color: #3e4c5e; }
.pill-info { background: var(--blue-100); color: var(--blue-700); }
.profile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile > div { flex: 1; min-width: 160px; }
.profile h1, .profile h2 { margin: 0 0 4px; }
.empty { text-align: center; padding: 22px 12px; }
.empty-ic { width: 44px; height: 44px; margin: 0 auto 8px; color: var(--blue-500); }
.empty p { margin-bottom: 4px; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 0; font-size: .92rem; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed small { display: block; color: var(--muted); }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--green); }
.cat-keamanan { background: var(--blue-500); }
.cat-pengaturan { background: #d97706; }
.link-more { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; font-weight: 600; text-decoration: none; }
.link-more .ic { width: 18px; height: 18px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ticks li { display: flex; gap: 8px; align-items: center; }
.ticks .ic { color: var(--green); width: 18px; height: 18px; }
.steps { padding-left: 1.3rem; margin: 0 0 14px; display: grid; gap: 6px; }
.menu-list { padding: 4px 0; }
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a > span { flex: 1; }
.menu-list small { display: block; color: var(--muted); }
.menu-list a .ic:first-child { color: var(--blue-600); }
.action-list { display: grid; gap: 10px; }
.danger-zone summary { cursor: pointer; font-weight: 650; display: flex; gap: 8px; align-items: center; min-height: 32px; }
.danger-zone[open] summary { margin-bottom: 10px; }
.status-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-box { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-box input { font-size: .9rem; }
.logo-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.logo-preview { width: 160px; height: auto; border-radius: 12px; background: var(--navy-900); }
.logo-row > div { flex: 1 1 240px; }

/* ---------- Beranda ---------- */
.hero-card {
  color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 14px; display: grid; gap: 12px;
  background: linear-gradient(100deg, rgba(1, 28, 54, .96) 0%, rgba(1, 28, 54, .82) 55%, rgba(4, 89, 176, .55) 100%), url("img/hero-pool.jpg") right center / cover no-repeat, var(--navy-900);
}
.hero-card h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: .01em; margin: 0; }
.hero-card p { margin: 0; color: #d6e8f8; }
.kicker { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 700; color: var(--blue-300) !important; margin: 0 0 4px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--text) !important; font-weight: 650; padding: 8px 12px; border-radius: 10px; justify-self: start; }
.date-chip .ic { color: var(--blue-600); width: 20px; height: 20px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 2px; color: var(--text); text-decoration: none; }
.stat strong { font-size: 1.7rem; line-height: 1.1; }
.stat > span:last-child { color: var(--muted); font-size: .88rem; }
.stat-ic { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; margin-bottom: 6px; }
.stat-ic .ic { width: 20px; height: 20px; }
.ic-blue { background: var(--blue-100); color: var(--blue-600); }
.ic-green { background: var(--green-bg); color: var(--green); }
.ic-orange { background: var(--orange-bg); color: #b45309; }
.ic-red { background: var(--red-bg); color: var(--red); }
.stats + .hint { margin-bottom: 14px; }
.hero-card + .stats + .hint + .btn { margin-bottom: 16px; }
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.roadmap li { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600; color: var(--muted); }
.roadmap li span { flex: 1; }
.phase-tag { font-size: .72rem; font-weight: 700; background: #e8edf3; color: #3e4c5e; padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.roadmap .ic { width: 20px; height: 20px; color: var(--blue-500); }

/* ---------- Filter, tabel, halaman ---------- */
.filters { display: grid; gap: 8px; margin-bottom: 10px; }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { padding-left: 42px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-row .btn { grid-column: 1 / -1; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.table-wrap { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; background: #f3f7fb; color: var(--muted); font-weight: 650; padding: 10px 12px; }
.table td[data-label="IP"], .table td[data-label="Waktu"] { white-space: nowrap; }
.table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.changes summary { cursor: pointer; color: var(--blue-600); font-size: .85rem; margin-top: 4px; }
.changes ul { margin: 6px 0 0; padding-left: 1.1rem; font-size: .85rem; }

/* ---------- 2FA ---------- */
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.qr svg { width: 220px; height: 220px; }
.secret { display: inline-block; font-size: 1.05rem; letter-spacing: .06em; background: #f3f7fb; padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.manual-key summary { cursor: pointer; color: var(--blue-600); font-weight: 600; min-height: 32px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-left: 1.6rem; margin: 0 0 14px; }
.codes code { font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; }

/* ---------- Kerangka aplikasi (HP) ---------- */
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); background: linear-gradient(90deg, var(--navy-950), var(--navy-800)); color: #fff; }
.brand-sm { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: 1rem; min-width: 0; }
.brand-sm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sm img { width: 46px; height: 36px; object-fit: contain; border-radius: 6px; }
.main { padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); max-width: 960px; margin: 0 auto; outline: none; }
.app-footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 12px 0 0; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(1, 28, 54, .08); padding-bottom: env(safe-area-inset-bottom); }
.tab, .tab-more { flex: 1; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabbar-h); color: #5a6b80; text-decoration: none; font-size: .74rem; font-weight: 650; cursor: pointer; list-style: none; }
.tab::-webkit-details-marker { display: none; }
.tab.active { color: var(--blue-600); }
.tab.active .ic { stroke-width: 2.2; }
.tab-more { position: relative; }
.more-sheet { position: absolute; right: 8px; bottom: calc(100% + 8px); width: min(280px, calc(100vw - 16px)); background: #fff; border-radius: var(--radius); box-shadow: 0 10px 34px rgba(1, 28, 54, .25); padding: 6px; display: grid; }
.more-link { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 48px; border-radius: 10px; color: var(--text); text-decoration: none; font: inherit; font-weight: 600; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.more-link:hover { background: var(--blue-100); }
.more-link .ic { color: var(--blue-600); }
.more-link.danger, .more-link.danger .ic { color: var(--red); }
.logout-mobile { margin-bottom: 16px; }

/* ---------- Halaman masuk ---------- */
body.auth { min-height: 100vh; background: radial-gradient(120% 70% at 50% 0%, #0b3a6e 0%, var(--navy-900) 45%, var(--navy-950) 100%); color: var(--text); }
.auth-hero { position: fixed; inset: 0 0 auto 0; height: 46vh; background: linear-gradient(180deg, rgba(1, 28, 54, .35), var(--navy-900) 95%), url("img/hero-pool.jpg") center 30% / cover no-repeat; opacity: .55; pointer-events: none; }
.auth-wrap { position: relative; max-width: 440px; margin: 0 auto; padding: 24px 16px 32px; }
.auth-brand { text-align: center; margin-bottom: 14px; }
.auth-brand img { width: 200px; height: auto; margin: 0 auto 6px; border-radius: 16px; }
.auth-brand .kicker { margin: 0; }
.auth-card { background: #fff; border-radius: 18px; padding: 22px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.auth-card .form { margin: 16px 0 10px; }
.auth-title { font-size: 1.45rem; margin-bottom: 4px; }
.auth-foot { text-align: center; color: #b8cde3; font-size: .85rem; margin-top: 18px; }

/* ---------- Layar lebar ---------- */
@media (min-width: 600px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .roadmap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .role-grid { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr auto; align-items: center; }
  .filter-row { grid-template-columns: auto auto auto; }
  .filter-row .btn { grid-column: auto; }
  .hero-card { grid-template-columns: 1fr auto; align-items: end; padding: 26px; }
  .back { flex: 0 0 auto; }
}
@media (max-width: 599px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 10px 14px; border-top: 1px solid var(--border); }
  .table td { border: 0; padding: 2px 0; }
  .table td[data-label="Waktu"], .table td[data-label="IP"] { color: var(--muted); font-size: .82rem; }
}
@media (min-width: 960px) {
  body.app { display: grid; grid-template-columns: 264px 1fr; }
  .topbar, .tabbar, .logout-mobile { display: none; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--navy-950), var(--navy-900) 60%, var(--navy-800)); color: #fff; padding: 18px 14px; }
  .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 6px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 12px; }
  .brand img { width: 56px; height: 44px; object-fit: contain; border-radius: 8px; }
  .brand strong { display: block; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; line-height: 1.1; }
  .brand small { display: block; color: var(--blue-300); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
  .sidebar nav { display: grid; gap: 4px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #cfe0f2; text-decoration: none; font-weight: 600; }
  .side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .side-link.active { background: var(--blue-600); color: #fff; }
  .side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
  .side-user-text { flex: 1; min-width: 0; }
  .side-user-text strong, .side-user-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user-text small { color: #9fb6cf; font-size: .78rem; }
  .main { padding: 28px 32px 40px; width: 100%; }
  .auth-wrap { padding-top: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Cetak (kode cadangan) ---------- */
@media print {
  .sidebar, .topbar, .tabbar, .app-footer, .page-head, .btn-row, .flash, .card:not(.codes-card), form, details { display: none !important; }
  body.app { display: block; background: #fff; }
  .codes-card { box-shadow: none; border: 1px solid #000; }
}

/* ---------- Fase 2: operasional ---------- */
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; font-style: normal; line-height: 1; }
.side-link .count { margin-left: auto; }
.tab-ic { position: relative; display: inline-flex; }
.tab-ic .count { position: absolute; top: -6px; right: -10px; }
.bell { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; color: #fff; border-radius: 12px; }
.bell:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.bell .count { position: absolute; top: 4px; right: 2px; }
.fab { position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-600); color: #fff; box-shadow: 0 8px 20px rgba(6, 103, 204, .4); }
.fab:hover { background: var(--blue-700); color: #fff; }
.badge-grup { background: var(--blue-100); color: var(--blue-700); }
.badge-privat { background: #ede7fb; color: #4b2aa0; }
.pill-danger { background: var(--red-bg); color: var(--red); }
.sess { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.sess strong { color: var(--text); font-size: 1rem; }
.sess.low strong { color: var(--red); }
.when { display: grid; text-align: center; min-width: 54px; line-height: 1.2; }
.when strong { font-size: .95rem; }
.when small { color: var(--muted); font-size: .78rem; }
.session.cancelled, .list-item.cancelled, .cur-row.cancelled { opacity: .6; }
.h-sm { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-when { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text); }
.session-when .ic { color: var(--blue-600); width: 20px; height: 20px; }
.section-title { font-size: 1.1rem; margin: 18px 2px 10px; }
.day-title { font-size: 1rem; margin: 16px 2px 8px; color: var(--muted); font-weight: 650; }
.stack-sm { margin-bottom: 16px; }
.stack-sm .btn { flex: 1 1 200px; }
.sub-form { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.w-sm { max-width: 110px; }
.form-inline.wrap input[type="text"] { flex: 1 1 160px; width: auto; }
.btn-col { display: grid; gap: 2px; justify-items: end; }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.link-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini { margin-top: 8px; }
.mini summary { cursor: pointer; color: var(--blue-600); font-weight: 600; font-size: .9rem; min-height: 32px; display: flex; align-items: center; }
.mini[open] summary { margin-bottom: 8px; }

/* Minggu & jadwal */
.week { display: flex; align-items: center; gap: 4px; padding: 8px; }
.week-nav { display: grid; place-items: center; width: 36px; height: 44px; border-radius: 10px; color: var(--blue-600); flex: none; }
.week-days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.day { display: grid; justify-items: center; gap: 1px; padding: 6px 0; border-radius: 12px; color: var(--text); text-decoration: none; min-height: 56px; }
.day small { font-size: .72rem; color: var(--muted); }
.day strong { font-size: 1.05rem; }
.day.today strong { color: var(--blue-600); }
.day.active { background: var(--blue-600); color: #fff; }
.day.active small { color: #d8ebff; }
.day.active.today strong { color: #fff; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-500); }
.day.active .dot { background: #fff; }
.dot.none { visibility: hidden; }
.filter-inline { margin-bottom: 8px; }

/* Absensi */
.att { padding: 12px 0; border-bottom: 1px solid var(--border); }
.att:last-of-type { border-bottom: 0; }
.att-head { display: flex; align-items: center; gap: 10px; }
.att-head a { color: var(--text); text-decoration: none; }
.att-form { display: grid; gap: 8px; margin-top: 10px; }
.att-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.att-btn { display: grid; justify-items: center; gap: 2px; min-height: 64px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid var(--border); background: #fff; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--muted); }
.att-btn .ic { width: 24px; height: 24px; }
.att-btn.ok { color: var(--green); }
.att-btn.warn { color: #b45309; }
.att-btn.danger { color: var(--red); }
.att-btn.ok.on { background: #15803d; border-color: #15803d; color: #fff; }
.att-btn.warn.on { background: #d97706; border-color: #d97706; color: #fff; }
.att-btn.danger.on { background: var(--red); border-color: var(--red); color: #fff; }

/* Daftar sesi murid */
.sched-list { list-style: none; padding: 0; margin: 0; }
.sched-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sched-list li:last-child { border-bottom: 0; }
.sched-list .when { text-align: left; min-width: 82px; }
.sched-list .what { flex: 1; min-width: 0; display: grid; }
.sched-list .what small { color: var(--muted); }

/* Kemampuan & batang progres */
.skills { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.skills li { display: grid; grid-template-columns: minmax(110px, 1fr) 1.3fr 44px; align-items: center; gap: 10px; font-size: .92rem; }
.skills strong { text-align: right; }
.bar { display: block; height: 10px; border-radius: 999px; background: #e3eaf2; overflow: hidden; min-width: 60px; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.tone-ok { background: #22a35a; }
.tone-mid { background: #f2b01e; }
.tone-low { background: #ef4444; }
.w-0 { width: 0; } .w-10 { width: 10%; } .w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; } .w-100 { width: 100%; }

/* Paket */
.pkg { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.pkg-aktif { border-color: #9fd3b4; }
.pkg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pkg p { margin: 4px 0; }
.pkg .bar { margin: 8px 0 4px; }
.ledger { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .9rem; }
.ledger li { display: flex; gap: 10px; }
.ledger small { display: block; color: var(--muted); }
.delta { min-width: 36px; font-weight: 800; text-align: right; }
.delta.plus { color: var(--green); }
.delta.minus { color: var(--red); }

/* Portal */
.child-head { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.child-name { font-size: 1.15rem; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 4px; text-align: center; }
.mini-stats div { background: #f3f7fb; border-radius: 10px; padding: 8px 4px; display: grid; }
.mini-stats strong { font-size: 1.3rem; }
.mini-stats span { font-size: .72rem; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.chip { flex: none; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; background: #fff; border: 1.5px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; }
.chip.on { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #e3eaf2; border-radius: 12px; }
.seg-nav { margin-bottom: 12px; }
.seg-opt { display: grid; place-items: center; min-height: 44px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 650; cursor: pointer; position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-opt.on, .seg-opt:has(input:checked) { background: #fff; color: var(--blue-700); box-shadow: var(--shadow); }
.seg-opt:has(input:focus-visible) { outline: 3px solid var(--blue-500); }
.summary-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slot.mine { background: #f2fbf5; }
.list-item.slot form { flex: none; }

/* Kelas */
.day-picks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pick { position: relative; display: grid; place-items: center; min-height: 44px; border: 1.5px solid var(--border); border-radius: 10px; font-weight: 650; cursor: pointer; background: #fff; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick:has(input:checked) { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.pick:has(input:focus-visible) { outline: 3px solid var(--blue-500); }

/* Kurikulum & evaluasi */
.cur-row { border-bottom: 1px solid var(--border); padding: 8px 0; }
.cur-row summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cur-row form { margin-top: 8px; }
.order { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--blue-100); color: var(--blue-700); font-weight: 700; font-size: .8rem; }
.eval-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.eval-row label small { display: block; color: var(--muted); font-weight: 400; }
.eval-inputs { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }

/* Grafik kehadiran mingguan */
.weekbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 130px; }
.wb { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; }
.wb-n { font-size: .78rem; font-weight: 700; color: var(--muted); }
.wb-bar { width: 70%; max-width: 30px; align-self: end; border-radius: 6px 6px 2px 2px; background: var(--blue-500); min-height: 3px; }
.wb small { font-size: .72rem; color: var(--muted); }
.wb.today .wb-bar { background: var(--navy-800); }
.wb.today small { color: var(--text); font-weight: 700; }
.h-0 { height: 3px; } .h-10 { height: 10%; } .h-20 { height: 20%; } .h-30 { height: 30%; } .h-40 { height: 40%; } .h-50 { height: 50%; }
.h-60 { height: 60%; } .h-70 { height: 70%; } .h-80 { height: 80%; } .h-90 { height: 90%; } .h-100 { height: 100%; }

/* Notifikasi & saklar */
.list-item.unread { background: #f2f8ff; }
.ic-muted { background: #eef2f6; color: #8394a8; }
.switch.disabled { opacity: .6; cursor: not-allowed; }
@media (min-width: 960px) { .fab { bottom: 28px; right: 28px; } }
.stats + .btn, .stats + .hint + .btn { margin-bottom: 16px; }

/* ---------- v0.3 SiniRenang ---------- */
.auth-brand .platform-logo { width: 150px; background: #fff; padding: 14px; border-radius: 24px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
.school-pick { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.school-pick.current { background: var(--blue-100); }
.center-block { justify-content: center; }
.brand-sm img, .brand img { background: #fff; padding: 2px; }

/* ---------- Fase 3: keuangan & laporan ---------- */
.stats-1 { grid-template-columns: minmax(0, 1fr) !important; }
.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 599px) { .stats-3 { grid-template-columns: minmax(0, 1fr) !important; } }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat strong.money { font-size: clamp(1.05rem, 4.6vw, 1.5rem); }
.money-col { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.money-col small { color: var(--muted); }
.text-ok { color: var(--green); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pre { white-space: pre-line; margin: 0; }
.proof { display: inline-block; margin: 8px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.proof img { display: block; width: 120px; height: 160px; object-fit: cover; }
.pay-line { margin: 6px 0; font-size: .92rem; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.is-disabled { opacity: .4; pointer-events: none; }
.is-void strong, .is-void .money-col strong { text-decoration: line-through; color: var(--muted); }
details.mini > summary { cursor: pointer; font-size: .82rem; color: var(--red); list-style: none; }
details.mini > summary::-webkit-details-marker { display: none; }
details.mini[open] { min-width: 200px; }
.seg-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.seg-tabs a { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.seg-tabs a.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.table-wrap { overflow-x: auto; }
@media (max-width: 599px) {
  .table-plain { display: table !important; min-width: 520px; }
  .table-plain thead { display: table-header-group !important; }
  .table-plain tbody { display: table-row-group !important; }
  .table-plain tr { display: table-row !important; padding: 0; }
  .table-plain th, .table-plain td { display: table-cell !important; padding: 8px 10px !important; border-top: 1px solid var(--border) !important; }
}
/* Dokumen cetak (tagihan/kwitansi) */
body.print-page { background: #e9eef4; margin: 0; color: #111; font-family: var(--font); }
.doc { max-width: 720px; margin: 24px auto; background: #fff; padding: 32px; border-radius: 12px; box-shadow: var(--shadow); }
.doc-head { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid #111; padding-bottom: 14px; }
.doc-head img { width: 72px; height: 56px; object-fit: contain; }
.doc-head div { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.doc-school { font-size: 1.2rem; }
.doc-title { letter-spacing: .12em; font-size: 1.4rem; margin: 22px 0 12px; }
.doc-void { color: var(--red); font-weight: 700; }
.doc-meta th { text-align: left; padding: 3px 18px 3px 0; color: #444; font-weight: 600; }
.doc-meta td { padding: 3px 0; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.doc-table th, .doc-table td { padding: 9px 6px; border-bottom: 1px solid #ccc; text-align: left; }
.doc-table thead th { border-bottom: 2px solid #111; }
.doc-stamp { display: inline-block; margin-top: 20px; padding: 6px 18px; border: 3px solid var(--green); color: var(--green); font-weight: 800; letter-spacing: .2em; transform: rotate(-4deg); }
.doc-bank { margin-top: 20px; }
.doc-foot { margin-top: 28px; font-size: .78rem; color: #666; }
.doc-actions { margin-top: 20px; }
@media (max-width: 599px) { .doc { margin: 0; border-radius: 0; padding: 20px 16px; } }
@media print {
  body.print-page { background: #fff; }
  .doc { box-shadow: none; margin: 0; max-width: none; padding: 0; }
  .no-print { display: none !important; }
}
