/* ===== NaraRT ===== */
:root {
  --bg: #f2f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --border: #e2e8ee;
  --text: #1d2733;
  --muted: #6a7684;
  --primary: #156f7f;
  --primary-600: #0f5b69;
  --primary-50: #e3f2f4;
  --danger: #b8373b;
  --danger-600: #9e2a2e;
  --green: #16a34a;
  --red: #d63b3b;
  --amber: #c98100;
  --blue: #2a6fdb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 38, 56, .05), 0 4px 14px rgba(16, 38, 56, .05);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --brand-font: "Cinzel", "Trajan Pro", Georgia, serif;
  --ink: #141414;
  --sb-w: 264px;
}
html.big { font-size: 118%; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 .95rem/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.t-green { color: var(--green); }
.t-red { color: var(--red); }
.ic { width: 1.15em; height: 1.15em; stroke-width: 2; flex-shrink: 0; }
i.ic { display: inline-block; }
.hp { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sb-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--ink); flex-shrink: 0;
  display: grid; place-items: center; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.brand-logo .logo-mark { width: 36px; height: 28px; }
.logo-mark { display: block; color: var(--ink); }
.logo-mark.sm { width: 34px; height: 26px; flex-shrink: 0; }
.brand-text b { display: block; font-size: 1rem; }
.brand-text b.brand-word { font-family: var(--brand-font); font-weight: 700; letter-spacing: .04em; font-size: 1.02rem; color: var(--ink); }
.brand-text small { display: block; font-size: .66rem; color: var(--muted); line-height: 1.25; }
.rt-chip {
  margin: 6px 14px 8px; padding: 6px 10px; border-radius: 8px; background: var(--primary-50); color: var(--primary-600);
  font: 600 .7rem var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.sb-section { font-size: .68rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; padding: 16px 8px 6px; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: #3a4654;
  font-weight: 500; font-size: .9rem; margin-bottom: 1px;
}
.sb-link:hover { background: var(--surface-2); text-decoration: none; }
.sb-link.active { background: var(--primary-50); color: var(--primary-600); font-weight: 700; }
.sb-link span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-style: normal; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 20px; padding: 1px 7px; }
.count-soft { font-style: normal; background: var(--surface-2); color: var(--muted); font-size: .72rem; border-radius: 20px; padding: 0 7px; margin-left: 4px; }
.sb-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding: 12px 14px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.me:hover { text-decoration: none; }
.sb-foot form, .page-actions form { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.me-text { min-width: 0; }
.me-text b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: .72rem; }

html.sb-mini .sidebar { width: 76px; }
html.sb-mini .brand-text, html.sb-mini .rt-chip, html.sb-mini .sb-section, html.sb-mini .sb-link span,
html.sb-mini .me-text, html.sb-mini .count { display: none; }
html.sb-mini .sb-head { flex-direction: column; gap: 8px; padding-inline: 10px; }
html.sb-mini .sb-collapse .ic { transform: rotate(180deg); }
html.sb-mini .sb-link { justify-content: center; padding: 10px; }
html.sb-mini .sb-nav { padding-top: 12px; }
html.sb-mini .sb-foot { flex-direction: column; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 24px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
}
.today { color: var(--muted); font-weight: 500; font-size: .88rem; }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
.content { padding: 4px 24px 40px; max-width: 1240px; width: 100%; }
#menu-btn { display: none; }
.sb-backdrop { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--primary); color: #fff; font: 600 .88rem var(--font); cursor: pointer;
  white-space: nowrap; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-600); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--primary-50); color: var(--primary-600); }
.btn-soft:hover { background: #d2eaee; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-600); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #efc9ca; }
.btn-danger-ghost:hover { background: #fbeeee; }
.btn-wa { background: #1fa855; }
.btn-wa:hover { background: #178c46; }
.btn-sm { padding: 6px 11px; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: 13px 20px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Generic ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card h3 + .detail, .card > h3 { margin-bottom: 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; font-size: .88rem; }
.page-head p a { display: inline-flex; align-items: center; gap: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card, .grid-3 > .card { margin: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 10px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .ic { width: 42px; height: 42px; color: #b6c1cc; }
.empty h3 { margin: 10px 0 14px; color: var(--text); }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 5px 0; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 3px 11px; font-size: .84rem; }
.list-lines { list-style: none; padding: 0; margin: 0; }
.list-lines li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.list-lines li:first-child { border-top: 0; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; letter-spacing: .01em; }
.badge-gray { background: #eef1f4; color: #5b6673; }
.badge-green { background: #e2f6e9; color: #137a3a; }
.badge-red { background: #fde7e7; color: #b42323; }
.badge-amber { background: #fff2d6; color: #946000; }
.badge-blue { background: #e4edfd; color: #1f58b8; }
.badge-teal { background: var(--primary-50); color: var(--primary-600); }
.badge-dark { background: #2b3440; color: #fff; }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 11px; margin-bottom: 14px; font-size: .9rem; border: 1px solid; }
.alert-ok { background: #ebf8f0; border-color: #c4ead2; color: #11602f; }
.alert-err { background: #fdeeee; border-color: #f3c8c8; color: #9b2020; }
.alert-info { background: #eef4fd; border-color: #cfdef8; color: #1f4f9c; }

/* ---------- Tabs, toolbar, table ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-color: var(--primary); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select, .toolbar input[type=month] { width: auto; }
.search { position: relative; flex: 1; min-width: 180px; max-width: 340px; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfd; }
.row-link { color: var(--text); font-weight: 600; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
td.row-actions { white-space: nowrap; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.thumb-lg { width: auto; height: auto; max-width: min(100%, 520px); max-height: 420px; }
.pager { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: .85rem; }
.pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .muted { margin-left: 8px; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.detail-1 { grid-template-columns: 1fr; }
.detail dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.detail dd { margin: 0; word-break: break-word; }
.detail .dl-full { grid-column: 1 / -1; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.sub-block { padding: 10px 0; border-top: 1px solid var(--border); }
.sub-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 600; color: #3a4654; }
.field-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .9rem; cursor: pointer; }
.req { color: var(--red); }
.help { color: var(--muted); font-size: .76rem; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .92rem; color: var(--text); background: var(--surface); border: 1px solid #d5dde5;
  border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 111, 127, .15); }
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-600); margin: 18px 0 10px; }
.card .form-section:first-child, .form > .form-section:first-of-type { margin-top: 0; }
.form-narrow { max-width: 680px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 40%); padding: 18px 0 8px; }
.img-current { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.check-inline { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 500 !important; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { display: flex; align-items: center; gap: 7px; border: 1px solid #d5dde5; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }

/* ---------- Beranda ---------- */
.sos {
  width: 100%; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #c2403f, #a93034); color: #fff; text-align: left; font-family: var(--font);
  box-shadow: 0 8px 22px rgba(169, 48, 52, .28); margin-bottom: 14px; transition: transform .1s, box-shadow .15s;
}
.sos:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(169, 48, 52, .35); }
.sos:active { transform: scale(.995); }
.sos-ic { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex-shrink: 0; }
.sos-ic .ic { width: 26px; height: 26px; }
.sos-ic.sm { width: 42px; height: 42px; background: #fbe5e5; color: var(--danger); }
.sos-ic.sm .ic { width: 20px; height: 20px; }
.sos-text b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.sos-text small { font-size: .86rem; opacity: .9; }

.ticker { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; color: var(--text); }
.ticker:hover { text-decoration: none; }
.ticker-label { display: flex; align-items: center; gap: 7px; background: linear-gradient(135deg, #1a8fa3, #156f7f); color: #fff; padding: 11px 16px; font: 700 .76rem var(--font); letter-spacing: .08em; flex-shrink: 0; }
.ticker-track { flex: 1; overflow: hidden; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-move { display: inline-flex; white-space: nowrap; animation: ticker 40s linear infinite; }
.ticker:hover .ticker-move { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding-right: 26px; font-weight: 600; font-size: .92rem; }
.ticker-item .dot { color: #9aa6b2; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; padding: 18px 8px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); cursor: pointer;
  font: inherit; text-align: center; transition: transform .12s, box-shadow .15s, border-color .15s; min-height: 112px;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 38, 56, .08); border-color: #cfd8e1; }
.tile-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255,255,255,.25); }
.tile-ic .ic { width: 23px; height: 23px; }
.tile-label { font-weight: 600; font-size: .86rem; line-height: 1.25; }

.rt-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, #1a7f90, #135f6d); color: #fff; border-radius: 16px; padding: 20px 22px; margin-bottom: 16px;
}
.rt-big { font: 700 2rem/1.1 var(--mono); letter-spacing: .02em; }
.rt-sub { font-size: .84rem; opacity: .85; margin-top: 6px; }
.rt-stats { display: flex; gap: 10px; }
.rt-stats div { background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 10px 14px; min-width: 96px; }
.rt-stats b { display: block; font: 700 1.25rem var(--mono); }
.rt-stats small { font-size: .74rem; opacity: .85; }

.mini-agenda { display: flex; gap: 12px; align-items: center; padding: 8px 0; color: var(--text); border-top: 1px solid var(--border); }
.mini-agenda:first-of-type { border-top: 0; }
.mini-agenda:hover { text-decoration: none; }
.mini-agenda b { display: block; font-size: .9rem; }
.mini-agenda small { display: block; }
.date-chip { width: 44px; flex-shrink: 0; text-align: center; background: var(--primary-50); color: var(--primary-600); border-radius: 10px; padding: 5px 0; }
.date-chip b { display: block; font-size: 1.1rem; line-height: 1.1; }
.date-chip small { font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.date-chip.lg { width: 62px; padding: 8px 0; }
.date-chip.lg b { font-size: 1.5rem; }
.ipl-state { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0 0 4px; }
.ipl-state.ok { color: var(--green); }
.ipl-state.due { color: var(--amber); }

/* ---------- Darurat ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 25, 35, .5); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.modal-head > div { flex: 1; }
.modal-head b { display: block; font-size: 1.1rem; }
.modal-head small { color: var(--muted); }
.modal .form { display: flex; flex-direction: column; gap: 12px; }
.sos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sos-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sos-opt span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1.5px solid var(--border); border-radius: 12px; font-size: .8rem; font-weight: 600; text-align: center; cursor: pointer; }
.sos-opt span .ic { width: 22px; height: 22px; color: var(--danger); }
.sos-opt input:checked + span { border-color: var(--danger); background: #fdf0f0; color: var(--danger-600); }
.sos-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(184, 55, 59, .25); }
.sos-bar { background: var(--danger); color: #fff; margin: 0 24px 12px; border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; animation: sosflash 1.4s ease-in-out infinite; }
.sos-bar .sos-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sos-bar .sos-row b { font-size: 1rem; }
.sos-bar .sos-row span { flex: 1; min-width: 180px; font-size: .88rem; }
.sos-bar .btn { background: #fff; color: var(--danger); }
@keyframes sosflash { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 59, 59, .55); } 50% { box-shadow: 0 0 0 8px rgba(214, 59, 59, 0); } }
.sos-done { text-align: center; max-width: 620px; margin: 20px auto; padding: 30px 22px; }
.sos-done .sos-ic { margin: 0 auto 14px; background: #fbe5e5; color: var(--danger); width: 70px; height: 70px; }
.sos-done h1 { margin-bottom: 8px; }
.sos-actions { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 59, 59, .4); } 50% { box-shadow: 0 0 0 14px rgba(214, 59, 59, 0); } }

/* ---------- Stats / dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
a.stat:hover { text-decoration: none; border-color: #c9d4de; }
.stat small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.stat b { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat b .muted { font-size: .9rem; font-weight: 600; }
.stat-primary { background: linear-gradient(135deg, #1a7f90, #135f6d); color: #fff; border: 0; }
.stat-primary small { color: rgba(255, 255, 255, .8); }
.bar { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.year-nav { display: flex; align-items: center; gap: 6px; }
.todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.todo-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--muted); }
.todo-item:hover { text-decoration: none; border-color: #c9d4de; }
.todo-item b { font-size: 1.2rem; color: var(--text); }
.todo-item span { font-size: .8rem; line-height: 1.25; }
.todo-item.hot { border-color: #f1d08a; background: #fffaf0; }
.todo-item.hot .ic { color: var(--amber); }
.todo-item.danger { border-color: #f2b9b9; background: #fff3f3; }
.todo-item.danger .ic, .todo-item.danger b { color: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.bar-pair .b { width: 38%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; }
.b.in, .lg.in { background: #1a8fa3; }
.b.out, .lg.out { background: #f0a04b; }
.bar-col small { color: var(--muted); font-size: .74rem; }
.legend { display: flex; gap: 14px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.ring-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 77%), conic-gradient(var(--green) calc(var(--p) * 1%), #e9eef2 0); }
.ring b { font-size: 1.1rem; }

/* ---------- IPL grid ---------- */
.ipl-wrap { overflow-x: auto; }
.ipl-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .84rem; }
.ipl-grid th, .ipl-grid td { padding: 4px; text-align: center; border-bottom: 1px solid var(--border); }
.ipl-grid thead th { background: var(--surface-2); font-size: .72rem; color: var(--muted); text-transform: uppercase; padding: 10px 4px; }
.ipl-grid .sticky { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 6px 14px; white-space: nowrap; z-index: 1; font-family: var(--mono); font-size: .82rem; }
.ipl-grid thead .sticky { background: var(--surface-2); font-family: var(--font); }
.ipl-grid td a, .ipl-grid td span { display: grid; place-items: center; width: 100%; min-width: 34px; height: 30px; border-radius: 7px; color: inherit; }
.ipl-grid td a:hover { text-decoration: none; outline: 2px solid var(--primary); }
.ipl-grid td.paid a, .ipl-grid td.paid span { background: #dcf3e4; color: #13813b; }
.ipl-grid td.late a, .ipl-grid td.late span { background: #fde8e8; }
.ipl-grid td.open a, .ipl-grid td.open span { background: var(--surface-2); }
.ipl-grid td.total { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding: 0 12px; white-space: nowrap; }
.ipl-grid tr.mine .sticky { background: #fff7dc; font-weight: 700; }
.ipl-grid tr.mine td { background: #fffbea; }
.ipl-grid tr.kosong { opacity: .55; }
.lg.paid { background: #bfe9cd; } .lg.late { background: #f8cfcf; } .lg.open { background: #e6ebf0; }
.legend.small { margin-top: 10px; }

/* ---------- Content views ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.news { padding: 0; overflow: hidden; color: var(--text); margin: 0; display: flex; flex-direction: column; }
.news:hover { text-decoration: none; border-color: #c9d4de; }
.news img { width: 100%; height: 160px; object-fit: cover; }
.news-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.news-meta { display: flex; justify-content: space-between; align-items: center; }
.news-body p { margin: 0; font-size: .86rem; }
.agenda-list { display: flex; flex-direction: column; gap: 10px; }
.agenda-item { display: flex; gap: 14px; align-items: flex-start; color: var(--text); margin: 0; }
.agenda-item:hover { text-decoration: none; border-color: #c9d4de; }
.agenda-item.past { opacity: .6; }
.agenda-item.today { border-color: var(--primary); }
.agenda-body { display: flex; flex-direction: column; gap: 3px; }
.agenda-body .muted { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ronda-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ronda-grid .card { margin: 0; }
.ronda-day.today { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.ronda-person { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.ronda-person:first-child { border-top: 0; }
.phone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.phone { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; }
.phone-info { display: flex; flex-direction: column; min-width: 0; }
.phone-info .mono { font-size: 1rem; font-weight: 700; }
.phone-danger .mono { color: var(--danger); }
.cctv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cctv { padding: 0; overflow: hidden; margin: 0; }
.cctv.off { opacity: .6; }
.cctv-screen { position: relative; aspect-ratio: 16 / 9; background: #0e1720; display: grid; place-items: center; }
.cctv-screen iframe, .cctv-screen img { width: 100%; height: 100%; border: 0; object-fit: cover; display: block; }
.cctv-open { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #cfe3e7; font-weight: 600; }
.cctv-open .ic { width: 40px; height: 40px; }
.live { position: absolute; top: 10px; left: 10px; background: rgba(214, 59, 59, .9); color: #fff; font: 700 .66rem var(--mono); padding: 3px 7px; border-radius: 5px; }
.cctv-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.cctv-foot small { display: block; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.shop { padding: 0; overflow: hidden; margin: 0; display: flex; flex-direction: column; }
.shop-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: #b6c1cc; }
.shop-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-img .ic { width: 40px; height: 40px; }
.shop.sold .shop-img img { filter: grayscale(1); opacity: .6; }
.sold-tag { position: absolute; top: 10px; right: 10px; background: #2b3440; color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.shop-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shop-body > a { color: var(--text); }
.shop-body small { display: flex; align-items: center; gap: 4px; }
.shop-body .btn { margin-top: auto; }
.price { font-weight: 800; color: var(--primary-600); margin-bottom: 6px; }
.share { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.share p { margin: 2px 0 0; }
.share-row { display: flex; gap: 8px; flex: 1; min-width: 280px; max-width: 640px; }
.share-row input { font-family: var(--mono); font-size: .8rem; }
.cards-list { display: flex; flex-direction: column; gap: 10px; }
.reg-card { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin: 0; }
.reg-main { display: flex; flex-direction: column; gap: 6px; }
.reg-title { display: flex; gap: 8px; align-items: center; font-size: 1.02rem; }
.reg-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .86rem; }
.reg-meta span { display: inline-flex; align-items: center; gap: 5px; }
.reg-actions { display: flex; gap: 8px; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 15% 10%, #d8eef1, transparent 45%), radial-gradient(circle at 90% 90%, #f9e3e3, transparent 40%), var(--bg); }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-wrap.auth-wide, .auth-card.auth-wide { max-width: 640px; }
.auth-wrap:has(.auth-wide) { max-width: 640px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; box-shadow: 0 10px 40px rgba(16, 38, 56, .08); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 18px; }
.auth-logo .logo-mark { width: 96px; height: 74px; }
.auth-word { font-family: var(--brand-font); font-weight: 700; font-size: 1.55rem; letter-spacing: .08em; color: var(--ink); line-height: 1; }
.auth-title { text-align: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.auth-title h1 { font-size: 1.15rem; }
.auth-title p { margin: 4px 0 0; font-size: .85rem; }

/* ---------- Lencana keamanan (login/daftar) ---------- */
.secure-badge { margin: 16px auto 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--muted); }
.secure-items { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  background: rgba(255,255,255,.75); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: .8rem; font-weight: 600; color: #3a4654; }
.secure-items > .ic { width: 15px; height: 15px; color: var(--green); }
.secure-items > span { margin-left: -5px; }
.secure-items b { color: #f38020; }
.secure-items .sep { width: 1px; height: 14px; background: var(--border); display: inline-block; }
.secure-badge small { font-size: .7rem; letter-spacing: .01em; }

/* ---------- Captcha ---------- */
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-img { border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); max-width: 100%; height: auto; }
.captcha-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.captcha-opt { position: relative; }
.captcha-opt input { position: absolute; opacity: 0; pointer-events: none; }
.captcha-opt span { display: grid; place-items: center; height: 46px; border: 1.5px solid #d5dde5; border-radius: 11px; font: 700 1.2rem var(--mono); cursor: pointer; transition: all .12s; }
.captcha-opt span:hover { border-color: var(--primary); }
.captcha-opt input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); box-shadow: 0 0 0 3px rgba(21,111,127,.15); }
.captcha-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Layar pembuka (splash) ---------- */
.splash { display: none; }
html.splash-on .splash {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 1000; background: #fff;
  animation: splash-failsafe .01s 6s forwards;
}
html.splash-on body { overflow: hidden; }
html.splash-out .splash { opacity: 0; transform: scale(1.03); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; padding: 24px; }
.splash-mark { width: min(46vw, 210px); height: auto; overflow: visible; }
.splash-mark path { fill: var(--ink); fill-opacity: 0; stroke: var(--ink); stroke-width: .9; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; }
.sp-arch { animation: sp-draw 1.1s cubic-bezier(.6,0,.3,1) .15s forwards, sp-fill .55s ease 1s forwards; }
.sp-wing { animation: sp-draw .75s cubic-bezier(.6,0,.3,1) .85s forwards, sp-fill .45s ease 1.4s forwards; }
.splash-word { font-family: var(--brand-font); font-weight: 700; color: var(--ink); font-size: clamp(1.7rem, 8vw, 2.6rem);
  margin-top: 26px; letter-spacing: .5em; opacity: 0; animation: sp-word 1s cubic-bezier(.2,.7,.2,1) 1.2s forwards; white-space: nowrap; }
.splash-sub { font-size: .74rem; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: 10px; opacity: 0; animation: sp-fade .6s ease 1.7s forwards; text-align: center; }
.splash-bar { width: 120px; height: 2px; background: #eceff2; border-radius: 2px; margin-top: 26px; overflow: hidden; opacity: 0; animation: sp-fade .4s ease 1.5s forwards; }
.splash-bar span { display: block; height: 100%; width: 40%; background: var(--ink); border-radius: 2px; animation: sp-load 1.1s ease-in-out infinite; }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-fill { to { fill-opacity: 1; stroke-width: 0; } }
@keyframes sp-word { from { opacity: 0; letter-spacing: .5em; } to { opacity: 1; letter-spacing: .1em; } }
@keyframes sp-fade { to { opacity: 1; } }
@keyframes sp-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) {
  .splash-mark path, .splash-word, .splash-sub, .splash-bar { animation: none !important; opacity: 1; fill-opacity: 1; stroke-dashoffset: 0; letter-spacing: .1em; }
}

/* ---------- Petunjuk pasang di iPhone ---------- */
.ios-hint { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 12px 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); font-size: .88rem; }
.ios-hint span { flex: 1; }
.ios-hint .ic { vertical-align: -3px; }
.auth-card .form { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; align-items: center; font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .18); width: var(--sb-w) !important; }
  html.sb-mini .brand-text, html.sb-mini .rt-chip, html.sb-mini .sb-section, html.sb-mini .sb-link span, html.sb-mini .me-text { display: revert; }
  html.sb-mini .sb-link { justify-content: flex-start; }
  .sb-collapse { display: none; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 25, 35, .4); z-index: 35; }
  #menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 4px 16px 32px; }
  .sos-bar { margin: 0 16px 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  h1 { font-size: 1.25rem; }
  .form-grid, .detail { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile { min-height: 96px; padding: 14px 4px 10px; gap: 8px; }
  .tile-ic { width: 42px; height: 42px; }
  .tile-label { font-size: .76rem; }
  .sos { padding: 14px 16px; }
  .sos-text b { font-size: 1.25rem; }
  .rt-big { font-size: 1.5rem; }
  .rt-stats { width: 100%; }
  .rt-stats div { flex: 1; min-width: 0; }
  .sos-grid { grid-template-columns: repeat(2, 1fr); }
  .search { max-width: none; flex-basis: 100%; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .auth-card { padding: 22px 18px; }
  /* Tabel jadi kartu di HP */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: left; flex-shrink: 0; }
  .table td:first-child { font-size: 1rem; }
  .table td.row-actions { justify-content: flex-end; padding-top: 6px; }
  .table td.row-actions::before { content: none; }
  .phone-grid, .cctv-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .no-print, .sos-bar, .page-actions, .alert, .pager { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  .stat-primary { background: #fff; color: var(--text); border: 1px solid var(--border); }
  .stat-primary small { color: var(--muted); }
}
