/* Shared app finish. Loaded after the legacy compact/mobile rules.
   Important declarations are limited to properties those rules already lock. */
:root {
  --app-control-border: #cbd8df;
  --app-tray: #f3f6f8;
  --app-radius: 12px;
  --app-shadow: 0 2px 6px rgb(23 43 58 / 4%), 0 8px 24px rgb(23 43 58 / 2%);
}

/* Every choice remains recognizable as a control, including inactive choices. */
:is(.filters, .prod-filter-pills, .log-cat-chips, .cust-city-chips,
    .booking-cat-pills, .booking-channel-segmented, .storefront-mobile-tabs,
    .notif-tabs, .overview-mini-tabs, .sf-mode-switch) {
  gap: 6px !important;
  padding: 5px !important;
  border: 1px solid #e0e7eb !important;
  border-radius: var(--app-radius) !important;
  background: var(--app-tray) !important;
  min-width: 0;
  max-width: 100%;
  scroll-padding-inline: 5px;
  overscroll-behavior-inline: contain;
}

:is(.filters button, .prod-filter-pills button, .log-cat-chip, .cust-city-chip,
    .booking-cat-chip, .channel-segment-btn, .storefront-tab-btn,
    .notif-tab-btn, .overview-mini-tabs button, .sf-mode-switch button,
    .sf-tab-btn, .sf-chip, .date-chip, .date-modal-preset-btn) {
  min-height: 38px !important;
  height: auto !important;
  padding: 8px 13px !important;
  border: 1px solid var(--app-control-border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #385365 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.35;
  box-shadow: 0 1px 2px rgb(23 43 58 / 5%) !important;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease,
              box-shadow 140ms ease, color 140ms ease;
}

:is(.filters button, .prod-filter-pills button, .log-cat-chip, .cust-city-chip,
    .booking-cat-chip, .channel-segment-btn, .storefront-tab-btn,
    .notif-tab-btn, .overview-mini-tabs button, .sf-mode-switch button,
    .sf-tab-btn, .sf-chip, .date-chip, .date-modal-preset-btn).active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 5px rgb(0 124 112 / 20%) !important;
}

@media (hover: hover) {
  :is(.filters button, .prod-filter-pills button, .log-cat-chip, .cust-city-chip,
      .booking-cat-chip, .channel-segment-btn, .storefront-tab-btn,
      .notif-tab-btn, .overview-mini-tabs button, .sf-mode-switch button,
      .sf-tab-btn, .sf-chip, .date-chip, .date-modal-preset-btn):hover:not(.active):not(:disabled) {
    border-color: #80b7b1 !important;
    background: #edf7f5 !important;
    color: var(--primary-hover) !important;
    box-shadow: 0 2px 5px rgb(23 43 58 / 8%) !important;
  }
  .metric[role="button"]:hover, .ov-notif-stat:hover {
    border-color: #80b7b1;
    background: var(--primary-soft);
  }
}

:is(button, a, input, select, textarea, [role="button"]):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
:is(button, .btn-outline-link):active:not(:disabled) { filter: brightness(.96); }
button:disabled { box-shadow: none !important; }

/* Keep the white workspace and existing information hierarchy. */
.page-head { margin-bottom: 14px; }
.overview-panel, .crud-panel, .sf-card, .sf-track-card, .sf-receipt,
.search-filter-card, .booking-controls-card {
  border: 1px solid #e0e7eb;
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: var(--app-shadow);
}
.overview-panel { padding: 10px 12px; }
.crud-panel { padding: 14px; }
.overview-grid { gap: 8px; margin-bottom: 8px; }
.overview-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  padding-bottom: 6px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.overview-panel-head h2, .overview-panel-head h3 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-panel-head p {
  display: none !important;
}
.overview-panel-head .btn-outline-link,
.overview-panel-head .badge {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 24px !important;
  font-size: 11px !important;
  padding: 2px 8px !important;
  border-radius: 5px;
}
.overview-alert-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.overview-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  flex-wrap: nowrap !important;
}
.overview-alert-main { min-width: 0; flex: 1; }
.overview-alert-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.overview-alert-top strong {
  font-size: 11.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-alert-top .badge {
  font-size: 9px;
  padding: 1px 5px;
  flex-shrink: 0;
  border-radius: 4px;
}
.overview-alert-main p {
  margin: 1px 0 0;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-alert-btn {
  min-height: 24px !important;
  height: 24px !important;
  padding: 2px 8px !important;
  font-size: 10.5px !important;
  border-radius: 5px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
.overview-alert-summary-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}
.ov-notif-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  min-height: 38px;
  min-width: 0;
}
.ov-notif-stat, .ov-notif-stat > div { min-width: 0; flex: 1; }
.ov-notif-stat strong {
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.ov-notif-stat .small {
  display: block;
  font-size: 10.5px;
  line-height: 1.15;
  color: var(--muted);
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100%;
}
.notif-stat-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 5px;
}
.notif-stat-icon .icon { width: 12px; height: 12px; }
.ov-notif-arrow {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
}
.metrics { gap: 6px; margin-bottom: 8px; }
.metric, .metric:first-child, .metric:last-child {
  padding: 8px 10px;
  min-height: 0;
  gap: 3px;
  justify-content: flex-start;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgb(23 43 58 / 3%);
}
/* Shared by every page's summary, including nested settings/audit screens.
   Status tones take priority over the decorative color sequence. */
.metrics .metric {
  --metric-bg: linear-gradient(125deg, #e1f3ee, #f4fbf8);
  --metric-ink: #154f49;
  --metric-muted: #3f655e;
  --metric-border: #c4dfd6;
  background: var(--metric-bg);
  border-color: var(--metric-border);
  color: var(--metric-ink);
}
.metrics .metric:nth-child(4n + 2) {
  --metric-bg: linear-gradient(125deg, #e4effc, #f3f8ff);
  --metric-ink: #214e7a;
  --metric-muted: #49627d;
  --metric-border: #c9dced;
}
.metrics .metric:nth-child(4n + 3) {
  --metric-bg: linear-gradient(125deg, #eee8fa, #faf6ff);
  --metric-ink: #584077;
  --metric-muted: #69577e;
  --metric-border: #ded1ee;
}
.metrics .metric:nth-child(4n + 4) {
  --metric-bg: linear-gradient(125deg, #e0f2f7, #f2fbfd);
  --metric-ink: #21586c;
  --metric-muted: #416776;
  --metric-border: #c4dfe8;
}
.metrics .metric.warning {
  --metric-bg: linear-gradient(125deg, #fff0cf, #fff9ed);
  --metric-ink: #805000;
  --metric-muted: #755c2d;
  --metric-border: #ecd39e;
}
.metrics .metric.critical {
  --metric-bg: linear-gradient(125deg, #ffe4e8, #fff5f6);
  --metric-ink: #a1243a;
  --metric-muted: #80515c;
  --metric-border: #edc0ca;
}
.metrics .metric.active-card {
  border-color: var(--metric-ink);
  box-shadow: inset 0 0 0 1px var(--metric-ink);
}
.metric[role="button"] { cursor: pointer; }
.metric-head { flex-wrap: wrap; row-gap: 2px; }
.metrics .metric-title {
  color: var(--metric-muted) !important;
  font-weight: 650;
}
.metrics .metric strong {
  color: var(--metric-ink);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  line-height: 1.15;
}
.metrics .metric-sub, .metrics .metric small {
  color: var(--metric-muted) !important;
  line-height: 1.25 !important;
}
.metrics .metric-pill {
  color: var(--metric-ink);
  background: rgb(255 255 255 / 75%);
}
@media (hover: hover) {
  .metrics .metric[role="button"]:hover {
    border-color: var(--metric-ink);
    box-shadow: inset 0 0 0 1px var(--metric-ink);
  }
}
.stream-container, .history-row, .product-row, .rep-exec-card { border-radius: 10px; }
.queue-row.table-head { color: #526977; background: #f5f8fa; }
.empty { border-radius: var(--app-radius); }

/* Form surfaces and action buttons share the same geometry. */
button, .btn-outline-link { border-radius: 8px; }
button.primary { box-shadow: 0 2px 4px rgb(0 124 112 / 16%); }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea {
  border-color: var(--app-control-border);
  border-radius: 8px;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow);
}
dialog { border-color: #e0e7eb; box-shadow: 0 24px 80px rgb(23 43 58 / 20%); }
dialog::backdrop { background: rgb(17 36 49 / 35%); backdrop-filter: blur(3px); }

/* A light finish on the approved shell; navigation geometry stays intact. */
.sidebar { border-right-color: #e1e8ec; }
.sidebar .nav a { border: 1px solid transparent; border-radius: 10px; }
.sidebar .nav a.active { border-color: #c9e5e0; box-shadow: inset 3px 0 var(--primary); }
.topbar-btn, .sidebar-toggle-btn { border-radius: 9px; }
.workspace-topbar { border-bottom-color: #e4ebee; }

@media (max-width: 820px) {
  :is(.filters button, .prod-filter-pills button, .log-cat-chip, .cust-city-chip,
      .booking-cat-chip, .channel-segment-btn, .storefront-tab-btn,
      .notif-tab-btn, .overview-mini-tabs button, .sf-mode-switch button,
      .sf-tab-btn, .sf-chip, .date-chip, .date-modal-preset-btn) {
    min-height: 44px !important;
    padding: 9px 12px !important;
  }
  .filters, .date-chips-bar { overflow-x: auto; flex-wrap: nowrap; }
  .filters button, .date-chip, .prod-filter-pills button { flex: 0 0 auto !important; }
  .channel-segment-btn { padding: 8px 4px !important; white-space: normal !important; }
  .channel-segment-btn .icon { width: 15px; height: 15px; }
  .storefront-tab-btn, .notif-tab-btn { white-space: normal; min-width: 0; }
  .workspace h1, .page-head h1 { font-size: 22px !important; line-height: 1.25 !important; }
  body:has(#booking-form) .page-head h1 { font-size: 22px !important; }
  body:has(#booking-form) .page-head { gap: 8px !important; margin-bottom: 12px !important; }
  body:has(#booking-form) .page-head p { font-size: 12px !important; }
  .page-head { gap: 8px !important; margin-bottom: 12px !important; }
  .page-head p { font-size: 12px !important; line-height: 1.45; }
  .metrics, .metrics.metrics-3 { gap: 6px !important; margin-bottom: 8px !important; padding-bottom: 0 !important; }
  .metric, .metric:first-child, .metric:last-child, .metrics.metrics-3 .metric {
    padding: 7px 8px !important;
    min-height: 0 !important;
    gap: 3px !important;
    border-radius: 10px !important;
  }
  .metric-title { font-size: 10px !important; line-height: 1.3 !important; }
  .metric strong, .metric.warning strong, .metric.critical strong,
  .metric strong.metric-money, .metrics.metrics-3 .metric strong {
    font-size: 17px !important; line-height: 1.15 !important; overflow-wrap: anywhere;
  }
  .metric-pill { font-size: 9.5px !important; padding: 1px 4px !important; line-height: 1.2 !important; }
  .metric-sub, .metric small { font-size: 10px !important; line-height: 1.25 !important; white-space: normal !important; }
  .overview-panel { padding: 8px 10px !important; }
  .overview-panel-head { padding-bottom: 5px !important; margin-bottom: 6px !important; gap: 6px !important; }
  .overview-panel-head h2, .overview-panel-head h3 { font-size: 12.5px !important; }
  .overview-panel .small { font-size: 10px !important; line-height: 1.2 !important; }
  .overview-alert-item { gap: 6px !important; flex-wrap: nowrap !important; padding: 4px 6px !important; }
  .overview-alert-btn { min-height: 24px !important; height: 24px !important; font-size: 10.5px !important; padding: 2px 7px !important; }
  .booking-controls-card { padding: 10px !important; }
  .booking-panel-cust :is(input:not([type="checkbox"]):not([type="radio"]), select),
  .crud-panel :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea),
  .search-input-wrap input, #queue-search-input, #prod-search-input, #cust-search-input,
  #product-search, .sf-input, .sf-select {
    min-height: 44px !important; height: auto !important; font-size: 16px !important;
  }
  .booking-search-wrap input#product-search, .booking-controls-card input#customer-combobox-input {
    min-height: 44px !important; height: auto !important; font-size: 16px !important;
  }
  .stepper button { width: 40px; min-width: 40px; min-height: 44px !important; }
  .stepper input { width: 38px; min-height: 44px !important; font-size: 16px !important; }
  .queue-row.crud-prod-row:not(.table-head), .queue-row.crud-cust-row:not(.table-head) {
    padding: 12px !important; gap: 8px !important;
    margin-bottom: 10px !important; border-radius: 12px !important;
  }
  .queue-row.crud-prod-row .prod-title, .queue-row.crud-cust-row .cust-name-title {
    font-size: 14px !important; line-height: 1.4 !important; white-space: normal !important;
  }
  .queue-row.crud-prod-row .prod-col-info .sub,
  .queue-row.crud-cust-row .cust-card-sub-line {
    font-size: 11.5px !important; line-height: 1.45 !important;
  }
  .queue-row.crud-prod-row .prod-col-stock { grid-column: 1 / -1 !important; }
  .queue-row.crud-prod-row .prod-col-actions {
    grid-column: 1 / -1 !important; grid-row: 4 !important;
    justify-self: stretch !important; justify-content: flex-end !important;
    padding-top: 8px !important; border-top: 1px solid var(--border);
  }
  .queue-row.crud-cust-row .cust-card-actions { flex-wrap: wrap; padding-top: 8px !important; }
  .queue-row.crud-prod-row .prod-stock-input {
    min-height: 44px !important; height: auto !important; width: 68px !important;
    font-size: 16px !important; border-radius: 8px !important;
  }
  .queue-row.crud-prod-row .prod-stock-stepper button,
  .queue-row.crud-prod-row .prod-col-actions button,
  .queue-row.crud-cust-row .cust-card-actions button {
    min-height: 44px !important; height: auto !important; min-width: 44px !important;
    padding: 8px 12px !important; font-size: 12px !important; border-radius: 8px !important;
  }
  dialog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  dialog select, dialog textarea {
    min-height: 44px !important; font-size: 16px !important;
  }
  .mobile-nav { border-top-color: #dfe9e8; box-shadow: 0 -4px 20px rgb(23 43 58 / 6%); }
  .mobile-nav a.active, .mobile-nav button.active {
    background: #e7f5f2; border-radius: 12px; box-shadow: inset 0 2px 0 #bee1d9;
  }
  .mobile-nav a, .mobile-nav button { gap: 4px; }
  .mobile-nav .icon { width: 20px; height: 20px; }
  .workspace-topbar { box-shadow: 0 2px 8px rgb(23 43 58 / 3%); }
}

@media (max-width: 360px) {
  .metrics.metrics-3 .metric { padding: 7px 6px !important; }
  .metrics.metrics-3 .metric strong { font-size: 17px !important; }
  .channel-segment-btn { font-size: 11px !important; gap: 4px; }
}

/* Compact choice strips with a discoverable, draggable horizontal scrollbar. */
:is(.filters, .prod-filter-pills, .log-cat-chips, .cust-city-chips,
    .booking-cat-pills, .date-chips-bar, .storefront-mobile-tabs, .notif-tabs) {
  overflow-x: auto !important;
  flex-wrap: nowrap !important;
  scrollbar-width: auto !important;
  scrollbar-color: #8aa9a6 #e5eeed !important;
  -ms-overflow-style: auto;
}
:is(.filters, .prod-filter-pills, .log-cat-chips, .cust-city-chips,
    .booking-cat-pills, .date-chips-bar, .storefront-mobile-tabs, .notif-tabs)::-webkit-scrollbar {
  display: block !important;
  height: 7px;
}
:is(.filters, .prod-filter-pills, .log-cat-chips, .cust-city-chips,
    .booking-cat-pills, .date-chips-bar, .storefront-mobile-tabs, .notif-tabs)::-webkit-scrollbar-track {
  background: #e5eeed;
  border-radius: 8px;
}
:is(.filters, .prod-filter-pills, .log-cat-chips, .cust-city-chips,
    .booking-cat-pills, .date-chips-bar, .storefront-mobile-tabs, .notif-tabs)::-webkit-scrollbar-thumb {
  background: #8aa9a6;
  border: 1px solid #e5eeed;
  border-radius: 8px;
}
:is(.filters button, .prod-filter-pills button, .log-cat-chip, .cust-city-chip,
    .booking-cat-chip, .channel-segment-btn, .storefront-tab-btn,
    .notif-tab-btn, .overview-mini-tabs button, .sf-mode-switch button,
    .sf-tab-btn, .sf-chip, .date-chip, .date-modal-preset-btn) {
  min-height: 32px !important;
  padding: 5px 10px !important;
  font-size: 11.5px !important;
  border-radius: 7px !important;
}
.channel-segment-btn { min-height: 36px !important; }
.search-filter-card { padding: 8px 10px; }
#order-dialog .detail-card-strip { display: block; padding-block: 12px; }
#order-dialog .detail-print-actions {
  display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 10px;
  overflow-x: auto; padding-bottom: 7px;
  scrollbar-color: #8aa9a6 #e5eeed;
}
#order-dialog .detail-print-actions button {
  flex: 0 0 auto; width: auto; min-height: 32px;
  padding: 5px 9px; font-size: 11.5px; gap: 5px; white-space: nowrap;
}
#order-dialog .detail-print-actions .icon { width: 15px; height: 15px; }
/* Chromium prioritizes scrollbar-color over WebKit styling; use the latter
   here so the visible track does not become an auto-hiding overlay. */
@supports selector(::-webkit-scrollbar) {
  :is(.filters, .prod-filter-pills, .log-cat-chips, .cust-city-chips,
      .booking-cat-pills, .date-chips-bar, .storefront-mobile-tabs, .notif-tabs,
      #order-dialog .detail-print-actions) {
    scrollbar-color: auto !important;
  }
}
#order-dialog .detail-print-actions::-webkit-scrollbar { display: block; height: 7px; }
#order-dialog .detail-print-actions::-webkit-scrollbar-track { background: #e5eeed; border-radius: 8px; }
#order-dialog .detail-print-actions::-webkit-scrollbar-thumb { background: #8aa9a6; border-radius: 8px; }
#order-dialog .dialog-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
}
#order-dialog .dialog-actions button {
  min-height: 34px; width: auto; padding: 6px 10px; font-size: 12px;
}
.order-row-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
}
.order-row-actions .inline-dispatch {
  min-height: 28px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  gap: 5px !important;
  white-space: nowrap !important;
}
.inline-dispatch .icon { width: 14px; height: 14px; }
.queue-row:not([class*="crud-"]):not(.table-head) {
  grid-template-columns: 46px minmax(180px, 1.4fr) 120px 120px 110px auto !important;
  align-items: center !important;
}
.history-side {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}
.queue-mobile-age {
  display: none !important;
}
.scroll-strip { min-width: 0; max-width: 100%; margin-bottom: 8px; }
.scroll-strip > [data-scroll-enhanced] { margin-bottom: 0 !important; scrollbar-width: none !important; }
.scroll-strip > [data-scroll-enhanced]::-webkit-scrollbar { display: none !important; }
.scroll-strip > input.strip-scrollbar {
  display: block; appearance: none; -webkit-appearance: none;
  width: 100%; height: 14px !important; min-height: 14px !important;
  margin: 0; padding: 0 !important; border: 0 !important; border-radius: 6px;
  background: transparent !important; box-shadow: none !important; cursor: pointer;
}
.strip-scrollbar::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: #e0ebe9; }
.strip-scrollbar::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: var(--scroll-thumb-size, 40px);
  height: 6px; background: #6e9892; border: 0; border-radius: 6px;
}
.strip-scrollbar::-moz-range-track { height: 6px; border-radius: 6px; background: #e0ebe9; }
.strip-scrollbar::-moz-range-thumb { width: var(--scroll-thumb-size, 40px); height: 6px; background: #6e9892; border: 0; border-radius: 6px; }
.strip-scrollbar:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 820px) {
  .queue-row:not([class*="crud-"]):not(.table-head) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 6px 8px !important;
    min-height: 42px !important;
    border-bottom: 1px solid var(--border) !important;
  }
  .queue-row:not([class*="crud-"]) .rank {
    flex-shrink: 0 !important;
    min-width: 18px !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: center !important;
  }
  .queue-row:not([class*="crud-"]) .rank .next-label {
    display: none !important;
  }
  .queue-row:not([class*="crud-"]) .customer-col {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .queue-row:not([class*="crud-"]) .customer-col .monogram {
    display: none !important;
  }
  .queue-row:not([class*="crud-"]) .customer-col strong {
    font-size: 12.5px !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .queue-row:not([class*="crud-"]) .customer-col .sub {
    font-size: 10px !important;
    line-height: 1.2 !important;
    color: var(--muted) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
  }
  .queue-row:not([class*="crud-"]) .booked-col,
  .queue-row:not([class*="crud-"]) .age-col {
    display: none !important;
  }
  .queue-row:not([class*="crud-"]) .amount-col {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    gap: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
  .queue-row:not([class*="crud-"]) .amount-col .mobile-label {
    display: none !important;
  }
  .queue-row:not([class*="crud-"]) .amount-col strong {
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
  .queue-row:not([class*="crud-"]) .amount-col .queue-mobile-age {
    display: inline-block !important;
    font-size: 9px !important;
    padding: 1px 4px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }
  .queue-row:not([class*="crud-"]) .order-row-actions {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
  .queue-row:not([class*="crud-"]) .order-row-actions .inline-dispatch,
  .history-row .order-row-actions .inline-dispatch {
    min-height: 26px !important;
    height: 26px !important;
    padding: 2px 7px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }
  .queue-row:not([class*="crud-"]) .order-row-actions .inline-dispatch .icon,
  .history-row .order-row-actions .inline-dispatch .icon {
    width: 12px !important;
    height: 12px !important;
  }
  .queue-row:not([class*="crud-"]) .order-row-actions .row-action,
  .history-row .order-row-actions .row-action {
    min-height: 26px !important;
    height: 26px !important;
    width: 24px !important;
    min-width: 24px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 5px !important;
    border: 1px solid var(--app-control-border) !important;
    background: #fff !important;
  }
  .queue-row:not([class*="crud-"]) .order-row-actions .row-action > span:first-child,
  .history-row .order-row-actions .row-action > span:first-child {
    display: none !important;
  }
  .history-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 6px 8px !important;
    min-height: 42px !important;
  }
  .history-row .monogram { display: none !important; }
  .history-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
  }
  .history-main .small.muted {
    font-size: 10px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }
  .history-main h3 {
    font-size: 12.5px !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
  }
  .history-main .history-age {
    font-size: 10px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .history-side {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .history-side-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 1px !important;
    min-width: 0 !important;
  }
  .history-side-meta strong {
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
  .history-side-meta .badge {
    font-size: 9px !important;
    padding: 1px 4px !important;
    line-height: 1.15 !important;
  }
  .history-row .order-row-actions {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
  }
}

/* ==================== APP INSTALL BUTTON FLASHING ALERT ==================== */
@keyframes pwaPulseAlert {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 124, 112, 0.7), 0 0 0 0 rgba(220, 38, 38, 0.4);
    border-color: #007c70;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 124, 112, 0), 0 0 12px 2px rgba(0, 124, 112, 0.4);
    border-color: #00564e;
  }
}
@keyframes pwaDotFlash {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    background: #dc2626;
    box-shadow: 0 0 6px #dc2626;
  }
  50% {
    opacity: 0.2;
    transform: scale(0.6);
    background: #f87171;
    box-shadow: 0 0 0 transparent;
  }
}
.pwa-flash-btn {
  position: relative !important;
  animation: pwaPulseAlert 2.2s infinite ease-in-out !important;
  background: linear-gradient(135deg, rgba(0, 124, 112, 0.09), rgba(0, 124, 112, 0.18)) !important;
  border-color: #007c70 !important;
  color: #007c70 !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: transform 0.12s ease !important;
}
.pwa-flash-btn:hover {
  transform: scale(1.03) !important;
}
.pwa-flash-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  background: #dc2626 !important;
  color: #ffffff !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  padding: 1px 5px !important;
  border-radius: 99px !important;
  line-height: 1.2 !important;
  margin-left: 5px !important;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.4) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}
.pwa-flash-dot {
  width: 7px !important;
  height: 7px !important;
  min-width: 7px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  animation: pwaDotFlash 1.2s infinite ease-in-out !important;
  margin-left: 3px !important;
}
/* ==================== COMPACT APP INSTALL DIALOG ==================== */
#pwa-dialog {
  max-width: 440px !important;
  width: calc(100vw - 24px) !important;
  max-height: 88vh !important;
  border-radius: 14px !important;
  padding: 0 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25) !important;
  background: #ffffff !important;
  overflow: hidden !important;
}
#pwa-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(2px) !important;
}
.app-modal-header {
  background: linear-gradient(135deg, #004d44 0%, #007c70 100%) !important;
  color: #ffffff !important;
  padding: 10px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.app-modal-header h2 {
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.app-modal-header .close-btn {
  background: transparent !important;
  border: 0 !important;
  color: #ffffff !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}
.app-modal-body {
  padding: 12px 14px !important;
  overflow-y: auto !important;
  max-height: calc(88vh - 50px) !important;
}
.app-tabs-nav {
  display: flex !important;
  gap: 6px !important;
  margin-bottom: 12px !important;
  background: #f1f5f9 !important;
  padding: 3px !important;
  border-radius: 8px !important;
}
.app-tabs-nav button {
  flex: 1 !important;
  padding: 5px 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-align: center !important;
  white-space: nowrap !important;
}
.app-tabs-nav button.active {
  background: #ffffff !important;
  color: #007c70 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}
.app-install-action-hero {
  text-align: center !important;
  margin-bottom: 10px !important;
}
.app-primary-hero-btn {
  width: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, #007c70 0%, #0f766e 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 124, 112, 0.28) !important;
  transition: transform 0.1s ease, box-shadow 0.1s ease !important;
}
.app-primary-hero-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 124, 112, 0.35) !important;
}
.app-primary-hero-btn .icon {
  width: 16px !important;
  height: 16px !important;
}
.app-hero-sub {
  margin: 4px 0 0 !important;
  font-size: 11px !important;
  color: #64748b !important;
}
.app-ios-hero {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  text-align: center !important;
  margin-bottom: 8px !important;
}
.app-ios-badge-title {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #166534 !important;
}
.app-compact-steps {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  margin: 8px 0 !important;
}
.app-step-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 7px !important;
  padding: 6px 9px !important;
  font-size: 11.5px !important;
  color: #1e293b !important;
  line-height: 1.3 !important;
}
.app-step-num {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  border-radius: 50% !important;
  background: #007c70 !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
}
.app-kbd {
  display: inline-block !important;
  padding: 1px 5px !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.ios-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1px 5px !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.app-modal-quick-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 8px !important;
}
.app-modal-quick-actions button,
.app-modal-quick-actions a {
  flex: 1 1 auto !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  text-align: center !important;
  justify-content: center !important;
  min-height: 28px !important;
}
.app-whatsapp-btn {
  background: #25d366 !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.app-whatsapp-btn:hover {
  background: #1eb854 !important;
  color: #ffffff !important;
}
.app-superadmin-dist {
  margin-top: 10px !important;
  padding: 9px 10px !important;
  background: #f0fdfa !important;
  border: 1px solid #99f6e4 !important;
  border-radius: 8px !important;
}
.app-dist-header strong {
  display: block !important;
  font-size: 12px !important;
  color: #0f766e !important;
}
.app-dist-header .muted {
  font-size: 10.5px !important;
  color: #64748b !important;
}
.app-dist-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 6px !important;
}
.app-dist-actions a,
.app-dist-actions button {
  font-size: 11px !important;
  padding: 4px 8px !important;
  min-height: 26px !important;
  background: #ffffff !important;
}
.app-modal-footer {
  margin-top: 10px !important;
  padding-top: 8px !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 10.5px !important;
  color: #64748b !important;
}

/* Compact desktop sidebar to ensure Administration & Settings are always visible without scrolling */
@media (min-width: 769px) {
  .sidebar-nav-scroll {
    gap: 8px !important;
  }
  .nav-section-title {
    padding: 2px 12px 1px !important;
    margin-top: 2px !important;
  }
  .nav a {
    padding: 9px 12px !important;
  }
}

/* ==================== BALANCED DIALOG / MODAL WIDTH CONSTRAINTS (ALL DEVICES) ==================== */
@media (min-width: 769px) {
  dialog {
    margin: auto !important;
    max-height: 88vh !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22) !important;
    position: fixed !important;
    inset: 0 !important;
  }
  dialog:not(#confirm-dialog):not(#date-dialog):not(#pwa-dialog):not(#crud-dialog):not(#notif-dialog) {
    max-width: 600px !important;
    width: min(600px, calc(100vw - 48px)) !important;
  }
  #order-dialog {
    max-width: 600px !important;
    width: min(600px, calc(100vw - 48px)) !important;
    padding: 24px 28px !important;
  }
  #notif-dialog {
    max-width: 580px !important;
    width: min(580px, calc(100vw - 48px)) !important;
    padding: 20px 24px !important;
  }
  #crud-dialog {
    max-width: 540px !important;
    width: min(540px, calc(100vw - 48px)) !important;
  }
  #confirm-dialog {
    max-width: 420px !important;
    width: min(420px, calc(100vw - 48px)) !important;
  }
  #date-dialog {
    max-width: 440px !important;
    width: min(440px, calc(100vw - 48px)) !important;
  }
  #pwa-dialog {
    max-width: 440px !important;
    width: min(440px, calc(100vw - 48px)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
