/* =============================================================================
   CRM «Вічність» — Strict Utilitarian Monochrome Design System (Light & Dark)
   Zero gradients · Zero blur/glass · Zero animations · Instant & Predictable
   ============================================================================= */

@font-face {
  font-family: 'e-Ukraine';
  src: url('../../fonts/e-Ukraine-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'e-Ukraine';
  src: url('../../fonts/e-Ukraine-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'e-Ukraine';
  src: url('../../fonts/e-Ukraine-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'e-UkraineHead';
  src: url('../../fonts/e-UkraineHead-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'e-UkraineHead';
  src: url('../../fonts/e-UkraineHead-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── 1. Design Tokens (Light Theme Default) ──────────────────────────────── */
:root {
  --paper: #F4F4F5;
  --surface: #FFFFFF;
  --surface-1: #FFFFFF;
  --surface-2: #F4F4F5;
  --surface-3: #E4E4E7;
  --glass: #FFFFFF;

  --ink: #111113;
  --ink-soft: #52525B;
  --ink-faint: #71717A;

  --line: #E4E4E7;
  --line-strong: #D4D4D8;

  /* Strict Monochrome Primary Accent */
  --primary: #18181B;
  --primary-hover: #27272A;
  --primary-fg: #FFFFFF;
  --primary-soft: #ECECEF;

  /* Legacy aliases mapped strictly to monochrome */
  --ink-violet: #18181B;
  --ink-violet-2: #27272A;
  --ink-violet-deep: #09090B;
  --gold: #3F3F46;
  --gold-soft: #F4F4F5;
  --sky-soft: #F4F4F5;

  /* Restrained Functional Semantic States (Status/SLA/Errors only) */
  --success: #166534;
  --success-soft: #ECFDF5;
  --danger: #B91C1C;
  --danger-soft: #FEF2F2;
  --warning: #92400E;
  --warning-soft: #FEF3C7;

  /* Crisp Architectural Geometry */
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 5px;
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);

  --font-display: 'e-UkraineHead', 'e-Ukraine', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'e-Ukraine', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sidebar-w: 236px;

  /* Light Mode Monochrome Sidebar */
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E4E4E7;
  --sidebar-text: #111113;
  --sidebar-text-muted: #52525B;
  --sidebar-hover-bg: #F4F4F5;
  --sidebar-active-bg: #18181B;
  --sidebar-active-text: #FFFFFF;
}

/* ─── 2. Design Tokens (Dark Theme) ───────────────────────────────────────── */
[data-theme="dark"] {
  --paper: #0A0A0C;
  --surface: #121215;
  --surface-1: #121215;
  --surface-2: #1A1A1F;
  --surface-3: #26262D;
  --glass: #121215;

  --ink: #F4F4F5;
  --ink-soft: #A1A1AA;
  --ink-faint: #71717A;

  --line: #242429;
  --line-strong: #383842;

  /* Strict Monochrome Inverted Primary Accent in Dark Mode */
  --primary: #F4F4F5;
  --primary-hover: #E4E4E7;
  --primary-fg: #09090B;
  --primary-soft: #222228;

  /* Legacy aliases mapped strictly to dark monochrome */
  --ink-violet: #F4F4F5;
  --ink-violet-2: #E4E4E7;
  --ink-violet-deep: #D4D4D8;
  --gold: #D4D4D8;
  --gold-soft: #1F1F25;
  --sky-soft: #1F1F25;

  /* Restrained Semantic States for Dark Mode */
  --success: #4ADE80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.12);

  --shadow-sm: none;
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.55);

  /* Dark Mode Monochrome Sidebar */
  --sidebar-bg: #0E0E11;
  --sidebar-border: #242429;
  --sidebar-text: #F4F4F5;
  --sidebar-text-muted: #A1A1AA;
  --sidebar-hover-bg: #1A1A1F;
  --sidebar-active-bg: #F4F4F5;
  --sidebar-active-text: #09090B;
}

/* ─── 3. Global Strict Reset & Zero-Animation Guarantee ───────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  transition: none !important;
  animation: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Keep minimal spinner rotation strictly for loading indicators */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  animation: spin 0.75s linear infinite !important;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  font-size: 14px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13.5px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

body.guest-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
body.guest-page main {
  flex: 1 0 auto;
}

/* Hide any legacy decorative blob layers */
.blob-layer,
.blob {
  display: none !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
}

a {
  color: inherit;
}
button {
  font-family: inherit;
}
img {
  max-width: 100%;
  display: block;
}

/* ─── 4. App Shell, Sidebar & Topbar ──────────────────────────────────────── */
.shell {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  margin: 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 54px;
}
.sidebar-profile:hover {
  background: var(--sidebar-hover-bg);
}

.avatar {
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
}
.sidebar-profile .avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.sidebar-profile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-profile-email {
  font-size: 11px;
  color: var(--sidebar-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--sidebar-text-muted);
  margin-bottom: 2px;
}
.sidebar-nav a ion-icon {
  font-size: 17px;
  flex-shrink: 0;
  color: inherit;
}
.sidebar-nav a span:not(.sidebar-nav-badge) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
}

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.sidebar-nav a.active .sidebar-nav-badge {
  background: rgba(128, 128, 128, 0.22);
  color: var(--sidebar-active-text);
  border-color: transparent;
}

/* Sidebar Accordions */
.sidebar-accordion {
  margin-bottom: 2px;
}
.sidebar-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.sidebar-accordion-toggle ion-icon:first-child {
  font-size: 17px;
  flex-shrink: 0;
}
.sidebar-accordion-toggle .sidebar-accordion-label {
  flex: 1;
}
.sidebar-accordion-chevron {
  font-size: 13px;
  opacity: 0.65;
  flex-shrink: 0;
}
.sidebar-accordion.open .sidebar-accordion-chevron {
  transform: rotate(180deg);
}
.sidebar-accordion-toggle:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
}
.sidebar-accordion.active-parent > .sidebar-accordion-toggle {
  color: var(--sidebar-text);
  background: var(--sidebar-hover-bg);
  font-weight: 700;
}

.sidebar-submenu {
  display: none;
  padding: 3px 0 4px 10px;
  margin-left: 16px;
  border-left: 1px solid var(--sidebar-border);
  flex-direction: column;
  gap: 2px;
}
.sidebar-accordion.open .sidebar-submenu {
  display: flex;
}
.sidebar-submenu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sidebar-text-muted);
  margin-bottom: 0;
}
.sidebar-submenu a ion-icon {
  font-size: 15px;
  flex-shrink: 0;
}
.sidebar-submenu a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
}
.sidebar-submenu a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.sidebar-footer-nav {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-logout {
  color: var(--danger) !important;
}
.sidebar-logout:hover {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

html.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar {
  display: none;
}
html.sidebar-collapsed .main,
body.sidebar-collapsed .main {
  margin-left: 0 !important;
}

/* Topbar */
.topbar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  height: 54px;
  min-height: 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-burger {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-burger:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.topbar-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-kbd-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.topbar-kbd-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}

.theme-switch-group {
  display: inline-flex;
  background: var(--surface-2);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  gap: 2px;
}
.theme-switch-btn {
  width: 30px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
}
.theme-switch-btn:hover {
  color: var(--ink);
}
.theme-switch-btn.active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 55;
}
.sidebar-overlay.open {
  display: block;
}

.page {
  flex: 1 0 auto;
  padding: 18px 22px 48px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 0 0 4px;
  color: var(--ink);
  line-height: 1.25;
}
.page-sub {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0;
  line-height: 1.45;
}

/* ─── 5. Buttons (Strict, Flat, Crisp Geometry) ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none !important;
  user-select: none;
}
.btn ion-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg) !important;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-fg) !important;
}

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF !important;
}
.btn-danger:hover {
  opacity: 0.9;
}
.btn-outline.btn-danger,
.btn-danger.btn-outline {
  background: transparent !important;
  border: 1px solid var(--danger) !important;
  color: var(--danger) !important;
}
.btn-outline.btn-danger:hover,
.btn-danger.btn-outline:hover {
  background: var(--danger-soft) !important;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-sm ion-icon {
  font-size: 14px;
}
.btn-block {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── 6. Cards & Stat Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}
.card:has(.custom-select-wrapper.is-open),
.card:has(.custom-div-select-options.is-open),
.card:has(.custom-div-select-options:not([style*="display: none"]):not([style*="display:none"])),
.card:has(.custom-dish-dropdown:not([style*="display: none"]):not([style*="display:none"])),
.card:has(.dropdown-export-menu[style*="display: block"]),
.card:has(.dropdown-export-menu[style*="display:block"]),
.card.has-open-select,
.card.has-open-dropdown {
  z-index: 55;
  overflow: visible !important;
}

.card-pad {
  padding: 16px 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.card-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.stat-val,
.stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.15;
  margin-top: 4px;
}
.stat-lbl,
.stat-label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* ─── 7. Tables (Crisp Tabular Data Grid) ─────────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.table th {
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  white-space: nowrap;
  vertical-align: middle;
  text-align: left;
}
.table td {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: middle;
}
.table tbody tr:hover td {
  background: var(--surface-2);
}
.table tbody tr:last-child td,
.table tr:last-child td {
  border-bottom: none !important;
}

.table th.text-right,
.table td.text-right,
.table td[style*="text-align:right"],
.table td[style*="text-align: right"],
.table th[style*="text-align:right"],
.table th[style*="text-align: right"],
.table td[style*="text-align:center"],
.table td[style*="text-align: center"],
.table td.nowrap,
.table th.nowrap,
.table .price-col,
.table .amount-col,
.table .date-col,
.table .num-col,
.table .badge,
.table .role-pill,
.table .stock-pill,
.table .plate-badge {
  white-space: nowrap !important;
}

/* ─── 8. Forms, Inputs, Selects & Custom Dropdowns ────────────────────────── */
.form-group,
.field {
  margin-bottom: 14px;
}
.form-label,
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}
.form-hint {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 4px;
  line-height: 1.4;
}

.input,
.input-field,
.form-control,
.stage-input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box !important;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  min-height: 38px;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus,
.input-field:focus,
.form-control:focus,
.stage-input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: none;
}
.input:disabled,
.form-control:disabled,
.stage-input:disabled {
  background: var(--surface-2);
  color: var(--ink-faint);
  border-color: var(--line);
  cursor: not-allowed;
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-faint) !important;
  opacity: 1 !important;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

select.input,
select.form-control,
select.stage-input {
  display: inline-block;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2371717A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px !important;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
select::picker-icon {
  display: none !important;
}
[data-theme="dark"] select.input,
[data-theme="dark"] select.form-control,
[data-theme="dark"] select.stage-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23A1A1AA' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
}
select.input option,
select.form-control option,
select.stage-input option {
  background: var(--surface);
  color: var(--ink);
}

.form-grid,
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

/* Custom DIV Selects */
.custom-div-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.custom-div-select-trigger {
  user-select: none;
  white-space: nowrap;
}
.custom-div-select-options {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  right: 0 !important;
  left: auto !important;
  z-index: 1050 !important;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
}
.custom-div-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.custom-div-option:hover,
.custom-div-option.is-kbd-active {
  background: var(--surface-2);
}

.custom-select-wrapper {
  position: relative;
  z-index: 1;
}
.custom-select-wrapper.is-open {
  z-index: 50;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 11px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.custom-select-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
}
.custom-select-wrapper.is-open .custom-select-panel {
  display: block;
}
.custom-select-option {
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.custom-select-option:hover,
.custom-select-option.is-kbd-active {
  background: var(--surface-2);
}
.custom-select-option.is-selected {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 600;
}

/* Keyboard highlighted custom dropdown item (shared across all custom dropdowns) */
.k-select-option.is-kbd-active,
.k-cselect-option.is-kbd-active,
.custom-dish-item.is-kbd-active,
.location-search-item.highlighted,
.location-search-item.is-kbd-active {
  background: var(--surface-3) !important;
  outline: 1px solid var(--ink) !important;
}

/* ─── 9. Navigation Bars, Pills, Tabs & Filter Bars ───────────────────────── */
.trade-suite-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin-bottom: 16px;
}
.trade-suite-bar::-webkit-scrollbar {
  display: none;
}
.trade-suite-bar .btn {
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.cat-pills-bar,
.kitchen-filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: var(--surface);
}
.cat-pills-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.kitchen-filter-pills {
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.cat-pill,
.btn-pill,
.kitchen-filter-pills .btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.cat-pill:hover,
.btn-pill:hover,
.kitchen-filter-pills .btn-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface-2);
}
.cat-pill.active,
.btn-pill.active,
.kitchen-filter-pills .btn-pill.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-fg) !important;
  box-shadow: none !important;
}
.cat-pill-count,
.btn-pill-count {
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cat-pill.active .cat-pill-count,
.btn-pill.active .btn-pill-count,
.kitchen-filter-pills .btn-pill.active .btn-pill-count {
  background: rgba(128, 128, 128, 0.28) !important;
  color: var(--primary-fg) !important;
}

.warehouse-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.search-field-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.search-field-wrap ion-icon[name="search-outline"] {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 16px;
  pointer-events: none;
}
.search-field-wrap .form-control {
  padding-left: 34px;
  padding-right: 32px;
  background: var(--surface);
}
.search-field-wrap .clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: none;
}
.search-field-wrap .clear-search-btn ion-icon {
  font-size: 16px;
}

.filter-dropdowns-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-inline-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-inline-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ─── 10. Badges, Pills, Indicators & Code ────────────────────────────────── */
.badge,
.tag,
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}
.role-pill {
  text-transform: uppercase;
  letter-spacing: 0.35px;
}
.badge-super,
.badge-admin {
  background: var(--primary);
  color: var(--primary-fg) !important;
  box-shadow: none;
}
.badge-manager {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}
.status-dot.offline {
  background: var(--ink-faint);
}
.status-dot.danger {
  background: var(--danger);
}

.sku-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.category-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}
.stock-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
  white-space: nowrap;
}
.badge-in-stock {
  background: var(--success-soft);
  color: var(--success);
}
.badge-low {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge-out {
  background: var(--surface-2);
  color: var(--ink-faint);
  border: 1px solid var(--line);
}
.badge-negative {
  background: var(--danger-soft);
  color: var(--danger);
}

code {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: var(--font-mono);
}

.filter-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── 11. Modals (Instant Open/Close, Crisp Monochrome Frame) ─────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open,
.modal.open {
  display: flex;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.modal-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}
.modal-close-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--ink-faint);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}
.modal-body {
  padding: 18px 20px;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── 12. Toast Notifications (Stacked Bottom-Right, Instant) ─────────────── */
.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}
.toast.toast-success {
  border-left-color: var(--success);
}
.toast.toast-error {
  border-left-color: var(--danger);
}
.toast.toast-warning {
  border-left-color: var(--warning);
}

/* ─── 13. Sessions & Log Terminal ─────────────────────────────────────────── */
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  gap: 14px;
  flex-wrap: wrap;
}
.session-row.current-session {
  border-color: var(--ink);
}
.log-terminal {
  background: #0B0B0D;
  color: #D4D4D8;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 14px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-height: 520px;
  line-height: 1.55;
  border: 1px solid #27272A;
}
.log-line {
  margin: 0;
  padding: 1px 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-line.error { color: #F87171; }
.log-line.warn  { color: #FBBF24; }
.log-line.info  { color: #A1A1AA; }
.log-line.ok    { color: #4ADE80; }

/* ─── 14. AI Receipts & Staging Components ────────────────────────────────── */
.preset-pills-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.preset-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.preset-pill-btn:hover {
  border-color: var(--ink);
  background: var(--surface-2);
}

.upload-dropzone {
  display: block;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 28px 18px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
}
.upload-dropzone:hover {
  border-color: var(--ink);
  background: var(--surface-2);
}

.staging-filter-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.staging-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.staging-search-input {
  width: 100%;
  padding: 8px 34px 8px 36px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
}
.staging-search-input:focus {
  border-color: var(--ink);
  outline: none;
}
.staging-tabs-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.staging-tab-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.staging-tab-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
.staging-tab-btn.active {
  background: var(--primary);
  color: var(--primary-fg) !important;
  border-color: var(--primary);
}
.staging-tab-badge {
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.staging-tab-btn.active .staging-tab-badge {
  background: rgba(128, 128, 128, 0.28);
  color: var(--primary-fg);
}

.custom-sku-box {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.custom-sku-box:hover {
  border-color: var(--ink);
  background: var(--surface-2);
}
.custom-sku-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid var(--line);
}
.custom-sku-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.custom-sku-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
  border-top: 1px dashed var(--line);
  padding-top: 4px;
}
.custom-sku-change-link {
  color: var(--ink);
  font-weight: 700;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sku-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sku-modal-overlay.active,
.sku-modal-overlay.open {
  display: flex;
}
.sku-modal-dialog {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.sku-modal-item {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sku-modal-item:hover {
  border-color: var(--ink);
  background: var(--surface-2);
}
.sku-modal-item.selected {
  border-color: var(--ink);
  background: var(--surface-2);
}
.sku-chip {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.sku-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.sku-chip.active {
  background: var(--primary);
  color: var(--primary-fg) !important;
  border-color: var(--primary);
}

/* ─── 15. Phone Mask & Fleet Plates ───────────────────────────────────────── */
.phone-input-wrap {
  position: relative;
  width: 100%;
}
.phone-input-wrap .form-control,
.phone-input-wrap .input {
  padding-right: 38px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.phone-flag-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  line-height: 1;
}
.phone-debug-info {
  min-height: 16px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
}
.carrier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.plate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 132px;
  min-width: 132px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.plate-flag {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: var(--ink);
  border-radius: 1px;
}
.fuel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.vehicle-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.status-active {
  background: var(--success-soft);
  color: var(--success);
}
.status-maintenance {
  background: var(--warning-soft);
  color: var(--warning);
}
.status-repair {
  background: var(--danger-soft);
  color: var(--danger);
}
.status-inactive {
  background: var(--surface-2);
  color: var(--ink-faint);
}

/* ─── 16. Hierarchical Location Widget ────────────────────────────────────── */
.location-widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  width: 100%;
}
.location-search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.location-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1050;
  padding: 4px 0;
}
.location-search-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.location-search-item:last-child {
  border-bottom: none;
}
.location-search-item:hover,
.location-search-item.highlighted {
  background: var(--surface-2);
}
.location-search-item-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.location-search-item-info {
  flex: 1;
  min-width: 0;
}
.location-search-item-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.location-search-item-sub {
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-search-item-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}
.location-search-loading,
.location-search-no-results {
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
}
.location-cascade-wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: start;
}
.location-field-col {
  display: flex;
  flex-direction: column;
}
.loc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--primary);
  color: var(--primary-fg) !important;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* ─── 17. Counter Inputs ──────────────────────────────────────────────────── */
.counter-box {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
}
.counter-btn {
  background: var(--surface-2);
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  user-select: none;
}
.counter-btn:hover {
  background: var(--surface-3);
}
.counter-input {
  width: 44px;
  height: 28px;
  border: none;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink) !important;
  background: transparent !important;
  outline: none !important;
}

/* ─── 18. Monuments, Market Rates & Admin Responsive Grids ────────────────── */
.mon-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.mon-tabs-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.mon-tabs-scroll::-webkit-scrollbar {
  display: none;
}
.mon-tabs-scroll .btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 7px 12px;
  font-size: 12.5px;
}
.mon-actions-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.mon-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 10px;
}
.mon-supplier-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}
.market-rates-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(125px, 1fr)) auto;
  gap: 8px;
  align-items: center;
}

.mon-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.mon-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mon-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mon-grid-cemetery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.1fr;
  gap: 10px;
}
.mon-picker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
}
.order-dish-add-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px auto;
  gap: 10px;
  align-items: start;
}
.additional-complex-row {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  grid-template-columns: 2fr 1.4fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}
.recipe-qty-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 105px;
  gap: 10px;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  align-items: end;
  width: 100%;
}
.admin-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.admin-filter-item label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wh-toggle-group {
  display: inline-flex;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  gap: 3px;
  flex-wrap: wrap;
}
.role-row-inner {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ─── 19. Keyboard Navigation Focus Ring, Hotkeys & Help Modal ────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.form-control:focus-visible,
.input:focus-visible,
.custom-dish-trigger:focus-visible,
.k-select-trigger:focus-visible,
.k-cselect-trigger:focus-visible,
.custom-select-trigger:focus-visible,
.custom-div-select-trigger:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--ink) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

.kbd-hint,
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.3;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  margin-left: 4px;
}
.btn-primary .kbd-hint {
  background: rgba(128, 128, 128, 0.25);
  border-color: rgba(128, 128, 128, 0.45);
  color: var(--primary-fg);
}

.kbd-shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.kbd-shortcut-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.kbd-shortcut-table tr:last-child td {
  border-bottom: none;
}
.kbd-shortcut-table td:first-child {
  width: 140px;
  white-space: nowrap;
}

/* ─── 20. PWA Banners ─────────────────────────────────────────────────────── */
.pwa-install-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 440px;
  width: calc(100vw - 32px);
}
.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.pwa-install-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-install-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-install-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pwa-update-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── 21. Responsive Breakpoints (Desktop / Tablet / Phone) ───────────────── */
@media (min-width: 769px) {
  .mon-tabs-scroll,
  .trade-suite-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

@media (min-width: 960px) {
  .warehouse-filter-bar {
    flex-wrap: wrap;
  }
  .filter-dropdowns-group {
    flex-wrap: wrap;
  }
  .filter-inline-item select.form-control {
    width: auto;
    max-width: 210px;
  }
}

@media (max-width: 1280px) {
  .mon-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .order-grid-3 {
    grid-template-columns: 1fr 1fr !important;
  }
  .order-grid-3 > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
  }
  .main {
    margin-left: 0 !important;
  }
  .topbar {
    padding: 0 10px;
    gap: 6px;
  }
  .topbar-title {
    font-size: 13.5px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .topbar-right {
    gap: 5px;
  }
  .topbar-kbd-btn {
    display: none;
  }
  .page {
    padding: 14px 12px 36px !important;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field,
  .form-group,
  .input,
  .input-field,
  .form-control {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .mon-grid-4,
  .mon-supplier-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mon-grid-cemetery {
    grid-template-columns: 1fr 1fr;
  }
  .mon-grid-cemetery > div:first-child {
    grid-column: 1 / -1;
  }
  .market-rates-strip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .market-rates-strip-grid > button {
    grid-column: 1 / -1;
    justify-content: center;
  }
  .additional-complex-row {
    grid-template-columns: 1fr 1fr;
  }
  .additional-complex-row > div:first-child {
    grid-column: 1 / -1;
  }
  .location-cascade-wrap {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .form-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .warehouse-filter-bar {
    padding: 12px;
    gap: 10px;
  }
  .search-field-wrap {
    min-width: 100%;
    flex: 1 1 100%;
  }
  .filter-dropdowns-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .filter-inline-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
  .filter-inline-item .form-control {
    width: 100% !important;
  }
  .mon-nav-row {
    flex-direction: column;
    align-items: stretch;
  }
  .mon-tabs-scroll,
  .mon-actions-group {
    width: 100%;
  }
  .mon-actions-group .btn {
    flex: 1 1 auto;
  }
  .mon-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mon-grid-3,
  .mon-picker-grid,
  .order-dish-add-grid,
  .modal-grid-2 {
    grid-template-columns: 1fr !important;
  }
  .mon-picker-grid .btn,
  .order-dish-add-grid .btn {
    width: 100%;
  }
  .recipe-qty-grid-4 {
    grid-template-columns: 1fr 1fr !important;
  }
  .wh-toggle-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .wh-toggle-group .btn {
    width: 100%;
  }
  .role-row-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .role-row-inner > div:last-child,
  .role-row-inner > div:last-child .btn {
    width: 100%;
  }
  .session-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }
  .session-row > div {
    min-width: 0 !important;
    width: 100%;
  }
  .session-row > div:last-child .btn {
    width: 100%;
  }
  .modal-card div[style*="grid-template-columns:1fr 1fr"],
  .modal-card div[style*="grid-template-columns: 1fr 1fr"],
  .modal-card div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .sku-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .sku-modal-dialog {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
  }
}

@media (max-width: 600px) {
  .form-grid-2,
  .form-grid-3,
  .form-grid-4,
  .location-cascade-wrap {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .page-title {
    font-size: 18px !important;
  }
  .card-pad {
    padding: 12px 14px !important;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 12px !important;
  }
  .stat-val,
  .stat-value {
    font-size: 19px !important;
  }
  .kbd-hint {
    display: none !important;
  }
  .topbar-title {
    font-size: 13px;
  }
  .topbar-shift-label {
    display: none;
  }
  .theme-switch-btn {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .topbar .avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
  .modal-backdrop {
    padding: 8px;
  }
  .modal-card {
    max-height: calc(100dvh - 16px);
  }
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 14px;
  }
  .modal-footer {
    flex-direction: column-reverse;
  }
  .modal-footer .btn {
    width: 100%;
  }
  .admin-filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .mon-kpi-grid,
  .mon-grid-4,
  .mon-grid-2,
  .mon-grid-cemetery,
  .mon-supplier-stats-grid,
  .market-rates-strip-grid,
  .additional-complex-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  .stat-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================================= */
/* EXCEL-LIKE STICKY TABLE HEADERS & LEFT COLUMN (LIGHT & DARK SAFE)         */
/* ========================================================================= */
.table-sticky-wrap {
  max-height: 70vh;
  overflow: auto;
  position: relative;
}
.table-sticky {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-2) !important;
  box-shadow: inset 0 -1px 0 var(--line-strong);
}
.table-sticky th.sticky-col,
.table-sticky td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface) !important;
  box-shadow: inset -1px 0 0 var(--line);
}
.table-sticky thead th.sticky-col {
  z-index: 6;
  background: var(--surface-2) !important;
  box-shadow: inset -1px 0 0 var(--line-strong), inset 0 -1px 0 var(--line-strong);
}
.table-sticky tbody tr:hover td.sticky-col {
  background: var(--surface-2) !important;
}
@media (max-width: 640px) {
  .table-sticky-wrap {
    max-height: none;
  }
  .table-sticky th.sticky-col,
  .table-sticky td.sticky-col {
    position: static;
    box-shadow: none;
  }
}

/* ========================================================================= */
/* OWNER DASHBOARD STRICT MONOCHROME LAYOUT GRIDS                            */
/* ========================================================================= */
.owner-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.owner-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.owner-kpi-card.is-accent {
  border-color: var(--ink);
}
.owner-kpi-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--ink-soft);
}
.owner-kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.owner-kpi-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.owner-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 18px;
  align-items: start;
}
.owner-split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.owner-dirs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.owner-bar-track {
  width: 100%;
  height: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.owner-bar-fill {
  height: 100%;
  background: var(--ink);
}
.owner-alert-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.owner-alert-item:last-child {
  border-bottom: none;
}
.owner-alert-item:hover {
  background: var(--surface-2);
}
@media (max-width: 1280px) {
  .owner-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1024px) {
  .owner-main-grid,
  .owner-split-2 {
    grid-template-columns: 1fr;
  }
  .owner-dirs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .owner-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .owner-dirs-grid {
    grid-template-columns: 1fr;
  }
}
