/* Portal Noori — gaya tampilan */
:root {
  --blue: #004AAD;
  --blue-d: #00347E;
  --blue-l: #E8EFFB;
  --gold: #FFBF00;
  --gold-d: #C99400;
  --gold-l: #FFF5D6;
  --bg: #F5F7FC;
  --card: #FFFFFF;
  --line: #E3E8F2;
  --ink: #13213C;
  --muted: #5F6B85;
  --ok: #17895A; --ok-l: #E4F5EC;
  --warn: #B07A12; --warn-l: #FCF1DA;
  --bad: #B83A3A; --bad-l: #FBE8E8;
  --accent: var(--blue);          /* warna kelas anak (diubah otomatis) */
  --r: 16px; --r-s: 10px;
  --sh: 0 1px 2px rgba(10,35,80,.05), 0 6px 20px rgba(10,35,80,.06);
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-size: 15px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
h1,h2,h3,h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; line-height: 1.55; }
a { color: var(--blue); }
button, input, select, textarea { font-family: inherit; font-size: 15px; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .76rem; }
.bold { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.stack-s > * + * { margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
@media (max-width: 640px) { .grid3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 22px; }
.boot img { width: 170px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--blue-l); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px calc(28px + var(--safe-b));
  background: radial-gradient(1200px 600px at 10% -10%, #FFF3C4 0%, transparent 60%), radial-gradient(900px 600px at 110% 110%, #DCE8FF 0%, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 430px; background: var(--card); border-radius: 24px; box-shadow: 0 24px 60px rgba(10,35,80,.12); padding: 30px 24px; }
.auth-card .logo { display: block; width: 150px; margin: 0 auto 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.auth-tabs button.on { background: var(--card); color: var(--blue); box-shadow: var(--sh); }
.auth-foot { margin-top: 18px; text-align: center; font-size: .85rem; color: var(--muted); }
.state-ico { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; font-size: 34px; background: var(--gold-l); }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #FBFCFE; outline: none; transition: border .15s, background .15s; }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); background: #fff; }
.field-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.field input, .field select, .input { min-width: 0; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-height: 46px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: .8rem; font-weight: 700; cursor: pointer; padding: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 18px; border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 700; font-size: .93rem; cursor: pointer; transition: transform .08s, background .15s, opacity .15s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-p { background: var(--blue); color: #fff; }
.btn-p:hover { background: var(--blue-d); }
.btn-g { background: var(--gold); color: #3A2A00; }
.btn-s { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-s:hover { background: var(--bg); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bad { background: #fff; color: var(--bad); border-color: #F0C9C9; }
.btn-bad.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-ghost { background: none; color: var(--blue); padding: 8px 10px; }
.btn-sm { padding: 7px 12px; font-size: .82rem; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: inherit; position: relative; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(0,0,0,.05); }
.dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E5484D; color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(245,247,252,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: calc(10px + env(safe-area-inset-top,0px)) 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .t-logo { height: 30px; }
.topbar .t-title { font-weight: 800; font-size: 1.05rem; }
.main { padding: 8px 16px calc(var(--nav-h) + 28px + var(--safe-b)); max-width: 820px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); font-size: .88rem; margin-top: 3px; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: var(--safe-b); height: calc(var(--nav-h) + var(--safe-b)); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 700; position: relative; }
.bottomnav a svg { width: 23px; height: 23px; }
.bottomnav a.on { color: var(--blue); }
.bottomnav a.on::before { content: ''; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.bottomnav .dot { top: 7px; right: calc(50% - 22px); }

.sidebar { display: none; }
@media (min-width: 1000px) {
  .shell.has-side { display: grid; grid-template-columns: 250px 1fr; }
  .shell.has-side .bottomnav { display: none; }
  .shell.has-side .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); padding: 20px 12px; overflow-y: auto; }
  .shell.has-side .main { padding-bottom: 40px; max-width: 1100px; }
  .shell.has-side .topbar .t-logo { display: none; }
}
.sidebar .s-logo { width: 130px; margin: 0 10px 18px; }
.sidebar .s-sec { font-size: .7rem; font-weight: 800; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 14px 12px 6px; }
.sidebar a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; position: relative; }
.sidebar a svg { width: 19px; height: 19px; color: var(--muted); }
.sidebar a:hover { background: var(--bg); }
.sidebar a.on { background: var(--blue-l); color: var(--blue); }
.sidebar a.on svg { color: var(--blue); }
.sidebar .pill-n { margin-left: auto; background: #E5484D; color: #fff; border-radius: 9px; font-size: .7rem; font-weight: 800; padding: 1px 7px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.li:last-child { border-bottom: 0; }
a.li:hover, .li.click:hover { background: #FAFBFE; cursor: pointer; }
.li .li-main { flex: 1; min-width: 0; }
.li .li-t { font-weight: 700; font-size: .95rem; }
.li .li-s { color: var(--muted); font-size: .82rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .e-ico { font-size: 34px; margin-bottom: 8px; }

/* Kartu anak (orang tua) */
.kid { position: relative; overflow: hidden; border-radius: 22px; padding: 20px; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #001a40)); box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 30%, transparent); }
.kid::after { content: ''; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.12); }
.kid::before { content: ''; position: absolute; right: 40px; bottom: -60px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,191,0,.25); }
.kid .k-av { width: 58px; height: 58px; border-radius: 18px; background: #fff; color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; flex: none; }
.kid .k-name { font-size: 1.3rem; font-weight: 800; }
.kid .k-sub { opacity: .9; font-size: .88rem; margin-top: 2px; }
.kid .k-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.kid .k-stat { background: rgba(255,255,255,.16); border-radius: 12px; padding: 9px 10px; }
.kid .k-stat b { display: block; font-size: 1.05rem; }
.kid .k-stat span { font-size: .72rem; opacity: .9; }

.av { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--blue); flex: none; font-size: .9rem; }
.av.sm { width: 32px; height: 32px; border-radius: 10px; font-size: .78rem; }

/* Statistik */
.stat { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.stat .s-n { font-size: 1.55rem; font-weight: 800; }
.stat .s-l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat.warn .s-n { color: var(--warn); }
.stat.bad .s-n { color: var(--bad); }

/* Quick actions */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick a { background: var(--card); border-radius: 16px; box-shadow: var(--sh); padding: 13px 6px 11px; text-align: center; text-decoration: none; color: var(--ink); font-size: .74rem; font-weight: 700; }
.quick a .q-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; margin: 0 auto 7px; }
.quick a .q-ico svg { width: 21px; height: 21px; }

/* Chips & badges */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-l); color: var(--ok); }
.chip.warn { background: var(--warn-l); color: var(--warn); }
.chip.bad { background: var(--bad-l); color: var(--bad); }
.chip.blue { background: var(--blue-l); color: var(--blue); }
.chip.gold { background: var(--gold-l); color: #8A6400; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: .82rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--blue); color: #fff; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 1.5px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: .82rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Toolbar */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; padding: 9px 12px; }
.toolbar .search { flex: 1; min-width: 160px; }

/* Laporan harian */
.dr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.dr .dr-i { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.dr .dr-i span { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.dr .dr-i b { font-size: .92rem; }
.dr .full { grid-column: 1 / -1; }
.mood { font-size: 1.6rem; }

/* Pilihan cepat (tombol) */
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 11px; font-weight: 600; font-size: .85rem; cursor: pointer; }
.opts button.on { border-color: var(--blue); background: var(--blue-l); color: var(--blue); }

/* Presensi */
.att-row { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .att-row { grid-template-columns: 1fr auto; } }
.att-row:last-child { border-bottom: 0; }
.att-btns { display: flex; gap: 6px; }
.att-btns button { flex: 1; min-width: 44px; height: 36px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: .78rem; cursor: pointer; color: var(--muted); }
.att-btns button.on.H { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-btns button.on.I { background: var(--blue); border-color: var(--blue); color: #fff; }
.att-btns button.on.S { background: var(--warn); border-color: var(--warn); color: #fff; }
.att-btns button.on.A { background: var(--bad); border-color: var(--bad); color: #fff; }
.att-times { display: flex; gap: 6px; margin-top: 6px; }
.att-times input { padding: 5px 8px; border: 1.5px solid var(--line); border-radius: 8px; font-size: .8rem; width: 98px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal .c-h { text-align: center; font-size: .7rem; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal .c-d { aspect-ratio: 1; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: .82rem; font-weight: 700; color: var(--muted); }
.cal .c-d.H { background: var(--ok-l); color: var(--ok); }
.cal .c-d.I { background: var(--blue-l); color: var(--blue); }
.cal .c-d.S { background: var(--warn-l); color: var(--warn); }
.cal .c-d.A { background: var(--bad-l); color: var(--bad); }
.cal .c-d.today { outline: 2px solid var(--gold); }
.cal .c-d.empty { background: none; }

/* Chat */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 150px - var(--nav-h) - var(--safe-b)); min-height: 360px; background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
@media (min-width: 1000px) { .shell.has-side .chat-wrap { height: calc(100vh - 150px); } }
.chat-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; background: #F3F6FB; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 82%; padding: 9px 12px 7px; border-radius: 16px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.05); align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 5px; }
.msg:not(.me) { border-bottom-left-radius: 5px; }
.msg .m-who { font-size: .72rem; font-weight: 800; color: var(--blue); margin-bottom: 2px; }
.msg.role-admin .m-who { color: #8A6400; }
.msg .m-t { font-size: .68rem; opacity: .7; text-align: right; margin-top: 3px; }
.msg .m-b { white-space: pre-wrap; word-break: break-word; line-height: 1.45; font-size: .93rem; }
.day-sep { align-self: center; font-size: .72rem; font-weight: 700; color: var(--muted); background: #E4E9F3; padding: 3px 10px; border-radius: 99px; margin: 8px 0; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; max-height: 120px; min-height: 44px; outline: none; line-height: 1.4; }
.chat-input textarea:focus { border-color: var(--blue); }
.chat-input .btn { height: 44px; width: 44px; padding: 0; border-radius: 14px; }
.monitor-note { background: var(--gold-l); color: #6E5000; font-size: .78rem; padding: 7px 12px; font-weight: 600; }

/* Tagihan */
.bill-total { border-radius: 20px; padding: 18px; background: linear-gradient(135deg, #13213C, #233a66); color: #fff; }
.bill-total .b-n { font-size: 1.7rem; font-weight: 800; margin: 4px 0; }
.inv { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.inv:last-child { border-bottom: 0; }
.inv .i-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.inv .i-amt { font-weight: 800; white-space: nowrap; }
.inv details { margin-top: 8px; }
.inv summary { cursor: pointer; font-size: .8rem; color: var(--blue); font-weight: 700; }
.bank { background: var(--gold-l); border-radius: 14px; padding: 14px; }
.bank .acct { font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; }
.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--ok); border-radius: 99px; }

/* Rapor */
.aspect { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.aspect:last-child { border-bottom: 0; }
.aspect .a-note { grid-column: 1 / -1; font-size: .86rem; color: var(--muted); }
.asp-edit { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }

/* Media */
.media-card { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--sh); text-decoration: none; color: inherit; }
.media-card + .media-card { margin-top: 10px; }
.media-card .m-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--gold-l); display: grid; place-items: center; flex: none; font-size: 22px; }
.media-main { background: linear-gradient(135deg, var(--gold), #FFD866); }

/* Notifikasi */
.notif { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.notif.unread { background: #F6F9FF; }
.notif.unread .n-t::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-left: 6px; vertical-align: middle; }
.notif .n-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 18px; background: var(--bg); }
.notif .n-t { font-weight: 700; font-size: .92rem; }
.notif .n-b { color: var(--muted); font-size: .84rem; margin-top: 2px; }

/* Banner */
.banner { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: 14px; background: var(--blue-l); color: var(--blue-d); margin-bottom: 12px; }
.banner.gold { background: var(--gold-l); color: #6E5000; }
.banner.bad { background: var(--bad-l); color: var(--bad); }
.banner .grow { font-size: .87rem; font-weight: 600; }

/* Tabel (admin) */
.tbl-wrap { overflow-x: auto; background: var(--card); border-radius: var(--r); box-shadow: var(--sh); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; }
.tbl th { text-align: left; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; background: #FAFBFE; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click:hover td { background: #FAFBFE; cursor: pointer; }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(12,22,44,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: up .2s ease-out; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; } .modal.wide { max-width: 760px; } }
.modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* Toast */
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top,0px)); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: .88rem; font-weight: 600; animation: up .2s; pointer-events: auto; cursor: pointer; }
.toast.ok { background: var(--ok); }
.toast.bad { background: var(--bad); }
.toast .t-t { font-weight: 800; }
.toast .t-b { font-weight: 500; opacity: .9; margin-top: 2px; }

.loading { padding: 40px; display: grid; place-items: center; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.section-t { font-size: .78rem; font-weight: 800; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin: 22px 0 10px; }
.class-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---------- Penyesuaian HP ---------- */
.av svg { width: 18px; height: 18px; }
.topbar .icon-btn svg { width: 24px; height: 24px; }
@media (max-width: 640px) {
  /* tabel admin menjadi kartu bertumpuk agar semua kolom & tombol terlihat */
  .tbl-wrap { overflow: visible; background: none; box-shadow: none; }
  table.tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr:first-child:has(th) { display: none; }
  .tbl tr { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 10px 14px; margin-bottom: 10px; }
  .tbl td { border: 0; padding: 5px 0; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; text-align: right; }
  .tbl td > * { text-align: right; }
  .tbl td::before { content: attr(data-l); font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; text-align: left; flex: none; padding-top: 2px; }
  .tbl td:first-child { font-size: 1rem; text-align: left; display: block; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; }
  .tbl td:first-child::before { display: none; }
  .tbl td[data-l=""]::before { display: none; }
  .tbl td.right { text-align: right; }
  .page-head .row .btn { flex: 1; }
  .toolbar .input:not(.search) { flex: 1; }
  .kv { grid-template-columns: 105px 1fr; }
}
