/* DewServe Dine · owner/staff portal only. Never load in storefront layouts. */
:root {
  color-scheme: dark;
  --ds-page: #101216;
  --ds-panel: #191c22;
  --ds-panel-soft: #222630;
  --ds-line: #303641;
  --ds-ink: #f5f6f8;
  --ds-muted: #a6abb5;
  --ds-orange: #f5a623;
  --ds-orange-hover: #ffb941;
}
html[data-bs-theme="light"] {
  color-scheme: light;
  --ds-page: #f4f6fa;
  --ds-panel: #ffffff;
  --ds-panel-soft: #edf1f7;
  --ds-line: #d9e0eb;
  --ds-ink: #172333;
  --ds-muted: #556276;
  --ds-orange: #d6820b;
  --ds-orange-hover: #b96c05;
}
html[data-bs-theme] {
  --bs-body-bg: var(--ds-page);
  --bs-body-color: var(--ds-ink);
  --bs-emphasis-color: var(--ds-ink);
  --bs-secondary-color: var(--ds-muted);
  --bs-secondary-bg: var(--ds-panel-soft);
  --bs-tertiary-bg: var(--ds-panel);
  --bs-border-color: var(--ds-line);
  --bs-primary: var(--ds-orange);
  --bs-primary-rgb: 245,166,35;
  --bs-link-color: var(--ds-orange);
  --bs-link-hover-color: var(--ds-orange-hover);
}
html[data-bs-theme="light"] {
  --bs-primary-rgb: 214,130,11;
}
body {
  background: var(--ds-page);
  color: var(--ds-ink);
  transition: background-color 150ms ease, color 150ms ease;
}
.main-workspace {
  min-width: 0;
  background: var(--ds-page);
  color: var(--ds-ink);
}
.main-workspace > main {min-width: 0;}
.topbar-header,
.topbar-header.bg-white,
.main-workspace > footer.bg-white {
  background: var(--ds-panel) !important;
  border-color: var(--ds-line) !important;
  color: var(--ds-ink);
}
.sidebar-wrapper {
  background: #171b22;
  border-right: 1px solid #333943;
}
html[data-bs-theme="light"] .sidebar-wrapper {
  background: #172333;
  border-right-color: #273a50;
}
.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link:hover {
  color: #ffb941 !important;
}
/* Existing view CSS contains many hard-coded white cards and table backgrounds. */
.main-workspace .card,
.main-workspace .card-header,
.main-workspace .card-footer,
.main-workspace .modal-content,
.main-workspace .offcanvas,
.main-workspace .dropdown-menu,
.main-workspace .accordion-item,
.main-workspace .list-group-item,
.modal-content {
  background-color: var(--ds-panel);
  color: var(--ds-ink);
  border-color: var(--ds-line);
}
.main-workspace .bg-white:not(img),
.main-workspace .bg-light:not(.badge),
.main-workspace .table-light,
.main-workspace .table-light > :not(caption) > * > * {
  background-color: var(--ds-panel) !important;
  color: var(--ds-ink);
}
.main-workspace .bg-body-tertiary,
.main-workspace .bg-body-secondary,
.main-workspace .bg-light-subtle {
  background: var(--ds-panel-soft) !important;
}
.main-workspace .table,
.main-workspace table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ds-ink);
  --bs-table-border-color: var(--ds-line);
  color: var(--ds-ink);
}
.main-workspace .table thead,
.main-workspace .table thead th {
  background: var(--ds-panel-soft);
  color: var(--ds-ink);
  border-color: var(--ds-line);
}
.main-workspace .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: var(--ds-panel-soft);
}
.main-workspace input:not([type="checkbox"]):not([type="radio"]),
.main-workspace textarea,
.main-workspace select,
.main-workspace .form-control,
.main-workspace .form-select,
.main-workspace .input-group-text {
  background-color: var(--ds-panel);
  color: var(--ds-ink);
  border-color: var(--ds-line);
}
.main-workspace .form-control::placeholder,
.main-workspace textarea::placeholder {color: var(--ds-muted); opacity: .9;}
.main-workspace .form-control:focus,
.main-workspace .form-select:focus {
  border-color: var(--ds-orange);
  box-shadow: 0 0 0 3px rgba(245,166,35,.14);
}
.main-workspace .text-muted,
.main-workspace .text-secondary {color: var(--ds-muted) !important;}
.main-workspace .text-dark:not(.badge),
.main-workspace .text-black:not(.badge) {color: var(--ds-ink) !important;}
.main-workspace .border,
.main-workspace .border-top,
.main-workspace .border-bottom,
.main-workspace .border-start,
.main-workspace .border-end {border-color: var(--ds-line) !important;}
.main-workspace .btn-primary {
  background: var(--ds-orange);
  border-color: var(--ds-orange);
  color: #151515;
  font-weight: 650;
}
.main-workspace .btn-primary:hover {
  background: var(--ds-orange-hover);
  border-color: var(--ds-orange-hover);
  color: #151515;
}
.main-workspace .btn-light {
  background: var(--ds-panel-soft);
  border-color: var(--ds-line);
  color: var(--ds-ink);
}
.main-workspace .btn-outline-secondary {
  border-color: var(--ds-line);
  color: var(--ds-ink);
}
.main-workspace .btn-outline-secondary:hover {
  background: var(--ds-panel-soft);
  color: var(--ds-ink);
}
.main-workspace a:not(.btn):not(.nav-link):not(.dropdown-item) {color: var(--ds-orange);}
.main-workspace a:not(.btn):not(.nav-link):not(.dropdown-item):hover {color: var(--ds-orange-hover);}
/* The toggle stays within reach of staff on narrow phones. */
#dewserve-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 42px;
  min-width: 98px;
  padding: .48rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--ds-line);
  background: var(--ds-panel-soft);
  color: var(--ds-ink);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 3px 14px rgba(0,0,0,.08);
}
#dewserve-theme-toggle .bi {font-size: 1rem; color: var(--ds-orange);}
#dewserve-theme-toggle:hover {border-color: var(--ds-orange);}
#dewserve-theme-toggle:focus-visible {outline: 3px solid var(--ds-orange); outline-offset: 3px;}
@media (max-width: 575.98px) {
  .topbar-header {padding: .55rem .75rem !important; gap: .35rem;}
  .topbar-header > .d-flex:last-child {min-width: 0; gap: .35rem !important;}
  .topbar-header .badge {max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
  .main-workspace > main {padding: .9rem !important;}
  #dewserve-theme-toggle {min-width: 44px; padding: .5rem .7rem;}
  #dewserve-theme-toggle .ds-theme-label {display: none;}
  .main-workspace .card {border-radius: 14px;}
  .main-workspace .table-responsive {border-radius: 12px;}
}

/*
 * V2 contrast repair: several owner pages have component-specific CSS that
 * hard-codes white panels. Bootstrap's data-bs-theme cannot reach those.
 * These rules are deliberately scoped to known portal components; QR artwork,
 * the public storefront, invoices and thermal/QR print layouts are untouched.
 */
.main-workspace .table-hub .hub-panel,
.main-workspace .table-hub .table-card,
.main-workspace #qr-studio .qr-panel,
.main-workspace .dew-import-panel,
.main-workspace .subscription-plans-page .plan-card,
.main-workspace .checkout-preview .section-card,
.main-workspace .wa-console .wa-surface {
  background: var(--ds-panel) !important;
  color: var(--ds-ink) !important;
  border-color: var(--ds-line) !important;
}

/* QR locations and table cards (the page shown in the report). */
.main-workspace .table-hub,
.main-workspace .table-hub h3,
.main-workspace .table-hub h5,
.main-workspace .table-hub .hub-panel p,
.main-workspace .table-hub .table-card p {
  color: var(--ds-ink);
}
.main-workspace .table-hub .table-url {
  color: var(--ds-muted) !important;
  overflow-wrap: anywhere;
}
.main-workspace .table-hub .hub-actions .btn-outline-secondary {
  background: var(--ds-panel-soft);
  color: var(--ds-ink);
  border-color: var(--ds-line);
}
.main-workspace .table-hub .hub-actions .btn-outline-secondary:hover {
  background: var(--ds-orange);
  color: #151515;
}
.main-workspace .table-hub .table-card {
  box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
}

/* QR designer: theme the editing controls but keep the QR preview printable. */
.main-workspace #qr-studio .qr-template,
.main-workspace #qr-studio .qr-checks label {
  background: var(--ds-panel-soft);
  color: var(--ds-ink);
  border-color: var(--ds-line);
}
.main-workspace #qr-studio .qr-muted,
.main-workspace #qr-studio .qr-preview-link {color: var(--ds-muted);}
.main-workspace #qr-studio .qr-warning {color: var(--ds-orange);}
.main-workspace #qr-studio .qr-preview-stage {
  background: #ece9e2;
  color: #172333;
}

/* WhatsApp management: its independent green design also needs dark surfaces. */
.main-workspace .wa-console {
  --wa-line: var(--ds-line);
  --wa-muted: var(--ds-muted);
  --wa-soft: var(--ds-panel-soft);
  color: var(--ds-ink) !important;
}
.main-workspace .wa-console .wa-hero {
  background: linear-gradient(120deg, var(--ds-panel-soft), var(--ds-panel) 78%) !important;
}
.main-workspace .wa-console .wa-config-body {
  background: var(--ds-panel-soft);
  color: var(--ds-ink);
}
html[data-bs-theme="dark"] .main-workspace .wa-console .wa-test-option {
  background: #493311;
  border-color: #87611d;
  color: #fdf1d9;
}

/* Menu import, billing plans and checkout previews. */
.main-workspace .dew-import-heading,
.main-workspace .subscription-plans-page .plans-heading,
.main-workspace .subscription-plans-page .plan-price-amount,
.main-workspace .subscription-plans-page .feature-list li,
.main-workspace .checkout-preview {
  color: var(--ds-ink);
}
.main-workspace .dew-import-note,
.main-workspace .dew-import-steps,
.main-workspace .subscription-plans-page .plans-muted,
.main-workspace .subscription-plans-page .feature-list .feature-disabled,
.main-workspace .checkout-preview .muted {
  color: var(--ds-muted);
}
.main-workspace .dew-import-steps span,
.main-workspace .dew-import-table thead th,
.main-workspace .subscription-plans-page .cycle-toggle,
.main-workspace .subscription-plans-page .current-plan-strip,
.main-workspace .subscription-plans-page .selection-summary,
.main-workspace .checkout-preview .total-box {
  background: var(--ds-panel-soft);
  color: var(--ds-ink);
  border-color: var(--ds-line);
}
.main-workspace .subscription-plans-page .cycle-toggle .btn {
  color: var(--ds-muted);
}
.main-workspace .subscription-plans-page .cycle-toggle .btn.is-active {
  background: var(--ds-panel);
  color: var(--ds-orange);
}
.main-workspace .dew-import-img-empty {
  background: var(--ds-panel-soft);
  border-color: var(--ds-line);
}

/*
 * V3 — Orders Queue + Kitchen Display (KDS).
 * Both screens share .ops-shell but their own view stylesheet still hard-codes
 * light cards (#fff) and navy headings (#172033). Scope these adjustments to
 * dark mode so light mode retains its intentionally bright workspace.
 */
html[data-bs-theme="dark"] .main-workspace .ops-shell {
  --ops-border: #343c49;
  --ops-muted: #b0b8c6;
  color: var(--ds-ink);
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-heading h2,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-heading h5,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-kitchen-title,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-order-no,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-dish b,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-total strong,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-stat strong {
  color: #f5f6f8;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-eyebrow {
  color: #f5a623;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-stat,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-card,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-empty {
  background: #191c22;
  border-color: #343c49;
  color: #f5f6f8;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .13);
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-card {
  border-top-color: var(--accent, #f5a623);
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-lane {
  background: #222630;
  border: 1px solid #343c49;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-lane > .d-flex > h5 {
  color: #f5f6f8;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-tab {
  color: #d9dee7 !important;
  background: #222630;
  border-color: #343c49;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-tab:hover {
  background: #303641;
  border-color: #f5a623;
  color: #fff !important;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-tab.selected {
  background: #f5a623;
  color: #101216 !important;
  border-color: #f5a623;
  box-shadow: 0 3px 13px rgba(245, 166, 35, .18);
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-tag,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-note {
  background: #292e39;
  color: #e8ebf1;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-warning {
  background: #493311;
  color: #ffe4ad;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-total,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-dish {
  border-color: #343c49;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-pill {
  color: var(--accent);
  background: var(--soft);
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-timer {
  color: #72b5ff;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-timer.overdue {
  color: #ff8389;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-refresh,
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-empty .text-secondary {
  color: #b0b8c6 !important;
}
/* This component originally uses an inline background:#fff. Important is
 * necessary to keep customer update forms legible on both KDS and Orders. */
html[data-bs-theme="dark"] .main-workspace .ops-shell details.ds32-note {
  background: #222630 !important;
  color: #f5f6f8;
  border-color: #434b5b !important;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell details.ds32-note summary {
  color: #f5f6f8;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-actions .btn-outline-secondary,
html[data-bs-theme="dark"] .main-workspace .ops-shell .btn-outline-secondary {
  background: #222630;
  color: #e8ebf1;
  border-color: #434b5b;
}
html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-actions .btn-outline-secondary:hover,
html[data-bs-theme="dark"] .main-workspace .ops-shell .btn-outline-secondary:hover {
  background: #303641;
  color: #fff;
  border-color: #f5a623;
}
@media (max-width: 575.98px) {
  html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-lane {
    padding: .65rem;
  }
  html[data-bs-theme="dark"] .main-workspace .ops-shell .ops-stat strong {
    font-size: 1.5rem;
  }
}
