:root {
  --bg: #11131c; --card: #1b1e2b; --card2: #232739; --line: #2f3449;
  --text: #eef0f7; --muted: #9aa1b9; --accent: #7c5cff; --accent2: #22d3ee;
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); font-size: 15px; line-height: 1.4; }
a { color: var(--accent2); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: rgba(17,19,28,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); font-size: 14px; }
#who { font-size: 13px; color: var(--muted); text-align: right; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { font-size: 19px; margin: 6px 0 12px; }
h3 { font-size: 16px; margin: 18px 0 8px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: #151826;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs[hidden] { display: none; }
.tabs a { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; padding: 8px 2px 9px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabs a i { display: block; font-style: normal; font-size: 19px; line-height: 1.2; }
.tabs a.on { color: var(--text); }
.tabs a.on i { color: var(--accent2); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 18px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); }
.b-ok { background: rgba(34,197,94,.15); color: #4ade80; }
.b-warn { background: rgba(245,158,11,.15); color: #fbbf24; }
.b-bad { background: rgba(239,68,68,.17); color: #f87171; }
.b-info { background: rgba(124,92,255,.18); color: #b5a3ff; }

.sewa .unit { font-weight: 700; font-size: 16px; }
.countdown { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.countdown.warn { color: var(--warn); }
.countdown.bad { color: var(--bad); }
.sewa .meta { color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.bar { height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; margin: 8px 0; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.units { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 5px 10px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line); background: var(--card); }
.chip.free { border-color: rgba(34,197,94,.5); color: #4ade80; }
.chip.busy { color: var(--muted); }
.chip.fix { border-color: rgba(245,158,11,.5); color: #fbbf24; }
.chip.off { opacity: .45; text-decoration: line-through; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--card2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: auto; margin-right: 6px; transform: scale(1.2); }
.check { display: flex; align-items: center; color: var(--text); font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.pilih { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.pilih input { position: absolute; opacity: 0; pointer-events: none; }
.pilih label { margin: 0; padding: 10px 8px; text-align: center; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); color: var(--text); cursor: pointer; }
.pilih label b { display: block; font-size: 15px; }
.pilih label small { color: var(--muted); font-size: 12px; }
.pilih input:checked + label { border-color: var(--accent); background: rgba(124,92,255,.18); }
.pilih input:disabled + label { opacity: .35; cursor: not-allowed; }

button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer;
  background: var(--card2); color: var(--text); text-decoration: none; display: inline-block; }
.primary { background: var(--accent); color: #fff; }
.ok { background: var(--ok); color: #05210f; }
.danger { background: transparent; color: #f87171; border: 1px solid rgba(239,68,68,.4); }
.full { width: 100%; padding: 13px; margin-top: 16px; }
button:disabled { opacity: .5; }

.total { background: var(--card2); border-radius: 12px; padding: 12px; margin-top: 14px; }
.total .row { padding: 3px 0; font-size: 14px; }
.total .row.big { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }

.list .item { display: block; text-decoration: none; color: inherit; }
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search select { width: auto; }

dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text); padding: 0;
  width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog form { padding: 18px; }
dialog h3 { margin-top: 0; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #fff; color: #111; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 20; max-width: 90vw; }
#toast.err { background: var(--bad); color: #fff; }

.login { max-width: 380px; margin: 8vh auto 0; }
.fotojaminan { max-width: 100%; border-radius: 10px; margin-top: 8px; }
