@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --primary: #0f74bd;
  --primary-light: rgba(15, 116, 189, 0.15);
  --primary-hover: #095a8f;
  --bg: #080c10;
  --bg-2: #0d1117;
  --bg-3: #131920;
  --text: #e8edf2;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(15, 116, 189, 0.5);
  --font: 'Space Grotesk', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(15, 116, 189, 0.15);
  --ring: rgba(15, 116, 189, 0.3);
  --muted: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --drawer-w: 260px;
  --header-h: 64px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font);
}

body {
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(15, 116, 189, 0.08) 0%, transparent 60%);
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Layout ─────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.hidden { display: none !important; }

.view { display: none; width: 100%; padding: 2rem; min-height: 100vh; }
.view.active { display: block; }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
  width: var(--drawer-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 100;
}

.logo-container {
  padding: 0.5rem 0.75rem 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.logo-container img { width: 130px; }

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
}

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.nav-links button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 0.7rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font);
}

.nav-links button:hover {
  background: var(--card-hover);
  color: var(--text);
}

.nav-links button.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-links button .nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-links button.active .nav-icon { opacity: 1; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0.75rem;
}

.nav-bottom { margin-top: auto; }

/* ── Main content ─────────────────────────────────────────── */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.card:hover { border-color: rgba(255,255,255,0.12); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Auth ────────────────────────────────────────────────── */
#auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: 
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(15, 116, 189, 0.12) 0%, transparent 70%);
}

#auth-view.active { display: flex; }

.auth-wrap {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
}

.auth-logo-wrap {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo-wrap img { width: 110px; }

.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.auth-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.auth-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  background: rgba(15, 116, 189, 0.05);
  box-shadow: 0 0 0 3px var(--ring);
}

select option { background: var(--bg-2); color: var(--text); }
textarea { resize: vertical; min-height: 80px; }

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card-hover); color: var(--text); }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.btn-success:hover { background: rgba(34, 197, 94, 0.25); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; }

button[type="submit"] {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
}
button[type="submit"]:hover { background: var(--primary-hover); transform: translateY(-1px); }

.error {
  color: #ff4444;
  font-size: 0.82rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 68, 68, 0.08);
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: var(--radius-xs);
}

/* ── Mobile header ───────────────────────────────────────── */
#mobile-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.25rem;
  height: var(--header-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.mobile-logo { height: 32px; }

#hamburger {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  align-items: center;
  justify-content: center;
}

.bar { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* ── Metrics ─────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: var(--transition);
}

.metric-card:hover { border-color: rgba(255,255,255,0.12); }

.metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── POS layout ─────────────────────────────────────────── */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  height: calc(100vh - 160px);
}

.pos-products-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 1.25rem;
}

.pos-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.pos-item-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.pos-item-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.pos-item-card:active { transform: scale(0.97); }

.pos-item-card.out-of-stock {
  opacity: 0.4;
  pointer-events: none;
}

.pos-item-img {
  width: 100%;
  aspect-ratio: 1;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--border);
  overflow: hidden;
}

.pos-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pos-item-body { padding: 0.75rem; }

.pos-item-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}

.pos-item-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}

.pos-item-stock {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ── Cart ────────────────────────────────────────────────── */
.pos-cart-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.82rem;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
}

.cart-empty-icon { font-size: 2rem; opacity: 0.3; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.cart-item:hover { background: var(--card-hover); }

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.1rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
  font-family: var(--font);
}

.qty-btn:hover { background: var(--primary); border-color: var(--primary); }

.qty-display {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 20px;
  text-align: center;
}

.cart-item-total {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary);
  min-width: 52px;
  text-align: right;
}

.cart-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.cart-total-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cart-total-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-mono);
}

.pay-methods { display: flex; flex-direction: column; gap: 0.5rem; }

.pay-btn {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  color: #fff;
  font-family: var(--font);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pay-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.pay-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.pay-btn.cash { background: #15803d; }
.pay-btn.card { background: #1d4ed8; }
.pay-btn.seamless { background: #7c3aed; }

.cart-clear-btn {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  margin-top: 0.5rem;
  transition: var(--transition);
}
.cart-clear-btn:hover { background: rgba(239, 68, 68, 0.08); }

/* ── Inventory management ─────────────────────────────────── */
.inventory-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.inventory-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.inventory-card:hover { border-color: rgba(255,255,255,0.12); }

.inventory-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--border);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.inventory-card-img img { width: 100%; height: 100%; object-fit: cover; }

.inventory-card-body { padding: 1rem; }

.inventory-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.inventory-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.inventory-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.inventory-card-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}

.stock-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  font-family: var(--font-mono);
}

.stock-badge.in-stock { background: rgba(34,197,94,0.12); color: #22c55e; }
.stock-badge.low-stock { background: rgba(245,158,11,0.12); color: #f59e0b; }
.stock-badge.out-stock { background: rgba(239,68,68,0.12); color: #ef4444; }

.inventory-card-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* ── Logo upload ─────────────────────────────────────────── */
.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.logo-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }

.logo-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
}

.logo-upload-area input[type="file"]:focus { box-shadow: none; }

.logo-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
  margin: 0 auto 0.75rem;
  border: 1px solid var(--border);
}

.upload-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
  display: block;
}

.upload-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.upload-progress {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ── Payment methods ─────────────────────────────────────── */
.payment-methods-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.payment-method-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.payment-method-row:hover { border-color: rgba(255,255,255,0.12); }

.payment-method-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1rem;
}

.payment-method-logo img { width: 100%; height: 100%; object-fit: contain; }

.payment-method-info { flex: 1; min-width: 0; }

.payment-method-label {
  font-size: 0.85rem;
  font-weight: 700;
}

.payment-method-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.payment-method-actions { display: flex; align-items: center; gap: 0.5rem; }

/* ── Toggle switch ───────────────────────────────────────── */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle-track {
  width: 100%;
  height: 100%;
  background: var(--border);
  border-radius: 99px;
  transition: var(--transition);
}

.toggle input:checked + .toggle-track { background: var(--primary); }

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked ~ .toggle-thumb { left: 18px; }

/* ── Profile ─────────────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.profile-avatar-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  overflow: hidden;
  border: 2px solid var(--border);
  position: relative;
  cursor: pointer;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  font-size: 1.25rem;
}

.profile-avatar:hover .profile-avatar-overlay { opacity: 1; }

.profile-avatar input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.profile-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* ── Finance ─────────────────────────────────────────────── */
.tx-table { width: 100%; border-collapse: collapse; }

.tx-table th {
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.tx-table td {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.tx-table tr:hover td { background: var(--card-hover); }

.method-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.method-chip.cash { background: rgba(34,197,94,0.12); color: #22c55e; }
.method-chip.card { background: rgba(59,130,246,0.12); color: #60a5fa; }
.method-chip.seamless { background: rgba(168,85,247,0.12); color: #c084fc; }

/* ── Section tabs ────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
  margin-bottom: -1px;
  letter-spacing: 0.03em;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Scan modal ──────────────────────────────────────────── */
#scan-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

#scan-modal h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

#scan-modal p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 999;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease forwards;
  max-width: 320px;
}

.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.success .toast-icon { color: #22c55e; }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.error .toast-icon { color: #ef4444; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Misc utilities ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 2.5rem; opacity: 0.3; margin-bottom: 0.75rem; }
.empty-state-text { font-size: 0.85rem; }

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-blue { background: rgba(15,116,189,0.15); color: var(--primary); }
.badge-green { background: rgba(34,197,94,0.12); color: #22c55e; }
.badge-amber { background: rgba(245,158,11,0.12); color: #f59e0b; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .pos-cart-panel { height: 500px; }
  .inventory-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  #app { flex-direction: column; }

  #sidebar {
    position: fixed;
    top: var(--header-h);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--header-h));
    z-index: 1000;
    transition: left 0.3s ease;
    border-right: none;
    border-top: 1px solid var(--border);
  }

  #sidebar.active { left: 0; }
  #mobile-header { display: flex; }

  .view { padding: 1.25rem; }

  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .input-row { grid-template-columns: 1fr; }
}