/* ============== AURORA POS — STYLES ============== */
:root {
  --bg: #f5f6fa;
  --bg-2: #ffffff;
  --bg-3: #fafbfd;
  --surface: #ffffff;
  --text: #15192b;
  --text-2: #5a6079;
  --muted: #8a90a5;
  --border: #e6e8ef;
  --border-strong: #d3d6e0;
  --primary: #5b6cff;
  --primary-2: #4754d6;
  --primary-soft: #eef0ff;
  --accent: #00b894;
  --warn: #f5a623;
  --warn-soft: #fff5e0;
  --danger: #ef4444;
  --danger-soft: #ffeaea;
  --shadow-sm: 0 1px 2px rgba(20,25,55,.05);
  --shadow: 0 8px 24px rgba(20,25,55,.08);
  --shadow-lg: 0 20px 60px rgba(20,25,55,.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
}

html[data-theme="dark"] {
  --bg: #0e1018;
  --bg-2: #161927;
  --bg-3: #1b1f30;
  --surface: #1a1d2c;
  --text: #e8eaf3;
  --text-2: #a7adc4;
  --muted: #777e98;
  --border: #262a3d;
  --border-strong: #353a52;
  --primary: #7c8aff;
  --primary-2: #5b6cff;
  --primary-soft: #232847;
  --accent: #2dd4a6;
  --warn-soft: #3a2f17;
  --danger-soft: #3a1f1f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 8px 28px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: 14px; color: inherit; }
input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
kbd {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-2);
}

/* ============== LOGIN ============== */
.login-screen {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(91,108,255,.25), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(0,184,148,.18), transparent 40%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.login-card {
  width: 420px;
  max-width: 92vw;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  border: 1px solid var(--border);
}
.login-brand {
  display: flex; align-items: center; gap: 14px; margin-bottom: 22px;
}
.brand-mark {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
  box-shadow: 0 8px 20px rgba(91,108,255,.4);
}
.brand-mark.sm { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
.login-brand h1 { margin: 0; font-size: 22px; font-weight: 700; }
.login-brand p { margin: 2px 0 0 0; font-size: 13px; }

.login-users {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.login-user {
  background: var(--bg-3);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.login-user:hover { background: var(--primary-soft); }
.login-user.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.login-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin: 0 auto 6px;
}
.login-user .n { font-weight: 600; font-size: 13px; }
.login-user .r { font-size: 11px; color: var(--muted); }

.pin-display {
  display: flex; gap: 12px; justify-content: center; margin: 6px 0 18px;
}
.pin-display span {
  width: 14px; height: 14px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
}
.pin-display span.filled {
  background: var(--primary);
  border-color: var(--primary);
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pin-pad button {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 56px;
  font-size: 20px; font-weight: 600;
  color: var(--text);
  transition: transform .05s, background .15s;
}
.pin-pad button:hover { background: var(--primary-soft); }
.pin-pad button:active { transform: scale(0.96); }
.pin-pad button.pin-action { background: var(--bg-2); color: var(--muted); }
.hint { text-align: center; margin: 16px 0 0; font-size: 12px; }
.login-footer { margin-top: 18px; font-size: 12px; }

/* ============== APP LAYOUT ============== */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  width: 100vw;
}

/* ============== SIDEBAR ============== */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-align: left;
  font-weight: 500;
  font-size: 14px;
  transition: background .12s, color .12s;
}
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.nav-item kbd { margin-left: auto; opacity: .6; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.sync-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  margin: 8px 0 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}
.sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 currentColor;
}
.sync-strip.online .sync-dot { background: var(--accent); animation: pulse 2s ease-in-out infinite; }
.sync-strip.local .sync-dot  { background: var(--warn); }
.sync-strip.offline .sync-dot{ background: var(--danger); }
.sync-strip.online .sync-text { color: var(--accent); }
.sync-strip.offline .sync-text { color: var(--danger); }
.sync-clients {
  margin-left: auto;
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,184,148,.6); }
  50%      { box-shadow: 0 0 0 5px rgba(0,184,148,0); }
}
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex; align-items: center; gap: 8px;
}
.user-chip {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.user-chip .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sidebar-actions { display: flex; gap: 4px; }
.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-3); }

/* ============== VIEWS ============== */
.view {
  display: none;
  overflow: hidden;
  height: 100vh;
  min-width: 0;
}
.view.active { display: flex; }
.view#view-pos { flex-direction: row; }
.view:not(#view-pos) { flex-direction: column; padding: 22px 28px; overflow: auto; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.page-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.page-head p { margin: 2px 0 0; font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions input, .page-actions select { width: auto; min-width: 180px; }

/* ============== BUTTONS ============== */
.btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-2); }
.btn:active { transform: scale(0.98); }
.btn.ghost {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.ghost:hover { background: var(--bg-3); }
.btn.danger { background: var(--danger); }
.btn.danger.ghost { color: var(--danger); background: var(--bg-2); border-color: var(--border); }
.btn.danger.ghost:hover { background: var(--danger-soft); }
.btn.accent { background: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .12s;
}
.chip:hover { background: var(--bg-3); color: var(--text); }
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.chip.danger { color: var(--danger); }
.chip.danger:hover { background: var(--danger-soft); }
.chip .badge {
  background: var(--primary); color: white;
  font-size: 10px; padding: 1px 6px; border-radius: 100px;
}

.link {
  background: none; border: none; padding: 0;
  color: var(--primary); text-decoration: underline; cursor: pointer; font-size: 12px;
}

/* ============== POS LAYOUT ============== */
.pos-left {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg);
  min-width: 0;
}
.pos-right {
  width: 380px;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}

.pos-toolbar {
  padding: 16px 20px 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 4px 4px 14px;
  margin-bottom: 14px;
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search .ico { color: var(--muted); }
.search input {
  flex: 1; border: none; background: transparent; padding: 10px 0;
  font-size: 15px;
}
.search input:focus { box-shadow: none; }
.cats {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}
.cats::-webkit-scrollbar { height: 4px; }

.product-grid {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  align-content: start;
}
.product-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  display: flex; flex-direction: column;
  gap: 8px;
  transition: all .12s;
  position: relative;
  text-align: left;
  font: inherit;
  color: inherit;
}
.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.product-card .emoji {
  font-size: 36px;
  text-align: center;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 10px 0;
}
.product-card .name {
  font-weight: 600; font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}
.product-card .price {
  font-weight: 700; font-size: 15px;
  color: var(--primary);
}
.product-card .stock {
  font-size: 11px; color: var(--muted);
}
.product-card.low .stock { color: var(--warn); }
.product-card.out { opacity: .55; cursor: not-allowed; }
.product-card.out .stock { color: var(--danger); }

/* ============== CART ============== */
.cart-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.cart-title { font-weight: 700; font-size: 16px; }
.cart-head-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

.customer-pill {
  margin: 12px 20px 0;
  padding: 8px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 13px;
}
.customer-pill button {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 14px;
}

.cart {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.cart-empty .e { font-size: 48px; margin-bottom: 8px; opacity: .4; }

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 8px;
  align-items: center;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.cart-item .ci-mode {
  width: auto;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.cart-item .ci-mode.wholesale {
  background: rgba(245,166,35,.12);
  color: var(--warn);
  border-color: rgba(245,166,35,.4);
}
.no-tax-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  vertical-align: middle;
}

.cat-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.cat-row select {
  flex: 1;
  margin-top: 0;
}
.cat-rem-btn {
  flex-shrink: 0;
  padding: 0 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: all .15s;
}
.cat-rem-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger);
}
.cat-rem-btn.confirm {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  padding: 0 14px;
  animation: armed-pulse 1s ease-in-out infinite;
}

body[data-role="cashier"] .admin-col { display: none; }

.chip.confirm-armed {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  animation: armed-pulse 1s ease-in-out infinite;
}
@keyframes armed-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50%      { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.cart-item .ci-mode:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.cart-item:hover { background: var(--bg-3); }
.cart-item .ci-name { font-weight: 600; font-size: 13px; }
.cart-item .ci-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.cart-item .ci-price { font-weight: 600; font-size: 13px; text-align: right; }
.cart-item .ci-discount {
  font-size: 11px;
  color: var(--accent);
  text-align: right;
}
.cart-item .ci-controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 13px; font-weight: 600;
  color: var(--text);
}
.qty-btn:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.qty-input {
  width: 44px; text-align: center; padding: 4px;
  font-weight: 600;
}
.ci-controls .spacer { flex: 1; }
.ci-controls .mini {
  background: none; border: none; color: var(--muted); font-size: 11px; padding: 4px 6px; border-radius: 4px;
}
.ci-controls .mini:hover { background: var(--bg-2); color: var(--text); }
.ci-controls .rem:hover { color: var(--danger); background: var(--danger-soft); }

.cart-totals {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.cart-totals .row {
  display: flex; justify-content: space-between;
  font-size: 13px;
}
.cart-totals .row.grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 18px;
  font-weight: 700;
}

.pay-row {
  display: flex;
  gap: 8px;
  margin: 0 14px 14px;
  align-items: stretch;
}
.pay-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(91,108,255,.35);
  transition: transform .08s, box-shadow .15s;
}
.pay-btn:hover { box-shadow: 0 12px 28px rgba(91,108,255,.5); }
.pay-btn:active { transform: scale(0.98); }
.pay-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; background: var(--text-2); }
.pay-amt { font-size: 22px; }

.pay-method-select {
  width: auto;
  padding: 0 14px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
  min-width: 110px;
  transition: border-color .15s, box-shadow .15s;
}
.pay-method-select:hover  { border-color: var(--primary); }
.pay-method-select:focus  { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ============== STAT ROW ============== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .val { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat.warn .val { color: var(--warn); }
.stat.danger .val { color: var(--danger); }

/* ============== TABLES ============== */
.table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: var(--bg-3);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-3); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.data-table .desc-cell {
  max-width: 240px;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table.compact td, .data-table.compact th { padding: 8px 12px; }

.row-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.row-tag.green { background: rgba(0,184,148,.12); color: var(--accent); }
.row-tag.warn { background: var(--warn-soft); color: var(--warn); }
.row-tag.danger { background: var(--danger-soft); color: var(--danger); }
.row-tag.muted { background: var(--bg-3); color: var(--muted); }

/* ============== CARDS / REPORTS ============== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.card label {
  display: block; margin-bottom: 12px; font-size: 12px;
  color: var(--text-2); font-weight: 500;
}
.card label input, .card label select, .card label textarea {
  margin-top: 4px;
}
.card label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  margin: 0;
}
.card label.check:last-child { border-bottom: none; }
.card label.check input { width: auto; margin-top: 0; }
.card label.check span { flex: 1; color: var(--text); font-weight: 500; font-size: 13px; }
.card code {
  background: var(--bg-3);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  border: 1px solid var(--border);
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.report-grid .card { min-height: 280px; }
.report-grid .span-2 { grid-column: span 2; }
.report-grid canvas { max-height: 240px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.cat-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3); border-radius: 100px; padding: 4px 10px;
  font-size: 12px; font-weight: 500;
}
.cat-pill button {
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 0;
}
.cat-pill button:hover { color: var(--danger); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.user-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row .info { display: flex; align-items: center; gap: 10px; }
.user-row .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

/* ============== MODAL ============== */
.modal-root {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(15,18,40,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  padding: 20px;
}
.modal-root.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
}
.modal.lg { max-width: 720px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-head .close {
  background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
}
.modal-head .close:hover { background: var(--bg-3); color: var(--text); }
.modal-body { padding: 22px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.form-grid label.full { grid-column: span 2; }
.form-grid label input, .form-grid label select, .form-grid label textarea {
  margin-top: 4px;
}

/* ============== PAYMENT MODAL ============== */
.pay-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.pay-method {
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.pay-method:hover { border-color: var(--primary); }
.pay-method.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.pay-method .e { font-size: 28px; margin-bottom: 4px; }
.pay-method .n { font-weight: 600; font-size: 13px; }

.pay-method .card-sub {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.pay-method.selected .card-sub {
  display: block;
  animation: card-sub-in .18s ease;
}
.card-sub-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.card-sub-btns {
  display: flex;
  gap: 6px;
}
.card-sub-btn {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 0;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .12s;
}
.card-sub-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}
.card-sub-btn.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(91,108,255,.3);
}
@keyframes card-sub-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.tendered-row {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  text-align: center;
}
.tendered-row .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tendered-row .amt {
  font-size: 32px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}
.tendered-row .change { color: var(--accent); font-size: 14px; font-weight: 600; }
.tendered-row .short { color: var(--warn); font-size: 14px; font-weight: 600; }

.success-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(0,184,148,.18), rgba(0,184,148,.05));
  border: 1px solid rgba(0,184,148,.25);
  color: var(--accent);
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.success-banner .e {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  flex-shrink: 0;
}
.success-banner > div:last-child { color: var(--text); font-weight: 600; }

.btn.print-big {
  background: linear-gradient(135deg, var(--accent), #009e7d);
  font-size: 15px;
  padding: 12px 22px;
  box-shadow: 0 6px 18px rgba(0,184,148,.35);
}
.btn.print-big:hover { box-shadow: 0 10px 24px rgba(0,184,148,.45); }
.btn.print-big:focus { outline: 3px solid rgba(0,184,148,.35); outline-offset: 2px; }

.quick-cash {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.quick-cash button {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.quick-cash button:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ============== TOAST ============== */
.toast-root {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  min-width: 240px;
  font-size: 13px;
  font-weight: 500;
  animation: toast-in .25s ease;
  pointer-events: auto;
}
.toast.ok { border-left-color: var(--accent); }
.toast.warn { border-left-color: var(--warn); }
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ============== RECEIPT (PRINT) ============== */
.receipt-print {
  display: none;
}
.receipt-preview {
  background: white;
  color: black;
  padding: 16px 14px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  width: 280px;
  margin: 0 auto;
  border: 1px dashed #ccc;
}
.receipt-preview h3 { margin: 0 0 4px; text-align: center; font-size: 14px; }
.receipt-preview .addr { text-align: center; margin-bottom: 8px; font-size: 11px; }
.receipt-preview .div { border-top: 1px dashed #999; margin: 8px 0; }
.receipt-preview .li { display: flex; justify-content: space-between; font-size: 11px; line-height: 1.5; }
.receipt-preview .li .nm { flex: 1; }
.receipt-preview .li .am { text-align: right; min-width: 60px; font-variant-numeric: tabular-nums; }
.receipt-preview .grand { font-weight: bold; font-size: 13px; margin-top: 4px; }
.receipt-preview .footer { text-align: center; margin-top: 8px; font-size: 11px; font-weight: bold; }
.receipt-preview .policy {
  font-size: 10px;
  line-height: 1.35;
  text-align: justify;
  margin: 8px 2px 0;
  color: #222;
}
.receipt-preview .social {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  margin: 10px 0 4px;
}
.receipt-preview .receipt-barcode {
  display: block;
  margin: 8px auto 0;
  max-width: 100%;
  height: auto;
}

@media print {
  body * { visibility: hidden; }
  .receipt-print, .receipt-print * { visibility: visible; }
  .receipt-print {
    display: block !important;
    position: absolute;
    top: 0; left: 0;
    width: 80mm;
    padding: 4mm;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: black;
    background: white;
  }
  .receipt-print .div { border-top: 1px dashed #555; margin: 6px 0; }
  .receipt-print h3 { margin: 0 0 4px; text-align: center; font-size: 13px; }
  .receipt-print .addr { text-align: center; font-size: 10px; margin-bottom: 6px; }
  .receipt-print .li { display: flex; justify-content: space-between; line-height: 1.4; }
  .receipt-print .li .am { text-align: right; }
  .receipt-print .footer { text-align: center; margin-top: 6px; font-weight: bold; }
  .receipt-print .policy {
    font-size: 9px;
    line-height: 1.3;
    text-align: justify;
    margin: 6px 1mm 0;
  }
  .receipt-print .social {
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    margin: 8px 0 4px;
  }
  .receipt-print .receipt-barcode {
    display: block;
    margin: 6px auto 0;
    max-width: 100%;
    height: auto;
  }
}

/* ============== SCROLLBARS ============== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar-brand span, .nav-item span:not(.ico), .nav-item kbd, .user-chip > div { display: none; }
  .sidebar-brand { justify-content: center; }
  .nav-item { justify-content: center; }
  .pos-right { width: 320px; }
  .report-grid { grid-template-columns: 1fr; }
  .report-grid .span-2 { grid-column: span 1; }
}
@media (max-width: 640px) {
  .pos-right { width: 280px; }
  .view:not(#view-pos) { padding: 14px; }
}
