/* ==========================================================
   KOST MANAGER — gaya tampilan
   ========================================================== */
:root {
  /* Menu samping: gradasi pink tua ke ungu. Warna utama (tombol, grafik): plum. */
  color-scheme: light;
  --bg: #f4f0f4;
  --surface: #ffffff;
  --surface-2: #f9f5f9;
  --surface-3: #ede5ee;
  --ink: #1f1520;
  --ink-2: #5a4a5c;
  --ink-3: #85748a;
  --line: #e6dce8;
  --line-2: #d4c6d8;
  --brand: #7a1f73;
  --brand-2: #63185d;
  --brand-soft: #f6e3f1;
  --on-brand: #ffffff;
  --side: linear-gradient(170deg, #9d1655 0%, #761a6b 52%, #4c1d95 100%);
  --side-solid: #761a6b;
  --side-ink: #f7d9ea;
  --accent: #f2b33d;
  --ok: #15803d;   --ok-soft: #dcfce7;   --ok-cell: #2f9e62;
  --warn: #b45309; --warn-soft: #fef3c7; --warn-cell: #e0a526;
  --bad: #b91c1c;  --bad-soft: #fee2e2;  --bad-cell: #d64545;
  --idle-cell: #ddd2df;
  --chart-pos: #7a1f73;
  --chart-pos-2: #dcb0d4;
  --chart-neg: #c2410c;
  --shadow: 0 1px 2px rgba(40, 15, 40, .06), 0 4px 16px rgba(40, 15, 40, .05);
  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 7px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141016; --surface: #1d171f; --surface-2: #241c27; --surface-3: #2d2330;
    --ink: #f1e9f1; --ink-2: #bfaebf; --ink-3: #8f7f91; --line: #33293a; --line-2: #443749;
    --brand: #e58bd0; --brand-2: #f0a8de; --brand-soft: #3a1a35; --on-brand: #2a0a24;
    --side: linear-gradient(170deg, #6e0f3f 0%, #4a0f4f 55%, #2e0d5c 100%); --side-solid: #4a0f4f; --side-ink: #f0cfe4;
    --ok: #4ade80; --ok-soft: #12321f; --ok-cell: #2f9e62;
    --warn: #f5b74a; --warn-soft: #3a2a0c; --warn-cell: #d29a22;
    --bad: #f87171; --bad-soft: #3b1515; --bad-cell: #d64545;
    --idle-cell: #3a2e3d; --chart-pos: #d77ac0; --chart-pos-2: #6a2c5f; --chart-neg: #f08a5d;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141016; --surface: #1d171f; --surface-2: #241c27; --surface-3: #2d2330;
  --ink: #f1e9f1; --ink-2: #bfaebf; --ink-3: #8f7f91; --line: #33293a; --line-2: #443749;
  --brand: #e58bd0; --brand-2: #f0a8de; --brand-soft: #3a1a35; --on-brand: #2a0a24;
  --side: linear-gradient(170deg, #6e0f3f 0%, #4a0f4f 55%, #2e0d5c 100%); --side-solid: #4a0f4f; --side-ink: #f0cfe4;
  --ok: #4ade80; --ok-soft: #12321f; --ok-cell: #2f9e62;
  --warn: #f5b74a; --warn-soft: #3a2a0c; --warn-cell: #d29a22;
  --bad: #f87171; --bad-soft: #3b1515; --bad-cell: #d64545;
  --idle-cell: #3a2e3d; --chart-pos: #d77ac0; --chart-pos-2: #6a2c5f; --chart-neg: #f08a5d;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Shell ---------------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: var(--side); background-color: var(--side-solid); color: var(--side-ink); padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #2b1d02; flex: none; }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.brand-mark.logo { background: #fff; padding: 3px; overflow: hidden; }
.brand-mark.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-prev { width: 84px; height: 84px; border-radius: 16px; border: 1px dashed var(--line-2); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.logo-prev svg { width: 32px; height: 32px; color: var(--ink-3); }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--side-ink); opacity: .8; }
.nav-group { font-size: 11.5px; color: var(--side-ink); opacity: .7; padding: 14px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink);
  font-weight: 500; position: relative; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .count { margin-left: auto; background: #fff; color: #9d1655 !important; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.16); font-size: 13px; }
.side-foot b { color: #fff; display: block; font-weight: 600; }
.side-foot a { color: var(--side-ink); display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 20px; font-weight: 700; margin-right: auto; }
.top .back { display: none; }
.content { padding: 24px 28px 64px; max-width: 1360px; width: 100%; }
.demo-bar {
  background: #2b1d02; color: #fde7b0; font-size: 13px; padding: 8px 28px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.demo-bar select { background: #3d2a05; color: #fde7b0; border: 1px solid #6b4a0c; border-radius: 6px; padding: 2px 6px; }

/* ---------------- Controls ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.wa { color: #128c4b; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg.i { width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.input, select.input, textarea.input {
  height: 38px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); padding: 0 11px; width: 100%; min-width: 0;
}
textarea.input { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.select { height: 38px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); padding: 0 32px 0 11px; font-weight: 600; max-width: 100%; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.tabs { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--ink-3); width: 16px; height: 16px; }
.search input { padding-left: 34px; }

/* ---------------- Panels ---------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; flex-wrap: wrap; }
.panel-h h2 { font-size: 15.5px; font-weight: 700; }
.panel-h p { margin: 0; }
.panel-b { padding: 16px 20px 20px; }
.section-title { display: flex; align-items: baseline; gap: 4px 12px; margin: 30px 0 12px; flex-wrap: wrap; }
.section-title h2 { font-size: 17px; font-weight: 700; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.plain::before { display: none; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t tr.click { cursor: pointer; }
.t td.act { text-align: right; white-space: nowrap; width: 1%; }
.t .sub { color: var(--ink-3); font-size: 12.5px; }
.t tfoot td { font-weight: 700; border-top: 1px solid var(--line-2); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------------- Dashboard ---------------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0; overflow: hidden;
}
.hero-main { padding: 24px 26px; border-right: 1px solid var(--line); }
.hero-label { font-size: 14px; color: var(--ink-2); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero-num { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 8px 0 6px; }
.hero-num.neg { color: var(--bad); }
.delta { font-size: 13px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.hero-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.kv span { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.kv b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.hero-rooms { padding: 22px 24px; background: var(--surface-2); display: flex; flex-direction: column; gap: 14px; }
.occ-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.occ-head b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.matrix-group { display: grid; grid-template-columns: 124px 1fr; gap: 10px; align-items: start; }
.matrix-group .mg-name { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; gap: 6px; align-items: center; padding-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix { display: flex; flex-wrap: wrap; gap: 3px; }
.cell { width: 13px; height: 13px; border-radius: 3px; background: var(--idle-cell); }
.cell.lunas { background: var(--ok-cell); }
.cell.segera { background: var(--warn-cell); }
.cell.telat { background: var(--bad-cell); }
.cell.kosong { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 11px; height: 11px; }
.hero-alert { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--bad-soft); color: var(--bad); font-weight: 600; text-decoration: none !important; }
.hero-alert:hover { filter: brightness(.98); }
.hero-alert b { font-size: 18px; }
.hero-alert .spacer + span { font-size: 13px; }

.kost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kost-card { padding: 18px 18px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s; }
.kost-card:hover { border-color: var(--line-2); }
.kost-card .kc-h { display: flex; align-items: center; gap: 8px; }
.kost-card .kc-h h3 { font-size: 15px; font-weight: 700; }
.kost-card .kc-laba { font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.kost-card .kc-laba.neg { color: var(--bad); }
.kc-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.kc-row b { color: var(--ink); font-weight: 600; }
.bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.kc-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 12.5px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 28px; }
.spark i { width: 7px; border-radius: 2px 2px 0 0; background: var(--chart-pos-2); }
.spark i.neg { background: var(--chart-neg); opacity: .6; border-radius: 0 0 2px 2px; align-self: flex-start; }
.spark i:last-child { background: var(--chart-pos); }

.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: 280px; overflow: visible; }
.chart-wrap .grid line { stroke: var(--line); stroke-width: 1; }
.chart-wrap .grid text, .chart-wrap .xl text { fill: var(--ink-3); font-size: 11.5px; font-family: var(--font); }
.chart-wrap .zero { stroke: var(--line-2); stroke-width: 1.2; }
.chart-wrap .b { fill: var(--chart-pos); }
.chart-wrap .b.neg { fill: var(--chart-neg); }
.chart-wrap .b.run { fill: url(#hatch); }
.chart-wrap .b.dim { opacity: .35; }
.chart-wrap .hit { fill: transparent; cursor: pointer; }
.chart-wrap .hit:hover + .hl, .chart-wrap .hl.on { fill: var(--surface-3); }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); border-radius: 9px; padding: 9px 12px; font-size: 12.5px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); min-width: 170px; z-index: 5; transform: translate(-50%, -100%); white-space: nowrap;
}
.tip b { display: block; margin-bottom: 4px; font-size: 13px; }
.tip div { display: flex; justify-content: space-between; gap: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.two-col.r { grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); }
.two-col.l { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 20px; border-top: 1px solid var(--line); align-items: center; }
.due-list li:first-child { border-top: 0; }
.due-list .dl-name { font-weight: 600; }
.due-list .dl-meta { font-size: 12.5px; color: var(--ink-3); }
.due-list .dl-amt { font-weight: 700; text-align: right; }
.due-list .dl-act { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); margin-bottom: 18px; font-size: 13.5px; }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.notice b { color: inherit; }

/* ---------------- Room map ---------------- */
.room-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; color: var(--ink-2); }
.chip.on { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }
.chip .cell { width: 10px; height: 10px; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.room {
  position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 10px 12px 11px 15px;
  text-align: left; cursor: pointer; min-height: 92px; display: flex; flex-direction: column; gap: 2px; overflow: hidden;
}
.room::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--idle-cell); }
.room.lunas::before { background: var(--ok-cell); }
.room.segera::before { background: var(--warn-cell); }
.room.telat::before { background: var(--bad-cell); }
.room.kosong { background: var(--surface-2); border-style: dashed; }
.room.kosong::before { background: transparent; }
.room.nonaktif { opacity: .5; }
.room:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.room .rn { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.room .rp { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .rs { font-size: 11.5px; color: var(--ink-3); margin-top: auto; }
.room.telat .rs { color: var(--bad); font-weight: 600; }
.room.segera .rs { color: var(--warn); font-weight: 600; }
.room .rt { position: absolute; top: 9px; right: 10px; font-size: 11px; color: var(--ink-3); max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Detail ---------------- */
.profile { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
.avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 19px; flex: none; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 500; }

/* ---------------- Modal / sheet ---------------- */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden;
}
dialog.modal.wide { width: min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 20, 18, .45); }
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.m-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.m-h h2 { font-size: 17px; font-weight: 700; margin-right: auto; }
.m-b { padding: 4px 20px 20px; overflow-y: auto; }
.m-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.m-err { color: var(--bad); font-size: 13px; font-weight: 600; margin-right: auto; align-self: center; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opts .btn { justify-content: flex-start; height: 46px; }
.pick-box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); padding: 12px 14px; font-size: 13px; }
.pick-box .t td, .pick-box .t th { padding: 6px 8px; }
.photo-in { display: flex; gap: 10px; align-items: center; }
.photo-in img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.kw-wrap { background: #f3edf4; border-radius: 14px; padding: 10px; max-height: 62vh; overflow-y: auto; }
.kw-wrap img { display: block; width: 100%; max-width: 420px; margin: 0 auto; border-radius: 10px; }
.receipt { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 16px 18px; background: var(--surface-2); }
.receipt .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.2); animation: pop .2s ease-out; max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); color: #fff; }

/* ---------------- Login ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); background-color: var(--side-solid); }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 22px; }
.login-card .brand { color: var(--ink); padding: 0 0 6px; }
.login-card .brand span { color: var(--ink-3); }

/* ---------------- Mobile ---------------- */
.tabbar { display: none; }
.sheet-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-nav a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 12.5px; font-weight: 600; text-decoration: none; text-align: center; }
.sheet-nav a svg { width: 22px; height: 22px; color: var(--brand); }
.cards-m { display: none; }

@media (max-width: 1100px) {
  .profile { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 10px 16px; gap: 8px; }
  .top h1 { font-size: 17px; }
  .top .back { display: inline-flex; }
  .content { padding: 16px 16px 96px; }
  .demo-bar { padding: 8px 16px; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .hero-rooms { padding: 18px 20px; }
  .two-col, .two-col.r, .two-col.l { grid-template-columns: minmax(0,1fr); }
  .room .rt { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--side); background-color: var(--side-solid); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--side-ink); opacity: .82; padding: 4px 0; position: relative; text-decoration: none; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: #fff; opacity: 1; }
  .tabbar a.on svg { background: rgba(255,255,255,.18); border-radius: 99px; padding: 2px 10px; width: 44px; box-sizing: content-box; height: 20px; margin: -2px 0; }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 8px); background: #fff; color: #9d1655; font-size: 10px; border-radius: 99px; padding: 0 5px; line-height: 16px; }
  .hide-m { display: none !important; }
  .cards-m { display: flex; flex-direction: column; }
  .table-m-hide { display: none; }
  .rooms { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .room { min-height: 84px; padding: 8px 10px 9px 13px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  dialog.modal { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; max-height: 92vh; }
  dialog.modal.wide { width: 100vw; }
  .search { max-width: none; }
  .top .select { max-width: 150px; }
}
@media (max-width: 560px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero-split { grid-template-columns: 1fr 1fr; }
  .hero-split .kv:last-child { grid-column: span 2; }
  .profile { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 120px 1fr; }
  .matrix-group { grid-template-columns: 1fr; gap: 6px; }
  .top .btn.primary .lbl { display: none; }
  .top .btn.primary { width: 38px; padding: 0; }
}
.m-item { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.m-item:first-child { border-top: 0; }
.m-item .grow { flex: 1; min-width: 0; }
.m-item .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-item .grow span { font-size: 12.5px; color: var(--ink-3); }
.m-item .end { text-align: right; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------- Print ---------------- */
#print { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; }
  body.printing > *:not(#print) { display: none !important; }
  body.printing #print { display: block; }
  .pr { font-family: var(--font); color: #000; font-size: 12px; }
  .pr h1 { font-size: 18px; }
  .pr h2 { font-size: 14px; margin: 18px 0 6px; }
  .pr table { width: 100%; border-collapse: collapse; margin-top: 6px; }
  .pr th, .pr td { border: 1px solid #999; padding: 4px 6px; text-align: left; font-size: 11px; }
  .pr td.r, .pr th.r { text-align: right; }
  .pr .hdr { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
  .pr .kw { max-width: 420px; border: 1.5px solid #000; padding: 16px; }
  .pr .kw .big { font-size: 22px; font-weight: 800; }
  .pr .ttd { display: flex; justify-content: flex-end; margin-top: 30px; text-align: center; }
  .pr .sum { display: flex; gap: 20px; margin: 8px 0; }
  .pr .sum div { border: 1px solid #999; padding: 6px 10px; }
  .pr .page { page-break-after: always; }
  .pr .page:last-child { page-break-after: auto; }
}

/* ---------------- Tata tertib ---------------- */
.tt-paper { padding: 28px 32px; max-width: 860px; }
.tt-doc { font-size: 15px; line-height: 1.6; }
.tt-title { font-size: 22px; font-weight: 800; text-align: center; color: var(--brand); margin: 0 0 10px; text-wrap: balance; }
.tt-h { font-size: 15px; font-weight: 800; color: var(--brand); background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 8px; padding: 8px 12px; margin: 18px 0 6px; }
.tt-li { display: grid; grid-template-columns: 30px 1fr; gap: 4px; margin: 6px 0; }
.tt-n { font-weight: 800; color: var(--brand); }
.tt-n.warn { color: var(--bad); }
.tt-p { margin: 8px 0; }
.tt-gap { height: 6px; }
.tt-sign { margin: 24px 0 0 auto; width: min(320px, 100%); display: flex; flex-direction: column; gap: 8px; }
.tt-sign-box { height: 90px; border: 1.5px dashed var(--line-2); border-radius: 10px; }
.tt-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tt-edit .tt-paper { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; }
textarea.input.tt-text { min-height: 56vh; font-size: 14px; line-height: 1.55; font-family: ui-monospace, Menlo, Consolas, monospace; }
@media (max-width: 1100px) { .tt-edit { grid-template-columns: minmax(0, 1fr); } .tt-edit .tt-paper { position: static; max-height: none; } }
@media (max-width: 560px) { .tt-paper { padding: 18px 16px; } }

/* ---------------- Perangkat: HP, tablet, laptop ---------------- */
@media (pointer: coarse) {
  .input, select.input, textarea.input, .select { font-size: 16px; } /* cegah iPhone/iPad zoom otomatis */
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .app { grid-template-columns: 206px 1fr; }
  .side { padding: 18px 10px; }
  .content { padding: 20px 20px 56px; }
  .top { padding: 12px 20px; }
  .hero-split { gap: 10px; }
  .kv b { font-size: 16px; }
  .profile { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 561px) and (max-width: 900px) {
  .kost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-split { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .top .btn .lbl { display: none; }
  .top .btn:not(.back) { width: 40px; padding: 0; }
  .toolbar .select { max-width: 100%; }
  .toolbar > label.row { width: 100%; }
  .toolbar > label.row .select { flex: 1; }
  .m-f .btn { flex: 1 1 auto; }
  .m-f .spacer { display: none; }
}

/* ---------------- Booking ---------------- */
.bk-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 20px; border-top: 1px solid var(--line); }
.bk-row:first-child { border-top: 0; }
.bk-no { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.bk-no.muted { background: var(--surface-3); color: var(--ink-3); }
.bk-nama { font-size: 15px; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.bk-meta span { display: inline-flex; align-items: center; gap: 5px; }
.bk-meta svg.i { width: 14px; height: 14px; color: var(--ink-3); }
.bk-note { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.bk-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 420px; }
.nav .count.soft { background: rgba(255,255,255,.22); color: #fff !important; }
@media (max-width: 900px) {
  .bk-row { grid-template-columns: 44px minmax(0, 1fr); padding: 12px 16px; }
  .bk-no { width: 40px; height: 40px; font-size: 15px; border-radius: 12px; }
  .bk-act { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}
