/* ═══════════════════════════════════════════════════════════════
   SOKO POS — Professional Redesign v2.0
   Inspired by modern POS/dashboard reference interfaces
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Reference-inspired palette (teal/green professional) ── */
  --color-primary: #1a5c3a;
  --color-primary-dark: #0f3d26;
  --color-primary-light: #267a4e;
  --color-accent: #e8852e;
  --color-accent-dark: #c96e1e;
  --color-success: #27ae60;
  --color-success-light: rgba(39, 174, 96, 0.12);
  --color-danger: #dc3545;
  --color-danger-light: rgba(220, 53, 69, 0.10);
  --color-warning: #e8852e;
  --color-warning-light: rgba(232, 133, 46, 0.12);
  --color-info: #2c7be5;

  /* ── Legacy brand (kept for backward compat) ── */
  --color-terracotta: #1a5c3a;
  --color-orange: #e8852e;
  --color-green: #27ae60;
  --color-cream: #f4f4f0;
  --color-dark: #1a2a32;
  --color-red: #dc3545;
  --color-gray: #8a9ba8;

  /* ── Neutrals ── */
  --color-white: #ffffff;
  --color-bg: #f0f0ec;
  --color-surface: #ffffff;
  --color-border: rgba(26, 42, 50, 0.10);
  --color-border-light: rgba(26, 42, 50, 0.06);
  --color-text: #1a2a32;
  --color-text-secondary: rgba(26, 42, 50, 0.65);
  --color-text-muted: rgba(26, 42, 50, 0.45);

  /* ── Sizing ── */
  --radius-sm: 6px;
  --radius-card: 10px;
  --radius-button: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-height: 76px;
  --header-height: 72px;
  --content-width: 1200px;
  --touch-target: 48px;
}

/* ═══════════════════════════════════════════════════════════════
   BASE / RESET
   ═══════════════════════════════════════════════════════════════ */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(26, 92, 58, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(232, 133, 46, 0.04) 0%, transparent 50%),
    var(--color-bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: var(--touch-target);
  border: 0;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--touch-target);
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 92, 58, 0.10);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL & TOPBAR
   ═══════════════════════════════════════════════════════════════ */

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-height);
  padding: 12px 20px;
  background: rgba(26, 42, 50, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-transform: uppercase;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.lang-toggle {
  min-width: var(--touch-target);
  padding: 8px 12px;
  font-size: 0.80rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-button);
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.store-switcher {
  display: flex;
  align-items: center;
}

.store-switcher .store-select {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.store-switcher .store-select option {
  color: var(--color-text);
  background: var(--color-white);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE SHELL & HEADERS
   ═══════════════════════════════════════════════════════════════ */

.page-shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 18px 28px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.page-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.page-description {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

.section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS & PANELS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hero-card {
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light));
  color: var(--color-white);
  border: none;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.hero-card::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 20%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.hero-card h2,
.hero-card p {
  margin: 0;
  position: relative;
  z-index: 1;
}

.hero-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
}

.hero-card p {
  margin-top: 6px;
  opacity: 0.88;
  font-size: 0.92rem;
  max-width: 50ch;
}

.panel {
  padding: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   GRID & LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inline-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   METRIC CARDS
   ═══════════════════════════════════════════════════════════════ */

.metric-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 2px 2px 0;
}

.metric-card:nth-child(1)::before {
  background: var(--color-primary);
}

.metric-card:nth-child(2)::before {
  background: var(--color-accent);
}

.metric-card:nth-child(3)::before {
  background: var(--color-success);
}

.metric-card:nth-child(4)::before {
  background: var(--color-info);
}

.metric-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-value {
  margin: 8px 0 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: var(--radius-button);
  white-space: nowrap;
  min-height: var(--touch-target);
}

.btn:hover {
  opacity: 0.92;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 6px rgba(26, 92, 58, 0.25);
}

.btn-primary:hover {
  background: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(26, 92, 58, 0.30);
}

.btn-secondary {
  background: rgba(26, 42, 50, 0.07);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: rgba(26, 42, 50, 0.10);
}

.btn-success {
  background: var(--color-success);
  color: var(--color-white);
  box-shadow: 0 2px 6px rgba(39, 174, 96, 0.25);
}

.btn-success:hover {
  background: #219a52;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.30);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
  background: #c82333;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-ghost:hover {
  background: rgba(26, 42, 50, 0.04);
  border-color: rgba(26, 42, 50, 0.18);
}

.btn-full {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   TAGS / BADGES / PILLS
   ═══════════════════════════════════════════════════════════════ */

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(26, 42, 50, 0.07);
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.tag-success {
  background: var(--color-success-light);
  color: #1a8a4a;
}

.tag-danger {
  background: var(--color-danger-light);
  color: #b82a38;
}

.tag-warn {
  background: var(--color-warning-light);
  color: #c06a1e;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text);
}

.field-help {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.field.span-2 {
  grid-column: span 2;
}

/* ═══════════════════════════════════════════════════════════════
   ITEM CARDS (list items)
   ═══════════════════════════════════════════════════════════════ */

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  padding: 16px 18px;
  cursor: default;
}

.item-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.item-meta {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  line-height: 1.4;
}

.price-line {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.muted {
  color: var(--color-text-secondary);
}

.mono {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   STOCK INDICATOR
   ═══════════════════════════════════════════════════════════════ */

.stock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
}

.stock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
}

.stock-dot.warn {
  background: var(--color-warning);
}

.stock-dot.danger {
  background: var(--color-danger);
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH ROW
   ═══════════════════════════════════════════════════════════════ */

.search-row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
  margin-bottom: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   POS LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.pos-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.product-tile {
  min-height: 160px;
  padding: 16px;
  text-align: left;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-tile:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.product-tile:active {
  transform: translateY(0);
}

.product-tile h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.product-tile p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* ── Cart Panel ── */

.cart-panel {
  position: sticky;
  top: calc(var(--header-height) + 14px);
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.cart-items::-webkit-scrollbar {
  width: 4px;
}

.cart-items::-webkit-scrollbar-track {
  background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(26, 42, 50, 0.04);
  transition: background 0.15s ease;
}

.cart-item:hover {
  background: rgba(26, 42, 50, 0.07);
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ── Summary ── */

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.9rem;
}

.summary-row.total {
  font-size: 1.25rem;
  font-weight: 800;
  border-top: 2px solid var(--color-border);
  margin-top: 4px;
  padding-top: 12px;
  color: var(--color-primary);
}

/* ── Barcode ── */

.barcode-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.barcode-row input {
  flex: 1;
}

.barcode-row button {
  min-width: var(--touch-target);
}

/* ═══════════════════════════════════════════════════════════════
   ALERT CARDS
   ═══════════════════════════════════════════════════════════════ */

.alert-card {
  border-left: 4px solid var(--color-danger);
  background: var(--color-danger-light);
  border-color: transparent;
}

.alert-card .tag-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */

.table-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  border-bottom: 2px solid var(--color-border);
}

th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  font-weight: 700;
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(26, 92, 58, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════
   FLOATING PILL DOCK + BOTTOM SHEET
   ═══════════════════════════════════════════════════════════════ */

/* ── Floating pill dock ── */
.nav-pill {
  position: fixed;
  bottom: 12px;
  left: 5%;
  width: 90%;
  height: 64px;
  background: #1a1a2e;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* Solid fallback for browsers without backdrop-filter */
  background: rgba(26, 26, 46, 0.97);
}

@media (min-width: 768px) {
  .nav-pill {
    width: 70%;
    left: 15%;
  }
}

/* ── Pill buttons ── */
.nav-pill-btn {
  flex: 1;
  height: 48px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  border-radius: 24px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  font-family: inherit;
}

.nav-pill-btn .nav-icon {
  font-size: 22px;
  line-height: 1;
}
.nav-pill-btn .nav-icon.nav-icon-svg {
  font-size: 0;
}
.nav-pill-btn .nav-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.nav-pill-btn .nav-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-pill-btn.active {
  color: var(--color-primary-light, #267a4e);
}

.nav-pill-btn.active .nav-icon {
  transform: scale(1.1);
}

.nav-pill-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Center button (floating above the pill) ── */
.nav-pill-center {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-bg);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(26, 92, 58, 0.15);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  /* Pulse animation */
  animation: nav-pulse 2s ease-in-out infinite;
}
.nav-pill-center .nav-icon.nav-icon-svg {
  font-size: 0;
}
.nav-pill-center .nav-icon svg {
  width: 26px;
  height: 26px;
  display: block;
  color: white;
}

.nav-pill-center:hover {
  transform: scale(1.05);
}

.nav-pill-center:active {
  transform: scale(0.95);
}

@keyframes nav-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(26, 92, 58, 0.15); }
  50% { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(26, 92, 58, 0.25); }
}

/* ── Bottom sheet overlay ── */
.nav-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.nav-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Bottom sheet ── */
.nav-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-radius: 24px 24px 0 0;
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px calc(80px + env(safe-area-inset-bottom));
}

.nav-sheet.open {
  transform: translateY(0);
}

.nav-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.nav-sheet-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  color: var(--color-text);
}

.nav-sheet-section {
  margin-bottom: 20px;
}

.nav-sheet-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  padding-left: 4px;
}

.nav-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.nav-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--color-bg);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 72px;
  font-family: inherit;
  color: var(--color-text);
}

.nav-sheet-item:active {
  transform: scale(0.96);
  background: var(--color-border-light, rgba(26, 42, 50, 0.06));
}

.nav-sheet-item .item-icon {
  font-size: 28px;
  line-height: 1;
}
.nav-sheet-item .item-icon.item-icon-svg {
  font-size: 0;
}
.nav-sheet-item .item-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.nav-sheet-item .item-label {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: var(--color-text);
}

/* ── Desktop: show labels alongside icons ── */
@media (min-width: 768px) {
  .nav-pill-btn {
    flex-direction: row;
    gap: 6px;
    padding: 0 12px;
  }
  .nav-pill-btn .nav-icon {
    font-size: 20px;
  }
  .nav-pill-btn .nav-icon svg {
    width: 20px;
    height: 20px;
  }
  .nav-pill-btn .nav-label {
    font-size: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 20px;
  background: rgba(26, 42, 50, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.15s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: min(640px, 100%);
  margin: 0 auto;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: modal-slide 0.2s ease;
}

@keyframes modal-slide {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card.wide {
  width: min(860px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-text);
}

.modal-close {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.1rem;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════ */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-height) + 16px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  color: var(--color-white);
  font-weight: 600;
  font-size: 0.9rem;
  animation: toast-slide 0.25s ease;
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toast-slide {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.info {
  background: var(--color-dark);
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-danger);
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════════ */

.login-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 20px;
}

.login-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
}

.login-brand {
  padding: 32px;
  min-height: 300px;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
  color: var(--color-white);
  overflow: hidden;
  position: relative;
  border: none;
}

.login-brand::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.login-brand::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.login-brand h1 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  position: relative;
  z-index: 1;
}

.login-brand p {
  max-width: 36ch;
  font-size: 1.05rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.login-card {
  padding: 28px;
}

.mode-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  padding: 5px;
  border-radius: var(--radius-lg);
  background: rgba(26, 42, 50, 0.06);
}

.mode-toggle button.active {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 6px rgba(26, 92, 58, 0.2);
}

.pin-input {
  text-align: center;
  font-size: 2rem;
  letter-spacing: 0.4em;
  padding-left: 0.7em;
  font-weight: 700;
}

/* ── Store Selector (Login Flow) ── */

.store-selector-layout {
  max-width: 600px;
}

.store-selector-item {
  cursor: pointer;
  text-align: left;
  background: var(--color-white);
  transition: all 0.2s ease;
}

.store-selector-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.store-selector-item:active {
  transform: translateY(0);
}

.store-selector-item strong {
  font-size: 1.1rem;
  color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════
   CREDIT BADGES
   ═══════════════════════════════════════════════════════════════ */

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
}

.credit-badge.ok {
  background: var(--color-success-light);
  color: #1a8a4a;
}

.credit-badge.warn {
  background: var(--color-warning-light);
  color: #c06a1e;
}

.credit-badge.over {
  background: var(--color-danger-light);
  color: #b82a38;
}

/* ═══════════════════════════════════════════════════════════════
   PROMO CODE
   ═══════════════════════════════════════════════════════════════ */

.promo-code-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.promo-code-input input {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   DETAIL PAGES
   ═══════════════════════════════════════════════════════════════ */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.detail-section {
  margin-bottom: 18px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.stats-row:last-child {
  border-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   AI INSIGHTS
   ═══════════════════════════════════════════════════════════════ */

.ai-card {
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.ai-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.ai-card:active {
  transform: translateY(0);
}

.report-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.report-header .text-muted {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
}

.report-metric {
  padding: 18px;
}

.report-metric .metric-sub {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

.trend-up {
  color: var(--color-success);
}

.trend-down {
  color: var(--color-danger);
}

/* ── Bar Charts ── */

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 120px;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
}

.bar-label {
  text-align: right;
  color: var(--color-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 22px;
  background: rgba(26, 42, 50, 0.06);
  border-radius: 11px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: 11px;
  transition: width 0.5s ease;
  min-width: 4px;
}

.bar-fill-green {
  background: linear-gradient(90deg, var(--color-success), #2ecc71);
}

.bar-value {
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
  color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════
   REGISTER / CAISSE
   ═══════════════════════════════════════════════════════════════ */

.register-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
}

.register-status-badge.open {
  background: var(--color-success-light);
  color: #1a8a4a;
}

.register-status-badge.closed {
  background: rgba(26, 42, 50, 0.07);
  color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE MONEY
   ═══════════════════════════════════════════════════════════════ */

.mm-operator-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mm-operator-btn {
  flex: 1;
  min-width: 100px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-button);
  border: 2px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.18s ease;
}

.mm-operator-btn.active {
  border-color: var(--color-primary);
  background: rgba(26, 92, 58, 0.08);
  color: var(--color-primary);
}

.mm-operator-btn:active {
  transform: translateY(1px);
}

/* ── Payment Section ── */

.payment-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.payment-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--color-text);
}

.mm-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLETS (≤1024px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-layout,
  .login-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }

  .topbar {
    padding: 10px 14px;
    min-height: 64px;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .user-badge {
    font-size: 0.78rem;
    padding: 4px 10px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤720px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .page-shell {
    padding: 14px 12px 24px;
  }

  .page-header,
  .split,
  .item-head,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-row,
  .form-grid,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .field.span-2 {
    grid-column: auto;
  }

  .nav-pill {
    height: 56px;
    border-radius: 28px;
    bottom: 8px;
    padding: 0 2px;
  }

  .nav-pill-btn {
    font-size: 9px;
    min-height: 40px;
  }

  .nav-pill-btn .nav-icon {
    font-size: 18px;
  }
  .nav-pill-btn .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .nav-pill-center {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin-top: -14px;
  }
  .nav-pill-center .nav-icon svg {
    width: 22px;
    height: 22px;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .pin-input {
    font-size: 1.5rem;
  }

  .bar-row {
    grid-template-columns: 70px 1fr 80px;
    gap: 6px;
  }

  .barcode-row {
    flex-direction: column;
    align-items: stretch;
  }

  .barcode-row button {
    align-self: flex-end;
  }

  .mm-fields {
    grid-template-columns: 1fr;
  }

  .mm-operator-row {
    flex-direction: column;
  }

  .mm-operator-btn {
    min-width: 0;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .user-badge {
    width: 100%;
    justify-content: center;
  }

  .lang-toggle,
  .topbar-actions .btn-secondary {
    flex: 1;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 180px;
    padding: 24px;
  }

  .login-brand h1 {
    font-size: 1.8rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .product-tile {
    min-height: 140px;
    padding: 12px;
  }

  .hero-card {
    padding: 18px 20px;
  }

  .hero-card h2 {
    font-size: 1.1rem;
  }

  .card.panel {
    padding: 14px;
  }

  .modal-card {
    padding: 18px;
  }

  /* Tables: make them horizontally scrollable on tiny screens */
  .table-shell table {
    min-width: 560px;
  }
}
