:root {
  --bg: #f6f3ea; --card: #ffffff; --ink: #14201d; --muted: #66726e; --line: #e6e1d4;
  --pri: #0f4c45; --pri2: #14695f; --pri-soft: #e5f1ee; --gold: #c39a26; --gold-soft: #fbf3dc;
  --red: #c0392b; --red-soft: #fdecea; --amber: #b7791f; --amber-soft: #fdf4e3; --green: #1e7d4f; --green-soft: #e4f4ea;
  --gray-soft: #efeee9; --shadow: 0 1px 2px rgba(20,32,29,.04), 0 6px 20px rgba(20,32,29,.06); --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1513; --card: #15201d; --ink: #e8eeec; --muted: #9aa8a3; --line: #26332f; --pri: #4fb8a6; --pri2: #3aa592;
    --pri-soft: #183531; --gold: #e2bd52; --gold-soft: #2c2716; --red: #ef7a6d; --red-soft: #3a1f1c; --amber: #e8b04f; --amber-soft: #33291a;
    --green: #5fcf93; --green-soft: #183326; --gray-soft: #222c29; --shadow: 0 6px 20px rgba(0,0,0,.35); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-size: 15px; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--pri); }

/* ---------- Kerangka ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, #0f4c45, #0a3530); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand b { font-family: Lora, serif; font-size: 22px; letter-spacing: .3px; }
.brand small { display: block; font-size: 11px; opacity: .7; letter-spacing: .5px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 0; background: transparent; color: rgba(255,255,255,.82); font-weight: 600; text-align: left; }
.nav span { width: 22px; text-align: center; }
.nav:hover { background: rgba(255,255,255,.07); }
.nav.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 #e8c468; }
.side-foot { margin-top: auto; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.18); font-size: 13px; }
.me .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #f3d57a, #b8891c); color: #2a1e00; display: grid; place-items: center; font-weight: 800; }
.me button { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.main { min-width: 0; padding: 22px 28px 90px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 26px; font-family: Lora, serif; color: var(--pri); }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.top-r { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 30; justify-content: space-around; gap: 0; }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10.5px; flex: 1; text-align: center; border-radius: 10px; }
  .nav span { font-size: 19px; width: auto; }
  .nav.active { box-shadow: none; }
  .main { padding: 14px 14px 96px; }
  .top h1 { font-size: 22px; }
}

/* ---------- Kartu & isi ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 18px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .hint, .hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.45; }
.grid { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi b { display: block; font-size: 22px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.hero { background: linear-gradient(135deg, #0f4c45, #14695f); color: #fff; border: 0; }
.kpi.hero small, .kpi.hero span { color: rgba(255,255,255,.75); }
.kpi.warn b { color: var(--red); }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }

.unitrow { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.unitrow:last-child { border-bottom: 0; }
.uico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--pri-soft); }
.unitrow b { font-size: 14px; }
.unitrow .nums { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.unitrow .nums b { display: block; }
.bar { height: 7px; border-radius: 99px; background: var(--gray-soft); margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pri2), #2bb39b); border-radius: 99px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--gray-soft); color: var(--muted); vertical-align: 1px; }
.tag.phase { background: var(--gold-soft); color: var(--amber); }

/* ---------- Daftar tagihan ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.inv { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; box-shadow: var(--shadow); }
.inv .who b { font-size: 15px; }
.inv .who small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.inv .amt { text-align: right; font-variant-numeric: tabular-nums; }
.inv .amt b { font-size: 16px; }
.inv .amt small { display: block; font-size: 12px; color: var(--muted); }
.inv .acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.st { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; margin-right: 6px; }
.st.lunas { background: var(--green-soft); color: var(--green); }
.st.belum, .st.sebagian { background: var(--amber-soft); color: var(--amber); }
.st.terlambat, .st.terlambat-sebagian { background: var(--red-soft); color: var(--red); }
.st.batal { background: var(--gray-soft); color: var(--muted); text-decoration: line-through; }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.empty div { font-size: 40px; margin-bottom: 6px; }

/* ---------- Filter ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { border: 1px solid var(--line); background: var(--card); padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.search { flex: 1; min-width: 180px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 9px 12px; }

/* ---------- Tombol & isian ---------- */
.btn { border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.pri { background: linear-gradient(135deg, var(--pri2), var(--pri)); color: #fff; }
.btn.gold { background: linear-gradient(135deg, #e8c468, #b8891c); color: #241a00; }
.btn.ghost { background: var(--gray-soft); }
.btn.out { background: transparent; border: 1.5px solid var(--pri); color: var(--pri); }
.btn.wa { background: #25d366; color: #fff; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.in, select.in, textarea.in { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; outline: none; }
.in:focus { border-color: var(--pri2); }
textarea.in { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.seg { display: flex; background: var(--gray-soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--pri); box-shadow: var(--shadow); }
.preview { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 6px 0 12px; line-height: 1.5; }
.preview b { font-size: 18px; color: var(--ink); }

/* ---------- Jendela ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(8,20,18,.45); opacity: 0; pointer-events: none; transition: .2s; z-index: 40; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.modal-wrap { position: fixed; inset: 0; display: grid; place-items: center; z-index: 41; pointer-events: none; padding: 16px; }
.modal { pointer-events: auto; background: var(--card); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 20px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); transform: translateY(10px) scale(.98); opacity: 0; transition: .18s; visibility: hidden; }
.modal-wrap.show .modal { transform: none; opacity: 1; visibility: visible; }
.modal h3 { margin: 0 0 4px; font-size: 19px; font-family: Lora, serif; color: var(--pri); }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal .acts .grow { margin-right: auto; }
@media (max-width: 600px) { .modal-wrap { place-items: end center; padding: 0; } .modal { border-radius: 20px 20px 0 0; width: 100%; max-height: 92vh; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #0f2a26; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; opacity: 0; transition: .2s; z-index: 60; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) { .toast { bottom: 84px; } }

/* ---------- Pelanggan ---------- */
.cust { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); text-align: left; width: 100%; }
.cust .av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.cust .info { flex: 1; min-width: 0; }
.cust .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust .info small { color: var(--muted); font-size: 12.5px; }
.cust .right { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.docs { display: flex; gap: 8px; flex-wrap: wrap; }
.doc { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; background: var(--gray-soft); }
.doc button { border: 0; background: transparent; color: var(--red); font-weight: 700; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 14px; margin-bottom: 10px; }
.kv span { color: var(--muted); }
.sec { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 800; margin: 18px 0 8px; }
.mini { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13.5px; margin-bottom: 6px; }
.mini small { color: var(--muted); display: block; }

/* ---------- Pengaturan ---------- */
.set { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.tarif { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-weight: 600; }
.switch-row input { width: 44px; height: 24px; accent-color: var(--pri); }

/* ---------- Layar masuk ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 600px at 15% 10%, #1a7a6c 0%, transparent 60%), linear-gradient(160deg, #0f4c45, #082a26); }
.gate-card { width: min(400px, 100%); background: var(--card); border-radius: 24px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); text-align: center; }
.gate-card h2 { font-family: Lora, serif; color: var(--pri); margin: 10px 0 4px; font-size: 28px; }
.gate-card p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.gate-card .field { text-align: left; }
.gate-card .btn { width: 100%; padding: 13px; }
.err { color: var(--red); font-weight: 600; font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- Kuitansi (cetak) ---------- */
.kw { border: 2px solid var(--pri); border-radius: 14px; padding: 18px; background: #fff; color: #14201d; font-size: 14px; }
.kw .head { display: flex; justify-content: space-between; border-bottom: 2px solid #c39a26; padding-bottom: 10px; margin-bottom: 10px; }
.kw .head b { font-family: Lora, serif; font-size: 20px; color: #0f4c45; }
.kw table { width: 100%; border-collapse: collapse; }
.kw td { padding: 4px 0; vertical-align: top; }
.kw td:first-child { color: #66726e; width: 120px; }
.kw .big { font-size: 22px; font-weight: 800; color: #0f4c45; }
@media print {
  body * { visibility: hidden !important; }
  .kw, .kw * { visibility: visible !important; }
  .kw { position: absolute; left: 0; top: 0; width: 100%; border-radius: 0; }
}

.only-m { display: none; }
@media (max-width: 860px) { .only-m { display: inline-flex; } .top-r { flex-wrap: wrap; } }

.btn { white-space: nowrap; }
.tarif b { white-space: nowrap; }

.nota-wrap { background: #e9ece8; border-radius: 14px; padding: 14px; text-align: center; margin-bottom: 12px; max-height: 52vh; overflow: auto; }
.nota-wrap img { width: 100%; max-width: 360px; border-radius: 6px; box-shadow: 0 6px 22px rgba(0,0,0,.15); }
.lrow { display: grid; grid-template-columns: 1fr 64px 120px auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.lrow .lsub { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-top: -2px; }
.logo-box { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 10px; min-height: 60px; display: grid; place-items: center; }
.logo-box img { max-width: 100%; max-height: 90px; }
@media (max-width: 520px) { .lrow { grid-template-columns: 1fr 56px 96px auto; } }

:root { --orange: #f97316; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.tbl th { text-align: right; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl td { text-align: right; padding: 9px 6px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: normal; }
.tbl .neg { color: var(--red); font-weight: 700; } .tbl .pos { color: var(--green); font-weight: 700; }
.tbl tr.tot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--line); }
.card .tbl { display: table; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart rect.bi, .legend i.bi { fill: #0f766e; background: #0f766e; }
.chart rect.be, .legend i.be { fill: var(--orange); background: var(--orange); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { margin: 10px 0; } .hbar > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.hbar .bar { margin: 0 0 4px; }
.recs .rec { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.recs .rec:last-child { border-bottom: 0; }
.recs .ri { font-size: 22px; line-height: 1.2; }
.recs .rec p { margin: 3px 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.card + .two, .two + .card, .two + .two, .card + .card { margin-top: 14px; }
@media (max-width: 860px) { .tbl { font-size: 12.5px; } .tbl td, .tbl th { padding: 7px 3px; } .side .nav { font-size: 10.5px; } }
.two > .card { margin-top: 0 !important; }
@media (max-width: 600px) { .tbl { font-size: 12px; } .tbl th { font-size: 10px; } .tbl td:first-child { min-width: 92px; } .card { overflow-x: auto; } }

.waitcard { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; border: 1px solid #f3d27a; background: #fffaf0; }
.waitcard small { display: block; margin-top: 3px; }
.bslist { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0 8px; }
.bsrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; justify-content: space-between; }
.bsrow:last-child { border-bottom: 0; } .bsrow > span { flex: 1; } .bsrow input { width: 18px; height: 18px; flex: none; }
.bsrow small { display: block; color: var(--muted); font-size: 12px; }
@media (prefers-color-scheme: dark) { .waitcard { background: #2a2414; border-color: #6b5a2a; } }
@media (max-width: 600px) { .waitcard { flex-direction: column; align-items: stretch; } }
.stopbox { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; }

/* ===================== Tema v7 — elegan ===================== */
:root {
  --bg: #f3f2ec; --card: #fffefa; --ink: #15211d; --muted: #61706a; --line: #e2e0d6;
  --pri: #134a3f; --pri2: #1d6a58; --pri-soft: #e1efe9; --mint: #2f9e80; --accent: #134a3f; --on-accent: #ffffff;
  --gold: #a87f1a; --gold-soft: #f6efdc; --red: #b4432f; --red-soft: #f8e6e1; --amber: #9a6a12; --amber-soft: #f7eedb;
  --green: #1f7a58; --green-soft: #e1f1e9; --gray-soft: #ecebe4; --head: #fffefa;
  --shadow: 0 1px 0 rgba(21,33,29,.03); --r: 18px; --serif: "Newsreader", "Lora", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131d1b; --card: #1b2725; --ink: #ecf2ef; --muted: #a5b3ae; --line: #2c3a37;
    --pri: #8fd8bf; --pri2: #7cccb1; --pri-soft: #223a33; --mint: #8fd8bf; --accent: #8fd8bf; --on-accent: #10201b;
    --gold: #e0bd64; --gold-soft: #2e2918; --red: #f0a090; --red-soft: #452822; --amber: #e8bf6a; --amber-soft: #3a3020;
    --green: #8fd8bf; --green-soft: #1f3a32; --gray-soft: #25322f; --head: #1b2725; --shadow: none;
  }
}
html, body { font-size: 15px; letter-spacing: .005em; }
body { background: var(--bg); }

/* Kepala & menu */
.app { display: block; min-height: 100vh; }
.side { position: static; height: auto; background: var(--head); color: var(--ink); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px 20px; padding: 22px max(28px, calc((100vw - 1240px) / 2)) 14px; }
.brand { padding: 0; gap: 0; }
.brand b { font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--mint); letter-spacing: -.01em; text-transform: lowercase; }
.brand b::after { content: "."; }
.brand small { font-size: 13px; opacity: 1; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.navrow { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; }
.nav { color: var(--muted); font-weight: 500; padding: 10px 14px; border-radius: 12px; gap: 9px; font-size: 15px; }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav:hover { background: var(--gray-soft); color: var(--ink); }
.nav.active { background: var(--pri-soft); color: var(--pri); font-weight: 700; box-shadow: none; }
.side-foot { margin: 0; grid-column: 2; grid-row: 1; }
.me { background: transparent; padding: 0; gap: 10px; font-size: 13px; color: var(--ink); }
.me small { color: var(--muted); }
.me .av { background: var(--pri-soft); color: var(--pri); width: 36px; height: 36px; }
.me button { border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 7px 12px; }
.me button:hover { background: var(--gray-soft); }
.main { max-width: 1240px; margin: 0 auto; padding: 30px 28px 90px; }

/* Judul halaman */
.top { margin-bottom: 22px; align-items: flex-end; }
.top h1 { font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1.1; color: var(--ink); letter-spacing: -.015em; }
.top .sub { font-size: 14px; margin-top: 6px; }
.eyebrow { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mint); font-weight: 600; margin-bottom: 8px; }

/* Kartu */
.card, .kpi, .inv, .cust { box-shadow: var(--shadow); border-color: var(--line); background: var(--card); }
.card { border-radius: var(--r); padding: 22px; }
.card h3 { font-size: 17px; font-weight: 700; }
.kpi { border-radius: var(--r); padding: 20px 22px; }
.kpi small { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; }
.kpi b { font-size: 30px; font-weight: 600; letter-spacing: -.01em; margin: 12px 0 8px; }
.kpi span { font-size: 13.5px; }
.kpi.hero { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.kpi.hero small, .kpi.hero span { color: var(--muted); }
.bar { background: var(--gray-soft); height: 8px; }
.bar i { background: var(--mint); }
.uico { background: var(--pri-soft); }

/* Tombol & pilihan */
.btn { border-radius: 12px; font-weight: 600; }
.btn.pri, .btn.gold { background: var(--accent); color: var(--on-accent); }
.btn.pri:hover, .btn.gold:hover { filter: brightness(1.06); }
.btn.out { border: 1px solid var(--line); color: var(--ink); background: var(--card); }
.btn.out:hover { background: var(--gray-soft); }
.btn.ghost { background: var(--gray-soft); color: var(--ink); }
.btn.wa { background: #1fa855; }
.chip { background: var(--card); border-color: var(--line); font-weight: 500; color: var(--ink); padding: 8px 14px; }
.chip.on { background: var(--pri-soft); color: var(--pri); border-color: transparent; font-weight: 700; }
.search, .in, select.in, textarea.in { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.in:focus, .search:focus { border-color: var(--mint); box-shadow: 0 0 0 3px var(--pri-soft); outline: none; }
.seg button.on { color: var(--pri); }
.preview { background: var(--pri-soft); }
.modal { border-radius: 22px; border: 1px solid var(--line); }
.modal h3 { font-family: var(--serif); font-weight: 500; font-size: 25px; color: var(--ink); }
.st { font-weight: 600; border-radius: 8px; padding: 4px 10px; }
.tag.phase { border-radius: 8px; }
.toast { background: var(--ink); color: var(--bg); }
.waitcard { background: var(--gold-soft); border-color: transparent; }

/* Ringkasan baru */
.rk-filters { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.rk-filters label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.rk-filters select { min-width: 230px; padding: 12px 14px; font-size: 15px; }
.pill { display: inline-block; background: var(--pri-soft); color: var(--pri); padding: 7px 12px; border-radius: 10px; font-size: 13.5px; }
.kpis.k3 { grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.rk-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.rk-grid .card { padding: 0; }
.ch { display: flex; justify-content: space-between; align-items: center; padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.ch h3 { margin: 0; font-size: 18px; } .ch span { color: var(--muted); font-size: 13.5px; }
.ch svg { width: 22px; height: 22px; color: var(--muted); }
.ub { padding: 0 26px; }
.ub .row { padding: 18px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ub .row:last-child { border-bottom: 0; }
.ub .row > div { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.ub .row b { font-variant-numeric: tabular-nums; }
.ub .row small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 9px; }
.ub .bar { margin-top: 12px; }
.todo { padding: 4px 26px 8px; }
.todo .t { padding: 18px 0; border-bottom: 1px solid var(--line); }
.todo .t:last-child { border-bottom: 0; }
.todo .lab { display: inline-block; font-size: 13px; padding: 5px 11px; border-radius: 8px; margin-bottom: 10px; background: var(--pri-soft); color: var(--pri); }
.todo .lab.red { background: var(--red-soft); color: var(--red); }
.todo .lab.amb { background: var(--amber-soft); color: var(--amber); }
.todo b { display: block; font-size: 15px; }
.todo p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.prio { margin-top: 18px; padding: 0 !important; overflow: hidden; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 16px 22px; background: var(--gray-soft); border-bottom: 1px solid var(--line); }
.ptable td { padding: 18px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 15px; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable td small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.ptable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable .badge { display: inline-block; font-size: 13.5px; padding: 5px 11px; border-radius: 8px; background: var(--pri-soft); color: var(--pri); white-space: nowrap; }
.ptable .badge.red { background: var(--red-soft); color: var(--red); }
.ptable .badge.amb { background: var(--amber-soft); color: var(--amber); }
.ptable .lnk { background: none; border: 0; color: var(--mint); font-weight: 600; padding: 6px 4px; white-space: nowrap; }
.ptable .lnk:hover { text-decoration: underline; }
.foot-note { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 18px; flex-wrap: wrap; gap: 6px; }

@media (max-width: 1000px) { .rk-grid { grid-template-columns: 1fr; } .kpis.k3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); display: block; border-top: 1px solid var(--line); border-bottom: 0; z-index: 30; background: var(--head); }
  .navrow { flex-wrap: nowrap; justify-content: space-around; gap: 0; }
  .nav { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 10.5px; flex: 1; border-radius: 10px; }
  .nav svg { width: 22px; height: 22px; }
  .lx { display: none; }
  .main { padding: 18px 16px 100px; }
  .top h1 { font-size: 30px; }
  .kpis.k3 { grid-template-columns: 1fr; gap: 12px; }
  .kpi b { font-size: 26px; margin: 8px 0 6px; }
  .ch { padding: 18px 18px 14px; } .ub, .todo { padding-left: 18px; padding-right: 18px; }
  .ptable thead { display: none; }
  .ptable tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .ptable tr:last-child { border-bottom: 0; }
  .ptable td { padding: 0; border: 0; font-size: 14px; }
  .ptable td.c-due { grid-column: 1; color: var(--muted); font-size: 13px; }
  .ptable td.num { grid-row: 1; grid-column: 2; }
  .ptable td.c-st { grid-column: 1 / -1; }
  .ptable td.c-act { grid-column: 1 / -1; }
  .rk-filters select { min-width: 0; width: 100%; } .rk-filters > div:first-child { flex: 1; }
}
.nav span.lbl { width: auto; text-align: left; white-space: nowrap; }
.nav .lx { display: inline; }
.rk-grid > .card, .kpis > .kpi { margin-top: 0 !important; }
@media (max-width: 860px) { .nav span.lbl { text-align: center; } .nav .lx { display: none; } }
.nav span.lbl { font-size: inherit; }
@media (max-width: 860px) { .nav { min-width: 0; } .nav span.lbl { overflow: hidden; text-overflow: ellipsis; max-width: 100%; } }

/* ===================== Tema v8 — zamrud & emas ===================== */
:root {
  --bg: #f6f2e8; --card: #fffdf7; --ink: #1c2420; --muted: #6d6b60; --line: #e7dfca;
  --pri: #0f3d33; --pri2: #175446; --pri-soft: #e6eee8; --mint: #0f3d33; --accent: #0f3d33; --on-accent: #fbf6e6;
  --goldx: #b08a35; --gold2: #d6b467; --gold-soft: #f5ecd3; --gold-line: #dcc58b;
  --red: #a23b2c; --red-soft: #f6e4dd; --amber: #8d6512; --amber-soft: #f6ebcf; --green: #1d6b4f; --green-soft: #e3efe7;
  --gray-soft: #efe9da; --head: #0f3d33; --head-ink: #efe6cc; --head-muted: #b9c5b9;
  --shadow: 0 1px 2px rgba(60,48,20,.04), 0 10px 30px -18px rgba(60,48,20,.25);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1613; --card: #15201c; --ink: #efe9d8; --muted: #a9ab9c; --line: #2a3530;
    --pri: #d6b467; --pri2: #c9a552; --pri-soft: #2a2a1d; --mint: #d6b467; --accent: #d6b467; --on-accent: #1a1608;
    --goldx: #d6b467; --gold2: #e6c97f; --gold-soft: #2c2817; --gold-line: #5c4f2a;
    --red: #eea08f; --red-soft: #3f2520; --amber: #e7c374; --amber-soft: #352d19; --green: #95d3b4; --green-soft: #1b3229;
    --gray-soft: #202b27; --head: #0a1210; --head-ink: #efe6cc; --head-muted: #98a59c; --shadow: none;
  }
}
/* Kepala zamrud dengan aksen emas */
.side { background: var(--head); border-bottom: 1px solid var(--gold-line); color: var(--head-ink); position: relative; }
.side::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold2), transparent); opacity: .7; }
.brand b { color: var(--gold2); font-size: 32px; }
.brand b::after { color: var(--head-ink); }
.brand small { color: var(--head-muted); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.nav { color: var(--head-muted); }
.nav:hover { background: rgba(255,255,255,.06); color: var(--head-ink); }
.nav.active { background: rgba(214,180,103,.14); color: var(--gold2); box-shadow: inset 0 -2px 0 var(--gold2); border-radius: 12px 12px 4px 4px; }
.me { color: var(--head-ink); } .me small { color: var(--head-muted); }
.me .av { background: linear-gradient(135deg, #e6c97f, #a9832f); color: #1a1608; }
.me button { border-color: rgba(214,180,103,.45); color: var(--head-ink); background: transparent; }
.me button:hover { background: rgba(214,180,103,.12); }
/* Judul */
.eyebrow { color: var(--goldx); }
.top h1 { color: var(--ink); }
/* Kartu */
.card, .kpi, .inv, .cust, .mini { border-color: var(--line); }
.card, .kpi { box-shadow: var(--shadow); }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -.005em; }
.ch h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.kpi { border-top: 3px solid var(--gold2); }
.kpi small { color: var(--muted); }
.kpi b { font-family: var(--serif); font-weight: 600; font-size: 34px; }
.sec { color: var(--goldx); letter-spacing: .12em; }
.bar { background: var(--gray-soft); } .bar i { background: linear-gradient(90deg, var(--pri), var(--goldx)); }
/* Tombol */
.btn.pri { background: var(--pri); color: var(--on-accent); }
.btn.gold { background: linear-gradient(135deg, #e3c57c, #b08a35); color: #1d1607; }
.btn.out { border: 1px solid var(--gold-line); color: var(--ink); background: transparent; }
.btn.out:hover { background: var(--gold-soft); }
.btn.ghost { background: var(--gray-soft); color: var(--ink); }
.btn .ic, a.btn .ic { width: 16px; height: 16px; flex: none; }
.btn.ghost.sm .ic { color: var(--goldx); }
a.btn { text-decoration: none; }
.chip.on { background: var(--pri); color: var(--on-accent); }
.in:focus, .search:focus { border-color: var(--goldx); box-shadow: 0 0 0 3px var(--gold-soft); }
.preview { background: var(--gold-soft); }
.modal h3 { font-weight: 600; }
.ptable th { background: var(--gold-soft); color: var(--ink); }
.ptable .lnk { color: var(--goldx); }
.todo .lab { background: var(--pri-soft); color: var(--pri); }
.pill { background: var(--gold-soft); color: var(--amber); }
.tag { background: var(--gold-soft); color: var(--amber); }
/* Sakelar */
.switch-row input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 99px; background: var(--gray-soft); border: 1px solid var(--line); position: relative; cursor: pointer; transition: .2s; flex: none; }
.switch-row input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch-row input[type=checkbox]:checked { background: var(--goldx); border-color: var(--goldx); }
.switch-row input[type=checkbox]:checked::after { left: 22px; }
/* Pengaturan rapi */
.set { align-items: start; }
.set > .card { margin-top: 0 !important; }
.mini { background: var(--card); }
@media (max-width: 860px) {
  .side { background: var(--head); border-top: 1px solid var(--gold-line); }
  .side::after { display: none; }
  .nav.active { box-shadow: none; border-radius: 10px; }
}
@media (max-width: 860px) { .side { position: fixed !important; top: auto; bottom: 0; left: 0; right: 0; } }
