/* ============================================================
   IzPOS - Design System
   Neutral surface + single indigo accent. No gradients.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #eef0f3;
  --sidebar: #14181f;
  --sidebar-2: #1b2029;
  --sidebar-border: #262c37;

  /* Text */
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --sidebar-text: #9aa3b2;
  --sidebar-text-2: #e5e8ee;

  /* Lines */
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Accent (single) */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0fe;
  --accent-ring: rgba(79, 70, 229, .18);

  /* Semantic */
  --green: #0f9d58;
  --green-soft: #e9f7ef;
  --amber: #b26a00;
  --amber-soft: #fdf3e3;
  --red: #d93a3a;
  --red-soft: #fdecec;
  --blue: #1d6fd6;
  --blue-soft: #eaf2fd;

  /* Radii */
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Shadows (very subtle) */
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-3: 0 8px 24px rgba(16, 24, 40, .10);
  --shadow-4: 0 16px 48px rgba(16, 24, 40, .16);

  --sidebar-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 13.5px; }
img, svg { display: block; }
::selection { background: var(--accent); color: #fff; }

/* Focus visible */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd3da; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b4b9c2; background-clip: content-box; }

/* ============================= Layout ============================= */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  transition: transform .24s cubic-bezier(.4,0,.2,1);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: #5b6472; padding: 16px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r); color: var(--sidebar-text);
  font-weight: 500; font-size: 13px; width: 100%; text-align: left;
  transition: background .12s, color .12s; margin-bottom: 1px;
}
.nav-item:hover { background: var(--sidebar-2); color: var(--sidebar-text-2); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .nav-ico { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; opacity: .9; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 600;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px;
}

.sidebar-footer { padding: 12px; border-top: 1px solid var(--sidebar-border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: var(--r); }
.user-chip:hover { background: var(--sidebar-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: #2f3743; color: #cfd4dc;
  display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.avatar.accent { background: var(--accent); color: #fff; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta span:first-child { font-weight: 600; font-size: 12.5px; color: #e5e8ee; }
.user-meta span:last-child { font-size: 11px; color: var(--sidebar-text); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  position: sticky; top: 0; z-index: 40;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center;
  color: var(--text-2); transition: background .12s, color .12s; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
#menuToggle { display: none; }
.topbar-title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.lang-btn {
  height: 32px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--border);
  color: var(--text-2); font-weight: 600; font-size: 11.5px; letter-spacing: .02em;
  transition: all .12s;
}
.lang-btn:hover { border-color: var(--border-strong); color: var(--text); }
.clock { font-size: 12.5px; font-weight: 500; color: var(--text-2); padding: 0 4px; font-variant-numeric: tabular-nums; }
.clock b { color: var(--text); font-weight: 600; }
.kds-badge {
  position: absolute; top: 3px; right: 3px; background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px;
  display: grid; place-items: center; padding: 0 4px; border: 1.5px solid var(--surface);
}

.content { padding: 20px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* ============================= Cards ============================= */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.card-pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.card-title { font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.card-sub { font-size: 12px; color: var(--text-2); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 12px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ico {
  width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}
.kpi-ico.accent { background: var(--accent-soft); color: var(--accent); }
.kpi-ico.green { background: var(--green-soft); color: var(--green); }
.kpi-ico.amber { background: var(--amber-soft); color: var(--amber); }
.kpi-ico.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.up { color: var(--green); }
.down { color: var(--red); }

/* ============================= Buttons ============================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r); font-weight: 600; font-size: 13px;
  transition: background .12s, border-color .12s, color .12s, transform .06s;
  white-space: nowrap; border: 1px solid transparent; line-height: 1.2;
}
.btn:active { transform: translateY(.5px); }
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-accent { background: var(--green); color: #fff; }
.btn-accent:hover { filter: brightness(.94); }
.btn-ghost { background: var(--surface-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--text-3); background: var(--surface-2); }
.btn-outline.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ============================= Inputs ============================= */
.input, .select, .textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface); color: var(--text); transition: border-color .12s, box-shadow .12s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input::placeholder { color: var(--text-3); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 34px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

/* ============================= Badges ============================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.badge-accent { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-primary { background: var(--accent-soft); color: var(--accent); }
.badge-soft { background: var(--surface-2); color: var(--text-2); }

.pill-new { background: var(--blue-soft); color: var(--blue); }
.pill-prep { background: var(--amber-soft); color: var(--amber); }
.pill-ready { background: #f3e8fd; color: #8b3fd4; }
.pill-done { background: var(--green-soft); color: var(--green); }

/* ============================= Tables ============================= */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 16px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3); font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================= POS ============================= */
.pos-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.pos-left { display: flex; flex-direction: column; gap: 14px; }
.cat-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  padding: 7px 14px; border-radius: 20px; background: var(--surface-2); font-weight: 500; font-size: 12.5px;
  color: var(--text-2); white-space: nowrap; transition: all .12s; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.cat-chip:hover { background: var(--surface-3); }
.cat-chip.active { background: var(--text); color: #fff; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prod-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .1s;
  display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.prod-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.prod-card:active { transform: scale(.985); }
.prod-thumb {
  width: 100%; aspect-ratio: 1.6; border-radius: var(--r-sm); background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-3);
}
.prod-name { font-weight: 500; font-size: 12.5px; line-height: 1.3; }
.prod-price { font-weight: 600; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.prod-card .stock-low { font-size: 10.5px; color: var(--red); font-weight: 600; }

.cart-panel { position: sticky; top: 72px; display: flex; flex-direction: column; max-height: calc(100vh - 92px); }
.cart-items { flex: 1; overflow-y: auto; padding: 8px 16px; min-height: 80px; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-qty { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center;
  color: var(--text-2); transition: all .12s; border: 1px solid var(--border);
}
.qty-btn:hover { background: var(--text); color: #fff; border-color: var(--text); }
.qty-num { font-weight: 600; min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-item-name { flex: 1; font-weight: 500; font-size: 12.5px; }
.cart-item-price { font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cart-item-del { color: var(--text-3); transition: color .12s; }
.cart-item-del:hover { color: var(--red); }
.cart-empty { text-align: center; padding: 36px 20px; color: var(--text-3); }
.cart-empty .e-ico { display: grid; place-items: center; margin-bottom: 10px; color: var(--border-strong); }
.cart-totals { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 7px; }
.tot-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tot-row.grand { font-size: 17px; font-weight: 700; color: var(--text); padding-top: 9px; border-top: 1px solid var(--border); }
.cart-actions { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Segmented */
.seg { display: flex; gap: 3px; background: var(--surface-2); padding: 3px; border-radius: var(--r); }
.seg-btn {
  flex: 1; padding: 7px 6px; border-radius: var(--r-sm); font-weight: 600; font-size: 12px;
  color: var(--text-2); transition: all .12s; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }

/* ============================= Tables (meja) ============================= */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.table-card {
  border-radius: var(--r-lg); padding: 15px; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  transition: border-color .12s, box-shadow .12s; position: relative;
}
.table-card:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.table-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--border-strong);
}
.table-card.available::before { background: var(--green); }
.table-card.occupied::before { background: var(--amber); }
.table-card.paying::before { background: var(--accent); }
.table-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.table-cap { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.table-status { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 5px; align-self: flex-start; }

/* ============================= Modal ============================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.5); backdrop-filter: blur(2px);
  z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-4); animation: pop .18s ease;
}
.modal-lg { max-width: 680px; }
.modal-full { max-width: 96vw; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal-title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-2); transition: all .12s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end;
  position: sticky; bottom: 0; background: var(--surface);
}
@keyframes pop { from { transform: scale(.98) translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================= Toast ============================= */
#toastWrap { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #fff; padding: 11px 15px; border-radius: var(--r);
  box-shadow: var(--shadow-4); display: flex; align-items: center; gap: 9px;
  font-weight: 500; font-size: 12.5px; animation: slideIn .2s ease; max-width: 340px;
}
.toast .ti { display: grid; place-items: center; flex-shrink: 0; }
.toast.success { background: #0b7a45; }
.toast.error { background: #b62d2d; }
.toast.warning { background: #a35f00; }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================= KDS ============================= */
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; padding: 18px; }
.kds-ticket {
  background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--border);
  border-left: 3px solid var(--blue); overflow: hidden; animation: pop .2s ease; box-shadow: var(--shadow-1);
}
.kds-ticket.prep { border-left-color: var(--amber); }
.kds-ticket.ready { border-left-color: #8b3fd4; }
.kds-ticket.done { border-left-color: var(--green); opacity: .65; }
.kds-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; background: var(--surface-2); }
.kds-id { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.kds-time { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.kds-type { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
.kds-items { padding: 10px 15px; }
.kds-item { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.kds-item span:first-child { font-weight: 500; }
.kds-item span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.kds-note { padding: 0 15px 10px; font-size: 12px; color: var(--text-2); font-style: italic; }
.kds-foot { display: flex; gap: 8px; padding: 11px 15px; border-top: 1px solid var(--border); }

/* ============================= Charts ============================= */
.chart-box { width: 100%; height: 260px; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 100%; padding: 10px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 42px; border-radius: 6px 6px 2px 2px; background: var(--accent);
  position: relative; min-height: 3px; transition: height .5s ease; opacity: .9;
}
.bar:hover { opacity: 1; }
.bar-label { font-size: 10.5px; color: var(--text-2); font-weight: 500; }

/* ============================= Misc ============================= */
.progress { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s ease; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty-state .e-ico { display: grid; place-items: center; margin-bottom: 12px; color: var(--border-strong); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.bold { font-weight: 600; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* method btn */
.method-btn { flex-direction: column; gap: 7px; padding: 14px 8px; height: auto; }
.method-btn span.lbl { font-size: 11.5px; font-weight: 600; }

/* ============================= Responsive ============================= */
.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pos-grid { grid-template-columns: 1fr; }
  .cart-panel { position: static; max-height: none; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-4); }
  .sidebar.open { transform: translateX(0); }
  #menuToggle { display: grid; }
  .main { margin-left: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .clock { display: none; }
}

@media (max-width: 560px) {
  .content { padding: 14px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .table-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 12px; }
  .kpi-value { font-size: 21px; }
  .modal { max-width: 100%; }
  .kds-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .cart-actions, #toastWrap, .modal-overlay, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
}

/* ============================================================
   PUBLIC PAGES - Landing / Auth / Onboarding
   ============================================================ */
body.public #app { display: block; }
body.public { background: var(--surface); }

/* ---------- Landing ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.land-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 40px; max-width: 1200px; width: 100%; margin: 0 auto;
}
.land-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.land-links { display: flex; gap: 26px; }
.land-links a { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 13.5px; }
.land-links a:hover { color: var(--text); }

.land-hero {
  max-width: 1200px; width: 100%; margin: 0 auto; padding: 50px 40px 70px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center;
}
.land-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; margin-bottom: 20px;
}
.land-hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.land-hero h1 em { font-style: normal; color: var(--accent); }
.land-hero p { color: var(--text-2); font-size: 15.5px; line-height: 1.6; margin: 18px 0 26px; max-width: 520px; }
.land-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.land-trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 24px; font-size: 12.5px; color: var(--text-2); }
.land-trust span { display: inline-flex; align-items: center; gap: 6px; }
.land-trust svg { color: var(--green); }

.land-hero-art { display: flex; justify-content: center; }
.mock {
  width: 100%; max-width: 460px; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-4); background: var(--surface);
}
.mock-top { display: flex; gap: 6px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mock-top span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.mock-body { display: grid; grid-template-columns: 70px 1fr; min-height: 250px; }
.mock-side { background: var(--sidebar); padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.mock-brand { margin-bottom: 6px; }
.mock-nav { height: 8px; border-radius: 4px; background: var(--sidebar-2); }
.mock-nav.active { background: var(--accent); }
.mock-main { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-kpi { background: var(--surface-2); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.mock-kpi i { display: block; width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); }
.mock-kpi b { display: block; height: 9px; width: 70%; border-radius: 4px; background: var(--border-strong); }
.mock-chart { flex: 1; display: flex; align-items: flex-end; gap: 8px; background: var(--surface-2); border-radius: var(--r); padding: 14px; }
.mock-chart span { flex: 1; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; }

.land-features, .land-biz, .land-pricing { max-width: 1200px; width: 100%; margin: 0 auto; padding: 60px 40px; }
.land-section-head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.land-section-head h2 { font-size: 30px; letter-spacing: -.025em; font-weight: 800; }
.land-section-head p { color: var(--text-2); font-size: 14.5px; margin-top: 10px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat-card {
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px;
  display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s;
}
.feat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }

.biz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.biz-card {
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}

.price-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 720px; margin: 0 auto; }
.price-card {
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 26px;
  display: flex; flex-direction: column; gap: 12px; position: relative;
}
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow-3); }
.price-tag {
  position: absolute; top: -11px; right: 22px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
}
.price-amt { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.price-amt span { font-size: 13px; font-weight: 500; color: var(--text-3); }
.price-card ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 8px 0 12px; }
.price-card li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.price-card li svg { color: var(--green); flex-shrink: 0; }

.land-foot {
  max-width: 1200px; width: 100%; margin: 0 auto; padding: 28px 40px;
  display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border);
}

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 40px; max-width: 440px; width: 100%; margin: 0 auto; }
.auth-back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 500; font-size: 13px; margin-bottom: 34px; align-self: flex-start; }
.auth-back svg { transform: rotate(180deg); }
.auth-back:hover { color: var(--text); }
.auth-brand { margin-bottom: 26px; }
.auth-title { font-size: 26px; letter-spacing: -.025em; font-weight: 800; }
.auth-sub { margin: 6px 0 24px; font-size: 13.5px; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-err { color: var(--red); font-size: 12.5px; font-weight: 500; min-height: 16px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-2); }
.auth-switch a { color: var(--accent); font-weight: 600; cursor: pointer; }

.auth-aside { background: var(--sidebar); color: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-aside-inner { max-width: 380px; }
.auth-aside h3 { font-size: 24px; letter-spacing: -.02em; font-weight: 800; margin: 20px 0 12px; }
.auth-aside p { line-height: 1.6; font-size: 14px; color: var(--sidebar-text) !important; }
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--sidebar-text-2); }
.auth-points svg { color: #34d399; }

/* ---------- Onboarding ---------- */
.onboard { min-height: 100vh; display: flex; flex-direction: column; }
.onboard-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 30px; border-bottom: 1px solid var(--border);
}
.onboard-steps { display: flex; align-items: center; gap: 10px; }
.onboard-steps span {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-3); font-weight: 700; font-size: 13px;
}
.onboard-steps span.on { background: var(--accent); color: #fff; }
.onboard-steps i { width: 34px; height: 2px; background: var(--border); display: block; }
.onboard-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.onboard-inner { width: 100%; max-width: 620px; }
.onboard-inner h2 { font-size: 26px; letter-spacing: -.025em; font-weight: 800; margin-bottom: 6px; }

.biz-select { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.biz-option {
  display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left;
  border: 1.5px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  transition: all .14s; position: relative;
}
.biz-option:hover { border-color: var(--border-strong); }
.biz-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.biz-check { display: none; color: var(--accent); margin-left: auto; }
.biz-option.selected .biz-check { display: block; }

/* ---------- Product management ---------- */
.prod-thumb-lg {
  width: 46px; height: 46px; border-radius: var(--r); background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-3); flex-shrink: 0;
}
.stat-mini { display: flex; flex-direction: column; }
.stat-mini b { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .land-hero { grid-template-columns: 1fr; gap: 34px; padding: 30px 22px 50px; }
  .land-hero h1 { font-size: 34px; }
  .land-features, .land-biz, .land-pricing { padding: 44px 22px; }
  .feat-grid, .biz-grid { grid-template-columns: repeat(2, 1fr); }
  .land-links { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .land-nav { padding: 16px 22px; }
  .land-foot { padding: 24px 22px; }
}
@media (max-width: 560px) {
  .land-hero h1 { font-size: 28px; }
  .feat-grid, .biz-grid, .price-grid, .biz-select { grid-template-columns: 1fr; }
  .land-hero-art { display: none; }
  .land-cta .btn { width: 100%; }
}
