/* ==========================================================================
   CEO Coffee Lounge - prototype design system
   Arah visual: "papan menu di depan terminal 5250". Kehangatan lounge
   (serif papan menu, warna sangrai) dipasang di atas disiplin sistem
   enterprise AS/400 (mono, angka rata kolom, log yang terbaca).

   Aturan warna yang dipegang di seluruh halaman:
     biru   = aksi dan navigasi
     sangrai= segala hal berbau CEO Point (CP)
     hijau  = lunas, siap, stok sehat
     merah  = tolak, batal, telat, stok habis
   ========================================================================== */

:root {
  /* Ditetapkan di PRD */
  --navy: #1a252f;
  --blue: #2980b9;

  --navy-2: #22303d;
  --navy-3: #31434f;
  --blue-2: #3fa2e0;
  --blue-3: #1f6d92;
  --blue-tint: #e5eff7;

  /* Sangrai kopi: dipakai khusus untuk CP Point */
  --roast: #a96a2c;
  --roast-2: #c98a4b;
  --roast-tint: #f7ecdf;

  --jade: #16805e;
  --jade-tint: #e0f0ea;

  --clay: #b23a2b;
  --clay-tint: #f9e7e4;

  --amber: #9a6f05;
  --amber-tint: #fbf1d9;

  --ground: #eaeef2;
  --paper: #ffffff;
  --paper-2: #f5f8fa;
  --paper-3: #eef2f6;

  --ink: #16202a;
  --ink-2: #4c5c6b;
  --ink-3: #82909d;

  --rule: #d6dee6;
  --rule-2: #e6ecf1;

  --display: "Constantia", "Georgia", "Iowan Old Style", serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, "SFMono-Regular", monospace;

  --r: 4px;
  --r-lg: 8px;
  --rail-w: 216px;
  --top-h: 56px;
  --shadow: 0 1px 2px rgba(22, 32, 42, .06), 0 8px 24px -14px rgba(22, 32, 42, .30);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* Angka uang, poin, dan kode selalu rata kolom. */
.mono, .num, td.num, th.num, input[type="number"] {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

a { color: var(--blue-3); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------- Kerangka aplikasi --------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  grid-template-areas: "brand top" "rail canvas";
  min-height: 100vh;
}

.brandbox {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brandbox .glyph {
  width: 26px; height: 26px; flex: none;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(160deg, var(--roast-2), var(--roast));
  position: relative;
}
.brandbox .glyph::after {
  content: "";
  position: absolute;
  inset: 8px 11px auto 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--navy);
  opacity: .85;
}

.brandbox .wordmark {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.12;
  letter-spacing: .01em;
}
.brandbox .wordmark b { display: block; font-weight: 600; }
.brandbox .wordmark span {
  display: block;
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

/* ---------- Topbar --------------------------------------------------- */

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.crumb { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.crumb strong { font-weight: 600; }
.crumb .bid {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
}

.linkbtn {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r);
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.linkbtn:hover { border-color: var(--blue); color: var(--blue-3); }

.netbtn .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-tint);
}
.netbtn[data-net="down"] .dot { background: var(--clay); box-shadow: 0 0 0 3px var(--clay-tint); }
.netbtn[data-net="down"] { border-color: var(--clay); color: var(--clay); }

.whoami { padding-left: 5px; }
.whoami .av {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  display: grid;
  place-items: center;
}
.whoami .rolelab { color: var(--ink-3); font-size: 11.5px; }

/* ---------- Rail (menu global) --------------------------------------- */

.rail {
  grid-area: rail;
  background: var(--navy);
  color: rgba(255, 255, 255, .8);
  padding: 14px 0 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.rail .grp {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .34);
  padding: 16px 16px 6px;
}
.rail .grp:first-child { padding-top: 2px; }

.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.rail a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.rail a[aria-current="page"] {
  background: rgba(41, 128, 185, .20);
  border-left-color: var(--blue-2);
  color: #fff;
  font-weight: 600;
}
.rail a .mod {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255, 255, 255, .42);
  min-width: 22px;
}
.rail a[aria-current="page"] .mod { color: var(--blue-2); }
.rail a[data-locked="yes"] { opacity: .38; }
.rail a[data-locked="yes"]:hover { background: rgba(255, 255, 255, .03); }
.rail .pill {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  border-radius: 9px;
  padding: 1px 6px;
}

.railfoot {
  margin-top: auto;
  padding: 16px;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .42);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
/* Tautan di kaki sidebar bukan item menu, jadi aturan .rail a tidak berlaku. */
.railfoot a {
  color: rgba(255, 255, 255, .62);
  display: inline;
  padding: 0;
  border-left: 0;
  font-size: 11px;
}
.railfoot a:hover { background: none; color: #fff; text-decoration: underline; }

/* ---------- Kanvas --------------------------------------------------- */

.canvas {
  grid-area: canvas;
  padding: 22px 26px 40px;
  overflow-x: hidden;
}
.canvas.flush { padding: 0; }
.wrap { max-width: 1180px; }
.wrap.wide { max-width: none; }

.phead { margin-bottom: 18px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 6px;
}
h1.page {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.005em;
}
.lede {
  margin: 8px 0 0;
  max-width: 68ch;
  color: var(--ink-2);
  font-size: 14.5px;
}

/* ---------- Panel ---------------------------------------------------- */

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.panel > .ph {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-2);
}
.panel > .ph h2 { font-size: 14.5px; font-weight: 600; }
.panel > .ph .sub { font-size: 12.5px; color: var(--ink-3); }
.panel > .pb { padding: 16px; }
.panel > .pb.tight { padding: 12px; }
.panel > .pf {
  padding: 12px 16px;
  border-top: 1px solid var(--rule-2);
  background: var(--paper-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 9px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hr { border: 0; border-top: 1px solid var(--rule-2); margin: 14px 0; }

/* ---------- Kartu angka --------------------------------------------- */

.stat {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat .k {
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stat .v {
  font-family: var(--mono);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  letter-spacing: -.02em;
}
.stat .v small { font-size: 13px; color: var(--ink-3); }
.stat .n { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.stat.cp { border-top: 3px solid var(--roast); }
.stat.cp .v { color: var(--roast); }
.stat.cash { border-top: 3px solid var(--navy); }
.stat.ok { border-top: 3px solid var(--jade); }
.stat.warn { border-top: 3px solid var(--amber); }

/* ---------- Tabel ---------------------------------------------------- */

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--paper-2); }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl tfoot td {
  border-top: 1px solid var(--rule);
  font-weight: 600;
  background: var(--paper-2);
}
.tblwrap { overflow-x: auto; }

/* ---------- Tag ------------------------------------------------------ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--paper-3);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.tag.cp { background: var(--roast-tint); color: var(--roast); border-color: #e6d0b6; }
.tag.ok { background: var(--jade-tint); color: var(--jade); border-color: #bfdfd3; }
.tag.bad { background: var(--clay-tint); color: var(--clay); border-color: #eec9c3; }
.tag.warn { background: var(--amber-tint); color: var(--amber); border-color: #e8d7a8; }
.tag.blue { background: var(--blue-tint); color: var(--blue-3); border-color: #c3dcec; }
.tag.solid { background: var(--navy); color: #fff; border-color: var(--navy); }

.tier {
  font-family: var(--body);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- Tombol --------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r);
  padding: 0 14px;
  height: 38px;
  font: inherit;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-3); border-color: var(--blue-3); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy-2); }
.btn.cp { background: var(--roast); border-color: var(--roast); color: #fff; }
.btn.cp:hover { background: #90591f; border-color: #90591f; }
.btn.warn { border-color: var(--clay); color: var(--clay); }
.btn.warn:hover { background: var(--clay-tint); }
.btn.sm { height: 30px; font-size: 13px; padding: 0 10px; }
.btn.lg { height: 46px; font-size: 15.5px; padding: 0 20px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45;
  pointer-events: none;
}

.segbar { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.segbar button {
  appearance: none;
  border: 0;
  background: var(--paper);
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  cursor: pointer;
  color: var(--ink-2);
  border-right: 1px solid var(--rule);
}
.segbar button:last-child { border-right: 0; }
.segbar button[aria-pressed="true"] { background: var(--navy); color: #fff; font-weight: 600; }

/* ---------- Form ----------------------------------------------------- */

.field { display: block; }
.field .lab {
  display: block;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
  font-weight: 600;
}
input[type="text"], input[type="password"], input[type="number"], input[type="tel"],
input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(41, 128, 185, .14); }
input::placeholder { color: var(--ink-3); }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink-2);
  padding: 9px 14px;
  cursor: pointer;
  margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); font-weight: 600; }

/* ---------- Gate (halaman masuk) ------------------------------------ */

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
  background: var(--navy);
}
.gate .hero {
  padding: 54px 56px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(1100px 500px at 8% -10%, rgba(41, 128, 185, .30), transparent 60%),
    radial-gradient(700px 420px at 92% 108%, rgba(169, 106, 44, .26), transparent 62%);
}
.gate .mark {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 26px;
}
.gate h1 {
  font-family: var(--display);
  font-size: clamp(30px, 3.5vw, 46px);
  line-height: 1.12;
  font-weight: 600;
  max-width: 15ch;
  letter-spacing: -.01em;
}
.gate h1 em { font-style: normal; color: var(--roast-2); }
.gate .hero p {
  max-width: 56ch;
  color: rgba(255, 255, 255, .72);
  font-size: 15.5px;
  margin: 18px 0 0;
}
.gate .pane {
  background: var(--paper);
  padding: 44px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}
.gate .form { width: 100%; max-width: 400px; margin: 0 auto; }

/* Rantai alur poin: dipakai di gate, isinya sama dengan bagan PRD bab 3. */
.flowchain { margin-top: 34px; display: grid; gap: 10px; max-width: 620px; }
.flowchain .step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .04);
}
.flowchain .n {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--roast-2);
  padding-top: 2px;
}
.flowchain b { display: block; font-size: 13.5px; font-weight: 600; color: #fff; }
.flowchain span { font-size: 12.5px; color: rgba(255, 255, 255, .62); }

/* ---------- POS ------------------------------------------------------ */

.posgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 18px;
  align-items: start;
}

.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.pcard {
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 12px;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 118px;
  transition: border-color .12s ease, transform .12s ease;
}
.pcard:hover { border-color: var(--blue); transform: translateY(-1px); }
.pcard .pn { font-weight: 600; font-size: 14px; line-height: 1.3; }
.pcard .pc { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.pcard .pp { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.pcard .rp { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.pcard .cp { font-family: var(--mono); font-size: 12px; color: var(--roast); }
.pcard[data-out="yes"] { opacity: .5; cursor: not-allowed; }
.pcard[data-out="yes"]:hover { border-color: var(--rule); transform: none; }

.cart { position: sticky; top: 16px; }
.cartlist { max-height: 46vh; overflow-y: auto; }
.citem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-2);
}
.citem:last-child { border-bottom: 0; }
.citem .nm { font-size: 13.5px; font-weight: 600; }
.citem .mods { font-size: 11.5px; color: var(--ink-3); }
.citem .amt { font-family: var(--mono); font-size: 13.5px; text-align: right; }
.citem .qty { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.citem .qty button {
  width: 24px; height: 24px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  color: var(--ink-2);
}
.citem .qty button:hover { border-color: var(--blue); color: var(--blue-3); }
.citem .qty b { font-family: var(--mono); font-size: 13px; min-width: 16px; text-align: center; }

.memberbox {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 11px 12px;
  background: var(--paper-2);
}
.memberbox[data-state="none"] { border-style: dashed; color: var(--ink-3); }
.memberbox[data-state="ok"] { background: var(--blue-tint); border-color: #c3dcec; }

.totrow { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.totrow .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.totrow.grand { font-size: 17px; font-weight: 600; padding-top: 8px; }
.totrow.grand .v { font-size: 19px; }
.totrow.cp .v, .totrow.cp .k { color: var(--roast); }

.empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--ink-3);
  font-size: 13.5px;
}
.empty b { display: block; color: var(--ink-2); font-size: 14.5px; margin-bottom: 4px; font-weight: 600; }

/* Modifier chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
}
.chips button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }

/* Slider poin di modal bayar */
.cpslider { width: 100%; accent-color: var(--roast); }
.paysplit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.paycell {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--paper-2);
}
.paycell .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.paycell .v { font-family: var(--mono); font-size: 19px; margin-top: 3px; }
.paycell.cp { background: var(--roast-tint); border-color: #e6d0b6; }
.paycell.cp .v { color: var(--roast); }

/* ---------- Struk termal -------------------------------------------- */

.receipt {
  width: 302px;
  margin: 0 auto;
  background: #fff;
  color: #111;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
  padding: 16px 14px 22px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.receipt .rc { text-align: center; }
.receipt .rt { font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.receipt .rl { border-top: 1px dashed #999; margin: 8px 0; }
.receipt .rr { display: flex; justify-content: space-between; gap: 8px; }
.receipt .rr span:last-child { white-space: nowrap; }
.receipt .rsub { color: #555; }
.receipt .big { font-size: 13px; font-weight: 700; }

/* ---------- Member (PWA) -------------------------------------------- */

.mcol { max-width: 470px; margin: 0 auto; }

.cpcard {
  border-radius: var(--r-lg);
  padding: 18px 20px 20px;
  color: #fff;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(169, 106, 44, .55), transparent 70%),
    linear-gradient(150deg, var(--navy-2), var(--navy));
  box-shadow: var(--shadow);
}
.cpcard .who { display: flex; align-items: center; gap: 10px; }
.cpcard .who .av {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
}
.cpcard .who b { display: block; font-size: 15px; }
.cpcard .who .id { font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .58); }
.cpcard .bal { margin-top: 16px; }
.cpcard .bal .k {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.cpcard .bal .v {
  font-family: var(--mono);
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-top: 2px;
}
.cpcard .bal .v small { font-size: 15px; color: rgba(255, 255, 255, .6); margin-left: 6px; }
.cpcard .bal .rp { font-size: 12.5px; color: rgba(255, 255, 255, .62); margin-top: 4px; }
.cpcard .sync {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: rgba(255, 255, 255, .5);
  display: flex;
  align-items: center;
  gap: 7px;
}
.cpcard .sync .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }

.qrbox { display: grid; place-items: center; gap: 12px; padding: 6px 0 2px; }
.qrmat {
  width: 216px; height: 216px;
  image-rendering: pixelated;
  border: 8px solid #fff;
  outline: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
}
.qrmeta { text-align: center; }
.qrmeta .tok {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  word-break: break-all;
  max-width: 300px;
  margin: 0 auto;
}
.countbar {
  width: 216px; height: 4px;
  background: var(--paper-3);
  border-radius: 3px;
  overflow: hidden;
}
.countbar i { display: block; height: 100%; background: var(--blue); transition: width .95s linear; }
.countbar[data-low="yes"] i { background: var(--clay); }

.voucher {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--roast);
  border-radius: var(--r);
  padding: 11px 13px;
  background: var(--paper);
}
.voucher .ic {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--roast-tint);
  color: var(--roast);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 19px;
}
.voucher b { display: block; font-size: 14px; }
.voucher .vs { font-size: 12px; color: var(--ink-3); }
.voucher[data-used="yes"] { opacity: .55; border-left-color: var(--ink-3); }

.track { display: grid; gap: 0; }
.track .tstep {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 14px;
  position: relative;
}
.track .tstep:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px; top: 24px; bottom: 0;
  width: 2px;
  background: var(--rule);
}
.track .tstep .d {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  z-index: 1;
}
.track .tstep[data-on="yes"] .d { border-color: var(--jade); background: var(--jade); color: #fff; }
.track .tstep[data-on="now"] .d { border-color: var(--blue); color: var(--blue); }
.track .tstep b { font-size: 14px; }
.track .tstep .ts { font-size: 12.5px; color: var(--ink-3); }

/* ---------- KDS ------------------------------------------------------ */

body.kds { background: #0f1720; }
body.kds .canvas { background: #0f1720; }
.kdswrap { padding: 18px 20px 26px; color: #fff; }
.kdsbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.kdsbar h1 { font-family: var(--display); font-size: 21px; color: #fff; }
.kdsbar .clock { font-family: var(--mono); font-size: 20px; color: rgba(255, 255, 255, .8); }
.kdsbar .segbar button { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .7); border-color: rgba(255, 255, 255, .12); }
.kdsbar .segbar { border-color: rgba(255, 255, 255, .14); }
.kdsbar .segbar button[aria-pressed="true"] { background: var(--blue); color: #fff; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--r-lg);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.col > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.col > h2 .c {
  font-family: var(--mono);
  background: rgba(255, 255, 255, .1);
  border-radius: 9px;
  padding: 0 7px;
  font-size: 11.5px;
  letter-spacing: 0;
}
.col[data-k="PREPARING"] > h2 { color: #ffd68a; }
.col[data-k="READY"] > h2 { color: #7fe3b6; }
.col[data-k="COMPLETED"] > h2 { color: rgba(255, 255, 255, .5); }
.colbody { padding: 12px; display: grid; gap: 12px; }

.ticket {
  background: #1b2733;
  border: 1px solid rgba(255, 255, 255, .1);
  border-left: 4px solid var(--blue-2);
  border-radius: var(--r);
  padding: 12px 13px;
}
.ticket[data-late="warn"] { border-left-color: #e8b93c; }
.ticket[data-late="late"] { border-left-color: #e2584a; animation: blink 1.6s steps(2, start) infinite; }
@keyframes blink { 50% { background: #2a2028; } }
.ticket .th { display: flex; align-items: baseline; gap: 8px; }
.ticket .inv { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.ticket .tmr {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: #7fe3b6;
}
.ticket[data-late="warn"] .tmr { color: #ffd68a; }
.ticket[data-late="late"] .tmr { color: #ff8f80; }
.ticket[data-late="done"] { border-left-color: rgba(255, 255, 255, .22); }
.ticket[data-late="done"] .tmr { color: rgba(255, 255, 255, .34); }
.ticket .meta { font-size: 11.5px; color: rgba(255, 255, 255, .5); margin-top: 2px; }
.ticket ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.ticket li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.ticket li .q { font-family: var(--mono); color: var(--blue-2); font-weight: 600; }
.ticket li .mo { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .48); }
.ticket .tact { margin-top: 12px; display: flex; gap: 8px; }
.ticket .tact .btn { height: 34px; font-size: 13px; }
.ticket .tact .btn:not(.primary):not(.dark) {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .82);
}
.ticket .tact .btn:not(.primary):not(.dark):hover { background: rgba(255, 255, 255, .12); }
.kdsempty { padding: 26px 12px; text-align: center; color: rgba(255, 255, 255, .32); font-size: 13px; }

/* ---------- Konsol AS/400 ------------------------------------------- */

.console {
  background: #0d1a16;
  border: 1px solid #1d3b31;
  border-radius: var(--r);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: #9fe8c4;
  max-height: 380px;
  overflow-y: auto;
}
.console .ln { display: grid; grid-template-columns: 66px 62px minmax(0, 1fr); gap: 10px; }
.console .t { color: #4e8f75; }
.console .m { color: #d7f5e6; }
.console .ln[data-lv="err"] .m { color: #ff9d8f; }
.console .ln[data-lv="err"] .v { color: #ff9d8f; }
.console .ln[data-lv="lock"] .m { color: #ffd68a; }
.console .v { color: #62c39a; }
.console .req { color: #7fd6ff; }

.apicard {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--paper-2);
}
.apicard .verb {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 6px;
  color: #fff;
  background: var(--jade);
}
.apicard .verb[data-v="POST"] { background: var(--roast); }
.apicard code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--paper-3);
  border-radius: 3px;
  padding: 1px 5px;
}
pre.code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  background: var(--navy);
  color: #d9e6ef;
  border-radius: var(--r);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 10px 0 0;
}
pre.code .k { color: #7fd6ff; }
pre.code .s { color: #ffd68a; }

/* ---------- Modal ---------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, .55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
  animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0 } }
.modal {
  background: var(--paper);
  border-radius: var(--r-lg);
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 32, .55);
  animation: rise .16s ease;
}
@keyframes rise { from { transform: translateY(8px); opacity: 0 } }
.modal.wide { width: min(760px, 100%); }
.modal > .mh {
  padding: 15px 18px;
  border-bottom: 1px solid var(--rule-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal > .mh h2 { font-family: var(--display); font-size: 19px; font-weight: 600; }
.modal > .mh .x {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 6px;
}
.modal > .mb { padding: 18px; overflow-y: auto; }
.modal > .mf {
  padding: 13px 18px;
  border-top: 1px solid var(--rule-2);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--paper-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ---------- Toast ---------------------------------------------------- */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 90;
  width: min(380px, calc(100vw - 36px));
}
.toast {
  background: var(--navy);
  color: #fff;
  border-radius: var(--r);
  padding: 11px 14px;
  border-left: 3px solid var(--blue-2);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .7);
  animation: slidein .18s ease;
}
@keyframes slidein { from { transform: translateX(12px); opacity: 0 } }
.toast b { display: block; font-size: 13.5px; }
.toast span { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.toast[data-k="good"] { border-left-color: #4ade80; }
.toast[data-k="bad"] { border-left-color: #ff8f80; }
.toast[data-k="cp"] { border-left-color: var(--roast-2); }

/* ---------- Kunci akses (RBAC) --------------------------------------- */

.lockpane {
  max-width: 520px;
  margin: 40px auto;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.lockpane .lk {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--clay-tint);
  color: var(--clay);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 20px;
}
.lockpane h2 { font-family: var(--display); font-size: 21px; margin-bottom: 8px; }

/* ---------- Responsif ------------------------------------------------ */

@media (max-width: 1180px) {
  .posgrid { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --rail-w: 0px; --top-h: 52px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "canvas"; }
  .brandbox { display: none; }
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, .5);
  }
  .rail[data-open="yes"] { transform: none; }
  .railscrim { position: fixed; inset: 0; background: rgba(15, 23, 32, .5); z-index: 65; }
  .menubtn { display: inline-flex !important; }
  .canvas { padding: 16px 14px 32px; }
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate .hero { padding: 36px 24px; }
  .gate .pane { padding: 30px 22px 44px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .whoami .txt { display: none; }
}

.menubtn { display: none; }

/* Di layar sempit, status AS/400 cukup diwakili titiknya. */
@media (max-width: 620px) {
  .netbtn .lbl { display: none; }
  .topbar { gap: 7px; padding: 0 11px; }
  .crumb .bid { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .topbar, .rail, .brandbox, .toasts, .noprint { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .canvas { padding: 0; }
  .receipt { border: 0; box-shadow: none; width: auto; }
  /* Saat mencetak struk, hanya isi modal yang ikut tercetak. */
  body.printing .app { display: none !important; }
  body.printing .scrim { position: static; background: none; padding: 0; display: block; }
  body.printing .modal { box-shadow: none; max-height: none; width: auto; animation: none; }
  body.printing .modal > .mh, body.printing .modal > .mf { display: none; }
}
