:root {
  --navy: #1F3864; --navy-2: #2B4A80; --navy-soft: #E8EDF5;
  --ink: #111827; --ink-2: #374151; --muted: #4B5563; --muted-2: #6B7280;
  --line: #E5E7EB; --line-2: #D1D5DB; --bg: #F4F5F7; --card: #FFFFFF;
  --merah: #991B1B; --merah-bg: #FEE2E2; --merah-line: #FCA5A5;
  --kuning: #92400E; --kuning-bg: #FEF3C7; --kuning-line: #FDE68A;
  --hijau: #166534; --hijau-bg: #DCFCE7; --hijau-line: #BBF7D0;
  --biru: #1E40AF; --biru-bg: #DBEAFE; --biru-line: #93C5FD;
  --ungu: #5B21B6; --ungu-bg: #EDE9FE;
  --abu-bg: #F3F4F6;
  --pink: #BE185D; --pink-bg: #FCE7F3;
  --r: 14px;
  --nav-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.4; }
body { min-height: 100vh; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
h1, h2, h3 { margin: 0; }
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
.app.tanpa-nav { padding-bottom: 24px; }

/* Header */
.hdr-biru { background: var(--navy); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 20px 22px; }
.hdr-biru .brand { font-size: 13px; font-weight: 600; letter-spacing: .06em; display: flex; justify-content: space-between; align-items: center; }
.hdr-biru h1 { font-size: 24px; font-weight: 700; margin-top: 8px; }
.hdr-biru p { margin: 2px 0 0; color: #D6DEEB; font-size: 14px; }
.hdr { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top)) 12px 8px 4px; display: flex; align-items: center; gap: 4px; min-height: 56px; }
.hdr h1 { font-size: 18px; font-weight: 700; flex: 1; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-ikon { width: 44px; height: 44px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 10px; flex-shrink: 0; }
.btn-akun { height: 36px; padding: 0 12px 0 4px; border: 1px solid var(--line); border-radius: 18px; background: #fff; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; position: relative; flex-shrink: 0; }
.hdr-biru .btn-akun { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; }
.avatar { width: 28px; height: 28px; border-radius: 14px; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.hdr-biru .avatar { background: #fff; color: var(--navy); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #DC2626; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.btn-akun .badge { position: absolute; top: -6px; right: -6px; }

/* Layout */
.isi { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec-judul { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sec-judul h2 { font-size: 16px; font-weight: 700; }
.kartu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kartu.p0 { padding: 0; overflow: hidden; }
.kartu h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.kartu-btn { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 5px; color: var(--ink); }
.kartu-btn:active, .baris:active { background: #F9FAFB; }
.baris { width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.baris:last-child { border-bottom: 0; }
.judul { font-size: 15px; font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); }
.kecil { font-size: 12px; color: var(--muted); }
.tebal { font-weight: 700; }
.angka { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.flex { display: flex; gap: 8px; align-items: center; }
.flex.antara { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.kolom { display: flex; flex-direction: column; gap: 8px; }
.pisah { height: 1px; background: var(--line); margin: 4px 0; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* Chip */
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--abu-bg); color: var(--muted); white-space: nowrap; }
.chip.merah { background: var(--merah-bg); color: var(--merah); }
.chip.kuning { background: var(--kuning-bg); color: var(--kuning); }
.chip.hijau { background: var(--hijau-bg); color: var(--hijau); }
.chip.biru { background: var(--biru-bg); color: var(--biru); }
.chip.ungu { background: var(--ungu-bg); color: var(--ungu); }
.chip.navy { background: var(--navy-soft); color: var(--navy); }
.chip.pink { background: var(--pink-bg); color: var(--pink); }

/* Tombol */
a.btn { text-decoration: none; }
.btn { height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn:disabled { opacity: .5; }
.btn.putih { background: #fff; color: var(--navy); border-color: var(--line-2); }
.btn.merah { background: #B91C1C; border-color: #B91C1C; }
.btn.hijau { background: #15803D; border-color: #15803D; }
.btn.wa { background: #1E9E63; border-color: #1E9E63; }
.btn.kecil { height: 38px; font-size: 13px; padding: 0 12px; width: auto; border-radius: 10px; }
.btn-link { border: 0; background: none; color: var(--navy); font-weight: 700; font-size: 13px; padding: 8px 0; min-height: 36px; }
.aksi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.aksi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; color: var(--ink); }
.aksi b { font-size: 14px; }
.aksi span { font-size: 12px; color: var(--muted); }
.aksi:disabled { opacity: .45; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .bantu { font-size: 12px; color: var(--muted); }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; padding: 12px; font-size: 16px; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.opsi { width: 100%; text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.opsi.on { border: 2px solid var(--navy); background: var(--navy-soft); padding: 11px 13px; }
.opsi b { font-size: 14px; }
.opsi span { font-size: 12px; color: var(--muted); }
.cek { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.cek input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.foto-pilih { border: 1.5px dashed var(--line-2); border-radius: 12px; background: #fff; min-height: 96px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 600; position: relative; overflow: hidden; padding: 12px; text-align: center; }
.foto-pilih input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-prev { display: flex; gap: 8px; flex-wrap: wrap; }
.foto-prev img, .thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--abu-bg); }
.thumb-btn { border: 0; padding: 0; background: none; }
.peringatan { background: var(--kuning-bg); border: 1px solid var(--kuning-line); color: var(--kuning); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.info { background: var(--navy-soft); border: 1px solid #C7D2E5; color: var(--navy); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.sukses { background: #ECFDF3; border: 1px solid var(--hijau-line); color: var(--hijau); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; }
.bahaya { background: var(--merah-bg); border: 1px solid var(--merah-line); color: var(--merah); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.kosong { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 12px; }

/* Bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav .dalam { max-width: 520px; margin: 0 auto; display: flex; height: var(--nav-h); }
.nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); font-size: 11px; font-weight: 600; position: relative; }
.nav button.on { color: var(--navy); }
.nav button .badge { position: absolute; top: 6px; left: 50%; margin-left: 6px; }

/* Tabs */
.tabs { display: flex; gap: 6px; background: var(--abu-bg); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; height: 38px; border: 0; border-radius: 9px; background: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 60; background: #111827; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); width: max-content; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: #991B1B; }

/* Sheet & viewer */
.lapis { position: fixed; inset: 0; z-index: 50; background: rgba(17,24,39,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.sheet h2 { font-size: 17px; }
.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .tutup { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; color: #fff; background: rgba(255,255,255,.15); border: 0; width: 44px; height: 44px; border-radius: 22px; font-size: 22px; }

/* Timeline */
.tl { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 52px 14px 1fr; gap: 8px; padding-bottom: 14px; position: relative; }
.tl-item .jam { font-size: 12px; color: var(--muted); text-align: right; padding-top: 1px; font-variant-numeric: tabular-nums; }
.tl-item .dot { width: 10px; height: 10px; border-radius: 5px; margin-top: 4px; background: #9CA3AF; position: relative; z-index: 1; }
.tl-item:not(:last-child)::after { content: ''; position: absolute; left: 64px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl-item b { font-size: 14px; display: block; }
.tl-item span { font-size: 12px; color: var(--muted); }

/* Bubble WA */
.bubble { background: #DCF8C6; border-radius: 10px; padding: 8px 10px; font-size: 13px; white-space: pre-wrap; word-break: break-word; align-self: flex-start; max-width: 100%; }
.bubble .w { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Progress */
.progress { height: 8px; background: var(--abu-bg); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--navy); border-radius: 4px; }
.progress.lewat > div { background: #DC2626; }

/* Jadwal */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; }
.tbl tr.we td:first-child { color: #DC2626; }
.tbl tr.we { background: #FDF2F8; }
.tbl tr.hari-ini { background: var(--biru-bg); }
.tbl tr.ubah td { background: #FFFBEB; }
.kal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.kal .h { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; padding: 2px 0; }
.kal .h.we { color: #DC2626; }
.kal button { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; color: var(--ink-2); }
.kal button .tg { font-size: 13px; font-weight: 700; color: var(--ink); }
.kal button.we { background: #FDF2F8; }
.kal button.we .tg { color: #DC2626; }
.kal button.ubah { background: #FFFBEB; border-color: var(--kuning-line); }
.kal button.hari-ini { border: 2px solid var(--biru); }
.kal button.kosong { visibility: hidden; }
.kal .merah { color: #DC2626; font-weight: 700; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; background: var(--navy); color: #fff; padding: calc(32px + env(safe-area-inset-top)) 20px 24px; max-width: 520px; margin: 0 auto; }
.login .brand { font-size: 13px; font-weight: 600; letter-spacing: .08em; opacity: .85; }
.login h1 { font-size: 26px; margin: 10px 0 4px; }
.login p { margin: 0; color: #D6DEEB; }
.login .panel { background: #fff; color: var(--ink); border-radius: 18px; padding: 18px 16px; margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.nama-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nama-grid button { height: 64px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 6px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 8px; border: 2px solid var(--navy); }
.pin-dots i.isi { background: var(--navy); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { height: 58px; border-radius: 14px; border: 1px solid var(--line); background: var(--abu-bg); font-size: 22px; font-weight: 600; }
.pinpad button.kosong { visibility: hidden; }

@media (min-width: 560px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
