/* ===== GDS POS — base template kasir. Palet brand GDS: indigo -> cyan di atas charcoal. ===== */
:root {
  --bg: #0c0e13;
  --bg-2: #0f1218;
  --panel: #161a22;
  --panel-hi: #1b202a;      /* tepi atas kartu (elevasi) */
  --panel-2: #1e232e;
  --line: #262c38;
  --line-soft: #1f242e;
  --ink: #eceef2;
  --ink-dim: #98a0ad;
  --ink-mute: #656d7b;
  --accent: #4f46e5;         /* indigo GDS */
  --accent-2: #06b6d4;       /* cyan GDS */
  --accent-ink: #fff;
  --ok: #2fd06a;
  --ok-dim: #1f8f4b;
  --warn: #f5a524;
  --info: #4c8dff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 34px rgba(0,0,0,.42);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.28);
  --sidebar-w: 236px;
  /* angka rata & rapat di tabel/nota */
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Segoe UI Mono", monospace;
  font-synthesis: none;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); line-height: 1.45; -webkit-font-smoothing: antialiased;
  /* ambient dash-lighting: vignette halus, bukan hitam datar */
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(79,70,229,.08), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(76,141,255,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
/* angka = readout instrumen: sejajar & tak goyang */
.num, .kpi-tile .val, .total-row .amt, .total-row span:last-child, td.r, th.r,
.success-num, .svc-btn .pr, .cart-item .pr { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a303c; border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #353c4a; background-clip: padding-box; }
::selection { background: rgba(79,70,229,.32); }

/* ---------- LOGIN ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 620px at 68% -12%, #2a0f13, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 384px; background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: .8; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 26px; letter-spacing: .3px; }
.brand .nm { color: var(--accent); }
.brand .flag { font-size: 24px; }
.login-card p.sub { color: var(--ink-dim); font-size: 13px; margin: 6px 0 22px; }

/* ---------- SHELL ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar { background: linear-gradient(180deg, #10131a, #0d1015); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; }
.sidebar .brand { padding: 22px 20px 16px; font-size: 21px; letter-spacing: .2px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--radius-sm);
  color: var(--ink-dim); font-weight: 600; font-size: 14px; position: relative; transition: background .13s, color .13s; }
.nav a .ic { width: 20px; text-align: center; font-size: 16px; filter: grayscale(.2); }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: linear-gradient(90deg, rgba(79,70,229,.20), rgba(79,70,229,.02) 70%, transparent);
  color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav a.active .ic { filter: none; }
.nav-sec { padding: 18px 14px 6px; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--ink-mute); text-transform: uppercase; }
.sidebar .foot { padding: 13px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-mute); letter-spacing: .3px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-bottom: 1px solid var(--line);
  background: rgba(18,21,27,.78); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim); }
.chip.ok { color: var(--ok); border-color: rgba(47,208,106,.35); }
.chip.warn { color: var(--warn); border-color: rgba(245,165,36,.38); }
.chip.accent { color: var(--accent-2); border-color: rgba(79,70,229,.38); }
.content { padding: 22px; flex: 1; width: 100%; max-width: 1360px; margin-inline: auto; }
.content > * { animation: rise .32s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hamb { display: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  width: 38px; height: 38px; font-size: 18px; cursor: pointer; }

/* ---------- COMPONENTS ---------- */
.card { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.card h2 { font-size: 14px; margin-bottom: 12px; letter-spacing: .2px; }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* KPI = readout instrumen (gauge cluster) */
.kpi-tile { position: relative; background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 17px; overflow: hidden; box-shadow: var(--shadow-sm); }
.kpi-tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 55%, transparent); opacity: .55; }
.kpi-tile .lbl { color: var(--ink-dim); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.kpi-tile .val { font-family: var(--mono); font-size: 27px; font-weight: 700; margin-top: 8px; letter-spacing: -.5px; line-height: 1.05; }
.kpi-tile .val.accent { color: var(--accent-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: var(--radius-sm);
  padding: 10px 16px; font-weight: 700; font-size: 14px; transition: .13s; user-select: none; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3c4454; background: #232937; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(79,70,229,.28); }
.btn.primary:hover { filter: brightness(1.07); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.ok { background: var(--ok); border-color: transparent; color: #06210f; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 20px; font-size: 17px; }

/* Segmented toggle (toolbar mode) */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; }
.seg .btn { border: 0; background: transparent; box-shadow: none; color: var(--ink-dim); padding: 7px 15px; }
.seg .btn:hover { background: var(--panel-2); color: var(--ink); }
.seg .btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; }

/* Toolbar untuk kelompok kontrol (periode dll) */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.toolbar .sp { flex: 1; }
.toolbar label.field { margin: 0; }
.toolbar .input { min-width: 0; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 11px; color: var(--ink-dim); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.input { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 13px; font-size: 14px; transition: border-color .13s, box-shadow .13s; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.16); }
select.input { cursor: pointer; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
th { color: var(--ink-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .2px; }
.badge.antri { background: rgba(245,165,36,.16); color: var(--warn); }
.badge.proses { background: rgba(76,141,255,.16); color: var(--info); }
.badge.selesai { background: rgba(47,208,106,.16); color: var(--ok); }
.badge.batal { background: rgba(101,109,123,.2); color: var(--ink-mute); }
.badge.tutup { background: rgba(101,109,123,.2); color: var(--ink-dim); }
.badge.buka { background: rgba(47,208,106,.16); color: var(--ok); }
.badge.minus { background: rgba(79,70,229,.16); color: var(--accent-2); }
.badge.plus { background: rgba(47,208,106,.16); color: var(--ok); }

.muted { color: var(--ink-dim); }
.section-title { display: flex; align-items: center; gap: 12px; margin: 2px 0 16px; }
.section-title h2 { font-size: 17px; letter-spacing: .2px; }
.section-title h3 { font-size: 15px; }
.section-title .spacer { flex: 1; }
.empty { text-align: center; color: var(--ink-mute); padding: 44px 20px; }

/* garis pemisah tebal untuk baris total di statement */
.total-row { display: flex; justify-content: space-between; font-size: 14px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 384px; gap: 16px; align-items: start; }
.pos-menu .cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-tab { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink-dim); transition: .12s; }
.cat-tab:hover { color: var(--ink); border-color: #3c4454; }
.cat-tab.active { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 3px 12px rgba(79,70,229,.3); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 10px; }
.svc-btn { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  cursor: pointer; text-align: left; transition: .13s; min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; }
.svc-btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.svc-btn .nm { font-weight: 700; font-size: 14px; }
.svc-btn .pr { color: var(--accent-2); font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.svc-btn .kt { font-size: 10.5px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }

.cart { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 78px;
  display: flex; flex-direction: column; max-height: calc(100dvh - 100px); box-shadow: var(--shadow-sm); }
.cart .hd { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cart .body { padding: 12px 16px; overflow-y: auto; flex: 1; }
.cart .items { display: flex; flex-direction: column; gap: 8px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cart-item .nm { font-weight: 600; font-size: 13px; }
.cart-item .free { color: var(--ok); font-size: 11px; font-weight: 700; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2);
  cursor: pointer; font-weight: 800; font-size: 15px; line-height: 1; }
.qty button:hover { border-color: var(--accent); }
.qty span { min-width: 20px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart .ft { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.total-row.big { font-size: 21px; font-weight: 800; }
.total-row.big .amt { color: var(--accent-2); }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pay-methods .btn { padding: 9px; font-size: 13px; }
.pay-methods .btn.on { background: var(--accent); border-color: transparent; color: #fff; }

.member-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; }
.member-box .found { display: flex; justify-content: space-between; align-items: center; }
.search-list { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 6px; max-height: 180px; overflow-y: auto; }
.search-list div { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.search-list div:hover { background: var(--panel-2); }

/* ---------- MODAL ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: grid; place-items: center; z-index: 100; padding: 20px;
  animation: fade .16s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow); max-height: 90dvh; overflow-y: auto; animation: rise .22s cubic-bezier(.2,.7,.3,1) both; }
.modal .mhd { padding: 18px 20px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 17px; }
.modal .mbd { padding: 20px; }
.modal .mft { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.success-num { text-align: center; font-size: 30px; font-weight: 900; color: var(--ok); margin: 8px 0; font-family: var(--mono); }

/* ---------- TOAST ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200;
  background: #232833; color: #fff; padding: 12px 20px; border-radius: 11px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); max-width: 90vw; border: 1px solid var(--line); }
.toast.err { background: var(--accent); border-color: transparent; }
.toast.ok { background: var(--ok); color: #06210f; border-color: transparent; }

.suspend-banner { background: var(--accent); color: #fff; text-align: center; padding: 10px; font-weight: 700; font-size: 14px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; }
  .cart { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 260px; left: -280px; transition: left .2s; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .hamb { display: inline-flex; align-items: center; justify-content: center; }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
  .content { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .content > *, .modal, .modal-bg { animation: none; }
}
