/* ===== RPM POS — tema otomotif charcoal + aksen merah ===== */
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --ink: #e8eaed;
  --ink-dim: #9aa1ad;
  --ink-mute: #6b7280;
  --accent: #ef2d2d;
  --accent-2: #ff5a3c;
  --accent-ink: #fff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --info: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  --sidebar-w: 232px;
  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;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.45;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c313c; border-radius: 20px; }

/* ---------- LOGIN ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 70% -10%, #241014, transparent), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 26px; letter-spacing: .5px; }
.brand .rpm { 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: #121419; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; }
.sidebar .brand { padding: 20px 20px 14px; font-size: 22px; }
.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 14px; border-radius: var(--radius-sm);
  color: var(--ink-dim); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a .ic { width: 20px; text-align: center; font-size: 16px; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: linear-gradient(90deg, rgba(239,45,45,.18), transparent); color: #fff;
  box-shadow: inset 3px 0 0 var(--accent); }
.nav-sec { padding: 16px 14px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .7px; color: var(--ink-mute); text-transform: uppercase; }
.sidebar .foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-mute); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; 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(34,197,94,.35); }
.chip.warn { color: var(--warn); border-color: rgba(245,158,11,.35); }
.chip.accent { color: var(--accent-2); border-color: rgba(239,45,45,.35); }
.content { padding: 20px; flex: 1; }

.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: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { font-size: 15px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi-tile .lbl { color: var(--ink-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi-tile .val { font-size: 26px; font-weight: 800; margin-top: 6px; }
.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: .12s; user-select: none; }
.btn:hover { border-color: #3a4150; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.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; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--ink-dim); font-weight: 600; margin-bottom: 6px; }
.input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 14px; }
.input:focus { outline: none; border-color: var(--accent); }
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); }
th { color: var(--ink-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
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; }
.badge.antri { background: rgba(245,158,11,.16); color: var(--warn); }
.badge.proses { background: rgba(59,130,246,.16); color: var(--info); }
.badge.selesai { background: rgba(34,197,94,.16); color: var(--ok); }
.badge.batal { background: rgba(107,114,128,.2); color: var(--ink-mute); }
.badge.tutup { background: rgba(107,114,128,.2); color: var(--ink-dim); }
.badge.buka { background: rgba(34,197,94,.16); color: var(--ok); }
.badge.minus { background: rgba(239,45,45,.16); color: var(--accent-2); }
.badge.plus { background: rgba(34,197,94,.16); color: var(--ok); }

.muted { color: var(--ink-dim); }
.section-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.section-title h2 { font-size: 18px; }
.section-title .spacer { flex: 1; }
.empty { text-align: center; color: var(--ink-mute); padding: 40px 20px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 380px; 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); }
.cat-tab.active { background: var(--accent); border-color: transparent; color: #fff; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.svc-btn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  cursor: pointer; text-align: left; transition: .12s; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; }
.svc-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.svc-btn .nm { font-weight: 700; font-size: 14px; }
.svc-btn .pr { color: var(--accent-2); font-weight: 800; margin-top: 8px; }
.svc-btn .kt { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .3px; }

.cart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 76px;
  display: flex; flex-direction: column; max-height: calc(100dvh - 96px); }
.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 span { min-width: 20px; text-align: center; font-weight: 700; }
.cart .ft { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.total-row { display: flex; justify-content: space-between; font-size: 14px; }
.total-row.big { font-size: 20px; 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); 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,.6); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: 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; }
.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; }

/* ---------- TOAST ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200;
  background: #222; color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--accent); }
.toast.ok { background: var(--ok); color: #06210f; }

.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; }
}
