:root {
  --bg: #f8fafc;
  --paper: #ffffff;
  --paper-2: #fafbfc;
  --ink: #0b1f1a;
  --ink-2: #1f2937;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e7ebee;
  --line-2: #eff2f5;
  --primary: #064e3b;
  --primary-2: #065f46;
  --accent: #10b981;
  --accent-soft: #d1fae5;
  --accent-soft-2: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #1e40af;
  --info-soft: #dbeafe;
  --shadow-sm: 0 1px 2px rgba(11,31,26,.04), 0 1px 1px rgba(11,31,26,.02);
  --shadow-md: 0 6px 24px -8px rgba(11,31,26,.10), 0 2px 6px rgba(11,31,26,.04);
  --shadow-lg: 0 24px 60px -20px rgba(6,78,59,.25);
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[dir="ltr"] body, html[dir="ltr"] {
  font-family: 'Inter', 'Vazirmatn', system-ui, sans-serif;
}

#root { height: 100%; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d8dee2; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b8c1c7; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* App layout */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  overflow: hidden;
}
[dir="ltr"] .app { grid-template-columns: 248px 1fr; }
.app.customer { grid-template-columns: 1fr; }

/* Sidebar */
.sidebar {
  background: var(--paper);
  border-inline-start: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
[dir="ltr"] .sidebar { border-inline-start: none; border-inline-end: 1px solid var(--line); }

.sidebar-head {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-2);
}
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-text .name { font-weight: 700; font-size: 15px; color: var(--ink); }
.logo-text .sub { font-size: 11px; color: var(--muted); }

.sidebar-org {
  margin: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: var(--paper-2);
}
.sidebar-org:hover { border-color: #d8dee2; }
.sidebar-org .avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
}
.sidebar-org .org-info { flex: 1; min-width: 0; }
.sidebar-org .org-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.sidebar-org .org-role { font-size: 11px; color: var(--muted); }

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
}
.nav-section {
  margin-top: 8px;
}
.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  padding: 12px 12px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}
.nav-item:hover { background: var(--paper-2); }
.nav-item.active {
  background: var(--accent-soft-2);
  color: var(--primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  inset-block: 6px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.nav-item .ic { color: var(--muted); width: 18px; height: 18px; flex-shrink: 0; }
.nav-item.active .ic { color: var(--primary); }
.nav-item .badge {
  margin-inline-start: auto;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 100px;
  font-weight: 600;
}

.sidebar-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-foot .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 12px;
}
.sidebar-foot .info { flex: 1; min-width: 0; }
.sidebar-foot .name { font-size: 13px; font-weight: 600; }
.sidebar-foot .email { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main column */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}
.topbar .crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}
.topbar .crumbs .sep { color: var(--muted-2); }
.topbar .crumbs .crumb-muted { color: var(--muted); font-weight: 400; }

.topbar-search {
  flex: 1;
  max-width: 420px;
  margin-inline: 24px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  height: 34px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper-2);
  padding-inline: 36px 12px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.topbar-search input:focus { border-color: var(--accent); background: white; }
.topbar-search .ic {
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.topbar-search .kbd {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.topbar-actions {
  display: flex; align-items: center; gap: 6px;
  margin-inline-start: auto;
}
.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn .dot {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--paper);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  height: 30px;
  background: var(--paper-2);
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.12s;
}
.lang-switch button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Page content */
.page {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.page-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 28px 60px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-head .sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}
.page-head .actions {
  display: flex; gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-2); }
.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-accent:hover { background: #059669; }
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--paper-2); border-color: #d8dee2; }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--paper-2); }
.btn-danger {
  background: white;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* Stat tile */
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat .label {
  font-size: 12.5px;
  color: var(--muted);
  display: flex; align-items: center; gap: 7px;
  font-weight: 500;
}
.stat .value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat .delta {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.delta.up { color: #059669; }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--accent-soft); color: var(--primary); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--line-2); color: var(--muted); }
.badge.outline { background: transparent; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }

/* Table */
.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.table-toolbar .grow { flex: 1; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: start;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
  vertical-align: middle;
}
table.data tbody tr { transition: background 0.08s; }
table.data tbody tr:hover { background: var(--paper-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.clickable { cursor: pointer; }
.cell-muted { color: var(--muted); }
.cell-strong { font-weight: 600; }
.cell-num { font-variant-numeric: tabular-nums; }

.table-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}
.pager {
  display: flex; align-items: center; gap: 4px;
}
.pager button {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  display: grid; place-items: center;
}
.pager button:hover { background: var(--paper-2); color: var(--ink); }
.pager button.active { background: var(--primary); color: white; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--danger); }
.input, .select, .textarea {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border 0.12s, box-shadow 0.12s;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: left 10px center; padding-inline-start: 30px; }
[dir="ltr"] .select { background-position: right 10px center; padding-inline-end: 30px; padding-inline-start: 12px; }
.input-with-icon { position: relative; }
.input-with-icon .ic { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-with-icon .input { padding-inline-start: 34px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: #d8dee2;
  border-radius: 100px;
  transition: background 0.12s;
  cursor: pointer;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--accent); }
[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-16px); }
[dir="ltr"] .switch input:checked + .track::after { transform: translateX(16px); }

/* Checkbox */
.checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background: var(--paper);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  vertical-align: middle;
}
.checkbox.checked { background: var(--primary); border-color: var(--primary); color: white; }
.checkbox.indeterminate { background: var(--primary); border-color: var(--primary); color: white; }

/* Grid helpers */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-12-8 { grid-template-columns: 2fr 1fr; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }

/* Modal */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(11,31,26,0.45);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
  animation: fade .15s ease;
}
.modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: pop .18s ease;
}
.modal.wide { max-width: 900px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line-2);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Drawer */
.drawer-back {
  position: fixed; inset: 0;
  background: rgba(11,31,26,0.4);
  z-index: 60;
  animation: fade .15s ease;
}
.drawer {
  position: fixed;
  top: 0; bottom: 0;
  inset-inline-start: 0;
  width: 560px;
  max-width: 100%;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 61;
  animation: slide .2s ease;
}
[dir="rtl"] .drawer { animation-name: slideRtl; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes slideRtl { from { transform: translateX(100%); } to { transform: none; } }

/* Empty state */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .ic-wrap {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--paper-2);
  display: inline-grid; place-items: center;
  color: var(--muted-2);
  margin-bottom: 12px;
}
.empty h4 { color: var(--ink); margin: 0 0 6px; font-size: 15px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-color: var(--accent); font-weight: 600; }
.tab .count {
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 11px;
  padding: 0 6px;
  border-radius: 100px;
  color: var(--muted);
}
.tab.active .count { background: var(--accent-soft); border-color: transparent; color: var(--primary); }

/* Chart */
.chart-svg { width: 100%; height: 220px; display: block; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.tl-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding-bottom: 14px;
  position: relative;
}
.tl-item::after {
  content: "";
  position: absolute;
  top: 28px; bottom: 0;
  inset-inline-start: 13px;
  width: 1.5px;
  background: var(--line);
}
.tl-item:last-child::after { display: none; }
.tl-item .dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  color: var(--muted);
  z-index: 1;
}
.tl-item.done .dot { background: var(--accent-soft); border-color: var(--accent); color: var(--primary); }
.tl-item.active .dot { background: var(--accent); border-color: var(--accent); color: white; box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-content { font-size: 13px; }
.tl-content .title { font-weight: 600; color: var(--ink); }
.tl-content .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Customer storefront */
.store-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky; top: 0;
  z-index: 10;
}
.store-header .search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border 0.12s, transform 0.12s;
}
.product-card:hover { border-color: var(--accent); }
.product-thumb {
  aspect-ratio: 1.2;
  background: repeating-linear-gradient(45deg, var(--paper-2) 0 10px, #f2f4f6 10px 20px);
  display: grid;
  place-items: center;
  color: var(--muted-2);
  position: relative;
}
.product-thumb .placeholder-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  background: rgba(255,255,255,0.85);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--muted);
}
.product-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.product-brand { font-size: 11px; color: var(--muted); }
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: auto;
}
.product-price { font-size: 15px; font-weight: 700; color: var(--ink); }
.product-price .unit { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.product-old-price { font-size: 12px; color: var(--muted); text-decoration: line-through; }

/* Cart */
.cart-line {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.cart-line:last-child { border: none; }
.qty-stepper {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.qty-stepper button {
  width: 28px; height: 28px;
  border: none;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
  display: grid; place-items: center;
}
.qty-stepper button:hover { background: var(--paper-2); }
.qty-stepper input {
  width: 44px;
  text-align: center;
  border: none;
  border-inline: 1px solid var(--line);
  background: var(--paper);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
  font-weight: 600;
  color: var(--ink);
}

/* Permission matrix */
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td { padding: 8px 10px; font-size: 12.5px; }
.perm-table thead th {
  text-align: center; font-weight: 600; color: var(--ink-2);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}
.perm-table thead th:first-child { text-align: start; }
.perm-table tbody td { border-bottom: 1px solid var(--line-2); text-align: center; }
.perm-table tbody td:first-child { text-align: start; font-weight: 500; }
.perm-table tbody .group-row td {
  background: var(--paper-2);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  text-align: start;
}

/* Mini bars */
.minibar {
  display: flex; align-items: flex-end; gap: 2px;
  height: 32px;
}
.minibar span {
  width: 5px;
  background: var(--accent-soft);
  border-radius: 1px;
}
.minibar span.hi { background: var(--accent); }

/* Avatar group */
.av-group { display: inline-flex; }
.av-group .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600;
  border: 2px solid var(--paper);
  margin-inline-end: -8px;
}

/* Receipt */
.receipt-row {
  display: flex; justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
}
.receipt-row.total {
  border-top: 1.5px dashed var(--line);
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 15px;
}
.receipt-row.muted { color: var(--muted); }
.receipt-row.muted.discount { color: var(--accent); }

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: pop .2s ease;
}
.toast.success { background: var(--primary); }
.toast.warn { background: var(--warn); }
.toast.danger { background: var(--danger); }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 420px;
  max-width: 100%;
  box-shadow: var(--shadow-md);
}
.login-card .head { text-align: center; margin-bottom: 24px; }
.login-card h2 { margin: 14px 0 4px; font-size: 20px; font-weight: 700; }
.login-card p { margin: 0; color: var(--muted); font-size: 13px; }
.login-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.login-role {
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}
.login-role:hover { border-color: var(--accent); }
.login-role.active { border-color: var(--accent); background: var(--accent-soft-2); }
.login-role .icw { color: var(--primary); margin-bottom: 6px; }
.login-role .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.login-role .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
