/* =====================================================================
   MINIATMPOS — Design system terinspirasi MaterialM (Nuxt Admin)
   Referensi: https://designmd.me/s/materialm-nuxt-main--9lbdw
   CSS variables + mode siang/malam, tanpa framework / build step.
   ===================================================================== */

:root {
  --brand: #00A1FF;
  --brand-soft: #E5F5FF;
  --brand-strong: #0074BA;
  --brand-hover: #0088CC;
  --ok: #4CAF50;
  --ok-soft: rgba(76, 175, 80, .15);
  --warn: #FFC107;
  --warn-soft: rgba(255, 193, 7, .15);
  --danger: #F44336;
  --danger-soft: rgba(244, 67, 54, .15);
  --info: #0A7EA4;
  --accent-blue: #00A1FF;
  --accent-cyan: #0A7EA4;
  --accent-purple: #763EBD;

  --bg: #F8FAFD;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --surface-3: #EEF3F7;
  --border: #E0E6EB;
  --text: #111C2D;
  --muted: #7B8893;
  --shadow: rgba(133, 146, 173, .2) 0 1px 4px;
  --shadow-elevated: rgba(0, 0, 0, .05) 0 9px 17.5px;
  --radius: 24px;
  --radius-sm: 8px;
  --radius-pill: 30px;
  --sidebar-w: 300px;
  --header-h: 70px;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --glow: 0 0 0 3px rgba(0, 161, 255, .12);
}

html[data-theme="dark"] {
  --brand: #33B5FF;
  --brand-soft: rgba(0, 161, 255, .16);
  --brand-strong: #66C9FF;
  --brand-hover: #1AABFF;
  --ok: #66BB6A;
  --ok-soft: rgba(76, 175, 80, .18);
  --warn: #FFD54F;
  --warn-soft: rgba(255, 193, 7, .16);
  --danger: #EF5350;
  --danger-soft: rgba(244, 67, 54, .18);
  --info: #4FC3F7;
  --accent-blue: #33B5FF;
  --accent-cyan: #4DD0E1;
  --accent-purple: #9575CD;

  --bg: #0B1220;
  --surface: #111C2D;
  --surface-2: #162235;
  --surface-3: #1C2A40;
  --border: #243247;
  --text: #E8EEF5;
  --muted: #8A97A8;
  --shadow: rgba(0, 0, 0, .35) 0 1px 4px;
  --shadow-elevated: rgba(0, 0, 0, .4) 0 10px 28px;
  --glow: 0 0 0 3px rgba(0, 161, 255, .22);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 22px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 18px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; }
.tiny { font-size: 11px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }

/* ---------------------------------------------------------------- login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 10% -10%, var(--brand-soft), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  padding: 32px 28px;
}
.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-card .logo { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto; }
.login-card h1 { font-size: 24px; font-weight: 700; color: var(--text); text-align: center; }
.login-modules { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; justify-content: center; }
.login-card > .tiny.muted { text-align: center; }

/* --------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 5;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, #33B5FF, #00A1FF);
  color: #fff; display: grid; place-items: center; flex: none;
  box-shadow: rgba(0, 161, 255, .28) 0 8px 18px;
}
.sidebar-brand .brand-title {
  font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15;
  color: var(--text);
  overflow-wrap: anywhere;
}
.sidebar-brand .brand-sub {
  font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-top: 3px;
  overflow-wrap: anywhere;
}
.sidebar-nav { padding: 4px 14px 28px; }
.nav-group { margin-top: 18px; }
.nav-group-title {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 4px 14px 10px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 42px;
  padding: 4px 14px; border-radius: var(--radius-pill);
  color: rgba(17, 28, 45, .8); font-weight: 400; cursor: pointer; margin-bottom: 2px;
  border: 0; transition: background .15s, color .15s;
}
html[data-theme="dark"] .nav-item { color: rgba(232, 238, 245, .78); }
.nav-item:hover { background: var(--brand-soft); color: var(--brand); }
.nav-item.active {
  background: var(--brand-soft); color: var(--brand);
  font-weight: 500;
}
.nav-ico {
  width: 22px; height: 22px; display: grid; place-items: center; flex: none;
}
.nav-svg { width: 20px; height: 20px; display: block; }
.nav-label { font-size: 14px; line-height: 1.35; }
.btn-ico { display: inline-grid; place-items: center; width: 16px; height: 16px; }
.btn-ico .nav-svg { width: 16px; height: 16px; }

.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  min-height: var(--header-h); display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: transparent;
  position: sticky; top: 0; z-index: 12;
}
.access-banner {
  margin: 0 24px 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
  color: var(--text);
  box-shadow: var(--shadow);
}
.access-banner.expired { border-left-color: var(--warn); background: var(--warn-soft); }
.access-banner-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.access-banner-msg { font-size: 13.5px; line-height: 1.4; }
.access-banner-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.app-readonly .btn.primary,
.app-readonly .btn.danger,
.app-readonly .btn.ok {
  opacity: .72;
}
.topbar .spacer { flex: 1; }
.topbar-shop {
  min-width: 220px; max-width: 320px; height: 42px; padding: 0 16px;
  background: var(--surface); border: 0; border-radius: var(--radius-pill);
  color: var(--text); font-weight: 500; box-shadow: var(--shadow);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: var(--radius-pill);
  padding: 6px 12px 6px 6px; box-shadow: var(--shadow);
}
.user-chip .meta .name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip .meta .sub { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.role-pill {
  display: inline-flex; padding: 2px 8px; border-radius: 9999px;
  font-size: 11px; font-weight: 500; line-height: 18px;
  background: var(--ok-soft); color: var(--ok);
}
.role-pill.kasir { background: var(--brand-soft); color: var(--brand); }
.role-pill.kurir { background: var(--warn-soft); color: #B28704; }
.role-pill.superadmin { background: rgba(118, 62, 189, .12); color: var(--accent-purple); }
.btn-logout {
  background: var(--brand) !important;
  border-color: transparent !important; color: #fff !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: var(--shadow-elevated);
}
.btn-logout:hover { background: var(--brand-hover) !important; }
.content { padding: 8px 24px 28px; max-width: 1600px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .spacer { flex: 1; }
.page-title {
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 10px;
}
.page-title::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); flex: none;
}
.page-desc { margin-top: 4px; color: var(--muted); }
.date-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--surface); border: 0;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
}
.date-badge .check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ok); color: #fff;
  display: grid; place-items: center;
}

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: var(--surface);
  color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 15px;
  box-shadow: var(--shadow);
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.hamburger { display: none; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 0;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid.auto-lg { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.stats-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.grid.stats-7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.grid.stats-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  background: var(--surface); border: 0;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px;
}
.panel-title {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}

/* Sel ringkas Laporan Laba Keseluruhan */
.ov-cell { font-size: 11px; line-height: 1.35; min-width: 92px; }
.ov-grp {
  font-weight: 700; font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  margin-top: 5px; margin-bottom: 1px;
}
.ov-grp:first-child { margin-top: 0; }
.ov-grp.atm { color: #1d4ed8; }
.ov-grp.pos { color: #c2410c; }
.ov-line { display: flex; gap: 4px; align-items: baseline; white-space: nowrap; }
.ov-k { font-weight: 700; min-width: 1.1em; }
.ov-line.t .ov-k, .ov-line.t .ov-v { color: #334155; }
.ov-line.n .ov-k, .ov-line.n .ov-v,
.ov-line.o .ov-k, .ov-line.o .ov-v { color: #0369a1; }
.ov-line.l .ov-k, .ov-line.l .ov-v,
.ov-line.m .ov-k, .ov-line.m .ov-v { color: #15803d; }
.ov-total.t { color: #1d4ed8; font-weight: 700; }
.ov-total.n { color: #0e7490; font-weight: 700; }
.ov-total.l { color: #15803d; font-weight: 700; }
[data-theme="dark"] .ov-grp.atm { color: #60a5fa; }
[data-theme="dark"] .ov-grp.pos { color: #fb923c; }
[data-theme="dark"] .ov-line.t .ov-k, [data-theme="dark"] .ov-line.t .ov-v { color: #cbd5e1; }
[data-theme="dark"] .ov-line.n .ov-k, [data-theme="dark"] .ov-line.n .ov-v,
[data-theme="dark"] .ov-line.o .ov-k, [data-theme="dark"] .ov-line.o .ov-v { color: #38bdf8; }
[data-theme="dark"] .ov-line.l .ov-k, [data-theme="dark"] .ov-line.l .ov-v,
[data-theme="dark"] .ov-line.m .ov-k, [data-theme="dark"] .ov-line.m .ov-v { color: #4ade80; }

.stat {
  background: var(--surface);
  border: 0;
  border-radius: 18px; padding: 18px 16px 16px; box-shadow: var(--shadow);
  min-width: 0;
  transition: box-shadow .15s, transform .15s;
}
.stat:hover { box-shadow: var(--shadow-elevated); }
.stat .label {
  font-size: 11px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
  overflow-wrap: anywhere;
}
.stat .value {
  font-size: 20px; font-weight: 700; margin-top: 10px;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  line-height: 1.25; color: var(--text);
}
.stat .sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
/* Soft live: angka berubah di tempat dengan flash singkat */
[data-live].live-tick {
  animation: liveTick .55s ease;
  border-radius: 4px;
}
@keyframes liveTick {
  0% { background: rgba(0, 161, 255, .18); }
  100% { background: transparent; }
}
.stat.brand .value, .stat.blue .value { color: var(--accent-blue); }
.stat.ok .value, .stat.green .value { color: var(--ok); }
.stat.warn .value, .stat.orange .value { color: #F59E0B; }
.stat.danger .value, .stat.pink .value { color: var(--danger); }
.stat.cyan .value { color: var(--accent-cyan); }
.stat.neutral .value { color: var(--text); }

.shop-box {
  background: var(--surface);
  border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.shop-box-head {
  padding: 20px 20px 12px; display: flex; align-items: flex-start; gap: 10px;
}
.shop-box-head .shop-title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.shop-box-head .shop-addr { font-size: 12px; color: var(--muted); margin-top: 4px; }
.shop-box-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 0 20px 16px;
}
.metric-tile {
  background: var(--surface-2); border: 0;
  border-radius: 16px; padding: 14px;
}
.metric-tile .lbl {
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.metric-tile .val {
  margin-top: 8px; font-size: 18px; font-weight: 700;
  color: var(--brand); font-variant-numeric: tabular-nums;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.25;
}
.shop-box-foot {
  margin-top: auto; padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  background: var(--surface-2); font-size: 11.5px; color: var(--muted); font-weight: 500;
}
.shop-box-foot strong, .shop-box-foot .foot-count {
  color: var(--brand); font-weight: 700; letter-spacing: .02em;
}
.shop-box-body { padding: 0 20px 16px; }
.shop-box details.more { margin-top: 2px; }
.shop-box details.more > summary {
  cursor: pointer; list-style: none; color: var(--brand); font-size: 12px; font-weight: 500;
  padding: 4px 0 8px;
}
.shop-box details.more > summary::-webkit-details-marker { display: none; }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv-total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 8px; }
.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 16px 0 12px;
}

/* --------------------------------------------------------------- inputs */
label.field { display: block; margin-bottom: 14px; }
label.field > span.lbl {
  display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--muted);
}
input, select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: border-color .12s, box-shadow .12s, background .12s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: var(--glow);
}
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 72px; resize: vertical; }
input.money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline > label.field { margin-bottom: 0; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; flex: none; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters label.field { margin-bottom: 0; min-width: 140px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow);
  transition: background .15s, box-shadow .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.primary {
  background: var(--brand); border-color: transparent; color: #fff;
  box-shadow: var(--shadow-elevated);
}
.btn.primary:hover { background: var(--brand-hover); border-color: transparent; }
.btn.ok { background: var(--ok); border-color: transparent; color: #fff; }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.ghost-danger {
  color: var(--danger); border-color: var(--border); background: transparent; box-shadow: none;
}
.btn.ghost-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: 6px 14px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 10px 16px; border: none; background: none; font: inherit; font-weight: 500;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.report-subnav {
  padding: 12px 16px; margin-bottom: 12px;
}
.report-subnav label.field { margin-bottom: 0; min-width: 220px; max-width: 420px; }
.report-subnav select { min-width: 260px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 9999px; font-size: 12px; font-weight: 500; line-height: 18px;
  background: var(--surface-2); color: var(--muted); border: 0;
}
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.online {
  background: var(--ok-soft); color: var(--ok);
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
.pill.offline {
  background: rgba(170, 170, 170, .15); color: #AAAAAA;
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
.pill.warn { background: var(--warn-soft); color: #B28704; }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto; border: 0; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 14px 16px; background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--brand-soft); }
tfoot td { padding: 14px 16px; font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-cell { color: var(--brand); cursor: pointer; font-weight: 500; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 2px 0; }

/* --------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17, 28, 45, .45);
  display: grid; place-items: center; padding: 18px; z-index: 1006; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column;
  border: 0;
}
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1120px; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius);
}

/* --------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1100; }
.toast {
  background: var(--surface); border: 0; border-left: 3px solid var(--brand);
  border-radius: 12px; box-shadow: var(--shadow-elevated); padding: 12px 16px; max-width: 380px;
  font-size: 13px; animation: slide-in .16s ease-out;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ POS kasir */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; max-height: 460px; overflow-y: auto; padding: 2px; }
.product-card {
  border: 0; border-radius: 16px; padding: 12px;
  cursor: pointer; background: var(--surface); display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow);
}
.product-card:hover { background: var(--brand-soft); }
.product-card.out { opacity: .5; cursor: not-allowed; }
.product-card .nm { font-weight: 600; font-size: 13px; line-height: 1.3; }
.product-card .pr { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.cart-list { max-height: 300px; overflow-y: auto; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.qty-box { display: flex; align-items: center; gap: 4px; }
.qty-box input { width: 54px; text-align: center; padding: 4px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: var(--brand-soft); color: var(--brand); cursor: pointer; font-weight: 700;
}
.total-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.total-line.big { font-size: 19px; font-weight: 700; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

/* ---------------------------------------------------------------- struk (preview mirip thermal 58mm) */
.receipt {
  font-family: "DejaVu Sans Mono", "Courier New", monospace; font-size: 11px;
  background: #fff; color: #111; padding: 10px 8px; border-radius: 6px;
  width: 220px; max-width: 100%; margin: 0 auto; line-height: 1.3;
  border: 1px dashed var(--border);
}
.receipt hr { border: none; border-top: 1px dashed #999; margin: 6px 0; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 6px; }
.receipt .r-center { text-align: center; }
.receipt .bold { font-weight: 700; }
.receipt .small { font-size: 10px; }

/* ---------------------------------------------------------------- chart */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { display: block; width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: 12px; }
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ------------------------------------------------------------------ gps */
.gps-panel { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.gps-status { padding: 14px 16px; border-radius: 16px; border: 0; background: var(--surface-2); box-shadow: var(--shadow); }
.gps-status.in { background: var(--ok-soft); }
.gps-status.out { background: var(--danger-soft); }

.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { padding: 48px; display: grid; place-items: center; gap: 12px; color: var(--muted); }

.wa-preview {
  font-family: "DejaVu Sans Mono", monospace; font-size: 12px; white-space: pre-wrap;
  background: var(--surface-2); border: 0; border-radius: 12px;
  padding: 14px; max-height: 340px; overflow-y: auto;
}

/* ---------------------------------------------------------- scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
*:hover { scrollbar-color: rgba(120, 130, 150, .28) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}
*:hover::-webkit-scrollbar-thumb { background: rgba(120, 130, 150, .28); }
*::-webkit-scrollbar-thumb:hover { background: rgba(120, 130, 150, .42); }

.table-sort {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1280px) {
  .grid.stats-3, .grid.stats-4, .grid.stats-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 86vw; max-width: var(--sidebar-w);
    z-index: 60; transform: translateX(-102%); transition: transform .18s ease;
  }
  .sidebar.open { transform: none; }
  .hamburger { display: grid; }
  .pos-layout { grid-template-columns: 1fr; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.stats-3, .grid.stats-4, .grid.stats-7 { grid-template-columns: 1fr; }
  .grid.auto, .grid.auto-lg { grid-template-columns: 1fr; }
  .topbar-shop { min-width: 160px; }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(17, 28, 45, .4); z-index: 55; }
}
@media (max-width: 620px) {
  .content { padding: 8px 14px 20px; }
  .topbar { padding: 10px 14px; }
  .hide-sm { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.stats-3, .grid.stats-4, .grid.stats-7,
  .grid.auto, .grid.auto-lg { grid-template-columns: 1fr; }
  .stat .value { font-size: 18px; }
/* Soft live: angka berubah di tempat dengan flash singkat */
.live-tick {
  animation: liveTick .55s ease;
}
@keyframes liveTick {
  0% { background: rgba(0, 161, 255, .18); }
  100% { background: transparent; }
}
  .shop-box-metrics { grid-template-columns: 1fr; }
  .btn-logout span.hide-xs { display: none; }
  .card, .panel { padding: 18px; }
}

/* ---------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .no-print, .modal-foot { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal { max-width: none; box-shadow: none; border: none; }
}
