:root {
  --asphalt: #2A2E31;
  --asphalt-2: #373C40;
  --concrete: #ECEEEC;
  --paper: #FFFFFF;
  --ink: #1C2023;
  --muted: #5F676C;
  --rule: #D5D9D7;
  --paint: #F2C230;
  --ok: #2E7D4F;
  --warn: #C9821B;
  --bad: #C4412B;
  --radius: 6px;
  --font: "Barlow", "Segoe UI", system-ui, sans-serif;
  --font-c: "Barlow Condensed", "Arial Narrow", "Barlow", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--concrete); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-c); font-weight: 600; line-height: 1.1; margin: 0 0 .5rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; margin-top: 1.75rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--asphalt); color: #E7E9E8; padding: 1.25rem 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { font-family: var(--font-c); font-size: 1.45rem; font-weight: 700; padding: 0 1.25rem 1rem; line-height: 1; }
.brand small { display: block; font-family: var(--font); font-weight: 400; font-size: .8rem; color: #AAB1B4; margin-top: .3rem; }
.side nav a { display: block; padding: .55rem 1.25rem; text-decoration: none; border-left: 4px solid transparent; }
.side nav a:hover { background: var(--asphalt-2); }
.side nav a.on { border-left-color: var(--paint); background: var(--asphalt-2); font-weight: 600; }
.side .who { margin-top: auto; padding: 1rem 1.25rem 0; font-size: .85rem; color: #AAB1B4; border-top: 1px solid var(--asphalt-2); }
.side .who a { color: #E7E9E8; }
main { padding: 1.75rem 2rem 3rem; max-width: 1180px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head h1 { margin: 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-weight: 600; padding: .5rem .95rem; border-radius: var(--radius); border: 1px solid var(--asphalt); background: var(--asphalt); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--asphalt-2); }
.btn.paint { background: var(--paint); border-color: #D9AA1F; color: var(--ink); }
.btn.paint:hover { background: #E8B822; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: #fff; }
.btn.danger { background: transparent; color: var(--bad); border-color: #E5B4AA; }
.btn.sm { padding: .25rem .6rem; font-size: .85rem; font-weight: 500; }
:focus-visible { outline: 3px solid var(--paint); outline-offset: 2px; }
input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid #BFC5C3; border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; }
input.rp { text-align: right; font-variant-numeric: tabular-nums; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.field { margin-bottom: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.inline { display: inline; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.narrow { max-width: 560px; }

/* ---------- flashes ---------- */
.flash { padding: .65rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; border-left: 5px solid var(--ok); background: #E4F1E8; }
.flash.err { border-color: var(--bad); background: #F7E3DE; }
.flash.warn { border-color: var(--warn); background: #FBEFD9; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .5rem .7rem; border-bottom: 1px solid #E6E9E7; text-align: left; vertical-align: middle; }
th { font-weight: 600; font-size: .85rem; color: var(--muted); background: #F6F7F6; }
tbody tr:hover { background: #FAFBFA; }
tfoot td { font-weight: 700; background: #F6F7F6; border-bottom: 0; }
td.slotno { font-family: var(--font-c); font-weight: 700; font-size: 1.15rem; width: 3rem; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge.lunas { background: #DDEFE3; color: var(--ok); }
.badge.sebagian { background: #FBEBCF; color: #8A560C; }
.badge.belum { background: #F6DDD7; color: var(--bad); }
.badge.kosong, .badge.tanpa { background: #E8EAE9; color: var(--muted); }
.plate { display: inline-block; font-family: var(--font-c); font-weight: 700; letter-spacing: .04em; background: #16191B; color: #fff; padding: .05rem .45rem; border-radius: 3px; border: 1px solid #000; box-shadow: inset 0 0 0 1px #5a6064; white-space: nowrap; }

/* ---------- stats line ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); margin-bottom: 1.5rem; }
.stats > div { padding: .85rem 1rem; border-right: 1px solid #E6E9E7; }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-family: var(--font-c); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .85rem; }
.stats .bad b { color: var(--bad); }

/* ---------- denah slot (parking bays) ---------- */
.lot { background: var(--asphalt); border-radius: 10px; padding: 18px 14px 14px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; }
.bay { position: relative; text-decoration: none; color: #fff; padding: 12px 10px 10px; min-height: 150px; display: flex; flex-direction: column; align-items: center; border-left: 3px solid var(--paint); }
.bay:nth-child(8n) { border-right: 3px solid var(--paint); }
.bay:nth-child(n+9) { border-top: 3px solid var(--paint); }
.bay:hover { background: var(--asphalt-2); }
.bay .no { font-family: var(--font-c); font-weight: 700; font-size: 2.6rem; line-height: 1; color: rgba(255,255,255,.88); }
.bay .plate { margin-top: .5rem; font-size: .92rem; }
.bay .st { width: 100%; margin-top: auto; padding-top: .2rem; font-size: .78rem; font-weight: 600; padding: .15rem .45rem; border-radius: 3px; text-align: center; }
.bay.lunas .st { background: var(--ok); }
.bay.sebagian .st { background: var(--warn); }
.bay.belum .st { background: var(--bad); }
.bay.tanpa .st, .bay.kosong .st { background: #4A5054; color: #CDD2D4; }
.bay.kosong .no { color: rgba(255,255,255,.35); }
.bay .owe { font-size: .75rem; color: #F3B7AB; margin-top: .25rem; text-align: center; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: .6rem 0 0; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }

/* ---------- laporan matrix ---------- */
.matrix td, .matrix th { padding: .4rem .5rem; font-size: .85rem; }
.matrix td.c-lunas { background: #E7F3EB; }
.matrix td.c-sebagian { background: #FCF0DA; }
.matrix td.c-belum { background: #F8E2DC; color: var(--bad); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--asphalt); padding: 1rem; }
.login .panel { width: 100%; max-width: 360px; border: 0; border-top: 6px solid var(--paint); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: .75rem 0 0; }
  .brand { padding-bottom: .5rem; }
  .side nav { display: flex; overflow-x: auto; }
  .side nav a { border-left: 0; border-bottom: 4px solid transparent; white-space: nowrap; padding: .5rem .85rem; }
  .side nav a.on { border-bottom-color: var(--paint); }
  .side .who { display: none; }
  main { padding: 1.25rem 1rem 2.5rem; }
  .lot { grid-template-columns: repeat(4, 1fr); }
  .bay:nth-child(8n) { border-right: 0; }
  .bay:nth-child(4n) { border-right: 3px solid var(--paint); }
  .bay:nth-child(n+5) { border-top: 3px solid var(--paint); }
  .grid2 { grid-template-columns: 1fr; }
}
@media print {
  .side, .noprint { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
