/* Panel Admin Kasir & PPOB
   Palet: tinta biru-batu, kertas struk, kuning sinyal konter pulsa */
:root {
  --ink: #172a3a;
  --ink-2: #24394b;
  --paper: #f3f5f7;
  --sheet: #ffffff;
  --line: #dde2e7;
  --text: #1c2730;
  --muted: #637280;
  --signal: #f5c518;
  --ok: #1e8e5a;
  --ok-bg: #e4f4ec;
  --wait: #9a6b00;
  --wait-bg: #fff4d1;
  --bad: #c8322d;
  --bad-bg: #fbe7e6;
  --radius: 8px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
}
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- Kerangka ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 236px; flex: none;
  background: var(--ink); color: #c9d4de;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; }
.brand strong { display: block; color: #fff; font-size: 16px; line-height: 1.2; }
.brand small { color: #8fa1b2; font-size: 12px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--signal);
  box-shadow: inset 0 -9px 0 rgba(0, 0, 0, .14);
}
.side nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a {
  color: #c9d4de; text-decoration: none; padding: 9px 12px; border-radius: 6px;
  font-weight: 500; border-left: 3px solid transparent;
}
.side nav a:hover { background: var(--ink-2); color: #fff; }
.side nav a.active { background: var(--ink-2); color: #fff; border-left-color: var(--signal); }
.side-foot { padding: 16px 20px 20px; border-top: 1px solid var(--ink-2); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.side-foot a { color: #8fa1b2; }
.mode-chip {
  align-self: flex-start; text-decoration: none; font-weight: 600;
  background: var(--signal); color: var(--ink) !important; padding: 3px 9px; border-radius: 999px; font-size: 12px;
}

.main { flex: 1; min-width: 0; padding: 0 32px 48px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 26px 0 18px; }
.topbar h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.menu-btn { display: none; }

/* ---------- Komponen ---------- */
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 17px; font-weight: 700; color: var(--ink); }
.panel p.hint, .hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }

label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font: inherit; width: 100%; padding: 9px 11px; border: 1px solid #c7d0d8; border-radius: 6px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(245, 197, 24, .45); }
.field { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; display: inline-block; text-decoration: none;
  padding: 9px 16px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff; line-height: 1.3;
}
.btn:hover { background: var(--ink-2); }
.btn-light { background: #fff; color: var(--ink); border-color: #c7d0d8; }
.btn-light:hover { background: var(--paper); }
.btn-danger { background: #fff; color: var(--bad); border-color: #e6b3b1; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.inline { display: inline; }

.alert { padding: 11px 14px; border-radius: 6px; margin-bottom: 16px; font-weight: 500; }
.alert-ok { background: var(--ok-bg); color: #145c3b; }
.alert-err { background: var(--bad-bg); color: #8c211d; }
.alert-info { background: var(--wait-bg); color: #6b4a00; }

.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.muted td { color: var(--muted); }
td .sub { display: block; color: var(--muted); font-size: 12px; }
.actions { white-space: nowrap; text-align: right; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-wait { background: var(--wait-bg); color: var(--wait); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.low { color: var(--bad); font-weight: 700; }

/* ---------- Ringkasan: struk hari ini ---------- */
.today { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 24px; align-items: start; }
.receipt {
  background: var(--sheet); padding: 22px 24px 30px; position: relative;
  border: 1px solid var(--line); border-bottom: 0;
  font-family: var(--mono); font-size: 13px; color: var(--text);
}
.receipt::after {
  content: ""; position: absolute; left: -1px; right: -1px; bottom: -10px; height: 10px;
  background:
    linear-gradient(-45deg, transparent 6px, var(--sheet) 0) 0 0 / 12px 10px repeat-x,
    linear-gradient(45deg, transparent 6px, var(--sheet) 0) 0 0 / 12px 10px repeat-x;
}
.receipt .r-head { text-align: center; margin-bottom: 12px; }
.receipt .r-head b { display: block; font-size: 15px; }
.receipt .r-line { border-top: 1px dashed #aab4be; margin: 10px 0; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 12px; }
.receipt .r-total { font-size: 22px; font-weight: 600; margin-top: 4px; }
.receipt .r-foot { text-align: center; color: var(--muted); margin-top: 10px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fact span { display: block; color: var(--muted); font-size: 13px; }
.fact strong { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--ink); }
.fact a { font-size: 13px; }

/* ---------- Login & instalasi ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.auth-card { width: 100%; max-width: 400px; background: var(--sheet); border-radius: 12px; padding: 28px; }
.auth-card.wide { max-width: 620px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--ink); }
.auth-card .lead { color: var(--muted); margin: 0 0 20px; }
.checks { list-style: none; padding: 0; margin: 0 0 18px; }
.checks li { padding: 6px 0; border-bottom: 1px solid #eef1f4; display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Responsif ---------- */
@media (max-width: 900px) {
  .today { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .side { position: fixed; z-index: 20; left: -260px; transition: left .2s; }
  .side.open { left: 0; }
  .menu-btn { display: inline-block; font: inherit; font-weight: 600; border: 1px solid #c7d0d8; background: #fff; border-radius: 6px; padding: 6px 12px; }
  .main { padding: 0 16px 40px; }
  .topbar h1 { font-size: 21px; }
  .grid-2, .grid-3, .facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
@media print {
  .side, .topbar .menu-btn, .toolbar, .no-print { display: none !important; }
  .main { padding: 0; }
}
