/* SIAPIN v2 — mobile-first, tanpa framework, tanpa CDN (aman untuk offline/PWA) */
:root {
  --bg: #f3f5f9; --surface: #fff; --surface2: #f8fafc; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #1e3a5f; --brand-2: #2c5282; --brand-ink: #fff; --accent: #c9a227; --accent-ink: #1f1700;
  --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --info: #1d4ed8; --info-bg: #dbeafe; --violet: #6d28d9; --violet-bg: #ede9fe; --wa: #128c4a;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05);
  --side-w: 264px; --tab-h: 62px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #121b2e; --surface2: #17223a; --text: #e6edf7; --muted: #93a1b8; --line: #243049;
    --brand: #16294a; --brand-2: #1f3a66; --accent: #e0b93a;
    --ok: #4ade80; --ok-bg: #12301f; --warn: #fbbf24; --warn-bg: #3a2c0b; --bad: #f87171; --bad-bg: #3b1616;
    --info: #7cb0ff; --info-bg: #14264a; --violet: #b69cff; --violet-bg: #251a4a; --wa: #34d27b;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
h1, h2, h3, p { margin: 0; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.i { width: 1.2em; height: 1.2em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
[hidden] { display: none !important; }

/* ---------- kerangka ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: min(86vw, var(--side-w)); z-index: 50; display: flex; flex-direction: column;
  background: var(--brand); color: #e8eef8; transform: translateX(-102%); transition: transform .25s ease;
  padding-top: var(--safe-t); padding-bottom: var(--safe-b); padding-left: var(--safe-l);
}
.drawer-open .side { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.35); }
.backdrop { position: fixed; inset: 0; background: rgba(2,8,23,.5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-open .backdrop { opacity: 1; pointer-events: auto; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.side-brand img { border-radius: 10px; }
.side-brand b { display: block; font-size: 18px; letter-spacing: .5px; }
.side-brand small { display: block; font-size: 11px; opacity: .7; line-height: 1.25; }
.side-close { margin-left: auto; color: #fff; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-install { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #dbe5f5; text-decoration: none; font-weight: 500; }
.side-nav a:hover, .side-install:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.side-nav a.on { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-install { background: none; border: 0; cursor: pointer; font-size: inherit; text-align: left; margin-top: 8px; color: var(--accent); }
.side-h { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .55; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.12); }
.side-user .who { min-width: 0; flex: 1; }
.side-user b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { display: block; opacity: .65; font-size: 12px; }
.side-user .icon-btn { color: #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }

.main { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; padding: calc(8px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l)); min-height: 56px;
}
.top-title { font-size: 18px; font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; }
.top .icon-btn { color: #fff; }
.content { padding: 16px calc(14px + var(--safe-r)) calc(var(--tab-h) + var(--safe-b) + 22px) calc(14px + var(--safe-l)); max-width: 1180px; margin: 0 auto; display: grid; gap: 14px; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 35; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); box-shadow: 0 -4px 18px rgba(15,23,42,.08);
}
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tab-h); background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tabbar .i { width: 22px; height: 22px; }
.tabbar .on { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { .tabbar .on { color: var(--accent); } }

@media (min-width: 960px) {
  .side { transform: none; width: var(--side-w); box-shadow: none; }
  .app .side-close, .app .menu-btn, .app .tabbar, .app .backdrop { display: none; }
  .main { margin-left: var(--side-w); }
  .top { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line); padding-left: 24px; padding-right: 24px; min-height: 64px; }
  .top .icon-btn { color: var(--text); }
  .content { padding: 22px 24px 40px; gap: 18px; }
}

/* ---------- komponen dasar ---------- */
.icon-btn { background: none; border: 0; width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(127,127,127,.15); }
.icon-btn .i { width: 22px; height: 22px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--surface2); color: var(--text); white-space: nowrap; transition: transform .05s, filter .15s; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand-2); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { background: #2f5da3; } }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa.btn-outline { background: transparent; color: var(--wa); border-color: var(--wa); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.top .btn-primary { background: var(--accent); color: var(--accent-ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-h a { font-size: 13px; font-weight: 600; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 960px) { .grid2 { grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; } }

.hero { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: var(--radius); padding: 18px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; box-shadow: var(--shadow); }
.hero h2 { font-size: 22px; line-height: 1.2; }
.hero-sub { opacity: .8; } .hero-date { opacity: .85; font-size: 13px; margin-top: 4px; }
.hero-act { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: grid; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b { font-size: 32px; line-height: 1.1; color: var(--brand-2); }
@media (prefers-color-scheme: dark) { .stat b { color: var(--accent); } }
.stat small { color: var(--muted); font-size: 12px; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 14px; }
.flash .i { margin-top: 2px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.flash-bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.flash a { color: inherit; font-weight: 700; text-decoration: underline; }
ul.plain { margin: 6px 0; padding-left: 18px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 26px 12px; }
.empty .i { width: 34px; height: 34px; opacity: .55; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; justify-self: start; }

/* ---------- pill / chip ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.pill-info { background: var(--info-bg); color: var(--info); } .pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); } .pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-violet { background: var(--violet-bg); color: var(--violet); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.chip i, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
@media (prefers-color-scheme: dark) { .chip { color: color-mix(in srgb, var(--c) 60%, #fff); } }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- kartu agenda ---------- */
.ag-list { display: grid; gap: 10px; }
@media (min-width: 1100px) { .ag-list-wide { grid-template-columns: 1fr 1fr; } }
.ag { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--line)); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.ag.is-batal { opacity: .6; } .ag.is-batal .ag-title { text-decoration: line-through; }
.ag-date { display: grid; place-items: center; align-content: center; text-align: center; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-radius: 12px; color: var(--text); text-decoration: none !important; padding: 6px 0; min-height: 66px; }
.ag-date b { font-size: 22px; line-height: 1; } .ag-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--c); } .ag-date small { font-size: 11px; color: var(--muted); }
.ag-body { min-width: 0; display: grid; gap: 4px; align-content: start; }
.ag-title { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.ag-sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.ag-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.ag-meta span { display: inline-flex; gap: 5px; align-items: center; }
.ag-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.ag-act { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--line); }
.qs { flex: 1; min-width: 120px; max-width: 200px; min-height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); padding: 0 8px; font-size: 13px; }

/* ---------- filter ---------- */
.filter { display: grid; gap: 10px; }
.filter-main { display: flex; gap: 8px; }
.grow { flex: 1; }
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { flex: none; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.seg a.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.seg-wrap { flex-wrap: wrap; }
.more summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; padding: 4px 0; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.more summary::-webkit-details-marker { display: none; }
.more-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin: 10px 0; }
@media (min-width: 720px) { .more-grid { grid-template-columns: repeat(4, 1fr); } }
.more-act { display: flex; gap: 8px; }
.result-info { color: var(--muted); font-size: 13px; }

/* ---------- form ---------- */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span2 { grid-column: 1 / -1; } .form-grid.g4 { grid-template-columns: repeat(4, 1fr); } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field.two label > span { font-size: 13px; font-weight: 650; color: var(--muted); }
.field.two { grid-template-columns: 1fr 1fr; gap: 10px; }
.field.two label { display: grid; gap: 6px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.req { color: var(--bad); font-style: normal; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=tel], input[type=email], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); font-size: 16px; /* 16px: cegah zoom otomatis iOS */
}
textarea { resize: vertical; min-height: 84px; }
input[readonly] { opacity: .75; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand-2) 35%, transparent); border-color: var(--brand-2); }
input.color { padding: 4px; height: 46px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand-2); }
.form-act { display: flex; gap: 10px; flex-wrap: wrap; }
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-ic input { padding-left: 40px; }
.input-ic .icon-btn { position: absolute; right: 2px; }

/* ---------- detail ---------- */
.detail { border-top: 4px solid var(--c); display: grid; gap: 14px; }
.detail-h h2 { font-size: 22px; line-height: 1.25; margin: 8px 0 6px; overflow-wrap: anywhere; }
.detail-when { color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.dl { margin: 0; display: grid; }
.dl-row { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.dl-row dt { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dl-row dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 720px) { .dl-row { grid-template-columns: 170px 1fr; gap: 16px; } }
.dl-compact .dl-row { padding: 8px 0; }
.detail-act, .detail-edit { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.detail-edit { padding-top: 12px; border-top: 1px solid var(--line); }
.detail-edit form { margin: 0; }

/* ---------- WA rekap ---------- */
.wa-list { display: grid; gap: 10px; margin-top: 10px; }
.wa-row { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); border-left: 4px solid var(--c); }
.wa-who { display: flex; align-items: center; gap: 10px; }
.wa-who .dot { background: var(--c); }
.wa-who small { display: block; color: var(--muted); font-size: 12px; }
.wa-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- grafik ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .val { fill: var(--text); font-size: 10px; font-weight: 700; }
.bar-a { fill: var(--brand-2); } .bar-b { fill: var(--accent); }
@media (prefers-color-scheme: dark) { .bar-a { fill: #5b8def; } }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-a { background: var(--brand-2); } .lg-b { background: var(--accent); }

/* ---------- kalender ---------- */
.cal-bar { display: flex; align-items: center; gap: 6px; }
.cal-bar h2 { font-size: 18px; flex: 1; text-align: center; }
.cal-wrap { display: grid; gap: 14px; }
@media (min-width: 960px) { .cal-wrap { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.cal { padding: 10px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 58px; min-width: 0; border-radius: 10px; border: 1px solid transparent; background: var(--surface2); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 6px 2px 4px; cursor: pointer; position: relative; }
.cal-cell.is-empty { background: none; cursor: default; }
.cal-cell b { font-size: 14px; } .cal-cell small { font-size: 10px; color: var(--muted); font-weight: 700; }
.cal-cell.is-sun b { color: var(--bad); }
.cal-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.is-on { background: var(--brand-2); color: #fff; } .cal-cell.is-on small { color: #dbe5f5; }
.cal-cell.is-on.is-sun b { color: #fff; }
.dots { display: flex; gap: 3px; } .dots i { width: 6px; height: 6px; border-radius: 50%; }
.cal-events { display: grid; gap: 10px; }
.ev { border-left: 4px solid var(--c); background: var(--surface2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 3px; }
.ev a { font-weight: 700; color: var(--text); } .ev small { color: var(--muted); }

/* ---------- tabel & laporan ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.is-off td { opacity: .55; }
.row-act { white-space: nowrap; text-align: right; } .inline-form { display: inline; margin: 0; }
@media (max-width: 719px) {
  .tbl-users thead { display: none; }
  .tbl-users, .tbl-users tbody, .tbl-users tr, .tbl-users td { display: block; }
  .tbl-users tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl-users td { border: 0; padding: 3px 4px; display: flex; justify-content: space-between; gap: 12px; }
  .tbl-users td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 700; }
  .tbl-users .row-act { justify-content: flex-end; padding-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
}
.report { display: grid; gap: 14px; }
.report-h { display: flex; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 3px double var(--line); }
.report-h img { border-radius: 10px; } .report-h h2 { font-size: 20px; } .report-h small { letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.report-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.report-sum div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; }
.report-sum b { font-size: 22px; } .report-sum span { font-size: 12px; color: var(--muted); }
.report-f { font-size: 12px; color: var(--muted); text-align: right; }

.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.pg { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.pg.is-on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }

/* ---------- dialog, toast, tip ---------- */
.dlg { border: 0; border-radius: var(--radius); padding: 20px; width: min(92vw, 380px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.dlg::backdrop { background: rgba(2,8,23,.55); }
.dlg p { font-size: 16px; margin-bottom: 18px; }
.dlg-act { display: flex; gap: 10px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); transform: translateX(-50%); background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 99px; z-index: 90; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); max-width: 90vw; }
@media (min-width: 960px) { .toast { bottom: 24px; } }
.ios-tip { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 80; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px 12px 16px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); font-size: 14px; }
.login-body .ios-tip { bottom: calc(12px + var(--safe-b)); }

.remind { position: fixed; left: 12px; right: 12px; top: calc(var(--safe-t) + 64px); z-index: 85; display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px rgba(0,0,0,.35); text-decoration: none !important; max-width: 520px; margin-inline: auto; }
.remind span { font-size: 13px; opacity: .85; }

/* ---------- login ---------- */
.login-body { background: linear-gradient(160deg, var(--brand), #0b1a33 70%); min-height: 100vh; min-height: 100dvh; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(20px + var(--safe-t)) 16px calc(20px + var(--safe-b)); }
.login-card { width: min(100%, 400px); background: var(--surface); border-radius: 22px; padding: 28px 22px; display: grid; gap: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.4); text-align: center; }
.login-logo { margin: -64px auto 0; border-radius: 22px; box-shadow: 0 10px 28px rgba(0,0,0,.35); border: 4px solid var(--surface); background: var(--brand); }
.login-card h1 { font-size: 26px; letter-spacing: 1px; color: var(--brand-2); }
@media (prefers-color-scheme: dark) { .login-card h1 { color: var(--accent); } }
.login-sub { color: var(--muted); font-size: 13px; }
.login-card .form { text-align: left; }
.login-foot { color: var(--muted); font-size: 12px; }
.login-brand { width: min(240px, 80%); height: auto; margin: 0 auto; background: #fff; border-radius: 16px; padding: 6px; }

/* ---------- cetak ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .side, .top, .tabbar, .backdrop, .no-print, .toast, .ios-tip, .flash, .pager { display: none !important; }
  .main { margin: 0; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .tbl th, .tbl td { border: 1px solid #999; padding: 4px 6px; font-size: 9.5pt; }
  .tbl-wrap { overflow: visible; }
  .report-sum div { border: 1px solid #999; }
  a { color: #000; }
  @page { size: A4 landscape; margin: 12mm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- akun wajib ganti password: menu lain terkunci ---------- */
.side-nav a.locked, .is-locked .tabbar a, .is-locked .tabbar button { opacity: .4; }
.side-nav a.locked::after { content: "🔒"; margin-left: auto; font-size: 12px; }
.is-locked .top-actions { display: none; }
.first-step { border: 2px solid var(--accent); display: grid; gap: 8px; }
.first-step h2 { font-size: 18px; display: flex; gap: 8px; align-items: center; }
.first-step ol { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.first-step code { background: var(--surface2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-weight: 700; user-select: all; }
