:root {
  color-scheme: dark;

  /* Grill restaurant design tokens. Semantic aliases below retain existing
     component contracts while individual page work is deferred to Phase 4. */
  --color-canvas: #121212;
  --color-canvas-raised: #191919;
  --color-surface: #202020;
  --color-surface-raised: #292929;
  --color-surface-interactive: #333333;
  --color-primary: #c84234;
  --color-primary-strong: #a83228;
  --color-accent: #dda64b;
  --color-text: #fff3e0;
  --color-text-muted: #cbb9a3;
  --color-border: #454545;
  --color-success: #54a878;
  --color-warning: #d9a441;
  --color-danger: #da6258;
  --color-info: #739dcc;
  --color-focus-ring: rgba(214, 160, 77, .36);

  --bg: var(--color-canvas);
  --bg-strong: var(--color-canvas-raised);
  --sidebar: #181818;
  --sidebar-2: #101010;
  --primary: var(--color-primary);
  --primary-dark: var(--color-primary-strong);
  --accent: var(--color-accent);
  --card: var(--color-surface);
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --border: var(--color-border);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
  --info: var(--color-info);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-control: 10px;
  --radius-card: 14px;
  --shadow: 0 18px 42px rgba(0, 0, 0, .28);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, .20);
  --focus: 0 0 0 3px var(--color-focus-ring);
}

/* Admin light mode. The public customer menu retains its own ELRock palette. */
:root[data-theme="light"] {
  color-scheme: light;
  --color-canvas: #f7f1e5;
  --color-canvas-raised: #fffaf2;
  --color-surface: #ffffff;
  --color-surface-raised: #fffdf9;
  --color-surface-interactive: #f0e5d4;
  --color-primary: #5a3b1a;
  --color-primary-strong: #3d260f;
  --color-accent: #b18b28;
  --color-text: #2c1b0c;
  --color-text-muted: #725e49;
  --color-border: #dfcfb7;
  --color-success: #19734a;
  --color-warning: #9a6414;
  --color-danger: #b64036;
  --color-info: #356d9e;
  --color-focus-ring: rgba(177, 139, 40, .28);
  --sidebar: #5a3b1a;
  --sidebar-2: #38220e;
  --shadow: 0 18px 42px rgba(90, 59, 26, .14);
  --shadow-sm: 0 8px 22px rgba(90, 59, 26, .10);
}

* { box-sizing: border-box; }
img, video, svg, iframe { max-width: 100%; height: auto; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, Arial, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; transition: .18s ease; }
button:disabled { cursor: not-allowed; opacity: .62; }

h1, h2, h3 { margin: 0; line-height: 1.35; }
h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 800; }

.sub {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.75;
  font-size: 14px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--color-canvas-raised);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.login-card {
  width: min(460px, 100%);
  padding: 36px 32px 32px;
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  animation: cardIn .4s cubic-bezier(.22, 1, .36, 1) both;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}
.brand-logo-full {
  width: 160px;
  height: auto;
  display: block;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  display: block;
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 11px 13px;
  background: var(--color-surface-raised);
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: unset;
  border: unset;
  border-radius: unset;
  padding: unset;
  background: transparent;
  -webkit-appearance: auto;
  appearance: auto;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.login-card .field span {
  color: var(--ink);
  font-size: 12.5px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.login-card .btn {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
  border-radius: 14px;
  margin-top: 6px;
  letter-spacing: .04em;
}

.btn {
  min-height: 44px;
  padding: 0 17px;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--color-text);
  font-weight: 800;
  box-shadow: none;
}
.btn:hover { transform: translateY(-1px); background: var(--primary-dark); box-shadow: none; }
.btn.secondary { background: var(--color-surface-interactive); color: var(--ink); box-shadow: none; }
.btn.warn { background: var(--warning); }
.btn.bad { background: var(--danger); }
.btn.ok { background: var(--success); }
.btn.info { background: var(--info); }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); box-shadow: none; }

.layout, .app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 18px 14px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 22rem),
    linear-gradient(160deg, var(--sidebar), var(--sidebar-2));
  box-shadow: 12px 0 34px rgba(16, 44, 42, .10);
}

.side-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px 20px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}
.side-head .logo { background: #fff; box-shadow: none; }
.sidebar-toggle {
  display: none;
  margin-right: auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 800;
}
.role-badge {
  display: inline-flex;
  margin-top: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(199, 146, 62, .18);
  color: #f7d99b;
  font-size: 12px;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 7px;
  padding-top: 16px;
}
.nav button {
  width: 100%;
  min-height: 44px;
  text-align: right;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,.76);
  font-weight: 700;
}
.nav button:hover,
.nav button.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.nav button.active {
  box-shadow: inset -4px 0 0 var(--accent);
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar, .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(231, 222, 210, .75);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow-sm);
}

.top-actions, .actions, .toolbar, .surface-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--color-surface-interactive); }
.theme-toggle span:first-child { font-size: 17px; line-height: 1; }

.pill, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f5ef;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}
.pill.warn, .badge.warning { background: #fff4d9; color: var(--warning); }
.pill.bad, .badge.danger { background: #ffe7e3; color: var(--danger); }
.pill.info, .badge.info { background: #eaf1ff; color: var(--info); }
.badge.success { background: #e8f5ef; color: var(--success); }

.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)); }

.panel, .data-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.welcome-panel {
  min-height: 150px;
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(15,118,110,.08), rgba(199,146,62,.11)),
    #fff;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  display: grid;
  gap: 8px;
  align-content: space-between;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto auto -35px -35px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(199,146,62,.10);
}
.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f2eadf;
  color: var(--primary);
  font-weight: 900;
}
.stat strong { font-size: 28px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 13px; }

.pos {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 440px);
  gap: 16px;
  align-items: start;
}

.seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.seg button {
  min-height: 42px;
  padding: 0 14px;
  background: transparent;
  border-left: 1px solid var(--border);
  font-weight: 800;
  color: var(--muted);
}
.seg button:last-child { border-left: 0; }
.seg button.active { background: var(--primary); color: #fff; }

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4eee5;
  color: var(--muted);
  font-weight: 800;
}
.chip.active, .chip:hover { background: var(--primary); color: #fff; }

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}
.product {
  min-height: 130px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  text-align: right;
  display: grid;
  align-content: space-between;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(33,28,21,.045);
}
.product:hover { transform: translateY(-2px); border-color: rgba(199,146,62,.75); box-shadow: var(--shadow-sm); }
.product b { font-size: 16px; }
.product span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.product strong { color: var(--primary); font-size: 18px; }

.menu-products-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.page-hero.compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, #f7efe4);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.page-hero.compact h2 {
  font-size: clamp(22px, 3vw, 30px);
}

.page-hero.compact p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 10px;
}

.menu-product-form-card,
.menu-products-list-panel {
  overflow: hidden;
}

.menu-product-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.menu-product-fields,
.menu-product-fields .grid {
  min-width: 0;
}

.tight-grid {
  gap: 12px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfaf7;
  color: var(--ink);
  font-weight: 800;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--primary);
}

.field small {
  color: var(--muted);
  line-height: 1.6;
}

.form-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.menu-product-image-uploader {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.menu-image-preview {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(199,146,62,.6);
  border-radius: 14px;
  background: #fffaf1;
  color: var(--muted);
  overflow: hidden;
  min-width: 0;
}

.menu-image-preview.has-image {
  border-style: solid;
  background: #fff;
}

.menu-image-preview img,
.menu-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-button {
  position: relative;
  overflow: hidden;
  justify-content: center;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.menu-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  min-width: 0;
}

.menu-product-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(33,28,21,.045);
  min-width: 0;
}

.menu-product-card.is-hidden {
  background: #fbfaf7;
}

.menu-product-image {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #f4eee5;
  min-width: 0;
}

.menu-product-image.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  padding: 10px;
}

.menu-product-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.menu-product-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.menu-product-title-row b {
  display: block;
  font-size: 18px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.menu-product-title-row span,
.menu-product-meta,
.menu-product-content p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.menu-product-title-row strong {
  color: var(--primary);
  font-size: 20px;
  white-space: nowrap;
}

.menu-product-content p {
  margin: 0;
}

.menu-product-badges,
.menu-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.badge.warn {
  background: #fff4d9;
  color: var(--warning);
}

.qr-image-warning {
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff4d9;
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

.menu-products-empty {
  margin-top: 12px;
}

.customer-qr-menu-page {
  direction: rtl;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  background: #faf7f1;
  color: #1f2933;
  padding: 16px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.admin-menu-products-page *,
.customer-qr-menu-page * {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal;
  box-sizing: border-box;
}

.customer-qr-menu-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.customer-qr-menu-header {
  width: 100%;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0f3d35, #14584c);
  color: white;
}

.customer-qr-menu-header h1,
.customer-qr-menu-header h2,
.customer-qr-menu-header p {
  margin: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.customer-qr-menu-search {
  width: 100%;
  margin: 16px 0;
}

.customer-qr-menu-search input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid #e5dccf;
  padding: 0 16px;
  font-size: 16px;
}

.customer-qr-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
  width: 100%;
}

.customer-qr-category-chip {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #eee7dc;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.customer-qr-category-chip.active {
  background: #0f766e;
  color: white;
}

.customer-qr-products-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
}

.customer-qr-product-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: white;
  border: 1px solid #eadfce;
  box-shadow: 0 10px 30px rgba(15, 61, 53, 0.08);
}

.customer-qr-product-image,
.customer-qr-product-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 160px;
  object-fit: cover;
  background: #f0ebe3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #746b5f;
  font-weight: 800;
  text-align: center;
}

.customer-qr-product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.customer-qr-product-title {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 900;
  color: #111827;
  margin: 0;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  min-width: 0;
}

.customer-qr-product-description,
.customer-qr-product-category {
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.customer-qr-product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-qr-product-price {
  font-size: 20px;
  font-weight: 900;
  color: #0f766e;
  white-space: nowrap;
}

.customer-qr-add-button {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: #0f766e;
  color: white;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .customer-qr-menu-page {
    padding: 12px;
  }

  .customer-qr-products-grid {
    grid-template-columns: 1fr !important;
  }

  .customer-qr-menu-header {
    padding: 16px;
    border-radius: 20px;
  }

  .customer-qr-product-title {
    font-size: 17px;
  }

  .customer-qr-product-price {
    font-size: 19px;
  }
}

.customer-qr-cart {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.qr-cart-line {
  display: grid;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   PUBLIC CUSTOMER MENU — premium layout
   ═══════════════════════════════════════════════════════════════ */

.customer-menu-page {
  direction: rtl;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--menu-bg, linear-gradient(180deg, #f9f5ee 0%, #fffcf6 100%));
  color: #111827;
  padding: 16px 16px 92px;
  font-family: var(--menu-font, inherit);
}

.customer-menu-page * {
  box-sizing: border-box;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
}

.customer-menu-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.customer-menu-loading,
.customer-menu-error,
.customer-menu-empty {
  min-height: 200px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(15, 61, 53, 0.1);
  border-radius: 20px;
  padding: 24px;
}

.customer-menu-error.inline {
  min-height: auto;
  display: block;
  margin-bottom: 14px;
  color: #991b1b;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 14px;
  padding: 12px 16px;
}

/* ── Hero ──────────────────────────────────────────────────── */
.customer-menu-hero {
  display: grid;
  grid-template-columns: 1fr 176px;
  gap: 20px;
  align-items: center;
  border-radius: 24px;
  padding: 18px 24px 20px;
  color: #fff;
  background: var(--menu-primary, linear-gradient(135deg, #0a2e28 0%, #0f3d35 60%, #1a5045 100%));
  box-shadow: 0 8px 28px rgba(15, 61, 53, 0.22);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.customer-menu-hero::before {
  content: "";
  position: absolute;
  top: -55px;
  left: -55px;
  width: 150px;
  height: 150px;
  border: 26px solid rgba(196, 127, 50, 0.10);
  border-radius: 50%;
  pointer-events: none;
}

.customer-menu-hero::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 60px;
  width: 80px;
  height: 80px;
  border: 16px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.customer-menu-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.customer-menu-hero-title {
  margin: 0 0 5px;
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--menu-hero-text, #fff);
}

.customer-menu-hero-sub {
  margin: 0 0 4px;
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--menu-hero-text, #ffe4bd);
  font-weight: 700;
  opacity: 0.92;
}

.customer-menu-hero-desc {
  margin: 0 0 10px;
  font-size: clamp(11px, 1.4vw, 13px);
  color: var(--menu-hero-text, rgba(255, 255, 255, 0.72));
  font-weight: 500;
  line-height: 1.5;
  opacity: 0.82;
}

.customer-menu-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255,255,255,0.13);
  color: #fff4df;
  border: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 9px;
  letter-spacing: 0.3px;
}

.customer-menu-table-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 900;
  background: var(--menu-accent, #c47f32);
  color: #fff;
  border: none;
  font-size: 13px;
  margin-top: 4px;
}

.customer-menu-hero-cta {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 800;
  background: var(--menu-accent, #c47f32);
  color: #fff;
  font-size: 13px;
  border: none;
  margin-top: 4px;
  letter-spacing: 0.2px;
}

.customer-menu-hero-mark {
  position: relative;
  z-index: 1;
  width: 176px;
  height: 148px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #fffdf7;
  border: 2px solid rgba(196, 127, 50, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(196, 127, 50, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  overflow: hidden;
  padding: 14px;
}

.customer-menu-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Search ────────────────────────────────────────────────── */
.customer-search-wrap {
  margin-bottom: 10px;
}

.customer-search-input {
  width: 100%;
  height: 50px;
  border: 1.5px solid #e4d8c6;
  border-radius: 16px;
  background: #fff;
  color: #111827;
  padding: 0 18px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  box-shadow: 0 4px 18px rgba(15, 61, 53, 0.06);
}

.customer-search-input:focus {
  border-color: #0f3d35;
  box-shadow: 0 0 0 3px rgba(15, 61, 53, 0.1);
}

/* ── Category chips ────────────────────────────────────────── */
.customer-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 10px;
}

.customer-chip {
  flex: 0 0 auto;
  border: 1.5px solid #e4d8c6;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.customer-chip.active,
.customer-chip:hover {
  background: var(--menu-primary, #0f3d35);
  border-color: var(--menu-primary, #0f3d35);
  color: #fff;
}

/* ── Offers section ────────────────────────────────────────── */
.customer-offers-section {
  margin: 0 auto 16px;
  max-width: 720px;
  background: linear-gradient(160deg, #fffbf0 0%, #fff8e8 100%);
  border: 1px solid #f0d9b0;
  border-radius: 22px;
  padding: 18px 18px 20px;
}

.customer-offers-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.customer-offers-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #0f3d35;
}

.customer-offers-sub {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.customer-offers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ── Featured offer (single offer — full-width horizontal layout) ── */
.customer-featured-offer {
  display: grid;
  grid-template-columns: 1fr 200px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, #fffbf2 0%, #fff7e6 100%);
  border: 1px solid #f0d9b0;
  box-shadow: 0 8px 28px rgba(196, 127, 50, 0.16);
  min-height: 160px;
}

.customer-featured-offer-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-featured-offer-badge {
  display: inline-block;
  background: var(--menu-accent, #c47f32);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.3px;
  align-self: flex-start;
}

.customer-featured-offer-title {
  margin: 0;
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 900;
  color: #111827;
  line-height: 1.25;
}

.customer-featured-offer-items {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.customer-featured-offer-prices {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-featured-offer-prices .customer-offer-price {
  font-size: 22px;
}

.customer-featured-offer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--menu-button, #0f3d35);
  color: var(--menu-button-text, #fff);
  border: none;
  border-radius: 14px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  height: 44px;
  margin-top: auto;
  transition: background .15s;
  font-family: inherit;
}

.customer-featured-offer-btn:hover { background: #0d3530; }

.customer-featured-offer-img {
  position: relative;
  overflow: hidden;
}

.customer-featured-offer-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.customer-offer-card {
  display: flex;
  flex-direction: row;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #fffbf2 0%, #fff7e6 100%);
  border: 1px solid #f0d9b0;
  box-shadow: 0 4px 16px rgba(196, 127, 50, 0.12);
  transition: box-shadow 0.2s;
  min-height: 140px;
}

.customer-offer-card:hover {
  box-shadow: 0 8px 28px rgba(196, 127, 50, 0.22);
}

.customer-offer-img-wrap {
  position: relative;
  width: 35%;
  flex-shrink: 0;
  overflow: hidden;
}

.customer-offer-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.customer-offer-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #c47f32 0%, #e8a84c 60%, #f5c97a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-offer-img-placeholder span {
  font-size: 48px;
  font-weight: 900;
  color: rgba(255,255,255,0.6);
}

.customer-offer-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--menu-accent, #c47f32);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 10px;
  letter-spacing: 0.4px;
}

.customer-offer-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.customer-offer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #111827;
  line-height: 1.3;
}

.customer-offer-products {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.customer-offer-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.customer-offer-original {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 13px;
}

.customer-offer-price {
  font-size: 20px;
  font-weight: 900;
  color: #0f3d35;
}

.customer-offer-savings {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
}

/* ── Product section header ────────────────────────────────── */
.customer-product-section-header {
  margin-bottom: 12px;
}

.customer-product-section-title {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 900;
  color: #0f3d35;
}

.customer-product-section-sub {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

/* ── Product grid ──────────────────────────────────────────── */
.customer-menu-layout {
  display: grid;
  gap: 18px;
}

.customer-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  min-width: 0;
}

/* ── Product card ──────────────────────────────────────────── */
.customer-product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--menu-card, #fff);
  border: 1px solid #eadfce;
  box-shadow: 0 4px 18px rgba(15, 61, 53, 0.07);
  transition: box-shadow 0.2s, transform 0.15s;
}

@media (hover: hover) {
  .customer-product-card:hover {
    box-shadow: 0 8px 30px rgba(15, 61, 53, 0.13);
    transform: translateY(-2px);
  }
}

.customer-product-img-wrap {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #f5f0ea;
  flex-shrink: 0;
}

.customer-product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.customer-product-img-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(145deg, #fdf6ed 0%, #fef3e2 50%, #fdf0d9 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.customer-product-img-placeholder span {
  font-size: 36px;
  font-weight: 900;
  color: #c47f32;
  opacity: 0.55;
  line-height: 1;
}

/* Emoji placeholder — shown instead of a letter initial */
.cpm-emoji {
  font-size: 34px !important;
  font-weight: normal !important;
  opacity: 0.6 !important;
  line-height: 1 !important;
  color: inherit !important;
}

.customer-product-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.customer-product-cat-badge {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 9px;
  background: #fdf0e0;
  color: #9a5d18;
  font-size: 11px;
  font-weight: 800;
}

.customer-product-name {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--menu-primary, #111827);
  line-height: 1.3;
}

.customer-product-desc {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.customer-product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
}

.customer-product-price {
  color: var(--menu-accent, #0f3d35);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Add buttons ───────────────────────────────────────────── */
.customer-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  background: var(--menu-button, #0f3d35);
  color: var(--menu-button-text, #fff);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 80px;
  height: 38px;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.15s;
}

.customer-add-btn:hover { background: #0d3530; }
.customer-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Product-card qty controls (replaces Add button once item is in cart) ── */
.cpm-qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 999px;
  overflow: hidden;
  height: 34px;
}
.cpm-qty-btn {
  width: 32px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
  flex-shrink: 0;
  line-height: 1;
}
.cpm-qty-btn:hover { background: #dcfce7; }
.cpm-qty-num {
  min-width: 24px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: #166534;
  padding: 0 2px;
}

.customer-add-btn.secondary-btn {
  background: #c47f32;
}

.customer-add-btn.secondary-btn:hover { background: #a86c28; }

.offer-add-btn {
  width: 100%;
  margin-top: auto;
  height: 42px;
  font-size: 13px;
  border-radius: 14px;
}

/* Keep old class as alias so QR cart panel buttons still work */
.customer-menu-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  background: #0f3d35;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 80px;
  height: 38px;
  flex-shrink: 0;
  line-height: 1;
}

.customer-menu-add-button.secondary { background: #c47f32; }
.customer-menu-add-button.wide { width: 100%; height: 46px; }
.customer-menu-add-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Card image size variants ────────────────────────────────── */
.cpc-img-large  { height: 200px !important; }
.cpc-img-medium { height: 140px !important; }

/* ── Card style: image-focus ─────────────────────────────────── */
.cpc-image-focus .customer-product-body { padding: 8px 12px 10px; gap: 4px; }
.cpc-image-focus .customer-product-desc { display: none; }

/* ── Card style: compact ─────────────────────────────────────── */
.cpc-compact .customer-product-img-wrap,
.cpc-compact .customer-product-img-placeholder { height: 110px !important; }
.cpc-compact .customer-product-body { padding: 8px 10px 10px; gap: 4px; }
.cpc-compact .customer-product-name { font-size: 13px; }
.cpc-compact .customer-product-desc { -webkit-line-clamp: 1; }

/* ── Card name + image as clickable ──────────────────────────── */
.cpc-name-link {
  cursor: pointer;
  touch-action: manipulation;
}
.cpc-name-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--menu-accent, #c47f32);
  text-underline-offset: 2px;
}
.customer-product-img-wrap[data-action],
.customer-product-img-placeholder[data-action] {
  cursor: pointer;
  touch-action: manipulation;
}
.customer-product-img-wrap[data-action] img { transition: transform .2s; }
.customer-product-img-wrap[data-action]:hover img { transform: scale(1.05); }

/* ── Product Detail Panel ────────────────────────────────────── */
/* ══ Product Detail Popup ═══════════════════════════════════════ */
.menu-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(10, 22, 20, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  touch-action: manipulation;
}

/* ── shared panel base ── */
.menu-detail-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--menu-popup-bg, #fff);
  font-family: var(--menu-font, inherit);
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.26),
    0 8px 24px rgba(0, 0, 0, 0.14);
  max-height: 88vh;
  animation: menuDetailPopIn .22s cubic-bezier(0.34, 1.12, 0.64, 1);
}

@keyframes menuDetailPopIn {
  from { transform: scale(0.88) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* ── top layout: image on top, content below ── */
.menu-detail-panel.detail-top {
  width: min(440px, 100%);
}
.menu-detail-panel.detail-top .menu-detail-img-wrap { height: 250px; }

/* ── side layout: image left + content right on desktop ── */
.menu-detail-panel.detail-side {
  width: min(440px, 100%);
  flex-direction: column;
}
.menu-detail-panel.detail-side .menu-detail-img-wrap { height: 250px; }

@media (min-width: 680px) {
  .menu-detail-panel.detail-side {
    flex-direction: row;
    width: min(720px, 94vw);
    max-height: 82vh;
    overflow: hidden;
  }
  .menu-detail-panel.detail-side .menu-detail-img-wrap {
    width: 48%;
    height: auto;
    min-height: 100%;
    flex-shrink: 0;
  }
  .menu-detail-panel.detail-side .menu-detail-img-wrap .menu-detail-img {
    height: 100%;
    object-fit: cover;
  }
  .menu-detail-panel.detail-side .menu-detail-body {
    overflow-y: auto;
  }
}

/* ── image wrapper ── */
.menu-detail-img-wrap {
  width: 100%;
  overflow: hidden;
  background: linear-gradient(145deg, #fdf6ed 0%, #fef3e2 100%);
  flex-shrink: 0;
  position: relative;
}

.menu-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.menu-detail-img-wrap.menu-detail-img-error,
.menu-detail-img-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
}

/* ── gradient overlay on image (fades into content) ── */
.menu-detail-img-wrap::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}

/* ── content body ── */
.menu-detail-body {
  padding: 22px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  direction: rtl;
  overflow-y: auto;
  flex: 1;
}

.menu-detail-name {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--menu-popup-title, var(--menu-primary, #0f3d35));
  line-height: 1.25;
}

.menu-detail-desc {
  margin: 0;
  font-size: 14px;
  color: var(--menu-popup-desc, #555f6e);
  line-height: 1.75;
  white-space: pre-line;
}

/* ── price + action row ── */
.menu-detail-footer {
  margin-top: 8px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.menu-detail-price {
  font-size: 24px;
  font-weight: 900;
  color: var(--menu-popup-price, var(--menu-accent, #c47f32));
  letter-spacing: -0.3px;
}

.menu-detail-add-btn {
  height: 46px;
  padding: 0 26px;
  font-size: 15px;
  border-radius: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.menu-detail-qty-ctrl { height: 42px; border-radius: 999px; }
.menu-detail-qty-ctrl .cpm-qty-btn { width: 40px; height: 42px; font-size: 20px; }
.menu-detail-qty-ctrl .cpm-qty-num { font-size: 16px; min-width: 30px; }

.menu-detail-cat {
  display: inline-block;
  margin-bottom: 4px;
}
.menu-detail-no-desc {
  opacity: 0.38;
  font-style: italic;
}

/* ── close button (top-right corner of popup) ── */
.menu-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  transition: background .15s, transform .15s;
  line-height: 1;
}
.menu-detail-close:hover {
  background: #fff;
  transform: scale(1.1);
}

/* ── mobile: bottom sheet ── */
@media (max-width: 540px) {
  .menu-detail-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .menu-detail-panel,
  .menu-detail-panel.detail-top,
  .menu-detail-panel.detail-side {
    width: 100%;
    max-height: 91dvh;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.22);
    animation: menuDetailSheetUp .24s cubic-bezier(0.34, 1.08, 0.64, 1);
    flex-direction: column;
  }
  .menu-detail-panel .menu-detail-img-wrap,
  .menu-detail-panel.detail-side .menu-detail-img-wrap {
    height: 220px !important;
    width: 100%;
    min-height: unset;
  }
  .menu-detail-panel.detail-side .menu-detail-body { overflow-y: auto; }
  .menu-detail-close { top: 10px; right: 10px; }
}

@keyframes menuDetailSheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
/* skip animation on re-renders while popup stays open */
.menu-detail-panel.no-anim { animation: none !important; }

/* ── Branding settings card option rows ──────────────────────── */
.branding-card-options {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.branding-card-opt-group { display: flex; flex-direction: column; gap: 6px; }
.branding-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.branding-radio-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1.5px solid #e4d8c6;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.branding-radio-opt:has(input:checked) { border-color: #0f3d35; background: #f0f9f6; }
.branding-radio-opt input { margin: 0; accent-color: #0f3d35; }
.branding-radio-opt small { font-size: 11px; color: #9ca3af; font-weight: 400; }

/* ── Settings section divider & subtitle ─────────────────────── */
.branding-section-divider {
  height: 1px;
  background: linear-gradient(to right, #e4d8c6, transparent);
  margin: 20px 0 18px;
}
.branding-subsection-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f3d35;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

/* ── Font picker grid ────────────────────────────────────────── */
.branding-font-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.branding-font-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border: 2px solid #e4d8c6;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  min-width: 86px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
}
.branding-font-opt input[type="radio"] { display: none; }
.branding-font-opt.selected,
.branding-font-opt:has(input:checked) {
  border-color: #0f3d35;
  background: #f0f9f6;
  box-shadow: 0 0 0 3px rgba(15, 61, 53, 0.1);
}
.branding-font-preview {
  font-size: 24px;
  font-weight: 700;
  color: #0f3d35;
  line-height: 1;
  display: block;
}
.branding-font-name {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}

/* ── QR cart drawer ─────────────────────────────────────────── */
.customer-menu-cart {
  position: sticky;
  top: 16px;
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #eadfce;
  box-shadow: 0 8px 30px rgba(15, 61, 53, 0.1);
}

.customer-menu-cart.drawer {
  position: static;
  width: min(94vw, 440px);
  max-height: 86vh;
  overflow-y: auto;
}

.customer-menu-cart-head,
.customer-menu-cart-line,
.customer-menu-cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-menu-cart-head h2 { margin: 0; }

.customer-menu-cart-line {
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid #efe4d3;
}

.customer-menu-cart-line b,
.customer-menu-cart-line span { display: block; }

.customer-menu-cart-line span,
.customer-menu-muted { color: #64748b; }

.qr-cart-offer-preview {
  font-size: 11px;
  color: #9ca3af;
  display: block;
  margin-top: 1px;
}

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

.customer-menu-icon-button {
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffaf2;
  color: #0f3d35;
  min-width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.customer-menu-note-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  padding: 0 12px;
}

/* ─── legacy totals (kept for backward compat) ─────────────── */
.customer-menu-cart-total {
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8f4ec;
}
.customer-menu-cart-total b { color: #0f3d35; font-size: 20px; }

/* ═══════════════════════════════════════════════════════════════
   QCB — fixed bottom cart bar (works on all screen sizes + Electron)
   ═══════════════════════════════════════════════════════════════ */
.qcb {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px;
  background: #0f3d35;
  box-shadow: 0 -4px 24px rgba(15,61,53,.22);
}
.qcb-failed { background: rgba(255,243,224,.98); border-top: 1.5px solid #ffcc80; justify-content: space-between; box-shadow: 0 -4px 20px rgba(180,83,9,.15); }
.qcb-expired { background: rgba(255,235,238,.98); border-top: 1.5px solid #ef9a9a; justify-content: center; box-shadow: 0 -4px 20px rgba(183,28,28,.12); }

.qcb-status-text { font-weight: 700; font-size: 14px; color: #b45309; }
.qcb-expired .qcb-status-text { color: #b71c1c; }

.qcb-left { display: flex; align-items: center; gap: 12px; }

.qcb-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #c47f32;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(196,127,50,.4);
}
.qcb-text { display: flex; flex-direction: column; gap: 1px; }
.qcb-label { font-size: 13px; font-weight: 700; color: rgba(255,255,255,.75); }
.qcb-total { font-size: 20px; font-weight: 900; color: #fff; }

.qcb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border: none;
  border-radius: 14px;
  background: #c47f32;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, transform .12s;
  box-shadow: 0 2px 10px rgba(196,127,50,.35);
}
.qcb-btn:hover { background: #a86c28; transform: translateY(-1px); }
.qcb-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.qcb-failed .qcb-btn { background: #b45309; }

/* ─── backward-compat alias ─────────────────────────────────── */
.customer-menu-mobile-cart-bar { display: none; }

body.cart-modal-open {
  overflow: hidden;
}

.customer-menu-cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 20, 30, 0.55);
  backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════════════════════════
   QR DRAWER — centered modal
   ═══════════════════════════════════════════════════════════════ */
.qr-drawer {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  width: 100%;
}
.qr-drawer.is-drawer {
  width: min(100%, 480px);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(10,20,30,.28);
}

.qr-drawer-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  min-height: 0;
}

.qr-drawer-footer {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #f0e8db;
  padding: 10px 16px 16px;
}

.qr-drawer-handle {
  display: none;
  width: 44px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 14px auto 6px;
  flex-shrink: 0;
}

.qr-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0e8db;
  position: sticky;
  top: 0;
  background: #0f3d35;
  z-index: 2;
  border-radius: 20px 20px 0 0;
}
.qr-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}
.qr-drawer-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.qr-drawer-close {
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
  flex-shrink: 0;
}
.qr-drawer-close:hover { background: rgba(255,255,255,0.25); }

/* Alert banners inside drawer */
.qr-drawer-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 16px 4px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
}
.qr-drawer-alert > span:first-child { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.qr-drawer-alert b { display: block; font-weight: 700; font-size: 14px; }
.qr-drawer-alert p { margin: 3px 0 0; color: #6b7280; font-size: 12px; }
.qr-drawer-alert-expired { background: #fff1f1; }
.qr-drawer-alert-expired b { color: #b91c1c; }
.qr-drawer-alert-failed { background: #fffbeb; flex-wrap: wrap; }
.qr-drawer-alert-failed b { color: #b45309; }

/* Items list */
.qr-drawer-items { padding: 4px 16px 8px; }

.qr-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 16px;
  color: #9ca3af;
  text-align: center;
}
.qr-drawer-empty span { font-size: 38px; }
.qr-drawer-empty p { font-size: 14px; margin: 0; }

/* Cart line */
.qr-cart-line {
  padding: 14px 0;
  border-bottom: 1px solid #f3ece1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qr-cart-line:last-child { border-bottom: none; }

.qr-cart-line-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.qr-cart-line-info { flex: 1; min-width: 0; }
.qr-cart-line-name { display: block; font-size: 15px; font-weight: 700; color: #1a2e2a; margin-bottom: 2px; }
.qr-cart-line-sub { display: block; font-size: 11px; color: #9ca3af; }
.qr-cart-line-unit { display: block; font-size: 12px; color: #9ca3af; margin-top: 3px; }

.qr-cart-line-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.qr-cart-line-total { font-size: 16px; font-weight: 900; color: #0f3d35; }

.qr-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #d1fae5;
  border-radius: 999px;
  background: #f0fdf4;
  overflow: hidden;
  height: 36px;
}
.qr-cart-qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
  line-height: 1;
}
.qr-cart-qty-btn:hover { background: #dcfce7; }
.qr-cart-qty-num {
  min-width: 30px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  color: #166534;
}

.qr-cart-note {
  width: 100%;
  min-height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
  outline: none;
  transition: border-color .15s, background .15s;
}
.qr-cart-note:focus { border-color: #0f3d35; background: #fff; }
.qr-cart-note::placeholder { color: #9ca3af; }

/* Totals block */
.qr-drawer-totals {
  margin: 4px 16px 12px;
  background: linear-gradient(135deg, #f8f4ec, #fdf6ec);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #ede2cc;
}
.qr-drawer-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: #374151;
}
.qr-drawer-total-row b { font-size: 15px; font-weight: 700; color: #1a3a32; }
.qr-drawer-total-final {
  border-top: 1px solid #e4d6b8;
  padding-top: 10px;
  margin-top: 2px;
}
.qr-drawer-total-final span { font-size: 16px; font-weight: 700; color: #0f3d35; }
.qr-drawer-total-final b { font-size: 22px; font-weight: 900; color: #0f3d35; }

/* Submit button */
.qr-drawer-submit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 16px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f4a3f, #0f3d35);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  letter-spacing: .3px;
  transition: transform .14s, box-shadow .14s;
  box-shadow: 0 4px 18px rgba(15,61,53,.32);
}
.qr-drawer-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,61,53,.4); }
.qr-drawer-submit:active:not(:disabled) { transform: translateY(0); }
.qr-drawer-submit:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ── Success card ──────────────────────────────────────────── */
.customer-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  margin-bottom: 20px;
  border-radius: 24px;
  background: linear-gradient(160deg, #edf7f3, #f0fbf5);
  border: 1px solid #c1e4d3;
  text-align: center;
}

.customer-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0f3d35;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-success-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #0f3d35;
}

.customer-success-order {
  font-size: 15px;
  color: #374151;
}

.customer-success-note {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

/* ── QR success card (existing) ────────────────────────────── */
.customer-menu-success {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 20px;
  color: #0f3d35;
  background: #edf7f3;
  border: 1px solid #cce6db;
  font-weight: 800;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .customer-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .customer-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}


@media (max-width: 600px) {
  .customer-menu-page { padding: 10px 10px 20px; }

  .customer-menu-hero {
    grid-template-columns: 1fr 128px;
    gap: 12px;
    padding: 14px 14px 16px;
    border-radius: 20px;
    align-items: center;
  }

  .customer-menu-hero-mark {
    width: 128px;
    height: 108px;
    border-radius: 16px;
    padding: 8px;
  }

  .customer-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .customer-product-name { font-size: 14px; }

  .customer-offer-card {
    flex-direction: column;
    min-height: auto;
  }

  .customer-offer-img-wrap {
    width: 100%;
    height: 160px;
  }

  .customer-featured-offer {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .customer-featured-offer-img {
    order: -1;
    height: 160px;
  }

  .customer-featured-offer-img img { height: 160px; }

}

@media (max-width: 380px) {
  .customer-product-grid { grid-template-columns: 1fr; }
}

.qr-cart-line span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

/* ── QR session badge & expiry ─────────────────────────────── */
.qr-session-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #e8f5e9;
  color: #2e7d32;
  white-space: nowrap;
}

.qr-session-badge.warn {
  background: #fff3e0;
  color: #e65100;
  animation: qr-pulse 1s ease-in-out infinite;
}

.qr-session-badge.expired {
  background: #ffebee;
  color: #b71c1c;
}

/* Full-width session strip inside the drawer, below the header */
.qr-session-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
  border-bottom: 1px solid #c8e6c9;
  flex-shrink: 0;
}
.qr-session-strip.warn {
  background: #fff3e0;
  color: #e65100;
  border-bottom-color: #ffe0b2;
  animation: qr-pulse 1s ease-in-out infinite;
}
.qr-session-strip.expired {
  background: #ffebee;
  color: #b71c1c;
  border-bottom-color: #ef9a9a;
}

@keyframes qr-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

.qr-session-expired-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  margin-bottom: 16px;
  font-size: 14px;
  color: #b71c1c;
}

.qr-session-expired-banner > span:first-child {
  font-size: 28px;
  flex-shrink: 0;
}

.qr-session-expired-banner > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qr-session-expired-banner b {
  font-size: 15px;
  font-weight: 700;
}

.qr-session-failed-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  margin-bottom: 16px;
  font-size: 14px;
  color: #e65100;
}
.qr-session-failed-banner > span:first-child { font-size: 28px; flex-shrink: 0; }
.qr-session-failed-banner > div { display: flex; flex-direction: column; gap: 6px; }
.qr-session-failed-banner b { font-size: 15px; font-weight: 700; }
.qr-session-failed-banner button {
  align-self: flex-start;
  background: #e65100;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.qr-session-expired-overlay {
  padding: 14px;
  border-radius: 12px;
  background: #ffebee;
  color: #b71c1c;
  text-align: center;
  font-size: 14px;
  margin-bottom: 12px;
}

.qr-session-expired-overlay p {
  margin: 3px 0;
}

.customer-menu-cart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-menu-cart-head h2 {
  margin: 0;
  flex: 1;
}

.customer-menu-mobile-cart-bar.session-expired {
  background: rgba(255, 235, 238, 0.97);
  border-top-color: #ef9a9a;
}

.customer-menu-mobile-cart-bar.session-failed {
  background: rgba(255, 243, 224, 0.97);
  border-top-color: #ffcc80;
}

.qr-session-failed-overlay {
  background: #fff8e1 !important;
  color: #e65100 !important;
}

.qr-session-failed-overlay button {
  margin-top: 8px;
}

.customer-menu-mobile-cart-bar > .qr-session-badge {
  font-size: 11px;
  padding: 2px 8px;
}

.qr-menu-success,
.qr-menu-error,
.qr-menu-loading {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-right: 5px solid var(--success);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: center;
  line-height: 1.8;
}

.qr-menu-error {
  border-right-color: var(--danger);
  color: var(--danger);
}

.qr-menu-order-error {
  margin: 0;
}

.table-qr-modal-box {
  width: min(94vw, 520px);
}

.table-qr-card,
.table-qr-print-card {
  display: grid;
  place-items: center;
  gap: 10px;
  margin: 12px auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  text-align: center;
  color: #111;
}

.table-qr-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.table-qr-brand {
  font-size: 22px;
  color: var(--primary);
  font-weight: 900;
}

.table-qr-print-card h3 {
  font-size: 22px;
}

.table-qr-print-card p,
.table-qr-print-card small {
  margin: 0;
  color: #333;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.table-qr-image-wrap {
  width: 280px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #eee;
}

.table-qr-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.table-qr-link {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4eee5;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.table-qr-permanent-note {
  padding: 10px 14px;
  border-radius: 10px;
  background: #edfaf4;
  border: 1px solid #b2dfc9;
  color: #1a6640;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 4px;
}

.table-qr-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.table-qr-actions .btn {
  min-width: 110px;
}

@media (max-width: 560px) {
  .table-qr-modal-box {
    padding: 14px;
  }

  .table-qr-card,
  .table-qr-print-card {
    padding: 16px;
    border-radius: 18px;
  }

  .table-qr-actions .btn {
    width: 100%;
  }
}

.danger-text {
  color: var(--danger);
  font-weight: 900;
}

.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.qty { display: inline-flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f0e8dc;
  color: var(--ink);
  font-weight: 900;
}
.icon-btn:hover { background: var(--accent); color: #fff; }

.totals {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}
.totals div { display: flex; justify-content: space-between; gap: 10px; }
.total { font-size: 22px; font-weight: 900; }

.table-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.table-card {
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 18px 14px 14px;
  text-align: right;
  box-shadow: 0 4px 14px rgba(33,28,21,.06);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.table-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: #d1d5db;
}
.table-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(33,28,21,.12); }

.table-card.available { border-color: rgba(22,128,87,.4); background: linear-gradient(165deg, #fff 60%, #f0fdf4); }
.table-card.available::before { background: #16a34a; }

.table-card.occupied { border-color: rgba(183,121,31,.5); background: linear-gradient(165deg, #fff 60%, #fffbeb); animation: tc-occupied-pulse 2.8s ease-in-out infinite; }
.table-card.occupied::before { background: #d97706; }
.table-card.occupied:hover { animation: none; transform: translateY(-3px); box-shadow: 0 10px 28px rgba(183,121,31,.22); }

.table-card.reserved { border-color: rgba(37,99,168,.4); background: linear-gradient(165deg, #fff 60%, #eff6ff); }
.table-card.reserved::before { background: #2563a8; }

.table-card.locked { border-color: #d9d9d9; background: linear-gradient(165deg, #fff 60%, #f3f4f6); }
.table-card.locked::before { background: #9ca3af; }

.table-card.busy { border-color: rgba(183,121,31,.5); background: #fffbeb; }
.table-card.free  { border-color: rgba(22,128,87,.4);  background: #f0fdf4; }

@keyframes tc-occupied-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(183,121,31,.07); }
  50%       { box-shadow: 0 6px 24px rgba(183,121,31,.28), 0 0 0 3px rgba(183,121,31,.09); }
}

/* table card internals */
.tc-num {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
  margin-top: 1px;
  letter-spacing: .3px;
}
.tc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}
.tc-actions { gap: 5px; }
.tc-actions .btn { font-size: 11px; padding: 5px 10px; }

.tc-view-order-btn {
  display: block;
  width: calc(100% + 28px);
  margin: 2px -14px -14px;
  padding: 10px 16px;
  background: #eff6ff;
  color: #1d4ed8;
  border: none;
  border-top: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
  letter-spacing: .2px;
}
.tc-view-order-btn:hover { background: #dbeafe; color: #1e40af; }

.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
}

.employee-card {
  min-height: 210px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbf8f2);
  padding: 14px;
  text-align: right;
  box-shadow: 0 8px 18px rgba(33,28,21,.045);
  transition: .18s ease;
}
.employee-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.employee-meta,
.attendance-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.employee-meta span,
.employee-meta b,
.attendance-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f4eee5;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}
.employee-meta b {
  background: #e8f5ef;
  color: var(--success);
}

.attendance-row {
  border-right: 5px solid rgba(15, 118, 110, .42);
}

.payroll-card {
  border-color: rgba(199, 146, 62, .38);
}

.payroll-total {
  display: block;
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.shift-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(15, 118, 110, .25);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f2fbf6);
  padding: 14px;
}

.inventory-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  min-width: 0;
}

.inventory-stock-card,
.inventory-recipe-card,
.inventory-movement-card,
.inventory-low-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.inventory-stock-card.low,
.inventory-low-card {
  border-color: rgba(185, 28, 28, .28);
  background: linear-gradient(180deg, #fff, #fff7f7);
}

.inventory-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.inventory-card-head b {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.inventory-card-head span:not(.badge):not(.pill) {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  min-width: 0;
}

.inventory-metric-grid div,
.inventory-reason,
.inventory-ingredient-line {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfaf7;
  padding: 10px;
  min-width: 0;
}

.inventory-metric-grid span,
.inventory-reason span,
.inventory-ingredients > .sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-metric-grid b,
.inventory-reason b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.inventory-card-actions {
  justify-content: flex-start;
}

.inventory-ingredients {
  display: grid;
  gap: 8px;
}

.inventory-ingredient-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inventory-ingredient-line b {
  color: var(--text);
  font-weight: 900;
}

.inventory-ingredient-line span {
  color: var(--primary);
  font-weight: 900;
}

.success-text {
  color: var(--success) !important;
}

.danger-text {
  color: var(--danger) !important;
}

@media (max-width: 520px) {
  .inventory-card-grid,
  .inventory-metric-grid {
    grid-template-columns: 1fr;
  }
}

.inventory-page-body {
  margin-top: 14px;
  min-width: 0;
}

.inventory-tab-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.inventory-form-panel {
  position: sticky;
  top: 16px;
  min-width: 0;
}

.inventory-list-panel {
  min-width: 0;
  overflow: hidden;
}

.inventory-stock-card,
.inventory-recipe-card,
.inventory-movement-card,
.inventory-low-card {
  box-shadow: 0 8px 18px rgba(33,28,21,.04);
}

.inventory-stock-card:hover,
.inventory-recipe-card:hover,
.inventory-movement-card:hover,
.inventory-low-card:hover {
  border-color: rgba(199,146,62,.55);
  box-shadow: var(--shadow-sm);
}

.inventory-quantity-hero {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(22,128,87,.18);
  border-radius: 14px;
  background: #eef8f5;
}

.inventory-quantity-hero.low {
  border-color: rgba(180,35,24,.18);
  background: #fff1ee;
}

.inventory-quantity-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inventory-quantity-hero strong {
  color: var(--primary);
  font-size: 24px;
  line-height: 1.2;
}

.inventory-quantity-hero.low strong {
  color: var(--danger);
}

.inventory-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.inventory-card-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.inventory-movements-list {
  display: grid;
  gap: 12px;
}

.inventory-recipe-card.empty-recipe {
  border-color: rgba(183,121,31,.5);
  background: #fffaf0;
}

.inventory-ingredient-line span {
  text-align: left;
}

@media (max-width: 1000px) {
  .inventory-tab-layout {
    grid-template-columns: 1fr;
  }

  .inventory-form-panel {
    position: static;
  }
}

.pos-table-map {
  margin: 12px 0 16px;
}

/* ============================================================
   TABLE SESSION MODAL
   ============================================================ */

/* Double-class selector beats .modal-box (same-specificity, later in file) */
.modal-box.table-session-modal {
  width: min(1180px, 99vw);
  max-width: min(1180px, 99vw);
  height: 98vh;          /* fixed height so flex children fill it */
  max-height: 98vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 16px;
}

.table-session-modal *,
.table-session-modal *::before,
.table-session-modal *::after {
  box-sizing: border-box;
  min-width: 0;
}

/* Push the outer modal overlay to the top with minimal padding
   so the table session modal uses nearly the full viewport height */
.modal:has(.table-session-modal) {
  align-items: flex-start;
  padding: 8px;
}

/* --- Header (sticky inside modal) ----------------------------- */
.ts-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
}

.ts-header-info { flex: 1 1 auto; min-width: 0; }

.ts-header-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.ts-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
}

.ts-table-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.ts-orders-badge {
  background: #f0f0f0;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.ts-header-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}
.ts-header-actions .btn { white-space: nowrap; }

/* --- Summary cards ------------------------------------------- */
.ts-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin: 8px 0 0;
  padding: 0 16px;
  flex-shrink: 0;
}

.ts-stat-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px 8px;
  min-width: 0;
  overflow: hidden;
}

.ts-stat-paid   { border-color: rgba(22,128,87,.25); background: linear-gradient(160deg,#fff,#f4fcf7); }
.ts-stat-credit { border-color: rgba(199,146,62,.3);  background: linear-gradient(160deg,#fff,#fff8ed); }
.ts-stat-items  { border-color: rgba(37,99,168,.2);   background: linear-gradient(160deg,#fff,#f0f6ff); }

.ts-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-stat-value {
  display: block;
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ts-stat-count {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: #1a5fb0;
}

.ts-stat-paid   .ts-stat-value { color: #137333; }
.ts-stat-credit .ts-stat-value { color: #b06000; }

.ts-stat-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 3px;
}

/* --- Tab bar -------------------------------------------------- */
.ts-tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 0;
  padding: 0 16px;
  flex-shrink: 0;
}

.ts-tab-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f4f4f4;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 16px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.ts-tab-btn:hover    { background: #eaeaea; color: var(--ink); }
.ts-tab-btn.active   { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Scrollable tab content (single scroll area) -------------- */
.table-session-tab-content {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 16px 8px;
  min-height: 0;
}

/* --- Payment method segmented control ------------------------ */
.ts-payment-method-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface, #f8f7f4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 12px;
}

.ts-payment-method-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.ts-payment-method-seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.ts-method-btn {
  flex: 1 1 auto;
  min-width: 72px;
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.ts-method-btn:hover       { border-color: rgba(199,146,62,0.5); color: var(--ink); }
.ts-method-btn.active      { background: #e6f4ea; border-color: #2f9e65; color: #137333; font-weight: 800; }
.ts-method-btn.credit-active { background: #fff8e6; border-color: #e8a826; color: #b06000; font-weight: 800; }

/* --- Selection toolbar --------------------------------------- */
.ts-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ts-selection-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: #137333;
  background: #e6f4ea;
  border-radius: 999px;
  padding: 2px 12px;
}

/* --- Order group --------------------------------------------- */
.table-session-order-group {
  background: linear-gradient(180deg, #fff, #fbfaf7);
  overflow: hidden;
}

.ts-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.ts-order-head-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ts-order-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.ts-order-number {
  font-size: 1rem;
  font-weight: 900;
  color: var(--ink);
}

.ts-order-time {
  font-size: 0.78rem;
  color: var(--muted);
  background: #f0f0f0;
  border-radius: 999px;
  padding: 1px 9px;
}

/* --- Items grid ---------------------------------------------- */
.table-session-items-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.table-session-unpaid-list {
  padding-bottom: 12px;
  min-width: 0;
}

.table-session-item input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.table-session-item-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(15,118,110,.16);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.table-session-item-card.selected {
  border: 2px solid #2f9e65;
  background: linear-gradient(180deg, #f1fbf5, #fff);
  box-shadow: 0 8px 20px rgba(47,158,101,.1);
}

.table-session-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.table-session-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1 1 220px;
  min-width: 0;
}

.table-session-check input {
  width: 20px;
  min-height: 20px;
  accent-color: #2f9e65;
  flex-shrink: 0;
}

.table-session-check b {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}

.table-session-item-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 1 auto;
}

/* Metrics row: 5 mini-cells */
.table-session-item-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  min-width: 0;
}

.table-session-item-metrics div,
.table-session-line-total {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfaf7;
  padding: 9px 10px;
  min-width: 0;
  overflow: hidden;
}

.table-session-item-metrics span,
.table-session-line-total span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.table-session-item-metrics b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

/* Collect row: stepper + line total */
.table-session-collect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 210px);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.table-session-qty-stepper {
  display: inline-grid;
  grid-template-columns: 40px minmax(58px, 80px) 40px;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  max-width: 185px;
  width: 100%;
}

.table-session-qty-stepper.muted { opacity: .55; }

.table-session-qty-stepper input {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
}

.table-session-line-total {
  text-align: center;
  display: grid;
  align-content: center;
}

.table-session-line-total b {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 1.05rem;
}

.table-session-line-total.active {
  border-color: rgba(47,158,101,.45);
  background: #e6f4ea;
}

.table-session-line-total.active b {
  color: #137333;
  font-size: 1.35rem;
  line-height: 1.2;
}

/* --- Payment bar (sticky bottom) ----------------------------- */
.ts-payment-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 14px;
  border: 2px solid;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
}

.ts-payment-bar-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.ts-payment-bar-left { min-width: 0; }

.ts-payment-bar-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.ts-payment-bar-amount {
  display: block;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 900;
  line-height: 1.15;
}

.ts-payment-bar-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3px;
}

.table-session-summary-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ts-payment-bar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
  flex-shrink: 0;
}

.ts-pay-btn {
  width: 100%;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 13px 14px;
  white-space: normal;
  line-height: 1.3;
  text-align: center;
}

.ts-pay-all-btn {
  width: 100%;
  font-size: 0.83rem;
  padding: 9px 12px;
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 820px) {
  .modal-box.table-session-modal {
    width: 100vw;
    max-width: 100vw;
    height: 99vh;
    max-height: 99vh;
    border-radius: 12px;
    padding: 0;
  }

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

  .table-session-item-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-session-collect-row {
    grid-template-columns: 1fr;
  }

  .table-session-qty-stepper {
    grid-template-columns: 40px minmax(70px, 1fr) 40px;
    max-width: none;
    width: 100%;
  }

  .ts-payment-bar-body {
    grid-template-columns: 1fr;
  }

  .ts-payment-bar-actions {
    flex-direction: row;
    min-width: 0;
    width: 100%;
  }

  .ts-pay-btn, .ts-pay-all-btn { flex: 1 1 auto; }
}

@media (max-width: 500px) {
  .ts-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .table-session-item-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .ts-header-actions { width: 100%; }
  .ts-header-actions .btn { flex: 1; }

  .table-session-summary-lines {
    flex-direction: column;
    gap: 2px;
  }
}

/* ── Report KPI cards ─────────────────────────────────────────── */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.report-kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-right: 4px solid transparent;
}
.report-kpi-card.kpi-green  { border-right-color: #2e7d32; }
.report-kpi-card.kpi-red    { border-right-color: #c62828; }
.report-kpi-card.kpi-blue   { border-right-color: #1565c0; }
.report-kpi-card.kpi-amber  { border-right-color: #e65100; }
.report-kpi-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.report-kpi-value { font-size: 1.6rem; font-weight: 900; color: var(--ink); line-height: 1.1; }
.report-kpi-sub   { font-size: 0.76rem; color: var(--muted); }
.kpi-green-text   { color: #2e7d32; }

/* ── Report table ─────────────────────────────────────────────── */
.report-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; direction: rtl; }
.report-table th { text-align: right; padding: 7px 10px; background: var(--bg-strong); font-weight: 700; font-size: 0.78rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.report-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.report-table tr:last-child td { border-bottom: none; }
.report-table tr:hover td { background: var(--bg-strong); }
.report-rank-cell { color: var(--muted); font-size: 0.78rem; font-weight: 700; width: 28px; text-align: center; }

/* ── Payment method rows ──────────────────────────────────────── */
.report-payment-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.87rem; }
.report-payment-row:last-child { border-bottom: none; }
.report-payment-label  { min-width: 75px; font-weight: 600; }
.report-bar-mini       { flex: 1; height: 7px; background: var(--bg-strong); border-radius: 4px; overflow: hidden; }
.report-bar-mini i     { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s; }
.report-payment-amount { min-width: 80px; text-align: left; }
.report-payment-pct    { min-width: 38px; text-align: left; color: var(--muted); font-size: 0.76rem; }

/* ── Report misc ──────────────────────────────────────────────── */
.report-empty-state { padding: 28px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.report-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 0.76rem; font-weight: 600; }
.report-badge.badge-ok   { background: #e8f5ef; color: #2e7d32; }
.report-badge.badge-bad  { background: #ffe7e3; color: #c62828; }
.report-badge.badge-warn { background: #fff3cd; color: #856404; }
.report-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.report-filters { margin-top: 12px; }

/* ── Print styles ─────────────────────────────────────────────── */
@media print {
  .no-print, .sidebar, nav, .chips, .report-presets, .report-filters { display: none !important; }
  .report-kpi-grid  { grid-template-columns: repeat(3, 1fr); }
  .report-kpi-card  { break-inside: avoid; border: 1px solid #ccc; }
  .report-table     { font-size: 0.78rem; }
  .report-table th, .report-table td { padding: 5px 7px; }
  .panel { box-shadow: none; border: 1px solid #ddd; }
}

.report-bar {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.report-bar i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.list { display: grid; gap: 12px; }
.row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 12px;
  text-align: right;
  vertical-align: top;
}
th {
  background: #f4eee5;
  color: #3a413f;
  font-size: 13px;
}

.notice, .empty-state {
  border: 1px solid var(--border);
  border-right: 5px solid var(--primary);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  line-height: 1.75;
}
.notice.error {
  border-right-color: var(--danger);
  background: #fff5f3;
  color: var(--danger);
}
.empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: #fbf8f2;
}
.empty-state b { color: var(--ink); }

.kitchen-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.kitchen-column {
  min-height: 420px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.kitchen-ticket {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(33,28,21,.045);
}

.kitchen-ticket-warning {
  border-color: #f0a928;
  box-shadow: 0 10px 22px rgba(176,96,0,.12);
}

.kitchen-ticket-critical {
  border-color: #d93025;
  box-shadow: 0 12px 26px rgba(217,48,37,.16);
  animation: kitchenCriticalPulse 1.8s ease-in-out infinite;
}

.kitchen-waiting-time {
  color: var(--ink);
}

.kitchen-waiting-warning {
  color: #b06000;
}

.kitchen-waiting-critical {
  color: #d93025;
}

@keyframes kitchenCriticalPulse {
  0%, 100% {
    box-shadow: 0 12px 26px rgba(217,48,37,.12);
  }
  50% {
    box-shadow: 0 12px 30px rgba(217,48,37,.28);
  }
}

.kitchen-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbf8f2;
}

.kitchen-item b {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.kitchen-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.65);
  background: var(--sidebar);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

/* ── Credit-order admin notification toast ─────────────────── */
.credit-notif-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  direction: rtl;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 14px 14px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f3d35 0%, #164e3a 100%);
  border: 1.5px solid rgba(196, 127, 50, 0.5);
  box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 0 0 3px rgba(196,127,50,0.10);
  color: #fff;
  cursor: pointer;
  animation: cntSlideIn 0.3s ease;
}
@keyframes cntSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.cnt-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.cnt-body { flex: 1; min-width: 0; }
.cnt-title { font-size: .72rem; font-weight: 700; color: #c47f32; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 3px; }
.cnt-customer { font-size: 1rem; font-weight: 900; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt-total { font-size: .9rem; font-weight: 700; color: #86efac; margin-bottom: 3px; }
.cnt-items { font-size: .75rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cnt-by { font-size: .72rem; opacity: .6; display: block; margin-top: 2px; }
.cnt-close {
  background: none; border: none; color: rgba(255,255,255,.5); font-size: 1rem;
  cursor: pointer; padding: 0 2px; line-height: 1; flex-shrink: 0; align-self: center;
}
.cnt-close:hover { color: #fff; }

/* ── Nav unread badge ──────────────────────────────────────── */
.notif-nav-badge {
  display: inline-block;
  margin-right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}

/* ── General admin notification toast ─────────────────────── */
.admin-notif-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  direction: rtl;
  min-width: 260px;
  max-width: min(400px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 16px;
  background: #1e293b;
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  color: #f1f5f9;
  cursor: pointer;
  animation: cntSlideIn 0.3s ease;
}
.admin-notif-toast.sev-info    { border-color: rgba(59,130,246,.45); }
.admin-notif-toast.sev-success { border-color: rgba(34,197,94,.45);  background: #14532d; }
.admin-notif-toast.sev-warning { border-color: rgba(245,158,11,.45); background: #451a03; }
.admin-notif-toast.sev-danger  { border-color: rgba(239,68,68,.45);  background: #450a0a; }
.admin-notif-toast .ant-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.admin-notif-toast .ant-body { flex: 1; min-width: 0; }
.admin-notif-toast .ant-title { font-size: .8rem; font-weight: 700; margin-bottom: 3px; opacity: .85; }
.admin-notif-toast .ant-msg   { font-size: .85rem; font-weight: 600; }
.admin-notif-toast .ant-close {
  background: none; border: none; color: rgba(255,255,255,.45); font-size: 1rem;
  cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0; align-self: center;
}
.admin-notif-toast .ant-close:hover { color: #fff; }

/* ── Notifications Center page ─────────────────────────────── */
.notifications-center { padding: 20px; }
.notif-center-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.notif-center-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-center-actions { display: flex; gap: 8px; }

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

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  cursor: pointer;
  transition: background .15s;
  direction: rtl;
}
.notif-item:hover { background: rgba(15,61,53,.06); }
.notif-item.is-unread { background: rgba(15,61,53,.05); border-color: rgba(15,61,53,.18); }
.notif-item.is-read { opacity: .6; }

.notif-item-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-size: .82rem; font-weight: 700; margin-bottom: 3px; }
.notif-item-msg { font-size: .85rem; color: #6b7280; margin-bottom: 4px; }
.notif-item-products { font-size: .75rem; color: #9ca3af; margin-bottom: 4px; }
.notif-item-meta { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: #9ca3af; }
.notif-item-actor { font-weight: 600; color: #6b7280; }
.notif-item-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  align-self: center; margin-right: 4px;
}

/* ── Notification Preferences Panel ────────────────────────── */
.notif-prefs-panel {
  background: linear-gradient(135deg, #0f3d35 0%, #133b2f 100%);
  border: 1.5px solid rgba(196, 127, 50, 0.3);
  border-radius: 20px;
  padding: 20px 20px 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  direction: rtl;
}
.notif-prefs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}
.notif-prefs-title {
  font-size: .95rem;
  font-weight: 800;
  color: #e2c880;
  letter-spacing: .02em;
}
.notif-test-btn {
  font-size: .78rem !important;
  padding: 6px 14px !important;
  border-radius: 10px !important;
  background: rgba(196,127,50,.18) !important;
  border-color: rgba(196,127,50,.4) !important;
  color: #e2c880 !important;
}
.notif-test-btn:hover {
  background: rgba(196,127,50,.3) !important;
}

/* Quiet Mode row */
.notif-quiet-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  margin-bottom: 4px;
  flex-wrap: wrap;
  transition: background .2s, border-color .2s;
}
.notif-quiet-mode-row.is-active {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.3);
}
.notif-quiet-mode-desc {
  font-size: .77rem;
  color: rgba(241,245,249,.55);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}
.notif-quiet-mode-row.is-active .notif-quiet-mode-desc {
  color: rgba(251,191,36,.75);
}
.notif-quiet-btn {
  white-space: nowrap;
  font-size: .8rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.09);
  color: #f1f5f9;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .16s, border-color .16s, color .16s;
  line-height: 1;
}
.notif-quiet-btn:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.3);
}
.notif-quiet-btn.active {
  background: rgba(245,158,11,.22);
  border-color: rgba(245,158,11,.55);
  color: #fbbf24;
}
.notif-quiet-btn.active:hover {
  background: rgba(245,158,11,.32);
}
.notif-prefs-divider {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 8px 0 4px;
}

.notif-prefs-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .14s;
  direction: rtl;
}
.notif-pref-row:hover { background: rgba(255,255,255,.06); }
.notif-pref-row.dimmed { opacity: .45; pointer-events: none; }

.notif-pref-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.notif-pref-label {
  font-size: .88rem;
  font-weight: 700;
  color: #f1f5f9;
}
.notif-pref-desc {
  font-size: .73rem;
  color: rgba(241,245,249,.55);
  line-height: 1.4;
}

/* Toggle switch */
.notif-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.2);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}
.notif-toggle.on {
  background: #c47f32;
  border-color: #c47f32;
}
.notif-toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  right: 2px;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), right .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.notif-toggle.on .notif-toggle-knob {
  transform: translateX(-20px);
}
.notif-toggle.disabled {
  opacity: .4;
  pointer-events: none;
}

.print-modal .modal-box {
  width: min(520px, 100%);
}

.print-sheet {
  display: grid;
  place-items: center;
  padding: 16px;
  background: #f4eee5;
  border-radius: 16px;
}

.thermal-preview {
  width: 80mm;
  max-width: 100%;
  padding: 14px;
  background: #fff;
  color: #111;
  border: 1px dashed #bbb;
  border-radius: 8px;
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.65;
  direction: rtl;
}

.thermal-preview h2 {
  text-align: center;
  font-size: 20px;
}

.thermal-preview p {
  margin: 5px 0;
  font-size: 13px;
}

.thermal-preview hr {
  border: 0;
  border-top: 1px dashed #999;
  margin: 10px 0;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.muted-line {
  color: #555;
  font-size: 12px;
}

.grand-total {
  font-size: 16px;
  font-weight: 900;
  margin-top: 8px;
}

.ticket-item {
  padding: 8px 0;
  border-bottom: 1px dashed #bbb;
}

.ticket-item b,
.ticket-item span {
  display: block;
}

.ticket-item span {
  color: #333;
  font-size: 12px;
}

.ticket-station {
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ticket-order-num {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  margin: 4px 0 10px;
  color: #111;
}

.ticket-item b {
  font-size: 17px;
}

.ticket-notes {
  color: #555;
  font-size: 12px;
  margin: 3px 0 0;
  font-style: italic;
}

.receipt-logo {
  text-align: center;
  margin-bottom: 8px;
}

.print-logo {
  max-width: 100px;
  max-height: 60px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.print-logo.logo-small  { max-width: 60px;  max-height: 40px; }
.print-logo.logo-medium { max-width: 100px; max-height: 60px; }
.print-logo.logo-large  { max-width: 140px; max-height: 80px; }

@media print {
  .no-print { display: none !important; }
  .thermal-preview { border: none; width: 80mm; }
  .ticket-order-num { font-size: 32px; }
  .print-logo { max-width: 100px; max-height: 60px; }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 18, .48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1300;
}
.modal.open { display: flex; }
.modal-box {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

/* ── Programmatic overlay (settle, QR, etc.) ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 18, .48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}
.modal-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
  max-height: 88vh;
  overflow: hidden;
  width: 100%;
}
/* override the legacy .modal { display:none } rule when nested inside overlay */
.modal-overlay .modal,
.modal-overlay .app-modal-box {
  display: flex;
  flex-direction: column;
  position: relative;
  inset: auto;
  background: var(--card);
  border-radius: 18px;
  padding: 0;
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow: hidden;
  z-index: auto;
  width: 100%;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.modal-header h2 { margin: 0; font-size: 1rem; }
.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary, #6b7280);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.modal-close:hover { background: var(--bg-alt, #f5f5f5); }

.print-preview {
  background: #fff;
  color: #111;
  border: 1px dashed #999;
  padding: 16px;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.8;
}
.hidden { display: none !important; }

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

@media (max-width: 900px) {
  .layout, .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-radius: 0 0 18px 18px;
  }
  .sidebar-toggle { display: inline-flex; align-items: center; }
  .nav { display: none; }
  body.nav-open .nav { display: grid; }
  .nav { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
  .main { padding: 16px; }
  .topbar, .page-header { align-items: stretch; flex-direction: column; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .page-hero.compact,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .menu-product-form-grid {
    grid-template-columns: 1fr;
  }
  .menu-product-image-uploader {
    max-width: 320px;
  }

}

@media (max-width: 560px) {
  .login { padding: 14px; }
  .login-card { padding: 22px 18px; }
  .main { padding: 12px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-products-grid { grid-template-columns: 1fr; }
  .menu-product-card {
    grid-template-columns: 1fr;
  }
  .menu-product-image {
    width: min(220px, 100%);
  }
  .menu-product-title-row {
    flex-direction: column;
  }
  .menu-product-title-row strong {
    white-space: normal;
  }

  .table-map { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .btn { width: 100%; }
  .actions .btn { width: auto; }
  .tc-view-order-btn { width: calc(100% + 28px); }
}

/* ============================================================
   SHIFT PAGE REDESIGN
   ============================================================ */

/* ── Page Header ─────────────────────────────────────────────── */
.shift-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.shift-page-header-info { min-width: 0; }
.shift-page-title { margin: 0 0 3px; font-size: 1.5rem; font-weight: bold; }
.shift-page-sub   { margin: 0; color: var(--muted); font-size: 0.88rem; }
.shift-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.shift-status-badge {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.shift-status-badge.open   { background: #e6f4ea; color: #1b7a42; border: 1px solid #c3e6cb; }
.shift-status-badge.closed { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.shift-num-label { font-size: 0.88rem; font-weight: bold; color: var(--ink); }

/* ── Error / Empty feedback panels ───────────────────────────── */
.shift-feedback-panel {
  text-align: center;
  padding: 36px 20px;
  margin-bottom: 18px;
}
.shift-error-panel  { background: #fff5f5; border-color: #f5c6cb; }
.shift-empty-panel  { border: 1.5px dashed var(--border); }
.shift-feedback-icon { font-size: 2.8rem; margin-bottom: 10px; }
.shift-feedback-panel h3 { margin: 0 0 6px; }
.shift-feedback-panel p  { color: var(--muted); margin: 0 0 16px; font-size: 0.9rem; }

/* ── KPI grouped sections ─────────────────────────────────────── */
.shift-kpi-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shift-kpi-group {
  background: var(--bg, #fafafa);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 14px;
}
.shift-kpi-group--closing { border-color: #a7d9c3; background: #f0faf4; }

.shift-kpi-group-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.shift-kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}

.shift-kpi-card {
  border-radius: 10px;
  padding: 10px 12px 10px;
  border: 1px solid var(--border);
  background: #fff;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.shift-kpi-card--green   { background: #f0faf4; border-color: #c3e6cb; }
.shift-kpi-card--blue    { background: #eff6ff; border-color: #bfdbfe; }
.shift-kpi-card--amber   { background: #fffbeb; border-color: #fde68a; }
.shift-kpi-card--teal    { background: #f0fdfa; border-color: #99f6e4; }
.shift-kpi-card--primary { background: #f5fcf8; border-color: #a7d9c3; }
.shift-kpi-card--neutral { background: #f9fafb; border-color: #e5e7eb; }

.shift-kpi-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
}
.shift-kpi-icon  { font-size: 0.95rem; flex-shrink: 0; }
.shift-kpi-title { font-size: 0.75rem; color: var(--muted); font-weight: 600; flex: 1; min-width: 0; }
.shift-kpi-value { font-size: 1.2rem; font-weight: 900; color: var(--ink); margin-top: 2px; }
.shift-kpi-desc  { font-size: 0.7rem; color: var(--muted); }

/* ── Work grid (form + details) ───────────────────────────────── */
.shift-work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 700px) {
  .shift-work-grid { grid-template-columns: 1fr; }
  .shift-kpi-cards { grid-template-columns: repeat(2, 1fr); }
}

.shift-section-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Shift details two-column grid ───────────────────────────── */
.shift-details-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  margin: 0;
  font-size: 0.875rem;
}
.shift-details-grid dt {
  padding: 7px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-left: 16px;  /* RTL: gap between dt and dd */
  font-weight: 500;
}
.shift-details-grid dd {
  padding: 7px 0;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.shift-details-grid dt:last-of-type,
.shift-details-grid dd:last-of-type { border-bottom: 0; }

/* ── Cash movement helpers ────────────────────────────────────── */
.shift-required-mark { color: #c00; font-size: 0.75rem; margin-right: 4px; }
.shift-optional-mark { color: var(--muted); font-size: 0.75rem; margin-right: 4px; }

/* ── Movements table ─────────────────────────────────────────── */
.shift-movements-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.875rem;
}

.shift-movements-head,
.shift-movements-row,
.shift-movements-footer {
  display: grid;
  grid-template-columns: 80px 120px 1fr auto;
  gap: 10px;
  padding: 8px 14px;
  align-items: center;
}

.shift-movements-head {
  background: #f3f4f6;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.shift-movements-row { border-bottom: 1px solid var(--border); }
.shift-movements-row:last-child { border-bottom: 0; }
.shift-movements-row:nth-child(even) { background: #fafafa; }

.shift-movements-footer {
  background: #f9fafb;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.shift-movement-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.shift-movement-badge.deposit  { background: #e6f4ea; color: #1b7a42; }
.shift-movement-badge.withdraw { background: #fef3c7; color: #92400e; }

.shift-movement-time   { color: var(--muted); white-space: nowrap; }
.shift-movement-reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-movement-amount { font-weight: bold; white-space: nowrap; text-align: left; }
.shift-movements-num   { text-align: left; }

.shift-positive { color: #1b7a42; }
.shift-negative { color: #c62828; }

/* ── Shift report modal wider for new sections ────────────────── */
.shift-report-modal-box { width: min(600px, 100%); }

/* Pre-close shift review modal */
.pre-close-modal-box { width: min(560px, 100%); }

.pre-close-section {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  background: #fff;
}
.pre-close-section.ok {
  border-color: #a5d6a7;
  background: #f1faf3;
}
.pre-close-section.blocker {
  border-color: #ef9a9a;
  background: #fff5f5;
}
.pre-close-section.force-close-section {
  border-color: #ffcc80;
  background: #fff8f0;
}
.pre-close-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
  gap: 8px;
}
.pre-close-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.87rem;
  margin-bottom: 6px;
}
.pre-close-blocker-msg {
  font-size: 0.82rem;
  color: #c62828;
  margin: 6px 0 0;
  line-height: 1.5;
}

/* Shift Report Styles */
.shift-report-print-card {
  background: #fff;
  color: #111;
  padding: 20px;
  border: 1px dashed #ccc;
  border-radius: 8px;
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.shift-report-print-card h2, .shift-report-print-card h3 {
  margin: 0 0 8px 0;
}
.shift-report-print-card .report-section {
  margin: 12px 0;
}
.shift-report-print-card .report-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.shift-report-print-card .negative {
  color: #e53935;
}
.shift-report-print-card .positive {
  color: #43a047;
}
/* .shift-report-modal-box width moved to SHIFT PAGE REDESIGN block above */

@media print {
  @page {
    size: auto;
    margin: 12mm;
  }

  body {
    background: #fff !important;
  }

  body.printing-table-qr * {
    visibility: hidden !important;
  }

  /* Scope to #tableQrPrintCard (the id on the modal element) to prevent any
     other .table-qr-print-card elements in the page from becoming visible */
  body.printing-table-qr #tableQrPrintCard,
  body.printing-table-qr #tableQrPrintCard * {
    visibility: visible !important;
  }

  body.printing-table-qr #tableQrPrintCard {
    position: absolute;
    inset: 12mm auto auto 50%;
    transform: translateX(-50%);
    width: 90mm;
    border: 0;
    box-shadow: none;
    background: #fff !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body.printing-shift-report * {
    visibility: hidden !important;
  }

  body.printing-shift-report .shift-report-print-card,
  body.printing-shift-report .shift-report-print-card * {
    visibility: visible !important;
  }

  body.printing-shift-report .shift-report-print-card {
    position: absolute;
    inset: 0 auto auto 0;
    width: 80mm;
    border: 0;
    box-shadow: none;
    padding: 0;
    background: #fff !important;
  }

  body.printing-customer-statement * {
    visibility: hidden !important;
  }

  body.printing-customer-statement .customer-statement-card,
  body.printing-customer-statement .customer-statement-card * {
    visibility: visible !important;
  }

  body.printing-customer-statement .customer-statement-card {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    max-width: 100%;
    max-height: none !important;
    overflow: visible !important;
    border: 0;
    box-shadow: none;
    background: #fff !important;
    direction: rtl;
    font-family: Arial, sans-serif;
  }

  body.printing-customer-statement .no-print {
    display: none !important;
  }

  body.printing-customer-statement .print-only {
    display: block !important;
    visibility: visible !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) {
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) * {
    display: none !important;
    visibility: hidden !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .modal.open.print-modal,
  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .modal.open.print-modal .modal-box,
  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .print-sheet,
  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .print-sheet * {
    display: block !important;
    visibility: visible !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .print-sheet {
    position: absolute;
    inset: 0 auto auto 0;
    width: 80mm;
    padding: 0;
    background: #fff !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .modal.open.print-modal {
    position: absolute !important;
    inset: 0 !important;
    width: 80mm !important;
    height: auto !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .modal.open.print-modal .modal-box {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    width: 80mm !important;
    background: #fff !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .modal.open.print-modal .no-print {
    display: none !important;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .thermal-preview {
    width: 80mm;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .receipt-logo,
  body:not(.printing-table-qr):not(.printing-shift-report):not(.printing-customer-statement) .print-logo {
    display: block !important;
    visibility: visible !important;
  }

  .no-print {
    display: none !important;
  }
}

/* Admin Menu Products Page Styles */
.admin-menu-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
}

.admin-menu-product-card {
  width: 100%;
  min-width: 0;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #eadfce;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-menu-product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-weight: bold;
}

.admin-menu-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-menu-product-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: start;
}

.admin-menu-product-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-menu-product-image-uploader {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

@media (max-width: 768px) {
  .admin-menu-product-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Polished Menu & Products management */
.admin-menu-products-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-menu-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-menu-page-header h2 {
  font-size: 26px;
}

.admin-menu-page-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-menu-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-menu-toolbar .btn,
.admin-menu-product-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.admin-menu-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.admin-menu-summary-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(33,28,21,.04);
}

.admin-menu-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-menu-summary-card b {
  color: var(--primary);
  font-size: 22px;
}

.admin-menu-filters-panel {
  padding: 14px;
}

.admin-menu-products-page select,
.admin-menu-product-modal select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: 16px 19px, 10px 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-left: 32px;
}

.admin-menu-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 240px) auto;
  gap: 10px;
  align-items: center;
}

.admin-menu-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.admin-menu-products-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-menu-product-card {
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(33,28,21,.04);
  min-width: 0;
}

.admin-menu-product-card.is-hidden {
  background: #fbfaf7;
}

.admin-menu-product-image {
  position: relative;
  background:
    linear-gradient(135deg, rgba(15,118,110,.12), rgba(199,146,62,.16)),
    #f7efe4;
  color: var(--muted);
  min-width: 0;
}

.admin-menu-product-image.empty span {
  display: grid;
  place-items: center;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  border: 1px dashed rgba(107,114,128,.35);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
}

.admin-menu-product-content {
  display: grid;
  gap: 9px;
  padding: 12px;
  min-width: 0;
  flex: 1;
}

.admin-menu-product-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.admin-menu-product-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.45;
}

.admin-menu-product-category,
.admin-menu-product-description,
.admin-menu-product-sku {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.admin-menu-product-description {
  display: -webkit-box;
  min-height: 40px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.admin-menu-product-price {
  color: var(--primary);
  font-size: 18px;
  white-space: nowrap;
}

.admin-menu-product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-menu-product-badges .badge {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.admin-menu-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.admin-menu-product-modal-box {
  width: min(820px, 100%);
}

/* ── Product status panel (3-toggle card row in product form) ───────────── */
.product-status-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.status-toggle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #f7f6f3;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}

.status-toggle-card input[type="checkbox"] {
  display: none;
}

.status-toggle-card .status-toggle-icon {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
}

.status-toggle-card .status-toggle-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.3;
}

.status-toggle-card.on {
  border-color: var(--primary);
  background: #fffaf1;
}

.status-toggle-card.on .status-toggle-icon,
.status-toggle-card.on .status-toggle-label {
  color: var(--primary);
}

@media (max-width: 480px) {
  .product-status-panel {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .status-toggle-card {
    padding: 8px 6px;
  }
  .status-toggle-label {
    font-size: 0.7rem;
  }
}

.product-category-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.product-category-row select {
  flex: 1;
  min-width: 0;
}
.product-category-row .btn {
  align-self: stretch;
  padding-top: 0;
  padding-bottom: 0;
  flex: 0 0 auto;   /* never grow, never shrink, size = content */
  white-space: nowrap;
}

.admin-menu-product-form-grid.compact {
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
}

.admin-menu-product-modal textarea {
  min-height: 70px;
}

.admin-menu-product-image-uploader {
  align-items: stretch;
}

.admin-menu-image-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(199,146,62,.55);
  border-radius: 14px;
  background: #fffaf1;
  color: var(--muted);
  overflow: hidden;
  font-weight: 900;
}

.admin-menu-image-preview.has-image {
  border-style: solid;
  background: #fff;
}

.admin-menu-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-menu-stock-selector {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfaf7;
}

.admin-menu-stock-selector .notice {
  grid-column: 1 / -1;
}

.admin-menu-modal-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

@media (max-width: 1250px) {
  .admin-menu-products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-menu-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .admin-menu-page-header,
  .admin-menu-filter-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .admin-menu-toolbar {
    justify-content: flex-start;
  }
  .admin-menu-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-menu-product-form-grid.compact,
  .admin-menu-stock-selector {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile product form modal ────────────────────────────────── */
@media (max-width: 640px) {
  /* Force single-column regardless of .compact specificity */
  .admin-menu-product-form-grid,
  .admin-menu-product-form-grid.compact {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  /* Image uploader: move to top, compact square */
  .admin-menu-product-image-uploader {
    order: -1;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  .admin-menu-image-preview {
    aspect-ratio: 3 / 2;
    max-height: 180px;
  }

  /* Category row: select fills width, button stays compact */
  .product-category-row {
    gap: 6px;
  }
  .product-category-row select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: 0;   /* flex-basis trick: forces flex to decide width */
  }
  .product-category-row .btn {
    flex: 0 0 auto;
    min-width: 72px;
    max-width: 100px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .admin-menu-summary-grid,
  .admin-menu-products-grid {
    grid-template-columns: 1fr;
  }
}

/* Antigravity: Polished Cashier Shift UI/UX styling rules */

/* POS Shift Warning Card style (RTL red/orange warning state) */
.pos-shift-warning-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fdf2e9; /* soft orange warning */
  border: 1.5px solid #f5b041;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  direction: rtl;
}

.pos-shift-warning-card .warning-icon {
  font-size: 2.2rem;
}

.pos-shift-warning-card .warning-info h3 {
  margin: 0 0 4px 0;
  color: #c0392b;
  font-size: 1.15rem;
  font-weight: bold;
}

.pos-shift-warning-card .warning-info p {
  margin: 0;
  color: #78281f;
  font-size: 0.95rem;
}

/* POS Shift Status Card (compact, premium layout) */
.pos-shift-status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  direction: rtl;
}

.pos-shift-status-card .status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.pos-shift-status-card .status-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-shift-status-card .status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.pos-shift-status-card .status-indicator.online {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.pos-shift-status-card .status-actions {
  display: flex;
  gap: 8px;
}

.pos-shift-status-card .status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.pos-shift-status-card .status-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
  align-items: center;
}

.pos-shift-status-card .status-item span {
  color: var(--muted);
}

.pos-shift-status-card .status-item b {
  color: var(--ink);
  font-weight: bold;
}

.pos-shift-status-card .status-item b.success-text {
  color: var(--success);
}

/* Cash Movement Form (RTL style, segmented control & chips) */
.cash-movement-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.segmented-control {
  display: flex;
  background: var(--bg-strong);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.segmented-control button {
  flex: 1;
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  padding: 10px;
  font-size: 0.92rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--muted);
}

.segmented-control button.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.reason-chips .chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reason-chips .chip:hover {
  background: var(--bg-strong);
  border-color: var(--primary);
}

/* Badges for shift history difference and statuses */
.badge.neutral-status {
  background: var(--bg-strong);
  color: var(--ink);
}

.badge.positive-status {
  background: #e6f4ea;
  color: #137333;
}

.badge.negative-status {
  background: #fce8e6;
  color: #c5221f;
}

/* Shift page layout custom improvements */
.current-shift-section {
  border-top: 4px solid var(--primary);
}

.large-numeric-input:focus {
  border-color: var(--primary) !important;
  box-shadow: var(--focus) !important;
  outline: none;
}

/* Credit Balance Badges */
.credit-balance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
  white-space: nowrap;
}

.credit-balance-badge.zero-balance {
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
}

.credit-balance-badge.has-balance {
  background: #fef7e0;
  color: #b06000;
  border: 1px solid #fde293;
}

.credit-balance-badge.over-limit {
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6cb;
}

/* ═══════════════════════════════════════════════
   KDS — Kitchen Display System Station Styles
═══════════════════════════════════════════════ */

.kds-station-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  align-items: center;
}

.kds-station-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 30px;
  border: 1.5px solid var(--border);
  background: var(--bg-body);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.kds-station-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.kds-station-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}

.kds-station-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255,255,255,0.3);
  color: inherit;
}

.kds-station-tab:not(.active) .kds-station-count {
  background: var(--primary);
  color: #fff;
}

/* Mobile column filter tabs — visible only on small screens */
.kds-mobile-col-tabs {
  display: none;
}

@media (max-width: 1100px) {
  .kds-mobile-col-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
  }
  .kds-mobile-col-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 24px;
    border: 1.5px solid var(--border);
    background: var(--bg-body);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    white-space: nowrap;
  }
  .kds-mobile-col-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
  }
  .kds-mobile-col-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
  }
  /* Hide non-selected columns on mobile */
  .kitchen-board[data-mobile-tab="ready"]    .kitchen-column[data-status="preparing"],
  .kitchen-board[data-mobile-tab="ready"]    .kitchen-column[data-status="pending"],
  .kitchen-board[data-mobile-tab="preparing"] .kitchen-column[data-status="ready"],
  .kitchen-board[data-mobile-tab="preparing"] .kitchen-column[data-status="pending"],
  .kitchen-board[data-mobile-tab="pending"]  .kitchen-column[data-status="ready"],
  .kitchen-board[data-mobile-tab="pending"]  .kitchen-column[data-status="preparing"] {
    display: none;
  }
}

/* Station Badges */
.kds-station-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.kds-station-kitchen { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.kds-station-barista,
.kds-station-bar     { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.kds-station-shisha  { background: #f3e5f5; color: #6a1b9a; border: 1px solid #e1bee7; }
.kds-station-none,
.kds-station-cashier { background: #f5f5f5; color: #757575; border: 1px solid #e0e0e0; }

/* KDS Order Card */
.kds-order-card {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}

/* KDS Item Row */
.kds-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px dashed var(--border);
}

.kds-item-row:last-child { border-bottom: none; }

/* KDS Empty State */
.kds-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  gap: 8px;
  text-align: center;
  color: var(--text-secondary);
}

.kds-empty-icon { font-size: 2.2rem; margin-bottom: 4px; }
.kds-empty-state b { font-size: 1rem; color: var(--text-primary); }

/* Table Zones */
.table-zone-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  border: 1px solid transparent;
  vertical-align: middle;
}

.table-zone-indoor {
  background: #e8f0fe;
  color: #1a4fb6;
  border-color: #b9cdf6;
}

.table-zone-outdoor {
  background: #e6f4ea;
  color: #137333;
  border-color: #b7dfc1;
}

.table-zone-credit {
  background: #fff4e5;
  color: #b06000;
  border-color: #f3c766;
  box-shadow: 0 0 0 2px rgba(176, 96, 0, 0.12);
}

.table-zone-kids {
  background: #fde8f3;
  color: #b0227a;
  border-color: #f6b9da;
}

.table-zone-staff {
  background: #ece8fd;
  color: #5a37c4;
  border-color: #cdc1f6;
}

.table-zone-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

/* ============================================================
   POS CASHIER REDESIGN
   ============================================================ */

/* Layout */
.pos-left-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pos-cart-panel {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Row 1: order type tabs + table selector */
.pos-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Row 2: product search + category + demo toggle */
.pos-row2 {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.pos-product-search {
  flex: 1.5;
  min-width: 140px;
  padding: 0 12px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fff;
  direction: rtl;
  box-sizing: border-box;
}

/* ─── Category Section (sticky bar inside left panel) ──────── */
.pos-category-section {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  /* extend to panel edges to fill full width */
  margin-left: -18px;
  margin-right: -18px;
  padding: 8px 18px 6px;
  border-bottom: 2px solid var(--bg-strong);
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.pos-category-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 7px;
  direction: rtl;
}

/* ═══════════════════════════════════════════════════════════════
   POS QUICK PRODUCTS STRIP
   ═══════════════════════════════════════════════════════════════ */
.pos-quick-products {
  background: #f0faf6;
  border: 1.5px solid #b2dfdb;
  border-radius: 12px;
  padding: 10px 14px 12px;
  direction: rtl;
}

.pos-quick-products-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.pos-quick-products-icon {
  font-size: 15px;
  line-height: 1;
}

.pos-quick-products-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f5132;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pos-quick-products-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pos-quick-product-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1.5px solid #80cbc4;
  border-radius: 8px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, transform 0.1s;
  min-width: 72px;
  text-align: center;
}

.pos-quick-product-btn:hover {
  background: #e0f7f0;
  border-color: #26a69a;
  transform: translateY(-1px);
}

.pos-quick-product-btn:active {
  transform: translateY(0);
  background: #b2dfdb;
}

.pos-quick-product-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f3d35;
  line-height: 1.2;
  white-space: nowrap;
}

.pos-quick-product-price {
  font-size: 11px;
  font-weight: 600;
  color: #26a69a;
}

@media (max-width: 700px) {
  .pos-quick-products-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .pos-quick-products-list::-webkit-scrollbar { display: none; }
  .pos-quick-product-btn { flex-shrink: 0; }
}

/* Category bubbles */
.pos-category-bubbles {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  overflow: visible;
  gap: 7px;
  padding: 2px 0 4px;
  direction: rtl;
}

.pos-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-height: 42px;
  box-sizing: border-box;
}
.pos-category-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(15, 118, 110, 0.05);
}
.pos-category-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(15, 118, 110, 0.35);
}

.pos-category-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 1px 7px;
  min-width: 22px;
  height: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}
.pos-category-chip-offer {
  border-color: rgba(199,146,62,0.55);
  background: linear-gradient(135deg, #fff8ec, #fff);
  color: #a5681e;
}
.pos-category-chip-offer:hover {
  border-color: #a5681e;
  color: #a5681e;
  background: #fff3da;
}
.pos-category-chip-offer.active {
  background: linear-gradient(135deg, #c7923e, #a5681e);
  border-color: #a5681e;
  color: #fff;
  box-shadow: 0 3px 12px rgba(165,104,30,0.35);
}

.pos-category-chip.active .pos-category-chip-count {
  background: rgba(255,255,255,0.3);
  color: #fff;
}

.pos-demo-toggle {
  height: 38px;
  padding: 0 13px;
  font-size: 0.78rem;
  border-radius: 10px;
  white-space: nowrap;
  color: var(--muted);
  box-sizing: border-box;
}

/* "اختيار طاولة" button */
.pos-choose-table-btn {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Selected table pill (row 1) */
.pos-selected-table-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff8ed;
  border: 1.5px solid rgba(199,146,62,0.55);
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(199,146,62,0.12);
}

.pos-change-table-btn {
  background: rgba(199,146,62,0.1);
  border: 1px solid rgba(199,146,62,0.6);
  border-radius: 999px;
  font-size: 0.75rem;
  color: #8a4e00;
  cursor: pointer;
  padding: 2px 11px;
  font-weight: 800;
  transition: background 0.1s, border-color 0.1s;
}
.pos-change-table-btn:hover { background: rgba(199,146,62,0.22); border-color: rgba(199,146,62,0.9); }

.pos-clear-table-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  font-weight: 700;
}
.pos-clear-table-btn:hover { color: #c00; }

.pos-session-badge {
  background: rgba(183,121,31,0.15);
  color: #7a4e00;
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 1px 8px;
}

/* Cart table info strip */
.pos-cart-table-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff8ed;
  border: 1px solid rgba(199,146,62,0.3);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

/* ── System action confirm modal ─────────────────────────── */
.sys-action-modal-box {
  text-align: center;
  padding: 36px 32px 28px;
  max-width: 400px;
}
.sys-action-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  line-height: 1;
}
.sys-action-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
}
.sys-action-body {
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 24px;
}
.sys-action-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.sys-action-btns .btn {
  min-width: 110px;
  font-size: 0.92rem;
}

/* ── POS cashier-disabled full error page ────────────────── */
.pos-system-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 24px;
}
.pos-system-error-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
}
.pos-system-error-title {
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #b45309;
}
.pos-system-error-msg {
  font-size: 1rem;
  color: #374151;
  margin: 0 0 6px;
  font-weight: 600;
}
.pos-system-error-sub {
  font-size: 0.88rem;
  color: #9ca3af;
  margin: 0;
}

/* ── Customer menu closed page ───────────────────────────── */
.customer-menu-closed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 40px 24px;
}
.customer-menu-closed-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}
.customer-menu-closed-title {
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1a1a;
}
.customer-menu-closed-msg {
  font-size: 1.1rem;
  font-weight: 700;
  color: #dc2626;
  margin: 0 0 8px;
}
.customer-menu-closed-sub {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

/* ---- Table picker modal ---- */
.pos-table-modal {
  position: fixed;
  inset: 0;
  background: rgba(30,25,15,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 16px;
}

.pos-table-modal-box {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 64px rgba(30,25,15,0.22);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-table-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.pos-table-modal-head h3 { margin: 0; font-size: 1.1rem; }

.pos-table-modal-search {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px 0;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  direction: rtl;
  background: #fafafa;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.pos-table-modal-search:focus {
  border-color: var(--primary);
  background: #fff;
}

.pos-table-modal-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 16px 0;
}

.pos-table-modal-status-bar {
  display: flex;
  gap: 6px;
  padding: 6px 16px 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
}
.pos-table-modal-status-bar .zone-chip { font-size: 0.74rem; padding: 3px 10px; }

.zone-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 13px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: #f4f4f4;
  color: var(--ink);
  transition: background 0.1s, border-color 0.1s;
}
.zone-chip.active,
.zone-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.zone-chip-indoor.active  { background: #1a4fb6; border-color: #1a4fb6; }
.zone-chip-outdoor.active { background: #137333; border-color: #137333; }
.zone-chip-credit.active  { background: #b06000; border-color: #b06000; }
.zone-chip-kids.active    { background: #b0227a; border-color: #b0227a; }
.zone-chip-staff.active   { background: #5a37c4; border-color: #5a37c4; }

.pos-table-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px 16px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.pos-table-modal-grid::-webkit-scrollbar {
  width: 4px;
}
.pos-table-modal-grid::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}
.pos-table-modal-grid::-webkit-scrollbar-track {
  background: transparent;
}

/* Modal table card */
.pos-modal-table-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px 10px 9px;
  text-align: right;
  display: flex;
  flex-direction: column;
  min-height: 88px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  user-select: none;
}
.pos-modal-table-card:hover { border-color: rgba(199,146,62,0.8); box-shadow: 0 4px 14px rgba(199,146,62,0.18); transform: translateY(-1px); }
.pos-modal-table-card:active { transform: translateY(0); }
.pos-modal-table-card.available { border-color: rgba(22,128,87,.35); background: linear-gradient(160deg,#fff 60%,#f0fbf6); }
.pos-modal-table-card.occupied  { border-color: rgba(198,40,40,.35); background: linear-gradient(160deg,#fff 60%,#fff5f5); }
.pos-modal-table-card.reserved  { border-color: rgba(37,99,168,.3);  background: linear-gradient(160deg,#fff 60%,#f0f6ff); }
.pos-modal-table-card.locked    { border-color: #ddd; background: #f6f6f6; opacity: 0.55; cursor: not-allowed; }
.pos-modal-table-card.locked:hover { transform: none; box-shadow: none; border-color: #ddd; }
.pos-modal-table-card.selected  { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(199,146,62,0.25); }
.pos-modal-table-name { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; flex: 1; }

.pos-modal-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pos-modal-table-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

.pos-modal-table-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Product meta bar (count) */
.pos-products-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 2px 6px;
}

.pos-products-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

/* Empty state */
.pos-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
}
.pos-empty-icon { font-size: 2.4rem; }
.pos-empty-state p { margin: 0; font-size: 0.95rem; font-weight: 600; }
.pos-empty-state .btn { font-size: 0.83rem; padding: 7px 18px; }

/* ---- Product grid ---- */
.pos-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  gap: 10px;
}

/* ---- Product card ---- */
.pos-product {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 152px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: right;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(33,28,21,0.06);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

/* Colored top accent bar by station */
.pos-product::before {
  content: "";
  display: block;
  height: 3px;
  flex-shrink: 0;
  background: var(--primary);
}
.pos-product.barista::before { background: #1a4fb6; }
.pos-product.kitchen::before { background: #c0392b; }
.pos-product.shisha::before  { background: #5a37c4; }

/* Hover state — default */
.pos-product:hover {
  border-color: rgba(199,146,62,0.55);
  box-shadow: 0 6px 22px rgba(199,146,62,0.18);
  transform: translateY(-2px);
}
/* Hover state — station tint */
.pos-product.barista:hover { border-color: rgba(26,79,182,0.4); box-shadow: 0 6px 20px rgba(26,79,182,0.14); }
.pos-product.kitchen:hover { border-color: rgba(192,57,43,0.4); box-shadow: 0 6px 20px rgba(192,57,43,0.14); }
.pos-product.shisha:hover  { border-color: rgba(90,55,196,0.4); box-shadow: 0 6px 20px rgba(90,55,196,0.14); }
/* Press effect */
.pos-product:active { transform: translateY(0) scale(0.98); transition: none; }

/* Meta row: category label + station badge */
.pos-product-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px 0;
  flex-shrink: 0;
}

.pos-product-cat {
  font-size: 0.67rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* Station badge pill */
.pos-route-badge {
  font-size: 0.63rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 8px;
  line-height: 1.5;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.pos-route-badge.barista { background: #e8f0fe; color: #1a4fb6; }
.pos-route-badge.kitchen { background: #fdecea; color: #b71c1c; }
.pos-route-badge.shisha  { background: #ece8fd; color: #5a37c4; }

/* Product name */
.pos-product-name {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.38;
  padding: 4px 11px 0;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Footer: price + add button */
.pos-product-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(33,28,21,0.06);
  background: #f9f8f6;
  flex-shrink: 0;
}

.pos-product-price {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.08rem;
  font-weight: 900;
  color: #1b7a42;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "+ إضافة" button */
.pos-add-btn {
  flex: 0 0 auto;
  font-size: 0.77rem;
  font-weight: 800;
  padding: 0 14px;
  min-height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, transform 0.08s;
}
.pos-add-btn:hover  { background: #a5681e; }
.pos-add-btn:active { transform: scale(0.94); }

/* Offer card accent + badge + savings tag */
.pos-product.offer::before { background: linear-gradient(90deg, #c7923e, #e0b15a); }
.pos-product.offer:hover { border-color: rgba(199,146,62,0.5); box-shadow: 0 6px 20px rgba(199,146,62,0.2); }
.pos-route-badge.offer { background: #fff3da; color: #a5681e; }
.pos-offer-savings {
  font-size: 0.7rem;
  font-weight: 800;
  color: #1b7a42;
  background: #eafaf0;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Cart panel */
.pos-cart-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pos-cart-header h2 { margin: 0; }

.pos-cart-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 9px;
}

.pos-last-order { font-size: 0.9rem; }

.pos-cart-items { flex: 1; }

.pos-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 0 20px;
  color: var(--muted);
}
.pos-cart-empty span { font-size: 2rem; }
.pos-cart-empty p { margin: 0; font-size: 0.9rem; }

/* Cart line */
.pos-cart-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.pos-cart-line-offer {
  background: #fffaf1;
  border-radius: 8px;
  padding: 11px 8px;
  margin: 0 -8px;
}

.pos-cart-line-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pos-cart-line-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.pos-cart-line-unit {
  font-size: 0.75rem;
  color: var(--muted);
}

.pos-cart-notes {
  font-size: 0.78rem;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  background: #fafafa;
  direction: rtl;
}

.pos-cart-line-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.pos-qty-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pos-qty-num {
  font-size: 1rem;
  min-width: 22px;
  text-align: center;
}

.pos-cart-line-total {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
}

/* Remove button — visible red */
.pos-remove-btn {
  background: #fff0f0;
  border: 1px solid #f5c6c6;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
  color: #c00;
  padding: 3px 7px;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s;
}
.pos-remove-btn:hover { background: #c00; color: #fff; border-color: #c00; }

/* Totals */
.pos-totals {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
  display: grid;
  gap: 7px;
}
.pos-totals-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}
.pos-totals-grand {
  font-size: 1.35rem;
  font-weight: 900;
  border-top: 2px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.pos-totals-grand strong { color: var(--primary); }

/* Cart action buttons */
.pos-cart-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.pos-submit-btn {
  flex: 1;
  font-size: 1rem;
  font-weight: 800;
  padding: 12px;
}

/* Responsive */
@media (max-width: 1100px) {
  .pos-cart-panel { position: static; }
  .pos-products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Stack footer (price above button) when viewport narrows enough
   that cards are too small to fit both side-by-side */
@media (max-width: 900px) {
  .pos-product-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .pos-add-btn {
    width: 100%;
    min-height: 36px;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .section.pos, section.pos {
    flex-direction: column-reverse;
  }
  .pos-cart-panel {
    width: 100%;
    max-height: none;
  }
  .pos-left-panel { width: 100%; }
  .pos-products { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 700px) {
  .pos-table-modal-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .pos-table-modal-box { max-height: 96vh; }
  .pos-row2 { gap: 6px; }
  .pos-product-search { min-width: 0; flex: 1; }
  .pos-category-chip { padding: 7px 13px; font-size: 0.83rem; min-height: 38px; }
  .pos-category-bubbles { gap: 6px 6px; }
}

/* ─── Delivery Module ──────────────────────────────────────── */

.delivery-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 4px;
}

.delivery-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.delivery-page-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.delivery-page-sub { color: var(--muted, #888); font-size: .875rem; margin: 0; }
.delivery-page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.delivery-filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.delivery-seg { flex-wrap: wrap; gap: 4px; }
.delivery-search-input { flex: 1 1 220px; min-width: 0; }

.delivery-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Delivery Card */
.delivery-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.delivery-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.delivery-card-number { font-weight: 700; font-size: 1rem; }
.delivery-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Status badges */
.delivery-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.delivery-badge-pending  { background: #fef9c3; color: #854d0e; }
.delivery-badge-preparing { background: #dbeafe; color: #1e40af; }
.delivery-badge-out      { background: #ede9fe; color: #5b21b6; }
.delivery-badge-delivered { background: #dcfce7; color: #166534; }
.delivery-badge-cancelled { background: #fee2e2; color: #991b1b; }

.delivery-pay-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.delivery-pay-badge.paid   { background: #dcfce7; color: #166534; }
.delivery-pay-badge.unpaid { background: #fef3c7; color: #92400e; }

.delivery-source-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: .72rem;
  background: #f3f4f6;
  color: #6b7280;
}

.delivery-card-customer { display: flex; flex-direction: column; gap: 4px; }
.delivery-customer-name { font-weight: 600; font-size: .95rem; }
.delivery-customer-phone { color: var(--primary, #2563eb); font-size: .875rem; text-decoration: none; }
.delivery-customer-phone:hover { text-decoration: underline; }
.delivery-card-address { font-size: .8rem; color: var(--muted, #666); }
.delivery-card-notes   { font-size: .8rem; color: var(--muted, #666); font-style: italic; }

.delivery-card-items { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border, #e5e7eb); padding-top: 10px; }
.delivery-item-row { display: flex; justify-content: space-between; font-size: .85rem; }

.delivery-card-footer { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border, #e5e7eb); padding-top: 10px; }
.delivery-card-total { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--muted, #666); }
.delivery-card-total strong { font-size: 1rem; color: var(--text, #111); margin-right: auto; }
.delivery-person-row { font-size: .82rem; color: var(--muted, #666); }
.delivery-card-time  { font-size: .78rem; color: #aaa; }

.delivery-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.delivery-advance-btn { background: var(--primary, #2563eb); color: #fff; }
.delivery-advance-btn:hover { background: var(--primary-dark, #1d4ed8); }
.delivery-cancel-btn  { color: var(--danger, #dc2626); border-color: var(--danger, #dc2626); }
.delivery-cancel-btn:hover { background: #fee2e2; }

.delivery-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted, #888);
}
.delivery-empty-icon { font-size: 3rem; display: block; margin-bottom: 12px; }

/* POS Delivery Panel */
.pos-delivery-panel {
  margin: 6px 0 2px;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  padding: 14px 16px;
}
.pos-delivery-panel-title {
  font-size: .85rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 12px;
  letter-spacing: .01em;
}
.delivery-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.delivery-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.delivery-field label {
  font-size: .8rem;
  font-weight: 600;
  color: #6b7280;
}
.delivery-field .input,
.delivery-field input.input,
.delivery-field textarea.input {
  font-size: .875rem;
  padding: 8px 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.delivery-field .input:focus,
.delivery-field input.input:focus,
.delivery-field textarea.input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.18);
  outline: none;
}
.delivery-field-textarea {
  resize: none;
  line-height: 1.5;
}
.delivery-field-full {
  grid-column: 1 / -1;
}
.req-star { color: #dc2626; }

.delivery-source-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.delivery-source-chip {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  color: #374151;
}
.delivery-source-chip:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.delivery-source-chip.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.delivery-customer-found {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .82rem;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.delivery-customer-new {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .82rem;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.delivery-customer-lookup {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .82rem;
  background: #f3f4f6;
  color: #6b7280;
}
@media (max-width: 700px) {
  .delivery-form-grid { grid-template-columns: 1fr; }
}

/* Delivery Create Modal */
.delivery-create-modal-box {
  width: min(1100px, 98vw);
  max-width: min(1100px, 98vw);
  height: 94vh;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 14px;
}
.modal:has(.delivery-create-modal-box) {
  align-items: flex-start;
  padding: 10px;
}

.delivery-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  position: sticky;
  top: 0;
  background: var(--card-bg, #fff);
  z-index: 2;
}
.delivery-create-head h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }

.delivery-create-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.delivery-create-form-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  border-left: 1px solid var(--border, #e5e7eb);
}
.delivery-form-section-title { margin: 0 0 4px; font-size: .9rem; font-weight: 600; color: var(--muted, #666); }
.delivery-form-group { display: flex; flex-direction: column; gap: 4px; }
.delivery-form-group label { font-size: .82rem; font-weight: 500; color: var(--muted, #555); }
.delivery-form-group .input { font-size: .875rem; }
.delivery-form-row { display: flex; gap: 8px; }
.delivery-form-row .delivery-form-group { flex: 1 1 0; }
.delivery-textarea { resize: none; }
.req-star { color: var(--danger, #dc2626); }

.delivery-create-cart-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  flex: 1 1 0;
  overflow-y: auto;
}
.delivery-cart-empty-hint { text-align: center; color: var(--muted, #888); font-size: .85rem; padding: 16px; }
.delivery-cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface, #f9fafb);
  border-radius: 8px;
  font-size: .875rem;
}
.delivery-cart-item-name { flex: 1 1 0; min-width: 0; }
.delivery-cart-item-controls { display: flex; align-items: center; gap: 6px; }
.delivery-cart-item-price { font-weight: 600; min-width: 60px; text-align: left; }
.delivery-cart-totals { border-top: 1px solid var(--border, #e5e7eb); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.delivery-cart-total-row { display: flex; justify-content: space-between; font-size: .875rem; }
.delivery-cart-grand { font-weight: 700; font-size: .95rem; }

.delivery-submit-btn.wide { width: 100%; margin-top: auto; }

.delivery-create-products-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.delivery-products-search-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.delivery-products-search-row .input { flex: 1 1 0; min-width: 0; font-size: .875rem; }
.delivery-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  flex: 1 1 0;
  align-content: start;
}
.delivery-product-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.delivery-product-card:hover { border-color: var(--primary, #2563eb); box-shadow: 0 2px 8px rgba(37,99,235,.12); }
.delivery-product-card.in-cart { border-color: var(--primary, #2563eb); background: #eff6ff; }
.delivery-product-name { font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.delivery-product-price { font-size: .82rem; color: var(--muted, #666); }
.delivery-product-qty {
  position: absolute;
  top: -7px;
  inset-inline-end: -7px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.delivery-no-products { grid-column: 1/-1; text-align: center; color: var(--muted, #888); font-size: .875rem; padding: 24px; }

@media (max-width: 800px) {
  .delivery-create-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .delivery-create-form-col { border-left: none; border-bottom: 1px solid var(--border, #e5e7eb); max-height: 50vh; }
  .delivery-create-modal-box { height: 98vh; }
  .delivery-cards-grid { grid-template-columns: 1fr; }
}

/* Customer type badges */
.customer-delivery-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.customer-credit-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .02em;
}


/* Products page tabs */
.products-page-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border, #e5e7eb);
}
.products-page-tab {
  padding: 8px 22px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: .925rem;
  font-weight: 600;
  color: var(--muted, #666);
  cursor: pointer;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.products-page-tab.active {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}
.products-page-tab:hover { color: var(--primary, #2563eb); }

/* ═══════════════════════════════════════════════════════════════
   ADMIN OFFERS SECTION
   ═══════════════════════════════════════════════════════════════ */

.offer-admin-section { padding: 4px 0; }

.offer-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.offer-admin-header-title { margin: 0 0 4px; font-size: 1.15rem; font-weight: 700; }
.offer-admin-header-sub { color: var(--muted, #666); font-size: .875rem; margin: 0; }

.offer-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.offer-admin-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow .15s;
  display: flex;
  flex-direction: column;
}

.offer-admin-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.1); }
.offer-admin-card--inactive { opacity: .6; }

.offer-admin-card-img {
  height: 130px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.offer-admin-card-img img { width: 100%; height: 100%; object-fit: cover; }

.offer-admin-card-img--placeholder span {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary, #2563eb);
  opacity: .25;
}

.offer-admin-badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
}

/* Alias for backward compat */
.offer-badge { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--primary, #2563eb); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 100px; }

.offer-admin-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.offer-admin-card-title { margin: 0; font-size: .95rem; font-weight: 700; }

.offer-admin-card-products { font-size: .8rem; color: var(--muted, #666); margin: 0; }

.offer-admin-card-prices { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.offer-admin-original { text-decoration: line-through; color: var(--muted, #999); font-size: .82rem; }
.offer-admin-price { font-weight: 700; font-size: 1rem; color: var(--primary, #2563eb); }
.offer-admin-savings { background: #dcfce7; color: #166534; font-size: .75rem; padding: 2px 8px; border-radius: 100px; font-weight: 600; }

.offer-admin-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.offer-admin-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   OFFER FORM MODAL
   ═══════════════════════════════════════════════════════════════ */

.offer-form-modal-box {
  max-width: 960px;
  width: 96vw;
  max-height: 92vh;
  overflow-y: auto;
}

.offer-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 4px;
}

@media (max-width: 700px) { .offer-form-grid { grid-template-columns: 1fr; } }

.offer-form-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.offer-form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .offer-form-row2 { grid-template-columns: 1fr; } }

.offer-form-toggles { display: flex; gap: 20px; margin-top: 4px; flex-wrap: wrap; }
.field-inline { display: flex; align-items: center; gap: 8px; font-size: .875rem; }

/* Product picker */
.offer-product-picker { display: flex; flex-direction: column; gap: 8px; }
.offer-picker-header { display: flex; align-items: center; justify-content: space-between; }
.offer-picker-header b { font-size: .875rem; }

.offer-product-search {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 0 10px;
  font-size: .875rem;
}

.offer-product-picker-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
}

/* New row-based picker (replaces old button-only design) */
.offer-product-pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--surface, #f9fafb);
  transition: background .12s;
}
.offer-product-pick-row:hover { background: #f0f4ff; border-color: #c7d2fe; }
.offer-product-pick-row.selected { background: #eff6ff; border-color: #bfdbfe; }

.offer-pick-info { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.offer-pick-name { font-size: .82rem; font-weight: 600; }
.offer-pick-meta { font-size: .74rem; opacity: .65; }

.offer-pick-add-btn {
  flex-shrink: 0;
  height: 30px;
  min-width: 60px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid var(--primary, #2563eb);
  background: #fff;
  color: var(--primary, #2563eb);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
}
.offer-pick-add-btn:hover { background: var(--primary, #2563eb); color: #fff; }
.offer-pick-add-btn.added {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
  cursor: default;
}

/* Selected product rows */
.offer-selected-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f0fdf4;
  margin-top: 4px;
}

.offer-selected-rows-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.offer-selected-rows-title { font-size: .875rem; font-weight: 700; color: #166534; }
.offer-selected-rows-count { font-size: .78rem; color: #16a34a; font-weight: 600; }

.offer-selected-empty {
  font-size: .8rem;
  color: #9ca3af;
  text-align: center;
  padding: 8px 0 2px;
}

.offer-selected-product-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #d1fae5;
  font-size: .82rem;
}

.offer-sel-name { flex: 1 1 0; min-width: 0; font-weight: 600; }
.offer-sel-unit { min-width: 50px; text-align: end; color: #6b7280; font-size: .78rem; }
.offer-qty-input { width: 52px; text-align: center; padding: 4px 6px; font-size: .875rem; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; }
.offer-sel-total { min-width: 60px; text-align: end; font-weight: 700; color: #166534; }
.offer-sel-remove { color: #dc2626; border-color: transparent; background: transparent; }

/* Price summary */
.offer-price-summary {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface, #f9fafb);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.offer-price-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .875rem;
}

.offer-price-summary-main {
  gap: 10px;
}

.offer-price-input {
  width: 120px;
  height: 38px;
  border: 1.5px solid var(--primary, #2563eb);
  border-radius: 8px;
  padding: 0 10px;
  font-size: .925rem;
  font-weight: 700;
  text-align: end;
}

.offer-savings-row { color: #166534; }
.offer-savings-amount { color: #166534; }

.offer-price-warning {
  font-size: .8rem;
  color: #b45309;
  background: #fef3c7;
  border-radius: 6px;
  padding: 5px 10px;
}

/* Offer image upload */
.offer-image-upload-area { display: flex; flex-direction: column; gap: 6px; }

.offer-image-preview {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1.5px dashed rgba(15,118,110,.4);
  border-radius: 12px;
  background: #f0fdf4;
  overflow: hidden;
}

.offer-image-preview.has-image {
  border-style: solid;
  border-color: var(--primary, #0f766e);
  background: #fff;
}

.offer-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.offer-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted, #9ca3af);
}

.offer-image-placeholder-icon {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary, #0f766e);
  opacity: .4;
}

.offer-image-placeholder small { font-size: .72rem; }

.offer-upload-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.offer-upload-btn {
  cursor: pointer;
  font-size: .82rem;
  padding: 5px 14px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.offer-upload-status { font-size: .78rem; color: var(--muted, #6b7280); }
.offer-upload-status.success { color: #16a34a; }
.offer-upload-status.error { color: #dc2626; }

/* Numeric inputs: LTR, no RTL cursor problems */
.numeric-input {
  direction: ltr;
  text-align: center;
}

/* Remove browser spinners from any remaining number inputs in offers */
.offer-form-modal-box input[type="number"]::-webkit-outer-spin-button,
.offer-form-modal-box input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.offer-form-modal-box input[type="number"] { -moz-appearance: textfield; }

/* Backward compat aliases */
.offer-savings-hint { background: #dcfce7; color: #166534; font-size: .78rem; padding: 2px 8px; border-radius: 100px; font-weight: 600; margin-inline-start: 8px; }
.offer-original-total { text-align: end; font-size: .875rem; color: var(--muted, #666); margin-top: 8px; }
.offer-price-row { margin-top: 4px; }

/* Legacy online-offer-* aliases so nothing breaks if used elsewhere */
.online-offer-badge { position: absolute; top: 8px; inset-inline-start: 8px; background: #c47f32; color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.online-offers-section { padding: 20px 0 8px; }
.online-offers-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 14px; }
.online-offer-card { display: flex; flex-direction: column; }

/* Online order form modal */
/* Online checkout modal sits above the cart bar (z-index: 999) */
.modal:has(.online-order-form-box) {
  z-index: 1500;
}

.online-order-form-box {
  max-width: 500px;
  width: 95vw;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--menu-bg, #fff);
  padding-bottom: 24px;
}
.online-order-form-box .btn[type="submit"] {
  background: var(--menu-primary, #0f3d35);
  box-shadow: none;
}
.online-order-form-box .btn[type="submit"]:hover {
  background: var(--menu-primary, #0f3d35);
  filter: brightness(0.9);
  transform: none;
  box-shadow: none;
}
.online-order-form-cart-summary {
  background: var(--surface, #f9fafb);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: .875rem;
}
.online-order-cart-line {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.online-order-cart-line span:first-child { flex: 1 1 0; }
.online-order-cart-total { font-weight: 700; margin-top: 8px; text-align: end; font-size: .95rem; color: var(--menu-accent, inherit); }
.online-order-note { font-size: .78rem; color: var(--muted, #999); margin-top: 4px; text-align: end; }
.online-order-type-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--surface, #f3f4f6);
  border-radius: 10px;
  padding: 4px;
}
.online-order-type-tab {
  flex: 1 1 0;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted, #666);
  cursor: pointer;
  transition: all .15s;
}
.online-order-type-tab.active {
  background: var(--menu-primary, #0f3d35);
  color: #fff;
}

/* Hidden cart bar */
.hidden-bar { visibility: hidden; pointer-events: none; }

/* Online ordering cart bar — fixed, always visible when items exist */
.online-menu-cart-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--menu-primary, #0f3d35);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(15, 61, 53, 0.35);
  color: #fff;
  font-weight: 700;
}
.online-cart-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex: 1 1 0;
  min-width: 0;
}

.online-cart-bar-icon { font-size: 18px; }
.online-cart-bar-sep { opacity: 0.5; }
.online-cart-bar-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 22px;
  background: var(--menu-accent, #c47f32);
  color: var(--menu-button-text, #fff);
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.online-cart-bar-btn:hover { filter: brightness(0.9); }

/* Pad page bottom so content isn't hidden under the fixed online cart bar */
.customer-menu-page.has-online-cart {
  padding-bottom: 90px;
}

/* ══════════════════════════════════════════════════════════════
   CUSTOMER CONTACT / LOCATION SECTION
══════════════════════════════════════════════════════════════ */

.customer-contact-section {
  margin-top: 34px;
  padding-top: 32px;
  border-top: 1px solid rgba(15, 61, 53, 0.1);
}

.customer-contact-header {
  text-align: center;
  margin-bottom: 28px;
}

.customer-contact-header h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  color: #0a2e28;
  margin: 0 0 6px;
}

.customer-contact-header p {
  font-size: .9rem;
  color: #4b7a72;
  margin: 0;
}

.customer-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  align-items: stretch;
}

.customer-contact-card {
  background: #fff;
  border: 1px solid rgba(15, 61, 53, 0.12);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(15, 61, 53, 0.06);
}

.customer-contact-card-icon { font-size: 1.4rem; line-height: 1; }
.customer-contact-card-label { font-size: .75rem; font-weight: 700; color: #c47f32; letter-spacing: .04em; }
.customer-contact-card-value { font-size: .82rem; color: #374151; line-height: 1.5; }

.customer-contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  justify-content: center;
}

.customer-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  cursor: pointer;
}

.customer-contact-btn.primary {
  background: #0f766e;
  color: #fff;
  border: 2px solid #0f766e;
}

.customer-contact-btn.primary:hover { background: #0a5c56; border-color: #0a5c56; }

.customer-contact-btn.secondary {
  background: #fff;
  color: #0a2e28;
  border: 2px solid rgba(15, 61, 53, 0.2);
}

.customer-contact-btn.secondary:hover {
  background: #f0fdf4;
  border-color: #0f766e;
  color: #0f766e;
}

.customer-map-card {
  margin-top: 4px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 61, 53, 0.12);
  border: 1px solid rgba(15, 61, 53, 0.1);
}

.customer-map-frame {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
}

@media (max-width: 600px) {
  .customer-map-frame { height: 240px; }
  .customer-contact-grid { grid-template-columns: 1fr 1fr; }
  .customer-contact-actions { flex-direction: column; align-items: stretch; }
  .customer-contact-btn { justify-content: center; }
}

/* ── Hero contact strip ────────────────────────────────────── */
.customer-hero-contact-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid rgba(15, 61, 53, 0.1);
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: .8rem;
  color: #374151;
}

.customer-hero-strip-item { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.customer-hero-strip-sep { color: #d1d5db; }

.customer-hero-strip-btn {
  margin-inline-start: auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s;
}

.customer-hero-strip-btn:hover { background: #0a5c56; }

/* ── Pickup location note ────────────────────────────────────── */
.pickup-location-note {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .875rem;
}

.pickup-location-note b { color: #166534; font-weight: 700; }
.pickup-location-note span { color: #374151; }

/* ── Branding settings UI ─────────────────────────────────── */
.branding-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.branding-logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: contain;
  border: 1.5px solid #e4d8c6;
  background: #f9f5ee;
}

.branding-logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1.5px dashed #c4a97b;
  background: #fdf6ea;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  color: #c47f32;
}

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

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

.branding-color-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}

.branding-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.branding-color-row input[type="color"] {
  width: 42px;
  height: 38px;
  border: 1.5px solid #e4d8c6;
  border-radius: 10px;
  padding: 2px;
  cursor: pointer;
  background: #fff;
  flex-shrink: 0;
}

.branding-hex-input {
  width: 100px;
  height: 38px;
  border: 1.5px solid #e4d8c6;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  font-family: monospace;
  background: #fff;
}

/* ── Menu settings tabs ───────────────────────────────────── */
.menu-settings-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  border-bottom: 2px solid #e4d8c6;
}
.menu-settings-tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.menu-settings-tab-btn.active {
  color: #c47f32;
  border-bottom-color: #c47f32;
}
.menu-settings-tab-btn:hover:not(.active) {
  color: #374151;
  background: #f9f5ee;
}
.menu-settings-pane {
  padding-top: 14px;
}
.online-order-type-info {
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 12px;
}

/* ── Branding preview card ────────────────────────────────── */
.branding-preview-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e4d8c6;
  max-width: 360px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.branding-preview-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.branding-preview-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.branding-preview-title {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 3px;
}

.branding-preview-sub {
  font-size: 12px;
  font-weight: 600;
}

.branding-preview-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1.5px solid;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
  opacity: 0.85;
}

.branding-preview-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

/* ── Station badge colors ─────────────────────────────────── */
.badge-station-kitchen  { background: #d1fae5; color: #065f46; }
.badge-station-barista  { background: #dbeafe; color: #1e40af; }
.badge-station-shisha   { background: #ede9fe; color: #5b21b6; }
.badge-station-cashier  { background: #f3f4f6; color: #374151; }

/* ── Category cards grid ──────────────────────────────────── */
.categories-tab-wrap { padding: 12px 0; }
.categories-tab-toolbar { margin-bottom: 14px; }

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

.category-card {
  background: var(--card, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-card-inactive { opacity: 0.6; }

.category-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.category-card-name { font-weight: 700; font-size: 15px; }

.category-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-card-order { font-size: 12px; color: var(--text-muted, #6b7280); }

.category-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.empty-state-panel {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #6b7280);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn.sm { padding: 4px 10px; font-size: 12px; }

/* ══════════════════════════════════════════════════
   LIVE OPS DASHBOARD
══════════════════════════════════════════════════ */

.live-ops-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Header bar ── */
.live-ops-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card, #fff);
  border-radius: 12px;
  padding: 10px 16px;
  border: 1.5px solid var(--border, #e5e7eb);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.live-ops-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.live-ops-brand {
  font-weight: 800;
  font-size: 15px;
  color: var(--text, #111);
}
.live-sys-badge { font-size: 12px; }

/* ── Stat chips ── */
.live-stat-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}
.live-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  min-width: 54px;
  border: 1.5px solid transparent;
  cursor: default;
}
.chip-val {
  font-weight: 900;
  font-size: 17px;
  line-height: 1.2;
}
.chip-val small { font-size: 11px; font-weight: 600; opacity: 0.7; }
.chip-lbl { font-size: 10px; opacity: 0.75; margin-top: 1px; }
.chip-warn    { background: #fff7ed; border-color: #f59e0b; color: #b45309; }
.chip-info    { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }
.chip-success { background: #f0fdf4; border-color: #22c55e; color: #15803d; }
.chip-danger  { background: #fef2f2; border-color: #ef4444; color: #b91c1c; }
.chip-neutral { background: #f9fafb; border-color: #d1d5db; color: #374151; }
.chip-ok      { background: #f0fdf4; border-color: #22c55e; color: #15803d; }

/* ── Main two-column layout ── */
.live-ops-main {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 14px;
  align-items: start;
}

/* ── Activity Feed ── */
.live-feed-panel { }
.live-feed-scroll {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  padding-right: 2px;
}
.dash-feed-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 2px;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}
.dash-feed-item:last-child { border-bottom: none; }
.dash-feed-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.dash-icon-success { background: #d1fae5; color: #065f46; }
.dash-icon-danger  { background: #fee2e2; color: #991b1b; }
.dash-icon-info    { background: #dbeafe; color: #1e40af; }
.dash-icon-warning { background: #fef3c7; color: #92400e; }
.dash-icon-normal  { background: #f3f4f6; color: #374151; }
.dash-feed-body { flex: 1; min-width: 0; }
.dash-feed-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.dash-feed-title {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-feed-time {
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-feed-sub {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  margin-top: 1px;
}

/* ── Table Radar ── */
.live-radar-panel { }
.radar-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 8px;
}
.radar-table-card {
  background: #fff;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.radar-table-medium { border-color: #fbbf24; }
.radar-table-long   { border-color: #ef4444; background: #fffbeb; }
.radar-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.radar-table-name { font-weight: 700; font-size: 13px; }
.radar-dur { font-size: 10px !important; padding: 2px 5px !important; }
.radar-money-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.radar-money-cell {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.radar-money-cell span { color: var(--text-muted, #6b7280); }
.radar-table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.radar-last-act { color: var(--text-muted, #9ca3af); }

/* Color helpers */
.ok-text     { color: #15803d; }
.warn-text   { color: #b45309; }
.danger-text { color: #b91c1c; }
.info-text   { color: #1d4ed8; }
.badge.neutral { background: #f3f4f6; color: #374151; }

/* ── Station Monitoring ── */
.live-stations-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.live-station-card { }
.station-has-ready { border-color: #22c55e !important; }
.station-idle {
  text-align: center;
  padding: 20px 0 12px;
  color: var(--text-muted, #9ca3af);
  font-size: 13px;
}
.station-counts {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}
.station-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 10px 6px;
  border-radius: 8px;
}
.station-count-pending    { background: #fef3c7; }
.station-count-preparing  { background: #dbeafe; }
.station-count-ready      { background: #f3f4f6; }
.station-count-ready-alert {
  background: #d1fae5;
  animation: pulse-ok 1.8s ease-in-out infinite;
}
@keyframes pulse-ok {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.35); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,.0); }
}
.scount-val { font-weight: 900; font-size: 22px; line-height: 1; }
.scount-lbl { font-size: 11px; margin-top: 3px; opacity: 0.75; }

/* ── Bottom row ── */
.live-bottom-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr;
  gap: 14px;
  align-items: start;
}

/* Cash panel */
.live-cash-panel { }
.cash-breakdown-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
}
.cash-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 3px 0;
  border-bottom: 1px dotted var(--border-light, #f3f4f6);
}
.cash-breakdown-row span { color: var(--text-muted, #6b7280); }
.cash-total-row {
  font-weight: 700;
  border-top: 2px solid var(--border, #e5e7eb);
  border-bottom: none !important;
  margin-top: 4px;
  padding-top: 6px !important;
}
.cash-expected-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  background: #eff6ff;
  padding: 7px 10px;
  border-radius: 8px;
  margin-top: 6px;
}
.cash-moves-section { margin-top: 12px; border-top: 1px solid var(--border, #e5e7eb); padding-top: 8px; }
.cash-moves-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted, #9ca3af); }
.cash-move-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}
.cash-move-reason { flex: 1; color: var(--text-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-move-time { color: var(--text-muted, #9ca3af); flex-shrink: 0; }
.cash-move-suspicious { background: #fff1f2; border-radius: 4px; padding: 2px 4px; }
.cash-suspicious-alert {
  background: #fff1f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 700;
  margin-bottom: 8px;
}
.cash-payments-table { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.cash-payment-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 0;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}
.cash-pay-amount { font-weight: 700; white-space: nowrap; }
.cash-pay-ref { flex: 1; color: var(--text-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-pay-time { color: var(--text-muted, #9ca3af); flex-shrink: 0; font-size: 11px; }

/* Station recent orders */
.station-orders-list { margin-top: 8px; border-top: 1px solid var(--border-light, #f3f4f6); padding-top: 6px; }
.station-order-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 0;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}
.station-order-row:last-child { border-bottom: none; }
.station-order-num { font-weight: 700; white-space: nowrap; }
.station-order-loc { flex: 1; color: var(--text-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; }
.station-order-age { font-size: 11px; color: var(--text-muted, #9ca3af); white-space: nowrap; }
.age-overdue { color: #dc2626; font-weight: 700; }
.station-order-overdue { background: #fff1f2; border-radius: 4px; }
.station-overdue-alert {
  background: #fff1f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 700;
  margin-top: 6px;
}

/* Last updated label */
.live-last-updated { font-size: 11px; color: var(--text-muted, #9ca3af); }

/* Low stock panel */
.live-stock-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.live-stock-row  { display: flex; justify-content: space-between; align-items: center; }
.live-stock-name { font-size: 13px; font-weight: 600; flex: 1; padding-left: 6px; }
.live-stock-qty  { display: flex; align-items: center; gap: 4px; }
.live-stock-min  { font-size: 11px; color: var(--text-muted, #9ca3af); }

/* Shift panel */
.live-shift-panel { }
.shift-info-rows { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.shift-info-row  {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 3px 0;
  border-bottom: 1px dotted var(--border-light, #f3f4f6);
}
.shift-info-row span { color: var(--text-muted, #6b7280); }
.warn-row { background: #fffbeb; padding: 4px 6px; border-radius: 6px; }

/* Detail rows */
.live-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

/* ── Responsive (old classes) ── */
@media (max-width: 1000px) {
  .live-ops-main { grid-template-columns: 1fr; }
  .live-bottom-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .live-stations-row { grid-template-columns: 1fr; }
  .live-bottom-row   { grid-template-columns: 1fr; }
  .live-detail-row   { grid-template-columns: 1fr; }
  .live-stat-chips   { justify-content: flex-start; }
}

/* ═══════════════════════════════════════════════════
   OPERATIONS CENTER — Premium Redesign (ops-*)
   ═══════════════════════════════════════════════════ */

/* Shell */
.ops-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 48px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── Sticky Header ── */
.ops-sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(249,250,251,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -4px;
}
.ops-hd-start { display: flex; align-items: center; gap: 10px; }
.ops-hd-end   { display: flex; align-items: center; gap: 10px; }
.ops-hd-title { font-size: 17px; font-weight: 800; color: var(--text, #111827); margin: 0; }
.ops-sys-badge {
  font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; letter-spacing: 0.02em;
}
.ops-sys-ok     { background: #dcfce7; color: #166534; }
.ops-sys-warn   { background: #fef9c3; color: #854d0e; }
.ops-sys-danger { background: #fee2e2; color: #991b1b; }
.ops-last-upd   { font-size: 12px; color: var(--text-muted, #9ca3af); }

/* ── KPI Grid ── */
.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.ops-kpi {
  background: white;
  border-radius: 16px;
  padding: 20px 20px 16px;
  border: 2px solid var(--border, #e5e7eb);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: box-shadow 0.15s;
}
.ops-kpi:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.07); }
.ops-kpi-val {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--text, #111827);
}
.ops-kpi-total { font-size: 18px; font-weight: 500; color: var(--text-muted, #9ca3af); }
.ops-kpi-lbl   { font-size: 13px; font-weight: 600; color: var(--text-muted, #6b7280); margin-top: 4px; }
.ops-kpi-sub   { font-size: 12px; color: var(--text-muted, #9ca3af); margin-top: 4px; }
.ops-kpi-detail { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }

/* KPI accent colors */
.ops-kpi-warn    { border-color: #f59e0b; }
.ops-kpi-ok      { border-color: #22c55e; }
.ops-kpi-info    { border-color: #3b82f6; }
.ops-kpi-blue    { border-color: #3b82f6; }
.ops-kpi-danger  { border-color: #ef4444; }
.ops-kpi-neutral { border-color: var(--border, #e5e7eb); }
.ops-kpi-warn    .ops-kpi-val { color: #d97706; }
.ops-kpi-danger  .ops-kpi-val { color: #dc2626; }
.ops-kpi-ok      .ops-kpi-val { color: #16a34a; }
.ops-kpi-info    .ops-kpi-val,
.ops-kpi-blue    .ops-kpi-val { color: #2563eb; }

/* KPI detail chips */
.ops-kd-chip {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.ops-kd-pending  { background: #fef9c3; color: #854d0e; }
.ops-kd-preparing{ background: #fff7ed; color: #9a3412; }
.ops-kd-ready    { background: #dcfce7; color: #166534; }
.ops-kd-danger   { background: #fee2e2; color: #991b1b; }
.ops-kd-warn     { background: #fef9c3; color: #854d0e; }

/* ── Generic Panel ── */
.ops-panel {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border, #e5e7eb);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ops-panel-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text, #111827);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.ops-panel-sub { font-size: 12px; font-weight: 400; color: var(--text-muted, #9ca3af); }

/* ── Main Grid: Feed 40% + Radar 60% ── */
.ops-main-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 16px;
  align-items: start;
}

/* Activity Feed */
.ops-feed-panel { min-height: 500px; }
.ops-feed-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
  scrollbar-width: thin;
}
.ops-feed-scroll::-webkit-scrollbar { width: 4px; }
.ops-feed-scroll::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

/* Timeline */
.ops-timeline { position: relative; padding-right: 24px; }
.ops-timeline::before {
  content: '';
  position: absolute;
  right: 10px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, #d1d5db, rgba(209,213,219,0));
  border-radius: 2px;
}
.ops-tl-item {
  position: relative;
  padding: 9px 18px 9px 0;
  border-bottom: 1px solid #f9fafb;
}
.ops-tl-item:last-child { border-bottom: none; }
.ops-tl-dot {
  position: absolute;
  right: 6px;
  top: 13px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #e5e7eb;
  flex-shrink: 0;
}
.ops-tl-body { }
.ops-tl-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.ops-tl-title {
  font-size: 12px; font-weight: 700;
  color: var(--text, #111827);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ops-tl-time  { font-size: 11px; color: var(--text-muted, #9ca3af); flex-shrink: 0; }
.ops-tl-sub   { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 2px; line-height: 1.3; }

/* Low stock alerts in feed */
.ops-feed-alerts {
  background: #fff1f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.ops-feed-alert-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dfa-name { flex: 1; font-weight: 600; color: #991b1b; }
.dfa-qty  { color: #9ca3af; font-size: 11px; }

/* ── Table Radar ── */
.ops-radar-panel { }
.ops-table-list { display: flex; flex-direction: column; gap: 8px; }
.ops-table-card {
  background: var(--bg-card, #f9fafb);
  border-radius: 12px;
  border: 1.5px solid var(--border, #e5e7eb);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.15s;
}
.ops-tc-danger { border-color: #ef4444 !important; background: #fff5f5; }
.ops-tc-warn   { border-color: #f59e0b !important; background: #fffdf5; }
.ops-tc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ops-tc-id     { display: flex; align-items: center; gap: 7px; flex: 1; flex-wrap: wrap; }
.ops-tc-name   { font-size: 14px; font-weight: 800; color: var(--text, #111827); }
.ops-tc-total  { font-size: 15px; font-weight: 900; color: var(--text, #111827); white-space: nowrap; }
.ops-tc-money  {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted, #6b7280);
}
.ops-tc-money b { font-weight: 700; }
.ops-tc-orders { margin-right: auto; font-size: 11px; color: var(--text-muted, #9ca3af); }
.ops-tc-act    { font-size: 11px; color: var(--text-muted, #9ca3af); }
.ops-tc-items  { font-size: 11px; color: var(--text-muted, #9ca3af); line-height: 1.5; }
.ops-tc-warn-msg { font-size: 12px; color: #d97706; font-weight: 600; }
.ops-table-map-wrap {
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 12px;
  margin-top: 2px;
}

/* ── Section Headers ── */
.ops-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 2px 0;
}
.ops-sec-title { font-size: 15px; font-weight: 800; color: var(--text, #111827); margin: 0; }
.ops-sec-sub   { font-size: 13px; color: var(--text-muted, #6b7280); }

/* ── Station Grid ── */
.ops-station-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.ops-station-card {
  background: white;
  border-radius: 14px;
  border: 1.5px solid var(--border, #e5e7eb);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ops-station-active  {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.08);
}
.ops-station-overdue {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.08);
}
.ops-sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ops-sc-name { font-size: 14px; font-weight: 800; color: var(--text, #111827); }
.ops-sc-idle {
  font-size: 13px; color: var(--text-muted, #9ca3af);
  text-align: center; padding: 16px 0;
}
.ops-sc-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.ops-sc-count {
  border-radius: 10px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ops-sc-pending      { background: #fef9c3; }
.ops-sc-preparing    { background: #fff7ed; }
.ops-sc-ready        { background: #f3f4f6; }
.ops-sc-ready-active { background: #dcfce7; animation: ops-pulse-ready 1.8s ease-in-out infinite; }
.ops-sc-val { font-size: 28px; font-weight: 900; color: var(--text, #111827); line-height: 1; }
.ops-sc-lbl { font-size: 11px; color: var(--text-muted, #6b7280); font-weight: 600; }
.ops-sc-overdue {
  background: #fee2e2; color: #991b1b;
  border-radius: 8px; padding: 6px 10px;
  font-size: 12px; font-weight: 700;
}
.ops-sc-orders {
  display: flex; flex-direction: column; gap: 2px;
  border-top: 1px solid var(--border-light, #f3f4f6);
  padding-top: 8px;
}
.ops-sc-order {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 2px 0;
}
.ops-sc-order-late { background: #fff1f2; border-radius: 4px; padding: 2px 5px; }
.ops-sc-onum { font-weight: 700; white-space: nowrap; }
.ops-sc-oloc { flex: 1; color: var(--text-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-sc-oage { font-size: 11px; color: var(--text-muted, #9ca3af); white-space: nowrap; }
.ops-age-danger { color: #dc2626; font-weight: 700; }

@keyframes ops-pulse-ready {
  0%, 100% { background: #dcfce7; }
  50%       { background: #bbf7d0; }
}

/* ── Bottom Grid ── */
.ops-bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1.3fr;
  gap: 14px;
  align-items: start;
}

/* Cash Panel */
.ops-cash-panel { }
.ops-cash-alert {
  background: #fee2e2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 8px; padding: 8px 12px;
  font-size: 12px; font-weight: 700;
}
.ops-receipt {
  background: #f9fafb;
  border-radius: 10px;
  border: 1px dashed #e5e7eb;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}
.ops-rcpt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid #f3f4f6;
}
.ops-rcpt-row:last-child { border-bottom: none; }
.ops-rcpt-row span { color: var(--text-muted, #6b7280); }
.ops-rcpt-warn   b { color: #d97706; }
.ops-rcpt-ok     b { color: #16a34a; }
.ops-rcpt-danger b { color: #dc2626; }
.ops-rcpt-divider { height: 0; border-top: 2px dashed #d1d5db; margin: 4px 0; }
.ops-rcpt-total {
  display: flex;
  justify-content: space-between;
  font-size: 14px; font-weight: 900;
  color: var(--text, #111827);
  padding-top: 4px;
}
.ops-rcpt-total span { color: var(--text-muted, #6b7280); }

.ops-cash-section { border-top: 1px solid var(--border, #e5e7eb); padding-top: 10px; }
.ops-cash-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted, #9ca3af); margin-bottom: 6px; letter-spacing: 0.03em; }
.ops-pay-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 0;
  border-bottom: 1px solid #f9fafb;
}
.ops-pay-row:last-child { border-bottom: none; }
.ops-pay-ref  { flex: 1; color: var(--text-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-pay-time { color: var(--text-muted, #9ca3af); font-size: 11px; flex-shrink: 0; }
.ops-cmove-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 0;
  border-bottom: 1px solid #f9fafb;
}
.ops-cmove-row:last-child { border-bottom: none; }
.ops-cmove-suspicious { background: #fff1f2; border-radius: 4px; padding: 2px 5px; }
.ops-cmove-reason { flex: 1; color: var(--text-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Shift Panel */
.ops-shift-panel { }
.ops-shift-info { display: flex; flex-direction: column; gap: 3px; }
.ops-si-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 5px 0;
  border-bottom: 1px dotted #f3f4f6;
}
.ops-si-row:last-child { border-bottom: none; }
.ops-si-row span { color: var(--text-muted, #6b7280); }
.ops-credit-alert {
  background: #fef9c3; border: 1px solid #fde68a;
  border-radius: 8px; padding: 8px 12px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #854d0e; font-weight: 600;
}
.ops-ctrl-btns { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }

/* Stock Panel */
.ops-stock-panel { }
.ops-stock-list { display: flex; flex-direction: column; gap: 6px; }
.ops-stock-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 3px 0;
  border-bottom: 1px solid #f9fafb;
}
.ops-stock-row:last-child { border-bottom: none; }
.ops-stock-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-stock-min  { font-size: 11px; color: var(--text-muted, #9ca3af); white-space: nowrap; }

/* Detail Grid */
.ops-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Empty States */
.ops-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 36px 20px;
  color: var(--text-muted, #9ca3af);
  text-align: center;
}
.ops-empty b    { color: var(--text, #374151); font-size: 14px; }
.ops-empty span { font-size: 13px; }
.ops-empty-icon { font-size: 26px; }
.ops-empty-sm   { padding: 16px 10px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .ops-kpi-grid    { grid-template-columns: repeat(2, 1fr); }
  .ops-main-grid   { grid-template-columns: 1fr; }
  .ops-bottom-grid { grid-template-columns: 1fr 1fr; }
  .ops-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ops-kpi-grid     { grid-template-columns: repeat(2, 1fr); }
  .ops-kpi-val      { font-size: 28px; }
  .ops-station-grid { grid-template-columns: 1fr; }
  .ops-bottom-grid  { grid-template-columns: 1fr; }
  .ops-detail-grid  { grid-template-columns: 1fr; }
  .ops-sticky-header { padding: 10px 14px; }
}

/* ═══════════════════════════════════════════════════════
   PREMIUM OPS DASHBOARD v3 — غرفة العمليات الحية
   ═══════════════════════════════════════════════════════ */

/* Page shell */
.ops-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 0 60px;
  max-width: 1440px;
  margin: 0 auto;
  background: #f4f6f9;
  min-height: 100vh;
}

/* ── Premium Header ── */
.ops-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 0 0 20px 20px;
  padding: 20px 28px;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.ops-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ops-header-title {
  font-size: 20px;
  font-weight: 900;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.3px;
}
.ops-header-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 3px 0 0;
}
.ops-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ops-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.4);
  color: #4ade80;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
}
.ops-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.3);
  animation: ops-live-pulse 2s ease-in-out infinite;
}
@keyframes ops-live-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0.1); }
}
.ops-sys-badge {
  font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
}
.ops-sys-ok     { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.ops-sys-warn   { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.ops-sys-danger { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.ops-last-upd   { font-size: 11px; color: #64748b; }

/* ── KPI Cards ── */
.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 4px;
}
.ops-kpi-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.ops-kpi-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.08); transform: translateY(-1px); }
.ops-kpi-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.ops-kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ops-kpi-val  { font-size: 36px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; color: #0f172a; }
.ops-kpi-of   { font-size: 16px; font-weight: 500; color: #94a3b8; }
.ops-kpi-lbl  { font-size: 13px; font-weight: 600; color: #64748b; }
.ops-kpi-hint { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.ops-kpi-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
/* KPI states */
.ops-kpi-warn    { border-color: #f59e0b; }
.ops-kpi-warn    .ops-kpi-val { color: #d97706; }
.ops-kpi-ok      { border-color: #22c55e; }
.ops-kpi-ok      .ops-kpi-val { color: #16a34a; }
.ops-kpi-info    { border-color: #3b82f6; }
.ops-kpi-info    .ops-kpi-val { color: #2563eb; }
.ops-kpi-blue    { border-color: #3b82f6; }
.ops-kpi-blue    .ops-kpi-val { color: #2563eb; }
.ops-kpi-danger  { border-color: #ef4444; }
.ops-kpi-danger  .ops-kpi-val { color: #dc2626; }
.ops-kpi-neutral { border-color: #e2e8f0; }
/* chips */
.ops-kd-chip     { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.ops-kd-pending  { background: #fef9c3; color: #854d0e; }
.ops-kd-preparing{ background: #fff7ed; color: #9a3412; }
.ops-kd-ready    { background: #dcfce7; color: #166534; }
.ops-kd-danger   { background: #fee2e2; color: #991b1b; }
.ops-kd-warn     { background: #fef9c3; color: #854d0e; }

/* ── Content Grid: Feed 3fr + Side 2fr ── */
.ops-content-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  align-items: start;
}
.ops-side-stack { display: flex; flex-direction: column; gap: 16px; }

/* ── Generic Panel ── */
.ops-panel {
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.ops-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.ops-panel-title { font-size: 14px; font-weight: 800; color: #0f172a; }
.ops-panel-sub   { font-size: 12px; color: #94a3b8; margin-top: 2px; display: block; }

/* Activity Feed */
.ops-feed-panel { min-height: 520px; }
.ops-feed-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
/* Timeline */
.ops-timeline { position: relative; padding-right: 26px; }
.ops-timeline::before {
  content: '';
  position: absolute;
  right: 11px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, #cbd5e1, rgba(203,213,225,0));
  border-radius: 2px;
}
.ops-tl-item {
  position: relative;
  padding: 9px 16px 9px 0;
  border-bottom: 1px solid #f8fafc;
}
.ops-tl-item:last-child { border-bottom: none; }
.ops-tl-dot {
  position: absolute;
  right: 7px; top: 13px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.ops-tl-body { }
.ops-tl-top  { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ops-tl-title {
  font-size: 12px; font-weight: 700; color: #0f172a;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ops-tl-time { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.ops-tl-sub  { font-size: 11px; color: #64748b; margin-top: 2px; }
/* Low stock alerts in feed */
.ops-feed-alerts {
  background: #fff1f2; border: 1px solid #fecaca;
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px;
}
.ops-feed-alert-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dfa-name { flex: 1; font-weight: 600; color: #991b1b; }
.dfa-qty  { color: #9ca3af; font-size: 11px; }

/* ── Station Cards ── */
.ops-station-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ops-station-card {
  background: white; border-radius: 16px;
  border: 2px solid #e2e8f0; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ops-station-active  { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.08); }
.ops-station-overdue { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.08); }
.ops-sc-header { display: flex; align-items: center; justify-content: space-between; }
.ops-sc-name { font-size: 14px; font-weight: 800; color: #0f172a; }
.ops-sc-idle { font-size: 13px; color: #94a3b8; text-align: center; padding: 16px 0; }
.ops-sc-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.ops-sc-count { border-radius: 12px; padding: 10px 4px; display: flex; flex-direction: column; gap: 3px; }
.ops-sc-pending      { background: #fef9c3; }
.ops-sc-preparing    { background: #fff7ed; }
.ops-sc-ready        { background: #f1f5f9; }
.ops-sc-ready-active { background: #dcfce7; animation: ops-pulse-ready 1.8s ease-in-out infinite; }
.ops-sc-val  { font-size: 28px; font-weight: 900; color: #0f172a; line-height: 1; }
.ops-sc-lbl  { font-size: 11px; color: #64748b; font-weight: 600; }
.ops-sc-overdue { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.ops-sc-orders { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.ops-sc-order       { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 0; }
.ops-sc-order-late  { background: #fff1f2; border-radius: 4px; padding: 2px 5px; }
.ops-sc-onum { font-weight: 700; white-space: nowrap; }
.ops-sc-oloc { flex: 1; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-sc-oage { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.ops-age-danger { color: #dc2626; font-weight: 700; }
@keyframes ops-pulse-ready {
  0%, 100% { background: #dcfce7; }
  50%       { background: #bbf7d0; }
}

/* ── Section Headers ── */
.ops-section-hd { display: flex; align-items: baseline; gap: 10px; padding: 4px 2px 0; }
.ops-sec-title  { font-size: 16px; font-weight: 800; color: #0f172a; margin: 0; }
.ops-sec-sub    { font-size: 13px; color: #64748b; }

/* ── Tables Section (at the bottom) ── */
.ops-tables-section { }
.ops-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
/* Table Card states */
.ops-table-card {
  background: white;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s;
}
.ops-table-card.is-free    { border-color: #22c55e; opacity: 0.75; }
.ops-table-card.is-busy    { border-color: #3b82f6; }
.ops-table-card.is-warning { border-color: #f59e0b; background: #fffdf5; }
.ops-table-card.is-danger  { border-color: #ef4444; background: #fff5f5; }
/* Table card inner */
.otc-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.otc-name   { font-size: 16px; font-weight: 900; color: #0f172a; }
.otc-status {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  background: #f1f5f9; color: #64748b;
}
.otc-status.is-free    { background: #dcfce7; color: #166534; }
.otc-status.is-busy    { background: #dbeafe; color: #1e40af; }
.otc-status.is-warning { background: #fef3c7; color: #92400e; }
.otc-status.is-danger  { background: #fee2e2; color: #991b1b; }
.otc-dur-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 12px; color: #64748b;
}
.otc-dur { font-weight: 700; }
.otc-bill-badge {
  font-size: 11px; font-weight: 700;
  background: #fef3c7; color: #92400e;
  padding: 2px 8px; border-radius: 20px;
}
.otc-paid-badge {
  font-size: 11px; font-weight: 700;
  background: #dcfce7; color: #166534;
  padding: 2px 8px; border-radius: 20px;
}
.otc-body { display: flex; flex-direction: column; gap: 5px; }
.otc-body-free { font-size: 12px; color: #94a3b8; text-align: center; padding: 8px 0; }
.otc-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #64748b; padding: 2px 0;
  border-bottom: 1px solid #f8fafc;
}
.otc-row:last-child { border-bottom: none; }
.otc-row b { font-weight: 700; color: #0f172a; }
.otc-v-ok     { color: #16a34a !important; }
.otc-v-danger { color: #dc2626 !important; }
.otc-row-danger { background: #fff1f2; border-radius: 4px; padding: 3px 4px; }
.otc-items { display: flex; flex-wrap: wrap; gap: 4px; }
.otc-item-chip {
  font-size: 11px; font-weight: 600;
  color: #374151; background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 2px 8px; border-radius: 12px;
  white-space: nowrap;
}
.otc-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 6px; border-top: 1px solid #f1f5f9;
}
.otc-last-act { font-size: 11px; color: #94a3b8; }
.otc-tap-hint { font-size: 11px; color: #94a3b8; }
.otc-clickable { cursor: pointer; }
.otc-clickable:active { opacity: 0.82; transform: scale(0.98); transition: transform 0.1s, opacity 0.1s; }
.otc-name-only { font-size: 14px; font-weight: 800; color: #0f172a; }

/* ── Free tables compact grid ── */
.ops-free-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.ops-free-tables-grid .ops-table-card.is-free {
  padding: 10px 12px;
  gap: 4px;
  align-items: flex-start;
}

/* ── Cash Panel adjustments ── */
.ops-cash-panel .ops-panel-hd,
.ops-shift-panel .ops-panel-hd { margin-bottom: -4px; }

/* ── Detail Grid ── */
.ops-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Stock in side panel ── */
.ops-stock-panel { }
.ops-stock-list  { display: flex; flex-direction: column; gap: 5px; }
.ops-stock-row   { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid #f8fafc; }
.ops-stock-row:last-child { border-bottom: none; }
.ops-stock-name  { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-stock-min   { font-size: 11px; color: #94a3b8; white-space: nowrap; }

/* ── Empty State ── */
.ops-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 36px 20px; color: #94a3b8; text-align: center; }
.ops-empty b    { color: #374151; font-size: 14px; }
.ops-empty span { font-size: 13px; }
.ops-empty-icon { font-size: 26px; }
.ops-empty-sm   { padding: 14px 10px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .ops-kpi-grid      { grid-template-columns: repeat(2, 1fr); }
  .ops-content-grid  { grid-template-columns: 1fr; }
  .ops-detail-grid   { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ops-kpi-grid      { grid-template-columns: repeat(2, 1fr); }
  .ops-kpi-val       { font-size: 26px; }
  .ops-kpi-icon      { font-size: 22px; }
  .ops-station-grid  { grid-template-columns: 1fr; }
  .ops-tables-grid   { grid-template-columns: 1fr 1fr; }
  .ops-header        { padding: 14px 16px; border-radius: 0 0 14px 14px; }
  .ops-header-title  { font-size: 16px; }
}

/* ── Profile Page ─────────────────────────────────────────────────── */
.profile-page { display: grid; gap: 20px; min-width: 0; }

.profile-top-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-avatar-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 26px; font-weight: 900;
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(15, 118, 110, .25);
}

.profile-divider { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

.profile-info-rows { display: grid; gap: 10px; }

.profile-info-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; font-size: 14px; min-width: 0;
}

.profile-info-label {
  color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap;
}

.profile-info-value {
  font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%;
}

.profile-ua { font-size: 12px; color: var(--muted); cursor: help; direction: ltr; text-align: right; }
.profile-ua-hint { font-size: 11px; color: var(--muted); cursor: help; }

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-perms-toolbar { margin-bottom: 12px; }
.profile-perm-search { max-width: 380px; }
.profile-perms-list { display: grid; gap: 10px; }

.profile-perm-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.profile-perm-group-header {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  background: #f9f5ef; border: 0; border-bottom: 1px solid var(--border);
  text-align: right; font-weight: 800; font-size: 14px; color: var(--ink);
  cursor: pointer; transition: background .15s;
}
.profile-perm-group-header:hover { background: #f2eadf; }

.profile-perm-group-label { flex: 1; text-align: right; }

.profile-perm-count {
  padding: 2px 9px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 900;
}

.profile-perm-chevron { color: var(--muted); transition: transform .2s; font-size: 16px; line-height: 1; }
.profile-perm-group.collapsed .profile-perm-chevron { transform: rotate(-90deg); }
.profile-perm-group.collapsed .profile-perm-chips { display: none; }

.profile-perm-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 14px; }

.perm-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--border);
  background: #f4ede5; color: var(--muted);
  direction: ltr; white-space: nowrap;
}
.perm-chip.perm-read   { background: #eef6ff; border-color: #c3daf5; color: var(--info); }
.perm-chip.perm-manage { background: #e6f5f0; border-color: #b3ddd2; color: var(--success); }
.perm-chip.perm-access { background: #f5eef8; border-color: #dcc3e8; color: #7c3aed; }
.perm-chip.perm-create { background: #fffbea; border-color: #f0d97f; color: #92560f; }
.perm-chip.perm-update { background: #fff4e8; border-color: #f5cfa0; color: var(--warning); }
.perm-chip.perm-action { background: #fff0f0; border-color: #f5b8b8; color: var(--danger); }

@media (max-width: 900px) {
  .profile-top-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .profile-stats-grid { grid-template-columns: 1fr 1fr; }
  .profile-perm-search { max-width: 100%; }
}

/* ── PWA / Mobile Polish ──────────────────────────────────── */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}
.sidebar { padding-bottom: calc(18px + var(--sab)); }
.main    { padding-bottom: calc(24px + var(--sab)); }
.pos-cart-actions { padding-bottom: calc(8px + var(--sab)); }

.pwa-install-banner,
.pwa-update-banner,
.ios-install-card {
  margin: 0 16px 8px;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
}
.pwa-install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(15,118,110,.08), rgba(15,118,110,.04));
  border: 1px solid rgba(15,118,110,.25);
}
.pwa-update-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff3cd;
  border: 1px solid #fbbf24;
}
.ios-install-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

/* ================================================================
   MOBILE RESPONSIVENESS — Comprehensive fixes for 360–768px
   Applied last so they safely override individual component rules.
   ================================================================ */

/* ── Scrollable table wrapper (used by report-table) ────────────── */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* ── Mobile-only UI elements: hidden on desktop by default ──────── */
.mobile-menu-btn  { display: none; }
.mobile-nav-backdrop { display: none; }

/* ── 1024px: tablet layout tweaks ───────────────────────────────── */
@media (max-width: 1024px) {
  .pos { grid-template-columns: 1fr; }
}

/* ── 768px: phones — fixed overlay sidebar + layout width lock ───── */
@media (max-width: 768px) {

  /* ─── 1. Pin page to viewport — stops any child pushing page wider */
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  /* ─── 2. Shell: force 1 column, clip overflow at layout boundary */
  .layout, .app-shell {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
    overflow-x: clip;
  }

  /* ─── 3. Main: fill viewport width, kill any desktop margin from sidebar */
  .main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: 0 !important;
    box-sizing: border-box;
  }

  /* ─── 4. Sidebar: fixed overlay sliding in from the right (RTL) */
  .sidebar {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(86vw, 300px);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    border-radius: 0 !important;
    transform: translateX(110%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  /* ─── 5. Backdrop: fades in behind the open sidebar */
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* ─── 6. Hamburger button in topbar: visible on mobile */
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 1.25rem;
    border-radius: 10px;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--ink);
    flex-shrink: 0;
    order: -1;
  }

  /* ─── 7. Sidebar close button: style consistently */
  .sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
  }

  /* ─── 8. Modals: bottom-sheet on mobile */
  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal-box {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 16px;
  }
  .modal-box.table-session-modal {
    border-radius: 20px 20px 0 0;
  }

  /* ─── 9. Page header: compact */
  .topbar, .page-header {
    padding: 12px 14px;
    gap: 10px;
    margin-bottom: 14px;
  }

  /* ─── 10. POS: single column on mobile */
  section.pos {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .pos-cart-panel { width: 100%; position: static; }
  .pos-category-section { position: static; }
}

/* ── 480px: phones ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Panel padding reduced */
  .panel, .data-card { padding: 14px; }

  /* Category section margin matches new panel padding */
  .pos-category-section {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Topbar typography */
  .topbar h1, .page-header h1 { font-size: 1.25rem; }
  .topbar h2, .page-header h2 { font-size: 1rem; }

  /* Grids go to 1 column */
  .grid.cols-2 { grid-template-columns: 1fr; }

  /* Products: force 2-column on phones */
  .pos-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }
  .pos-product { min-height: 120px; padding: 10px; }
  .pos-product-name { font-size: 0.82rem; }
  .pos-product-price { font-size: 0.88rem; }

  /* Order type row (table/takeaway/delivery) */
  .pos-row1 { flex-wrap: wrap; gap: 6px; }
  .seg { flex-wrap: wrap; }
  .seg button { padding: 7px 10px; font-size: 0.82rem; min-height: 38px; }

  /* POS search row */
  .pos-row2 { flex-wrap: wrap; gap: 6px; }
  .pos-product-search { width: 100%; flex: none; }

  /* Cart lines */
  .pos-cart-line { gap: 7px; }
  .pos-cart-line-name { font-size: 0.86rem; }
  .pos-cart-notes { font-size: 0.8rem; }

  /* Cart action buttons — stay full width on phones */
  .pos-cart-actions { flex-wrap: wrap; }
  .pos-submit-btn { min-height: 48px; font-size: 0.95rem; }

  /* Report tables compact */
  .report-table th,
  .report-table td { padding: 6px 7px; font-size: 0.78rem; }

  /* Report KPI grid: 2 columns on phones */
  .report-kpi-grid { grid-template-columns: repeat(2, 1fr); }

  /* Shift KPIs */
  .shift-kpi-cards { grid-template-columns: repeat(2, 1fr); }
  .shift-work-grid { grid-template-columns: 1fr; }

  /* Inputs/selects full width inside panels */
  .panel input:not([type="checkbox"]):not([type="radio"]),
  .panel select,
  .panel textarea { width: 100%; max-width: 100%; }

  /* Fix BTN width override: only full-width in form contexts */
  .pos-row1 .btn,
  .pos-row2 .btn { width: auto; }
  .top-actions .btn { width: auto; }

  /* Shift movements: fixed-width columns overflow on 360px — make table scrollable */
  .shift-movements-table { overflow-x: auto; }
}

/* ── 380px: very small phones ───────────────────────────────────── */
@media (max-width: 380px) {
  /* Main padding minimal */
  .main { padding: 10px; }

  /* Nav buttons smaller */
  .nav { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .nav button { font-size: 0.78rem; padding: 8px 6px; min-height: 40px; }

  /* POS products tighter */
  .pos-products { gap: 4px; }
  .pos-product { min-height: 110px; padding: 8px; }
  .pos-product-name { font-size: 0.78rem; }

  /* Chips smaller */
  .pos-category-chip { padding: 6px 11px; font-size: 0.8rem; min-height: 36px; }

  /* Panel padding minimal */
  .panel, .data-card { padding: 10px; }
  .pos-category-section {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Topbar title */
  .topbar h1, .page-header h1 { font-size: 1.1rem; }
}

/* ================================================================
   DASHBOARD MOBILE — ops-page responsive refinements (360–768px)
   All rules scoped to ops-page classes; desktop unchanged.
   ================================================================ */

/* ── 768px: dashboard layout overhaul ───────────────────────────── */
@media (max-width: 768px) {

  /* Page shell: tighter vertical rhythm */
  .ops-page { gap: 14px; padding: 0 0 32px; }

  /* Dark header: not sticky on mobile (avoids overlap with sidebar) */
  .ops-header { position: static; border-radius: 12px; padding: 14px 16px; }
  .ops-header-title { font-size: 15px; }
  .ops-header-sub   { font-size: 11px; }
  .ops-last-upd     { display: none; }

  /* KPI grid: keep 2 columns, tighten spacing */
  .ops-kpi-grid { gap: 10px; padding: 0; }
  .ops-kpi-card { padding: 14px 12px; gap: 10px; align-items: flex-start; }
  .ops-kpi-icon { font-size: 22px; flex-shrink: 0; }
  .ops-kpi-val  {
    font-size: 24px;
    overflow-wrap: anywhere;
    word-break: break-all;
    min-width: 0;
    line-height: 1.1;
  }
  .ops-kpi-body { min-width: 0; overflow-wrap: anywhere; }
  .ops-kpi-lbl  { font-size: 12px; }
  .ops-kpi-hint { font-size: 11px; overflow-wrap: anywhere; }
  .ops-kd-chip  { font-size: 10px; padding: 2px 6px; }

  /* Content + detail grids: single column */
  .ops-content-grid { grid-template-columns: 1fr; }
  .ops-detail-grid  { grid-template-columns: 1fr; }

  /* Generic panel: smaller padding */
  .ops-panel { padding: 14px; gap: 10px; }
  .ops-panel-hd { padding-bottom: 8px; }

  /* Feed: reduce fixed height, keep scrollable */
  .ops-feed-panel { min-height: 0; }
  .ops-feed-scroll { max-height: 440px; }

  /* Timeline items: let titles & subs wrap fully */
  .ops-tl-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 12px;
  }
  .ops-tl-sub { font-size: 12px; overflow-wrap: anywhere; white-space: normal; }

  /* Payment rows: wrap on narrow screens */
  .ops-pay-row { flex-wrap: wrap; gap: 4px 6px; }
  .ops-pay-ref {
    width: 100%; flex: none;
    white-space: normal; overflow: visible; text-overflow: clip;
    font-size: 11px;
  }
  .ops-cmove-row    { flex-wrap: wrap; gap: 4px 6px; }
  .ops-cmove-reason {
    width: 100%; flex: none;
    white-space: normal; overflow: visible; text-overflow: clip;
    font-size: 11px;
  }

  /* Cash receipt */
  .ops-receipt { font-size: 12px; padding: 10px 12px; }
  .ops-rcpt-total { font-size: 13px; }
  .ops-rcpt-row b { overflow-wrap: anywhere; }

  /* Shift/cash rows */
  .ops-si-row { font-size: 12px; }
  .ops-credit-alert { font-size: 12px; flex-wrap: wrap; }

  /* Section headers */
  .ops-section-hd { gap: 6px; }
  .ops-sec-title { font-size: 14px; }
  .ops-sec-sub { font-size: 11px; }

  /* Station grid: 1 column on mobile */
  .ops-station-grid { grid-template-columns: 1fr; gap: 10px; }
  .ops-station-card { padding: 14px; gap: 10px; }
  .ops-sc-val { font-size: 24px; }

  /* Tables grid: 1 column on mobile (auto-fill 240px min won't fit 2 on phone) */
  .ops-tables-grid { grid-template-columns: 1fr; }
  .ops-table-card  { padding: 12px; gap: 8px; }
  /* Free tables: 2-column compact grid on mobile */
  .ops-free-tables-grid { grid-template-columns: 1fr 1fr; gap: 6px; }

  /* Order/activity rows in list containers */
  .ops-panel .row { min-width: 0; }
  .ops-panel .row .sub { overflow-wrap: anywhere; white-space: normal; }

  /* Low-stock alert rows in feed */
  .dfa-name { overflow-wrap: anywhere; }

  /* Stock list rows */
  .ops-stock-name { white-space: normal; overflow: visible; text-overflow: clip; }
}

/* ── 480px: compact phones ───────────────────────────────────────── */
@media (max-width: 480px) {

  /* KPI cards: smaller but still 2 columns */
  .ops-kpi-grid { gap: 8px; }
  .ops-kpi-card { padding: 12px 10px; gap: 8px; }
  .ops-kpi-val  { font-size: 22px; }
  .ops-kpi-icon { font-size: 18px; }
  .ops-kpi-lbl  { font-size: 11px; }

  /* Station count cells */
  .ops-sc-counts { gap: 5px; }
  .ops-sc-val  { font-size: 22px; }
  .ops-sc-count { padding: 8px 3px; }
  .ops-sc-lbl  { font-size: 10px; }
  .ops-sc-onum, .ops-sc-oloc, .ops-sc-oage { font-size: 11px; }

  /* Table card: minimal padding */
  .ops-table-card { padding: 10px; gap: 6px; }
  .otc-name { font-size: 14px; }
  .otc-item-chip { font-size: 10px; padding: 2px 6px; }
  .ops-free-tables-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .ops-free-tables-grid .ops-table-card.is-free { padding: 8px 10px; }

  /* Feed: slightly reduced max height */
  .ops-feed-scroll { max-height: 360px; }
}

/* ── 380px: very small phones ────────────────────────────────────── */
@media (max-width: 380px) {

  /* KPI cards: absolute minimum */
  .ops-kpi-card { padding: 10px 8px; gap: 6px; }
  .ops-kpi-val  { font-size: 20px; }
  .ops-kpi-icon { font-size: 16px; }
  .ops-kpi-lbl  { font-size: 10px; }

  /* Side stack panels: tighter */
  .ops-side-stack { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── VIP Customers ─────────────────────────────────────────────────── */
.vip-customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.vip-customer-card {
  background: var(--bg-card, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: box-shadow 0.18s;
}
.vip-customer-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.vip-customer-card.inactive {
  opacity: 0.65;
}

.vip-customer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.vip-customer-name {
  font-weight: 700;
  font-size: 1rem;
}

.vip-customer-phone {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  direction: ltr;
}

.vip-customer-notes {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.vip-customer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.vip-customer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* VIP QR link box in modal */
.vip-qr-link-box {
  user-select: all;
}

/* VIP badge on public menu hero */
.customer-menu-badge.vip-badge {
  background: linear-gradient(135deg, #c8a84b 0%, #f0d080 50%, #c8a84b 100%);
  color: #3a2800;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* VIP QR mode subtle gold tint on hero */
.customer-menu-page.vip-qr-mode .customer-menu-hero {
  border-bottom: 2px solid #c8a84b;
}

@media (max-width: 600px) {
  .vip-customers-grid {
    grid-template-columns: 1fr;
  }
  .vip-customer-actions {
    flex-direction: column;
  }
  .vip-customer-actions .btn {
    width: 100%;
  }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Live Online Orders Page ─────────────────────────────────── */
.ol-page { padding: 20px; max-width: 900px; }
.ol-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ol-page-title { font-size: 22px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.ol-pending-badge { background: #e53935; color: #fff; border-radius: 20px; padding: 2px 10px; font-size: 13px; font-weight: 700; }

.ol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ol-empty { text-align: center; padding: 60px 20px; color: #888; }
.ol-empty span { font-size: 48px; display: block; margin-bottom: 12px; }
.ol-empty p { font-size: 16px; }

.ol-card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.08); border-right: 5px solid #bbb; transition: box-shadow .2s; }
.ol-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13); }
.ol-card-new { border-right-color: #e53935; }
.ol-card-preparing { border-right-color: #f59e0b; }
.ol-card-ready { border-right-color: #22c55e; }

.ol-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ol-order-num { font-weight: 700; font-size: 14px; color: #333; }
.ol-time { color: #999; font-size: 12px; margin-right: auto; }
.ol-type-badge { font-size: 11px; border-radius: 8px; padding: 2px 8px; font-weight: 600; }
.ol-delivery { background: #e3f2fd; color: #1565c0; }
.ol-takeaway { background: #f3e5f5; color: #6a1b9a; }
.ol-status-badge { font-size: 11px; border-radius: 8px; padding: 2px 8px; font-weight: 600; }
.ol-status-badge.ol-new { background: #fde8e8; color: #b71c1c; }
.ol-status-badge.ol-preparing { background: #fff8e1; color: #e65100; }
.ol-status-badge.ol-ready { background: #e8f5e9; color: #1b5e20; }

.ol-customer { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ol-cust-name { font-size: 15px; font-weight: 600; }
.ol-cust-phone { font-size: 13px; color: #1565c0; text-decoration: none; }
.ol-cust-phone:hover { text-decoration: underline; }
.ol-addr { font-size: 13px; color: #555; margin-bottom: 8px; }
.ol-items { font-size: 13px; color: #666; margin-bottom: 8px; line-height: 1.5; }
.ol-total { font-size: 14px; margin-bottom: 12px; }
.ol-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ol-btn { padding: 8px 16px; border-radius: 10px; border: none; font-size: 13px; font-family: inherit; cursor: pointer; font-weight: 600; transition: opacity .15s; }
.ol-btn:hover { opacity: .85; }
.ol-accept { background: #e53935; color: #fff; }
.ol-ready-btn { background: #f59e0b; color: #fff; }
.ol-done-btn { background: #22c55e; color: #fff; }

/* ── Order Tracker ─────────────────────────────── */
.ot-page { padding: 20px; max-width: 1100px; }
.ot-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ot-page-title { font-size: 22px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.ot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.ot-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.07); border-right: 5px solid #bbb; transition: box-shadow .2s; }
.ot-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ot-status-pending   { border-right-color: #e53935; }
.ot-status-preparing { border-right-color: #f59e0b; }
.ot-status-ready     { border-right-color: #22c55e; }
.ot-status-completed { border-right-color: #94a3b8; }
.ot-status-cancelled { border-right-color: #d1d5db; opacity: .65; }
.ot-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ot-order-num { font-weight: 700; font-size: 14px; color: #222; }
.ot-time { color: #999; font-size: 11px; margin-right: auto; }
.ot-customer { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 6px; }
.ot-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #555; }
.ot-meta strong { font-size: 14px; color: #111; }

/* ══════════════════════════════════════════════════════════════
   Table Quick View Modal  (dashboard tap-to-peek check view)
   ══════════════════════════════════════════════════════════════ */
.tqv-box {
  background: #fff;
  border-radius: 22px;
  width: min(400px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
}
.tqv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.tqv-title-block { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tqv-table-name  { font-size: 20px; font-weight: 900; color: #0f172a; }
.tqv-status-pill {
  font-size: 11px; font-weight: 700;
  background: #fef3c7; color: #92400e;
  padding: 3px 10px; border-radius: 20px;
}
.tqv-close-btn {
  background: #f1f5f9; border: none; border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer;
  font-size: 13px; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s;
}
.tqv-close-btn:hover { background: #e2e8f0; }
.tqv-body { overflow-y: auto; flex: 1; padding: 16px 20px; }
.tqv-section-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: #94a3b8; margin-bottom: 10px;
}
.tqv-items-list { display: flex; flex-direction: column; margin-bottom: 4px; }
.tqv-item-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 0; border-bottom: 1px solid #f8fafc; font-size: 15px;
}
.tqv-item-row:last-child { border-bottom: none; }
.tqv-item-qty  { font-weight: 800; color: #6366f1; min-width: 28px; text-align: center; font-size: 13px; }
.tqv-item-name { flex: 1; font-weight: 600; color: #111827; }
.tqv-item-price { font-weight: 700; color: #374151; white-space: nowrap; font-size: 13px; }
.tqv-divider   { height: 1px; background: #e2e8f0; margin: 14px 0; }
.tqv-totals    { display: flex; flex-direction: column; gap: 8px; }
.tqv-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: #374151;
}
.tqv-total-row b { font-weight: 700; font-size: 15px; }
.tqv-remaining-row {
  background: #fff1f2; border-radius: 10px;
  padding: 10px 12px; margin-top: 2px;
}
.tqv-remaining-row span { font-weight: 700; color: #dc2626; }
.tqv-v-paid   { color: #16a34a !important; }
.tqv-v-unpaid { color: #dc2626 !important; font-size: 18px !important; }
.tqv-empty    { text-align: center; color: #94a3b8; padding: 28px 16px; font-size: 14px; }
.tqv-loading  { padding: 48px; text-align: center; color: #64748b; font-size: 14px; }
.tqv-footer {
  display: flex; gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.tqv-footer .btn { flex: 1; }

/* ══════════════════════════════════════════════════════════════
   PHASE 3 — shared grill-theme component foundation
   These selectors intentionally target reusable primitives only. Page-specific
   layouts, workflows, and business-state styling remain unchanged until Phase 4.
   ══════════════════════════════════════════════════════════════ */

::selection {
  background: var(--color-primary);
  color: var(--color-text);
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: .52;
  cursor: not-allowed;
}

.topbar,
.page-header,
.panel,
.data-card,
.modal-box,
.modal-card,
.modal-overlay .modal,
.modal-overlay .app-modal-box,
.notice,
.empty-state,
.empty-state-panel {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar,
.page-header {
  border-radius: var(--radius-card);
}

.panel,
.data-card,
.modal-box,
.modal-card {
  border-radius: var(--radius-card);
}

.modal,
.modal-overlay {
  background: rgba(10, 7, 5, .74);
}

.modal-header,
.modal-footer {
  border-color: var(--border);
}

.modal-close {
  color: var(--muted);
}

.modal-close:hover {
  background: var(--color-surface-interactive);
  color: var(--ink);
}

.btn.secondary:hover,
.btn.ghost:hover {
  background: var(--color-surface-interactive);
  color: var(--ink);
}

.btn.ghost {
  color: var(--accent);
  border-color: var(--border);
}

.pill,
.badge {
  background: rgba(63, 155, 109, .16);
  color: #8ed5aa;
}

.pill.warn,
.badge.warning {
  background: rgba(213, 154, 50, .16);
  color: #f0c66f;
}

.pill.bad,
.badge.danger {
  background: rgba(216, 87, 77, .17);
  color: #f29d95;
}

.pill.info,
.badge.info {
  background: rgba(103, 150, 201, .17);
  color: #a8c7ed;
}

.notice,
.empty-state {
  background: var(--color-surface);
}

.notice.error {
  background: rgba(216, 87, 77, .12);
}

th {
  background: var(--color-surface-raised);
  color: var(--ink);
}

tr {
  border-color: var(--border);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   PHASE 4A — login, application chrome, and live dashboard only
   No POS/order/inventory selectors are included in this section.
   ══════════════════════════════════════════════════════════════ */

/* Login */
.login {
  position: relative;
  isolation: isolate;
  padding: clamp(20px, 4vw, 56px);
  background: #17110e;
}

.login::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(216, 146, 54, .11) 1px, transparent 1px),
    linear-gradient(rgba(216, 146, 54, .08) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

.login-card {
  width: min(440px, 100%);
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid #624637;
  border-top: 4px solid var(--accent);
  background: #30231d;
}

.login-card .brand-mark {
  gap: 12px;
  margin-bottom: 30px;
}

.login-card .brand-logo-full {
  width: min(190px, 70%);
}

.login-card .sub {
  color: var(--color-text-muted);
  font-size: 13px;
}

.login-card .field span {
  color: var(--color-text);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.login-card input {
  min-height: 48px;
  background: #211813;
  border-color: #674b3b;
}

.login-card .btn {
  min-height: 52px;
  margin-top: 12px;
  background: var(--primary);
  letter-spacing: 0;
}

/* Application header and sidebar */
.sidebar {
  border-inline-end: 1px solid #4e382d;
  background: #1c1511;
  box-shadow: none;
}

.side-head {
  padding: 12px 8px 22px;
  border-bottom-color: rgba(247, 237, 220, .12);
}

.side-head .logo {
  width: 48px;
  height: 48px;
  padding: 5px;
  border: 1px solid #624637;
  background: #2d211a;
}

.side-head h2 {
  color: var(--color-text);
  font-size: 18px;
  letter-spacing: .01em;
}

.role-badge {
  background: rgba(216, 146, 54, .16);
  color: #f0c979;
  border: 1px solid rgba(216, 146, 54, .25);
}

.nav {
  gap: 5px;
  padding-top: 18px;
}

.nav button {
  position: relative;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #cfbeaa;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.nav button:hover {
  color: var(--color-text);
  background: #2b2019;
  border-color: #49352a;
}

.nav button.active {
  color: var(--color-text);
  background: #3a2920;
  border-color: #72503a;
  box-shadow: inset -3px 0 0 var(--accent);
}

.topbar,
.page-header {
  min-height: 84px;
  padding: 18px 20px;
  border-color: #594033;
  background: #251b16;
}

.topbar h1,
.page-header h1 {
  color: var(--color-text);
  font-size: clamp(21px, 2.2vw, 28px);
}

.topbar .sub,
.page-header .sub {
  margin-top: 3px;
  color: var(--color-text-muted);
}

.top-actions .pill {
  min-height: 32px;
  background: #35271f;
  color: var(--color-text);
  border: 1px solid #5a4031;
}

/* Live dashboard */
.ops-page {
  gap: 22px;
}

.ops-header {
  border: 1px solid #604434;
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius-card);
  background: #2b1f19;
  box-shadow: var(--shadow-sm);
}

.ops-header-title,
.ops-panel-title,
.ops-sec-title {
  color: var(--color-text) !important;
}

.ops-header-sub,
.ops-panel-sub,
.ops-sec-sub,
.ops-last-upd {
  color: var(--color-text-muted) !important;
}

.ops-live-badge {
  background: rgba(63, 155, 109, .14);
  color: #9cddaf;
  border: 1px solid rgba(63, 155, 109, .32);
}

.ops-live-dot {
  background: var(--success);
  box-shadow: none;
}

.ops-sys-badge {
  border-color: #594033;
  background: #211813;
}

.ops-kpi-grid,
.ops-station-grid,
.ops-content-grid,
.ops-detail-grid {
  gap: 14px;
}

.ops-kpi-card,
.ops-panel,
.ops-station-card,
.ops-tables-section {
  border-color: #5a4031;
  background: #2c201a;
  box-shadow: none;
}

.ops-kpi-card {
  min-height: 138px;
  border-top-width: 3px;
  border-radius: 12px;
}

.ops-kpi-card:hover {
  transform: translateY(-2px);
  background: #34251d;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

.ops-kpi-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #3b2b21;
  font-size: 21px;
}

.ops-kpi-val,
.ops-kpi-lbl,
.ops-kpi-hint,
.ops-kpi-of {
  color: var(--color-text) !important;
}

.ops-kpi-hint,
.ops-kpi-of {
  color: var(--color-text-muted) !important;
}

.ops-kpi-warn { border-color: var(--warning); }
.ops-kpi-ok { border-color: var(--success); }
.ops-kpi-info, .ops-kpi-blue { border-color: var(--info); }
.ops-kpi-danger { border-color: var(--danger); }
.ops-kpi-warn .ops-kpi-val { color: #f0c66f !important; }
.ops-kpi-ok .ops-kpi-val { color: #8ed5aa !important; }
.ops-kpi-info .ops-kpi-val, .ops-kpi-blue .ops-kpi-val { color: #a8c7ed !important; }
.ops-kpi-danger .ops-kpi-val { color: #f29d95 !important; }

.ops-kd-chip {
  border: 1px solid rgba(247, 237, 220, .12);
}

.ops-panel-hd,
.ops-cash-section,
.ops-stock-row,
.ops-tl-item,
.ops-sc-order,
.ops-rcpt-row {
  border-color: rgba(247, 237, 220, .10) !important;
}

.ops-feed-scroll::-webkit-scrollbar-thumb {
  background: #71503b;
}

.ops-tl-title,
.ops-sc-name,
.ops-sc-onum,
.ops-stock-name,
.ops-rcpt-row b,
.ops-rcpt-total b,
.ops-si-row b {
  color: var(--color-text) !important;
}

.ops-tl-sub,
.ops-tl-time,
.ops-sc-oloc,
.ops-sc-oage,
.ops-pay-time,
.ops-stock-min,
.ops-si-row span {
  color: var(--color-text-muted) !important;
}

.ops-station-card {
  border-radius: 12px;
}

.ops-station-active {
  box-shadow: inset 0 0 0 1px rgba(63, 155, 109, .38);
}

.ops-station-overdue {
  box-shadow: inset 0 0 0 1px rgba(216, 87, 77, .48);
}

.ops-table-card {
  background: #34251d;
  border-color: #5a4031;
}

.ops-empty,
.ops-empty b {
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .topbar,
  .page-header {
    min-height: auto;
    padding: 15px;
    border-radius: 12px;
  }

  .ops-header {
    border-radius: 12px;
  }

  .ops-header-main,
  .ops-header-actions {
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════════════════════
   PHASE 4B — POS surface only
   Existing POS markup, IDs, data attributes, and event handlers are retained.
   ══════════════════════════════════════════════════════════════ */

.pos {
  gap: 18px;
  align-items: start;
}

.pos-left-panel,
.pos-cart-panel {
  border-color: #5d4334;
  background: #271c17;
  box-shadow: var(--shadow-sm);
}

.pos-left-panel {
  gap: 14px;
}

.pos-row1 {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(247, 237, 220, .11);
}

.pos .seg {
  overflow: hidden;
  border-color: #5d4334;
  border-radius: 10px;
  background: #1d1511;
}

.pos .seg button {
  min-height: 40px;
  color: var(--color-text-muted);
  border-inline-start-color: #5d4334;
}

.pos .seg button:hover {
  color: var(--color-text);
  background: #33251d;
}

.pos .seg button.active {
  background: var(--primary);
  color: var(--color-text);
}

.pos-product-search {
  min-height: 46px;
  padding-inline: 15px;
  border-color: #5d4334;
  border-radius: 10px;
  background: #1c1410;
  color: var(--color-text);
}

.pos-product-search::placeholder {
  color: #a99580;
}

/* Category navigation */
.pos-category-section {
  top: -18px;
  z-index: 11;
  margin-inline: -18px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #5d4334;
  background: #271c17;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .16);
}

.pos-category-title {
  padding-bottom: 8px;
  color: var(--color-text-muted);
  font-size: 11px;
  letter-spacing: .03em;
}

.pos-category-bubbles {
  gap: 7px;
}

.pos-category-chip {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #5c4334;
  border-radius: 8px;
  background: #33251d;
  color: var(--color-text-muted);
  box-shadow: none;
}

.pos-category-chip:hover {
  border-color: #9a6c42;
  background: #423025;
  color: var(--color-text);
}

.pos-category-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--color-text);
  box-shadow: none;
}

.pos-category-chip-count {
  background: rgba(247, 237, 220, .13);
  color: inherit;
}

.pos-category-chip.active .pos-category-chip-count {
  background: rgba(255, 255, 255, .18);
}

.pos-quick-products {
  border-color: #765337;
  border-radius: 12px;
  background: #30231b;
}

.pos-quick-products-title {
  color: #edc97a;
}

.pos-quick-product-btn {
  min-height: 56px;
  border-color: #624637;
  border-radius: 8px;
  background: #211813;
  color: var(--color-text);
}

.pos-quick-product-btn:hover {
  border-color: var(--accent);
  background: #38271d;
}

/* Product cards */
.pos-products-meta {
  color: var(--color-text-muted);
}

.pos-products {
  gap: 12px;
}

.pos-product {
  min-height: 142px;
  border-color: #5d4334;
  border-radius: 12px;
  background: #30231d;
  box-shadow: none;
}

.pos-product::before {
  background: var(--accent);
}

.pos-product:hover {
  border-color: #966943;
  background: #39291f;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .18);
}

.pos-product.barista::before { background: var(--info); }
.pos-product.kitchen::before { background: var(--primary); }
.pos-product.shisha::before { background: #9b7bc9; }
.pos-product.offer::before { background: var(--accent); }

.pos-product.barista:hover,
.pos-product.kitchen:hover,
.pos-product.shisha:hover,
.pos-product.offer:hover {
  border-color: #966943;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .18);
}

.pos-product-cat {
  color: var(--color-text-muted);
}

.pos-product-name {
  color: var(--color-text);
}

.pos-product-price {
  color: #f0c979;
}

.pos-route-badge {
  border: 1px solid rgba(247, 237, 220, .15);
}

.pos-route-badge.barista { background: rgba(103, 150, 201, .18); color: #b5d1f3; }
.pos-route-badge.kitchen { background: rgba(184, 50, 39, .18); color: #f0a198; }
.pos-route-badge.shisha { background: rgba(155, 123, 201, .18); color: #d6c0f4; }
.pos-route-badge.offer { background: rgba(216, 146, 54, .18); color: #f0c979; }

.pos-add-btn {
  border-radius: 8px;
  background: var(--primary);
  color: var(--color-text);
}

.pos-add-btn:hover {
  background: var(--primary-dark);
}

.pos-offer-savings {
  background: rgba(63, 155, 109, .16);
  color: #9cddaf;
}

/* Table selection */
.pos-choose-table-btn {
  border: 1px solid #85603d;
  background: #3b2a1e;
  color: #f0c979;
}

.pos-selected-table-pill,
.pos-cart-table-info {
  border-color: #7f5a39;
  background: #38291f;
  color: var(--color-text);
}

.pos-change-table-btn {
  border-color: #8e643e;
  background: transparent;
  color: #f0c979;
}

.pos-change-table-btn:hover {
  border-color: var(--accent);
  background: rgba(216, 146, 54, .14);
}

.pos-clear-table-btn {
  color: #e68d85;
}

.pos-session-badge {
  border-color: rgba(63, 155, 109, .36);
  background: rgba(63, 155, 109, .15);
  color: #9cddaf;
}

.pos-table-modal {
  background: rgba(10, 7, 5, .78);
}

.pos-table-modal-box {
  border: 1px solid #634736;
  border-radius: 14px;
  background: #271c17;
  box-shadow: var(--shadow);
}

.pos-table-modal-head {
  border-bottom-color: #5d4334;
}

.pos-table-modal-head h3 {
  color: var(--color-text);
}

.pos-table-modal-search {
  border-color: #5d4334;
  background: #1d1511;
  color: var(--color-text);
}

.pos-table-modal-search:focus {
  border-color: var(--accent);
}

.pos-table-modal-zones,
.pos-table-modal-status-bar {
  border-color: #5d4334;
}

.pos-table-modal .zone-chip {
  border-color: #5d4334;
  background: #33251d;
  color: var(--color-text-muted);
}

.pos-table-modal .zone-chip:hover,
.pos-table-modal .zone-chip.active {
  border-color: var(--accent);
  background: #453025;
  color: var(--color-text);
}

.pos-table-modal-grid::-webkit-scrollbar-thumb {
  background: #73513b;
}

.pos-modal-table-card {
  border-color: #5d4334;
  border-radius: 10px;
  background: #30231d;
}

.pos-modal-table-card.available,
.pos-modal-table-card.occupied,
.pos-modal-table-card.reserved {
  background: #30231d;
}

.pos-modal-table-card.available { border-color: rgba(63, 155, 109, .52); }
.pos-modal-table-card.occupied { border-color: rgba(216, 87, 77, .58); }
.pos-modal-table-card.reserved { border-color: rgba(103, 150, 201, .52); }
.pos-modal-table-card.locked { border-color: #4e3a2e; background: #211813; }
.pos-modal-table-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(216, 146, 54, .25); }
.pos-modal-table-card:hover { border-color: var(--accent); background: #39291f; box-shadow: none; }
.pos-modal-table-name { color: var(--color-text); }

/* Cart and order summary */
.pos-cart-panel {
  border-top: 3px solid var(--primary);
  border-radius: 14px;
}

.pos-cart-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(247, 237, 220, .11);
}

.pos-cart-header h2 {
  color: var(--color-text);
}

.pos-cart-count {
  background: var(--primary);
  color: var(--color-text);
}

.pos-cart-empty {
  min-height: 210px;
  justify-content: center;
  color: var(--color-text-muted);
}

.pos-cart-line {
  padding: 13px 0;
  border-bottom-color: rgba(247, 237, 220, .11);
}

.pos-cart-line-offer {
  margin-inline: -8px;
  background: rgba(216, 146, 54, .10);
}

.pos-cart-line-name {
  color: var(--color-text);
}

.pos-cart-line-unit {
  color: var(--color-text-muted);
}

.pos-cart-notes {
  border-color: #5d4334;
  background: #1d1511;
  color: var(--color-text);
}

.pos-qty-row .icon-btn {
  border: 1px solid #624637;
  background: #38291f;
  color: var(--color-text);
}

.pos-cart-line-total,
.pos-totals-grand strong {
  color: #f0c979;
}

.pos-remove-btn {
  border-color: rgba(216, 87, 77, .46);
  background: rgba(216, 87, 77, .12);
  color: #f29d95;
}

.pos-remove-btn:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--color-text);
}

.pos-totals {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #5d4334;
  border-radius: 10px;
  background: #211813;
}

.pos-totals-row {
  color: var(--color-text-muted);
}

.pos-totals-row b,
.pos-totals-grand {
  color: var(--color-text);
}

.pos-totals-grand {
  border-top-color: #634736;
}

.pos-cart-actions {
  padding-top: 14px;
  border-top: 1px solid rgba(247, 237, 220, .11);
}

.pos-submit-btn {
  min-height: 50px;
}

@media (max-width: 1100px) {
  .pos { gap: 14px; }
}

@media (max-width: 640px) {
  .pos-left-panel,
  .pos-cart-panel { padding: 14px; }

  .pos-category-section {
    top: -14px;
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .pos .seg {
    width: 100%;
    overflow-x: auto;
  }

  .pos .seg button { flex: 1 0 auto; }
}

/* ══════════════════════════════════════════════════════════════
   PHASE 5 — charcoal grill palette across application surfaces
   Neutral charcoal replaces the brown base. Ember red and warm gold are used
   only for meaningful actions and highlights.
   ══════════════════════════════════════════════════════════════ */

body,
.main,
.ops-page {
  background: var(--color-canvas) !important;
}

.main {
  color: var(--color-text);
}

/* Common application surfaces. Print preview is intentionally excluded. */
.main :where(
  .panel,
  .data-card,
  .card,
  [class*="-panel"],
  [class*="-card"]
):not(.print-preview):not(.thermal-preview) {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.main :where(h1, h2, h3, h4, h5, th, td, label, b, strong) {
  color: var(--color-text);
}

.main :where(p, small, .sub, [class*="-meta"], [class*="-hint"], [class*="-muted"]) {
  color: var(--color-text-muted);
}

.main :where(input, select, textarea) {
  border-color: var(--color-border);
  background: #181818;
  color: var(--color-text);
}

.main :where(input, select, textarea)::placeholder {
  color: #9c9c9c;
}

.main :where(table, thead, tbody, tr, td, th) {
  border-color: var(--color-border);
}

.main th {
  background: var(--color-surface-raised);
}

.main :where(.topbar, .page-header) {
  background: #202020;
  border-color: #464646;
}

/* Application navigation: charcoal only, with a small gold selection cue. */
.sidebar {
  border-inline-end-color: #363636;
  background: #171717;
}

.side-head,
.nav button.active {
  border-color: #3e3e3e;
}

.side-head .logo {
  border-color: #484848;
  background: #242424;
}

.nav button {
  color: #c8c0b6;
}

.nav button:hover {
  border-color: #3f3f3f;
  background: #262626;
}

.nav button.active {
  background: #2b2b2b;
  box-shadow: inset -3px 0 0 var(--accent);
}

.role-badge {
  border-color: rgba(221, 166, 75, .32);
  background: rgba(221, 166, 75, .13);
  color: #f0c979;
}

/* Live dashboard: fixes the old light canvas shown behind dark cards. */
.ops-page {
  padding: 0 0 60px;
}

.ops-header,
.ops-kpi-card,
.ops-panel,
.ops-station-card,
.ops-tables-section {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}

.ops-header {
  border-inline-start-color: var(--accent) !important;
}

.ops-kpi-card:hover,
.ops-table-card:hover,
.ops-station-card:hover {
  background: var(--color-surface-raised) !important;
}

.ops-kpi-icon {
  background: #303030;
}

.ops-kd-chip,
.ops-sc-count,
.ops-sys-badge,
.ops-live-badge {
  background-color: #292929;
  border-color: #484848;
}

.ops-feed-alerts,
.ops-cash-alert,
.ops-credit-alert,
.ops-sc-overdue {
  background: rgba(200, 66, 52, .12);
  border-color: rgba(218, 98, 88, .36);
}

.ops-table-card,
.ops-rcpt-row,
.ops-pay-row,
.ops-cmove-row {
  background-color: transparent;
}

/* POS and modal surfaces use neutral charcoal, not brown. */
.pos-left-panel,
.pos-cart-panel,
.pos-category-section,
.pos-table-modal-box,
.pos-product,
.pos-modal-table-card,
.pos-quick-products {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}

.pos-product-search,
.pos-cart-notes,
.pos-table-modal-search,
.pos-totals,
.pos .seg,
.pos-quick-product-btn,
.pos-category-chip,
.pos-modal-table-card.locked {
  background: #181818 !important;
  border-color: #474747 !important;
}

.pos-category-chip:hover,
.pos-quick-product-btn:hover,
.pos-modal-table-card:hover,
.pos-product:hover,
.pos .seg button:hover {
  background: var(--color-surface-raised) !important;
  border-color: #626262 !important;
}

.pos-selected-table-pill,
.pos-cart-table-info,
.pos-choose-table-btn {
  background: #292929;
  border-color: #5b5b5b;
}

.pos-add-btn,
.pos-submit-btn,
.btn:not(.secondary):not(.ghost):not(.warn):not(.bad):not(.ok):not(.info) {
  background: var(--primary);
}

.pos-add-btn:hover,
.pos-submit-btn:hover,
.btn:not(.secondary):not(.ghost):not(.warn):not(.bad):not(.ok):not(.info):hover {
  background: var(--primary-dark);
}

/* Preserve semantic state colors without returning to pale backgrounds. */
.badge.success,
.pill:not(.warn):not(.bad):not(.info) {
  background: rgba(84, 168, 120, .16);
  color: #9cddaf;
}

.badge.warning,
.pill.warn,
.badge.warn {
  background: rgba(217, 164, 65, .16);
  color: #f0c979;
}

.badge.danger,
.pill.bad,
.badge.bad {
  background: rgba(218, 98, 88, .16);
  color: #f29d95;
}

.badge.info,
.pill.info {
  background: rgba(115, 157, 204, .16);
  color: #b5d1f3;
}

/* Public and QR menus share the same charcoal restaurant identity. */
.customer-menu-page,
.customer-qr-menu-page {
  background: var(--color-canvas) !important;
  color: var(--color-text);
}

.customer-menu-container,
.customer-qr-menu-container {
  color: var(--color-text);
}

.customer-menu-hero,
.customer-qr-menu-header,
.customer-menu-cart,
.qr-drawer,
.customer-qr-cart,
.customer-menu-success,
.customer-menu-closed {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text);
}

.customer-menu-hero::before,
.customer-menu-hero::after {
  opacity: 0 !important;
}

.customer-menu-hero-title,
.customer-qr-menu-header :is(h1, h2),
.customer-qr-product-title,
.customer-menu-cart-head h2,
.qr-drawer-title,
.qr-cart-line-name,
.qr-drawer-total-row b,
.qr-drawer-total-final :is(span, b) {
  color: var(--color-text) !important;
}

.customer-menu-hero-sub,
.customer-menu-hero-desc,
.customer-qr-product-description,
.customer-qr-product-category,
.qr-cart-line-sub,
.qr-cart-line-unit,
.customer-menu-muted {
  color: var(--color-text-muted) !important;
}

.customer-qr-menu-search input,
.customer-menu-note-input,
.qr-cart-note {
  border-color: var(--color-border);
  background: #181818;
  color: var(--color-text);
}

.customer-qr-category-chip,
.customer-menu-icon-button,
.qr-cart-qty-btn {
  border-color: var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.customer-qr-category-chip.active,
.customer-menu-add-button,
.customer-qr-add-button,
.qr-drawer-submit {
  background: var(--primary) !important;
  border-color: var(--primary);
  color: var(--color-text);
}

.customer-qr-product-card,
.customer-menu-cart-line,
.qr-cart-line {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.customer-qr-product-placeholder,
.customer-qr-product-image {
  background: var(--color-surface-raised);
}

.customer-qr-product-price,
.qr-cart-line-total,
.customer-menu-cart-total b {
  color: #f0c979 !important;
}

/* ELRock public menu — warm espresso and gold from the restaurant logo.
   Kept separate from the dark POS workspace so the customer menu remains
   bright, calm, and easy to scan on a phone. */
.customer-menu-page {
  --elrock-espresso: var(--menu-primary, #5a3b1a);
  --elrock-gold: var(--menu-accent, #d8bf53);
  --elrock-cream: var(--menu-bg, #f7f1e5);
  --elrock-card: var(--menu-card, #ffffff);
  --elrock-ink: #2c1b0c;
  --elrock-muted: #725e49;
  background: linear-gradient(180deg, var(--elrock-cream) 0%, #fffdf8 56%, var(--elrock-cream) 100%) !important;
  color: var(--elrock-ink) !important;
}

.customer-menu-page .customer-menu-hero {
  background: linear-gradient(135deg, var(--elrock-espresso) 0%, #3d260f 100%) !important;
  border: 1px solid rgba(216, 191, 83, .36) !important;
  box-shadow: 0 12px 30px rgba(61, 38, 15, .24) !important;
}

.customer-menu-page .customer-menu-hero::before,
.customer-menu-page .customer-menu-hero::after { opacity: 1 !important; }
.customer-menu-page .customer-menu-hero::before { border-color: rgba(216, 191, 83, .20); }
.customer-menu-page .customer-menu-hero-mark {
  background: #fffaf0;
  border-color: rgba(216, 191, 83, .72);
}

.customer-menu-page :is(.customer-menu-hero-title, .customer-menu-hero-sub, .customer-menu-hero-desc) { color: var(--menu-hero-text, #fff) !important; }
.customer-menu-page .customer-menu-badge { color: #fff7d6; background: rgba(216, 191, 83, .16); border-color: rgba(216, 191, 83, .45); }
.customer-menu-page :is(.customer-menu-table-badge, .customer-menu-hero-cta) { background: var(--elrock-gold); color: #2c1b0c; }

.customer-menu-page .customer-search-input {
  background: rgba(255,255,255,.94) !important;
  border-color: #dfcfb7 !important;
  color: var(--elrock-ink) !important;
}
.customer-menu-page .customer-search-input:focus { border-color: var(--elrock-gold) !important; box-shadow: 0 0 0 3px rgba(216,191,83,.24) !important; }
.customer-menu-page .customer-chip { background: #fffaf1; border-color: #dfcfb7; color: #513719; }
.customer-menu-page .customer-chip.active,
.customer-menu-page .customer-chip:hover { background: var(--elrock-espresso); border-color: var(--elrock-espresso); color: #fff; }

.customer-menu-page :is(.customer-product-section-title, .customer-offers-title) { color: var(--elrock-espresso) !important; }
.customer-menu-page :is(.customer-product-section-sub, .customer-offers-sub, .customer-product-desc) { color: var(--elrock-muted) !important; }
.customer-menu-page .customer-product-card {
  background: var(--elrock-card) !important;
  border-color: #eadcc8 !important;
  box-shadow: 0 5px 18px rgba(90,59,26,.08) !important;
}
.customer-menu-page .customer-product-name { color: var(--elrock-espresso) !important; }
.customer-menu-page .customer-product-price { color: var(--elrock-gold) !important; }
.customer-menu-page .customer-product-cat-badge { background: #fbf0cf; color: #79561c; }
.customer-menu-page .customer-product-img-wrap,
.customer-menu-page .customer-product-img-placeholder { background: #f5ead9 !important; }

.customer-menu-page :is(.customer-add-btn, .customer-menu-add-button, .customer-featured-offer-btn) { background: var(--menu-button, #5a3b1a) !important; color: var(--menu-button-text, #fff) !important; }
.customer-menu-page :is(.customer-add-btn:hover, .customer-menu-add-button:hover, .customer-featured-offer-btn:hover) { background: #3d260f !important; }
.customer-menu-page .customer-add-btn.secondary-btn,
.customer-menu-page .customer-menu-add-button.secondary { background: var(--elrock-gold) !important; color: #2c1b0c !important; }

.customer-menu-page .qcb { background: var(--elrock-espresso) !important; border-top: 1px solid rgba(216,191,83,.30); }
.customer-menu-page .qcb-badge,
.customer-menu-page .qcb-btn { background: var(--elrock-gold) !important; color: #2c1b0c !important; }
.customer-menu-page .qr-drawer-head { background: var(--elrock-espresso) !important; }
.customer-menu-page .qr-drawer,
.customer-menu-page .qr-drawer-footer { background: #fffdf8 !important; border-color: #eadcc8 !important; }
.customer-menu-page :is(.qr-cart-line-name, .qr-drawer-total-row b, .qr-drawer-total-final :is(span, b)) { color: var(--elrock-ink) !important; }
.customer-menu-page .qr-cart-line-total { color: var(--elrock-espresso) !important; }

/* Shared admin loading state — replaces the old development-only notice. */
.page-loading-state {
  min-height: 180px;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 8px;
}
.page-loading-state h2,
.page-loading-state p { margin: 0; }
.page-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(216, 191, 83, .24);
  border-top-color: #d8bf53;
  border-radius: 50%;
  animation: pageLoadingSpin .75s linear infinite;
}
@keyframes pageLoadingSpin { to { transform: rotate(360deg); } }

/* Distinct section layout: the menu controls, offers, and products each have
   their own surface and visual rhythm instead of reading as one long list. */
.customer-menu-page .customer-menu-explorer {
  position: relative;
  overflow: hidden;
  margin: 14px 0 16px;
  padding: 18px;
  border: 1px solid #e5d5bd;
  border-radius: 22px;
  background: rgba(255, 252, 245, .88);
  box-shadow: 0 8px 24px rgba(90, 59, 26, .06);
}
.customer-menu-page .customer-menu-explorer::after {
  content: "";
  position: absolute;
  inset: auto -32px -50px auto;
  width: 150px;
  height: 150px;
  border: 22px solid rgba(216, 191, 83, .14);
  border-radius: 50%;
  pointer-events: none;
}
.customer-menu-toolbar-head,
.customer-menu-page .customer-product-section-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.customer-menu-toolbar-head { margin-bottom: 14px; }
.customer-menu-toolbar-head h2 {
  margin: 3px 0 0;
  color: var(--elrock-espresso);
  font-size: clamp(19px, 3vw, 25px);
  line-height: 1.15;
}
.customer-section-kicker {
  display: block;
  color: #9d7c27;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1;
}
.customer-products-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #e5cc74;
  border-radius: 999px;
  background: #fff8dc;
  color: #624617;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.customer-menu-page .customer-search-wrap { position: relative; z-index: 1; margin-bottom: 13px; }
.customer-menu-page .customer-search-icon {
  position: absolute;
  top: 50%;
  right: 17px;
  z-index: 1;
  transform: translateY(-52%);
  color: #896c41;
  font-size: 26px;
  font-weight: 700;
  pointer-events: none;
  line-height: 1;
}
.customer-menu-page .customer-search-input { padding-right: 50px; }
.customer-menu-page .customer-category-chips {
  position: relative;
  z-index: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: thin;
  scrollbar-color: #d8bf53 transparent;
}
.customer-menu-page .customer-category-chips::-webkit-scrollbar { height: 5px; }
.customer-menu-page .customer-category-chips::-webkit-scrollbar-thumb { background: #d8bf53; border-radius: 10px; }
.customer-menu-page .customer-chip { min-height: 40px; padding: 8px 18px; }

.customer-menu-page .customer-products-section {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #e9ddcc;
  border-radius: 24px;
  background: rgba(255, 255, 255, .62);
}
.customer-menu-page .customer-product-section-header {
  margin: 0 0 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eadcc8;
}
.customer-menu-page .customer-product-section-title { margin-top: 4px; }
.customer-menu-page .customer-product-grid { gap: 16px; }
.customer-menu-page .customer-product-card { position: relative; border-radius: 16px; }
.customer-menu-page .customer-product-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 4px;
  background: linear-gradient(90deg, var(--elrock-espresso), var(--elrock-gold));
}
.customer-menu-page .customer-product-img-wrap { border-bottom: 1px solid #f0e7d9; }

@media (max-width: 640px) {
  .customer-menu-page .customer-menu-explorer,
  .customer-menu-page .customer-products-section { padding: 15px; border-radius: 18px; }
  .customer-menu-page .desktop-count { display: none; }
  .customer-menu-page .customer-product-grid { gap: 11px; }
}

/* Override the legacy dark-only component layer when the admin chooses light. */
:root[data-theme="light"] .main :where(input, select, textarea),
:root[data-theme="light"] .pos-product-search,
:root[data-theme="light"] .pos-cart-notes,
:root[data-theme="light"] .pos-table-modal-search,
:root[data-theme="light"] .pos-totals,
:root[data-theme="light"] .pos .seg,
:root[data-theme="light"] .pos-quick-product-btn,
:root[data-theme="light"] .pos-category-chip,
:root[data-theme="light"] .pos-modal-table-card.locked {
  background: var(--color-surface-raised) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
:root[data-theme="light"] .main :where(.topbar, .page-header) {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}
:root[data-theme="light"] .sidebar {
  border-inline-end-color: rgba(216, 191, 83, .35);
  background: linear-gradient(160deg, var(--sidebar), var(--sidebar-2));
}
:root[data-theme="light"] .side-head,
:root[data-theme="light"] .nav button.active { border-color: rgba(255, 255, 255, .18); }
:root[data-theme="light"] .side-head .logo { background: #fffaf0; border-color: rgba(216, 191, 83, .55); }
:root[data-theme="light"] .nav button { color: #f9ebd3; }
:root[data-theme="light"] .nav button:hover { background: rgba(255,255,255,.10); border-color: rgba(216,191,83,.45); }
:root[data-theme="light"] .nav button.active { background: rgba(255,255,255,.14); }
:root[data-theme="light"] .role-badge { background: rgba(216,191,83,.17); color: #fff0a9; }
:root[data-theme="light"] .ops-kpi-icon { background: #f1e5d3; }
:root[data-theme="light"] :is(.ops-kd-chip, .ops-sc-count, .ops-sys-badge, .ops-live-badge) {
  background-color: #f7eddd;
  border-color: #dfcfb7;
}
:root[data-theme="light"] :is(.pos-selected-table-pill, .pos-cart-table-info, .pos-choose-table-btn) {
  background: #f7eddd;
  border-color: #dfcfb7;
}
:root[data-theme="light"] .badge.success,
:root[data-theme="light"] .pill:not(.warn):not(.bad):not(.info) { background: #e7f5eb; color: #19734a; }
:root[data-theme="light"] :is(.badge.warning, .pill.warn, .badge.warn) { background: #fff4d9; color: #9a6414; }

/* Light mode contrast: strong actions must use light text on brand/danger
   fills, while neutral controls retain dark readable text. */
:root[data-theme="light"] .btn:not(.secondary):not(.ghost),
:root[data-theme="light"] .pos-add-btn,
:root[data-theme="light"] .pos-submit-btn,
:root[data-theme="light"] .qcb-btn {
  color: #fffaf2 !important;
}
:root[data-theme="light"] .btn.bad,
:root[data-theme="light"] .btn.warn,
:root[data-theme="light"] .btn.ok,
:root[data-theme="light"] .btn.info { color: #fff !important; }
:root[data-theme="light"] .btn.secondary {
  background: #f0e5d4;
  border-color: #d8c2a4;
  color: #3d260f;
}
:root[data-theme="light"] .btn.ghost {
  background: #fffaf2;
  border-color: #cdb18a;
  color: #5a3b1a;
}
:root[data-theme="light"] .top-actions .pill.info {
  background: #edf4ff;
  color: #356d9e;
  border-color: #b9d2ed;
}
:root[data-theme="light"] .pos-product-price,
:root[data-theme="light"] .cart-total-value { color: #8a6517; }

/* Table picker in light mode: lift the dialog without dimming the whole POS
   into near-black, and keep its chips readable against the white surface. */
:root[data-theme="light"] .pos-table-modal {
  background: rgba(57, 38, 19, .38) !important;
  backdrop-filter: blur(2px);
}
:root[data-theme="light"] .pos-table-modal-box {
  background: #fffdf9 !important;
  border-color: #d8c2a4 !important;
  box-shadow: 0 24px 72px rgba(61, 38, 15, .24) !important;
}
:root[data-theme="light"] .pos-table-modal-head {
  background: #fffaf2;
  border-bottom-color: #dfcfb7 !important;
}
:root[data-theme="light"] .pos-table-modal .zone-chip {
  background: #fffaf2 !important;
  border-color: #dcc5a5 !important;
  color: #513719 !important;
}
:root[data-theme="light"] .pos-table-modal .zone-chip.active,
:root[data-theme="light"] .pos-table-modal .zone-chip:hover {
  background: #5a3b1a !important;
  border-color: #5a3b1a !important;
  color: #fffaf2 !important;
}
:root[data-theme="light"] .pos-table-modal .zone-chip small { color: inherit; }
:root[data-theme="light"] .pos-table-modal-grid {
  background: #fffdf9;
  border-top: 1px solid #eadcc8;
}
:root[data-theme="light"] .pos-table-modal-grid > .notice {
  grid-column: 1 / -1;
  min-height: 96px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px dashed #d8c2a4;
  border-radius: 14px;
  background: #fffaf2;
  color: #725e49;
}
