:root {
  /* ─── Brand (Sapaad green) ─── */
  --brand-50: #ecfdf3;
  --brand-100: #d1fadf;
  --brand-200: #a6f4c5;
  --brand-500: #22c55e;
  --brand-600: #16a34a;
  --brand-700: #15803d;
  --brand-800: #166534;

  /* ─── Surfaces ─── */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f8f7;
  --bg-tertiary: #f1f3f2;
  --bg-success: #dcfce7;
  --bg-danger: #fee2e2;
  --bg-info: #dbeafe;
  --bg-warning: #fef4e2;

  /* ─── Text ─── */
  --text-primary: #15191c;
  --text-secondary: #5b6168;
  --text-tertiary: #9aa1a8;
  --text-success: #15803d;
  --text-danger: #b42318;
  --text-info: #1e40af;
  --text-warning: #92400e;

  /* ─── Accents ─── */
  --green: var(--brand-500);
  --green-dark: var(--brand-600);
  --blue: #3b82f6;

  /* ─── Borders ─── */
  --border-tertiary: rgba(16, 24, 32, 0.06);
  --border-secondary: rgba(16, 24, 32, 0.11);
  --border-primary: rgba(16, 24, 32, 0.2);

  /* ─── Accent aliases (brand-driven) ─── */
  --accent: var(--brand-600);
  --accent-dark: var(--brand-700);
  --accent-light: var(--brand-50);
  --focus-ring: rgba(22, 163, 74, 0.18);

  /* ─── Sidebar (deep, premium dark) ─── */
  --sidebar-bg: #14171a;
  --sidebar-fg: rgba(255, 255, 255, 0.72);
  --sidebar-fg-muted: rgba(255, 255, 255, 0.4);
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-border: rgba(255, 255, 255, 0.08);

  /* ─── Elevation ─── */
  --shadow-xs: 0 1px 2px rgba(16, 24, 32, 0.05);
  --shadow-sm:
    0 1px 3px rgba(16, 24, 32, 0.08), 0 1px 2px rgba(16, 24, 32, 0.04);
  --shadow-md:
    0 4px 12px rgba(16, 24, 32, 0.08), 0 2px 4px rgba(16, 24, 32, 0.04);
  --shadow-lg:
    0 12px 32px rgba(16, 24, 32, 0.12), 0 4px 8px rgba(16, 24, 32, 0.06);

  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 100px;

  --navbar-bg: var(--sidebar-bg);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

::selection {
  background: var(--brand-100);
  color: var(--brand-800);
}

/* Premium thin scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 24, 32, 0.2) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(16, 24, 32, 0.18);
  border: 3px solid transparent;
  border-radius: 100px;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 24, 32, 0.3);
  background-clip: padding-box;
}

/* Consistent keyboard focus across interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: 244px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-logo {
  padding: 6px 8px;
  margin-bottom: 20px;
}

.sidebar-logo img {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.nav-group {
  margin-bottom: 10px;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sidebar-fg-muted);
  padding: 10px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-md);
  color: var(--sidebar-fg);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition:
    background 0.14s ease,
    color 0.14s ease;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.nav-item.active svg {
  color: #fff;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--sidebar-fg-muted);
  transition: color 0.14s ease;
}

.nav-item:hover svg {
  color: rgba(255, 255, 255, 0.85);
}

/* Sidebar user footer (sticky bottom) */
.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-sub {
  font-size: 11px;
  color: var(--sidebar-fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-tertiary);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.topbar-brand-label strong {
  color: var(--text-primary);
  font-weight: 600;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navbar-bg);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.content-area {
  padding: 28px 24px;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-secondary);
}

@media (max-width: 900px) {
  .content-area {
    padding: 24px 20px;
  }
}

/* Page header */
.page-header {
  margin-bottom: 24px;
}

.page-header.with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.page-header .actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary);
}

.page-header .sub {
  color: var(--text-secondary);
  margin-top: 6px;
  font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: var(--shadow-xs);
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.05s ease;
}

.btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-primary);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: var(--brand-600);
  color: #fff;
  border-color: transparent;
  box-shadow:
    0 1px 2px rgba(16, 24, 32, 0.08),
    0 2px 6px rgba(22, 163, 74, 0.25);
}

.btn-primary:hover {
  background: var(--brand-700);
  border-color: transparent;
}

.btn-primary:disabled {
  background: var(--brand-600);
}

.btn.is-readonly,
.btn-primary.is-readonly {
  background: var(--bg-tertiary, #e2e8f0);
  color: var(--text-tertiary, #94a3b8);
  border-color: var(--border-primary, #cbd5e1);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.success {
  background: var(--bg-success);
  color: var(--text-success);
}

.pill.neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.pill.info {
  background: var(--bg-info);
  color: var(--text-info);
}

/* Schedule cards */
.schedule-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.schedule-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-secondary);
  transform: translateY(-1px);
}

.schedule-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.schedule-name {
  font-size: 15px;
  font-weight: 600;
}

.schedule-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

.schedule-windows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.window-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  font-size: 12px;
  color: var(--text-secondary);
}

.window-pill strong {
  color: var(--text-primary);
}

.schedule-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-tertiary);
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  align-items: center;
}

.schedule-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.schedule-meta svg {
  width: 14px;
  height: 14px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 32, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: overlay-in 0.16s ease;
}

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

.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.modal-sm {
  width: 460px;
}

.modal.modal-md {
  width: 520px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-tertiary);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  height: 60vh;
  overflow-y: auto;
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-tertiary);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-footer .btn-start {
  margin-right: auto;
}
.btn-text-danger {
  color: var(--text-danger);
}
.btn-text-success {
  color: var(--text-success);
}

/* Compact alert-style dialog (useDialog) — sits above feature modals */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 24, 32, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: overlay-in 0.16s ease;
}
.dialog-box {
  width: 100%;
  max-width: 320px;
  min-height: 240px;
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.dialog-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}
.dialog-message {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}
.dialog-message p {
  margin: 0;
}
.dialog-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.dialog-actions .btn {
  min-width: 88px;
}

/* Schedule form fields */
.schedule-field {
  margin-bottom: 22px;
}

.schedule-field:last-child {
  margin-bottom: 0;
}

.schedule-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  display: block;
}

.schedule-field-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.schedule-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--bg-primary);
}

.schedule-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.time-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.time-row .schedule-input {
  flex: 1;
}

.time-row span {
  color: var(--text-tertiary);
  font-size: 13px;
}

.time-row-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.time-row-remove:hover {
  color: var(--text-danger);
  background: var(--bg-danger);
}

.time-row-remove svg {
  width: 16px;
  height: 16px;
}

/* Timing group cards */
.timing-group-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
}

.timing-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.timing-group-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.repeat-select {
  padding: 5px 10px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  font-weight: 500;
}

.repeat-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.timing-group-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.timing-group-remove:hover {
  color: var(--text-danger);
  background: var(--bg-danger);
}

.timing-group-days {
  margin-bottom: 12px;
}

.timing-group-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-slot-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 4px 0;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}

.add-slot-btn:hover {
  color: var(--accent-dark);
}

.add-group-btn {
  background: transparent;
  border: 1px dashed var(--border-secondary);
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.add-group-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.add-group-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-tertiary);
}

.add-group-wrapper {
  margin-top: 4px;
}

.repeat-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-tertiary);
}

.modal-lg {
  width: 700px;
}

.time-separator {
  color: var(--text-tertiary);
  font-size: 13px;
  flex-shrink: 0;
}

.schedule-input.input-error {
  border-color: var(--text-danger);
}

.schedule-input.input-error:focus {
  box-shadow: 0 0 0 2px var(--bg-danger);
}

.slot-error-msg {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-danger);
  margin-top: 2px;
  margin-bottom: 4px;
}

/* Day chips */
.day-chips {
  display: flex;
  gap: 6px;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  transition: all 0.12s;
  border: 1px solid transparent;
}

.day-chip.selected {
  background: var(--navbar-bg);
  color: white;
}

.day-chip:hover:not(.selected):not(.disabled) {
  background: var(--bg-primary);
  border-color: var(--border-secondary);
}

.day-chip.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Selectable chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  transition: all 0.12s;
}

.chip:hover:not(.selected) {
  border-color: var(--border-secondary);
  color: var(--text-primary);
}

.chip.selected {
  background: var(--navbar-bg);
  color: white;
  border-color: var(--navbar-bg);
}

/* Loader */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
}

.loader-text {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state.empty-state-compact {
  padding: 28px;
}

.empty-state.empty-state-padded {
  padding: 40px 20px;
}

.empty-state-action {
  margin-top: 12px;
}

/* EmptySchedules ships its own 160×140 illustration; icon-based empty states
   keep their intrinsic icon size. Just handle spacing here. */
.empty-state svg {
  margin-bottom: 18px;
}

.empty-state p {
  font-size: 13.5px;
  color: var(--text-tertiary);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Card action buttons */
.card-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}

.btn-icon-sm:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

.btn-icon-sm.danger:hover {
  background: var(--bg-danger);
  color: var(--text-danger);
  border-color: #fecaca;
}

.btn-icon-sm svg {
  width: 15px;
  height: 15px;
}

/* Placeholder page */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text-tertiary);
}

.placeholder-page svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.placeholder-page h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.placeholder-page p {
  font-size: 14px;
}

/* Filter row */
.filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: stretch;
}

.filter-row.filter-row-tight {
  margin-top: 0;
}

.filter-dropdown-wrapper {
  position: relative;
}

.filter-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  padding: 0 14px;
  width: 170px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: inherit;
  user-select: none;
  height: 44px;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.filter-select:hover {
  border-color: var(--border-primary);
}

.filter-select-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

.filter-select-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-select-value span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-select-value svg {
  color: var(--text-tertiary);
}

.filter-dropdown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
}

.filter-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}

.filter-dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}

.filter-dropdown-item:hover {
  background: var(--bg-tertiary);
}

.filter-dropdown-item.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 500;
}

.filter-search {
  flex: 1;
  min-width: 240px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.filter-search:focus-within {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.filter-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  height: inherit;
}

.filter-search svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-clear-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  transition:
    color 0.12s ease,
    background-color 0.12s ease;
}

.search-clear-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* Data table */
.data-table-wrap {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  text-align: left;
  padding: 13px 16px;
  background: var(--bg-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-tertiary);
}

.data-table thead th.center,
.data-table tbody td.center,
.data-table thead th.cell-center,
.data-table tbody td.cell-center {
  text-align: center;
}

.data-table thead th.right,
.data-table tbody td.right,
.data-table thead th.cell-right,
.data-table tbody td.cell-right {
  text-align: right;
}

.data-table tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--border-tertiary);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-secondary);
}

.data-table tbody td strong {
  color: var(--text-primary);
  font-weight: 600;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: var(--brand-50);
}

.table-footer {
  text-align: center;
  padding: 14px;
  color: var(--text-tertiary);
  font-size: 12px;
  border-top: 1px solid var(--border-tertiary);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
  margin-top: 8px;
}

.page-indicator,
.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  margin-top: 4px;
}

.table-pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.table-pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-pagination-page {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Platform icons */
.platforms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.platform-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 8px;
  color: white;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  background: var(--swatch-color);
}

/* Aggregator logo (wordmark) in the platforms column — kept small so a location
   with many aggregators still fits (the row wraps). */
.platform-logo {
  height: 16px;
  max-width: 60px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

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

/* ─── Menu tab ─── */

/* Native <select> embedded inside the existing filter-select chrome */
.filter-select-value select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  padding: 0;
  width: 100%;
}

/* Horizontal scroll container for the many aggregator columns */
.menu-scroll-wrap {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.menu-table {
  min-width: 760px;
}

.menu-table th.menu-master-col,
.menu-table td.menu-master-col,
.menu-table th.menu-agg-col,
.menu-table td.menu-agg-col {
  white-space: nowrap;
  width: 150px;
}

.menu-table td.menu-master-col {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Aggregator columns centre their header + price/toggle stack */
.menu-table th.menu-agg-col,
.menu-table td.menu-agg-col {
  text-align: center;
}

/* Sticky left column so the item name stays visible while scrolling */
.menu-table th.menu-col-item,
.menu-table td.menu-col-item {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  min-width: 280px;
  background: var(--bg-primary);
}

.menu-table thead th.menu-col-item {
  background: var(--bg-secondary);
}

.menu-table tbody tr:hover td.menu-col-item {
  background: var(--brand-50);
}

/* Item cell: thumbnail + name/category */
.menu-item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-thumb {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  overflow: hidden;
}

.menu-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item-name strong {
  color: var(--text-primary);
  font-weight: 600;
}

.menu-item-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.type-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
}

.type-badge.item {
  background: var(--bg-info);
  color: var(--text-info);
}

.type-badge.modifier {
  background: #ede9fe;
  color: #6d28d9;
}

/* Aggregator price cell: editable-on-hover price chip + availability toggle.
   Price and toggle are centred and stacked so the toggle sits under the price. */
.menu-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.menu-cell.off .menu-price {
  color: var(--text-tertiary);
}

.menu-price-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font: inherit;
  color: var(--text-primary);
  background: transparent;
  border: 1px dashed transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}

/* Unsaved local edit (draft) */
.menu-price-chip.edited {
  background: var(--bg-warning);
  border-color: transparent;
}

.menu-price-chip.edited .menu-price {
  color: var(--text-warning);
}

.menu-draft-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-warning);
  background: rgba(146, 64, 14, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Inline price editor */
.menu-price-input {
  width: 76px;
  padding: 3px 6px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Price = small currency symbol + amount, vertically centred together */
.menu-price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  white-space: nowrap;
}

.menu-price-cur {
  font-size: 0.7em;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-right: 3px;
}

.menu-price-prefix {
  font-weight: 600;
  color: var(--text-tertiary);
}

/* Modifier thumbnail tint */
.menu-thumb.modifier {
  background: #f3effb;
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.18);
}

/* ─── Review & Sync modal ─── */
.review-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-success);
  margin-bottom: 12px;
}

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

.review-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.review-row:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-sm);
}

.review-row-check {
  flex-shrink: 0;
  color: var(--brand-600);
}

.review-row-main {
  flex: 1;
  min-width: 0;
}

.review-row-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
}

.review-row-title strong {
  color: var(--text-primary);
  font-weight: 600;
}

.review-sep {
  color: var(--border-secondary, #d1d5db);
  user-select: none;
  font-size: 14px;
}

.review-row-change-type {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: capitalize;
}

.review-arrow {
  color: var(--text-tertiary);
}

.review-row-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.review-agg-chip {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-tertiary);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.review-footer-note {
  font-size: 13px;
  color: var(--text-secondary);
  align-self: center;
  margin-right: auto;
}

/* ─── Aggregators page ─── */
.agg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.agg-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.agg-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-secondary);
  transform: translateY(-2px);
}

.agg-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
}

.agg-logo {
  display: flex;
  align-items: center;
  height: 44px;
  /* Logo artwork is tight-cropped on the left, so it starts at the card's
     content edge — lining up with the aggregator name below it. */
}

.agg-logo img {
  max-height: 38px;
  max-width: 150px;
  object-fit: contain;
}

.agg-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  background: var(--swatch-color);
}

.agg-mode {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-warning);
  background: var(--bg-warning);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.agg-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.agg-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.agg-region {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 2px 7px;
  border-radius: 5px;
}

.agg-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.agg-cap {
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.agg-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto; /* pin to the bottom regardless of content above */
  padding-top: 12px;
}

.agg-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.agg-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.agg-status.on {
  color: var(--text-success);
}
.agg-status.on::before {
  background: var(--green);
}

/* Unavailable in the company's region — whole card dimmed & non-interactive */
.agg-card.unavailable {
  background: var(--bg-secondary);
  box-shadow: none;
}

.agg-card.unavailable:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-tertiary);
}

.agg-card.unavailable .agg-logo,
.agg-card.unavailable .agg-name,
.agg-card.unavailable .agg-regions,
.agg-card.unavailable .agg-caps {
  opacity: 0.45;
  filter: grayscale(0.4);
}

/* Coming soon — in-region but not yet integrated/configurable. */
.agg-card.coming-soon {
  background: var(--bg-secondary);
  box-shadow: none;
}

.agg-card.coming-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-tertiary);
}

.agg-card.coming-soon .agg-logo,
.agg-card.coming-soon .agg-name,
.agg-card.coming-soon .agg-desc,
.agg-card.coming-soon .agg-loc-count,
.agg-card.coming-soon .agg-regions,
.agg-card.coming-soon .agg-caps {
  opacity: 0.72;
  filter: grayscale(0.2);
}

.agg-card.coming-soon .agg-conn-badge {
  opacity: 0.65;
}

/* Red diagonal corner ribbon */
.agg-ribbon-coming-soon {
  position: absolute;
  top: 30px;
  right: -30px;
  transform: rotate(45deg);
  width: 140px;
  background: #ea2a2a;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  z-index: 10;
  user-select: none;
  line-height: 1.2;
}

.agg-coming-soon {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.agg-unavailable-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.agg-unavailable-note svg {
  flex-shrink: 0;
}

/* ─── Aggregator config page ─── */
.config-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.config-back:hover {
  color: var(--brand-700);
}

.config-header {
  align-items: center;
}
.config-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.config-logo {
  max-height: 34px;
  max-width: 150px;
  object-fit: contain;
}

.config-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 0;
}

.config-card-head {
  margin-bottom: 16px;
}
.config-card-head h2 {
  font-size: 16px;
  font-weight: 600;
}
.config-card-head p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.config-enable {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.config-enable input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand-600);
}
.config-enable-title {
  font-weight: 600;
}
.config-enable-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Per-location list */
.config-locations {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.config-location {
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.14s ease;
}
.config-location.enabled {
  border-color: var(--brand-200);
}
.config-location-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
.config-location.enabled .config-location-head {
  background: var(--brand-50);
}
.config-location-head input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-600);
}
.config-location-name {
  font-weight: 600;
}
.config-location-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}
.config-location-body {
  padding: 16px;
  border-top: 1px solid var(--border-tertiary);
}

/* ─── DynamicForm ─── */
.df-section + .df-section {
  margin-top: 22px;
}
.df-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.df-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}
.df-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.df-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.df-required {
  color: var(--text-danger);
  margin-left: 3px;
}
.df-help {
  font-size: 12px;
  color: var(--text-tertiary);
}

.df-input {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}
.df-input:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.df-input:disabled,
.df-input[disabled] {
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-tertiary, #94a3b8);
  border-color: var(--border-primary, #e2e8f0);
  cursor: not-allowed;
  opacity: 0.75;
}
select.df-input {
  appearance: none;
  cursor: pointer;
}

.df-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.df-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-600);
}

/* Schedule field */
.schedule-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.schedule-select {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  background: var(--bg-primary);
}
.schedule-select select {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  cursor: pointer;
}

/* ─── Order Automation entry card (on Aggregators page) ─── */
.automation-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--brand-50), var(--bg-primary));
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.16s ease,
    transform 0.16s ease;
}
.automation-entry:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.automation-entry-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.automation-entry-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.automation-entry-title {
  font-weight: 600;
  color: var(--text-primary);
}
.automation-entry-sub {
  font-size: 13px;
  color: var(--text-secondary);
}
.automation-entry-chevron {
  color: var(--text-tertiary);
}

/* ─── Header actions with the location filter ─── */
.automation-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

/* ─── Prep time controls ─── */
.prep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 720px) {
  .prep-grid {
    grid-template-columns: 1fr;
  }
}
.prep-control {
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-secondary);
}
.prep-label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
}
.prep-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prep-input-row .df-input {
  max-width: 120px;
}
.prep-unit {
  font-size: 13px;
  color: var(--text-tertiary);
}
.prep-range {
  width: 100%;
  margin-top: 14px;
  accent-color: var(--brand-600);
}
.prep-range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ─── Auto-acknowledge platform table ─── */
.automation-platforms {
  display: flex;
  flex-direction: column;
}
.automation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-tertiary);
}
.automation-row:last-child {
  border-bottom: 0;
}
.automation-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.automation-platform img {
  max-height: 26px;
  width: 110px;
  object-fit: contain;
}
.agg-logo-badge.sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ─── Config workspace (section nav + body) ─── */
.config-workspace {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 760px) {
  .config-workspace {
    grid-template-columns: 1fr;
  }
}
.config-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (max-width: 760px) {
  .config-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
.config-nav-item {
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.config-nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.config-nav-item.active {
  color: var(--brand-700);
  background: var(--brand-50);
  border-left-color: var(--brand-600);
}
.config-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Config sections — full width */
.config-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.config-scope-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-info);
  color: var(--text-info);
  font-size: 13px;
  line-height: 1.45;
}
.config-scope-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}
.config-enable-inline {
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
}
.config-enable-inline input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-600);
}

/* Config page top bar: back · title · filter · save, all aligned in one row */
.config-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
/* Sticky variant: full-bleed within the padded content area, pinned on scroll.
   .content-area is the scroll container and has 36px top padding; a sticky box
   in a padded scroller pins to the CONTENT box (below the padding), leaving a
   36px strip where content leaks above the bar. Pulling the bar up by the
   padding (margin-top: -36) AND matching `top: -36` pins its visible edge flush
   at the very top of the scroll area, covering that strip at rest and on scroll. */
.config-topbar.sticky {
  position: sticky;
  top: -28px;
  z-index: 30;
  margin: -28px -28px 20px;
  padding: 14px 28px;
  background: var(--bg-secondary);
  box-shadow:
    0 1px 0 var(--border-tertiary),
    0 8px 16px -12px rgba(16, 24, 32, 0.18);
}
@media (max-width: 900px) {
  .config-topbar.sticky {
    top: -24px;
    margin: -24px -20px 28px;
    padding: 14px 20px;
  }
}
.config-back-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease;
}
.config-back-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-primary);
  color: var(--text-primary);
}
.config-topbar .config-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.config-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.config-topbar .config-heading h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.config-subtitle {
  font-size: 12.5px;
  color: var(--text-tertiary);
}
.config-topbar .config-logo {
  max-height: 42px;
  max-width: 200px;
  object-fit: contain;
}
.config-topbar-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-left: auto;
}

/* Per-section save footer */
.config-card-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-tertiary);
}
.config-md-form .config-card-foot {
  margin-top: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Toggle switch (settings) */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  border: 0;
  padding: 0;
  border-radius: 11px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.16s ease;
}
.switch.on {
  background: var(--green);
}
.switch:disabled,
.switch[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.85);
  box-shadow: none;
}
.switch:disabled .switch-knob {
  box-shadow: none;
  background: #f1f5f9;
}
.switch:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: left 0.16s ease;
}
.switch.on .switch-knob {
  left: 20px;
}
/* Loading state: a centered spinner occupying the switch's 40×22 footprint. */
.switch-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
  color: var(--brand-600, #4f46e5);
}

/* Enable card: label left, switch right */
.enable-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Outlets master–detail */
.outlets-card {
  padding-bottom: 8px;
}
.config-md {
  display: grid;
  grid-template-columns: 264px 1fr;
  border-top: 1px solid var(--border-tertiary);
  margin: 0 -22px -8px;
}
@media (max-width: 760px) {
  .config-md {
    grid-template-columns: 1fr;
  }
}

.config-md-list {
  border-right: 1px solid var(--border-tertiary);
  padding: 14px;
}
@media (max-width: 760px) {
  .config-md-list {
    border-right: 0;
    border-bottom: 1px solid var(--border-tertiary);
  }
}
.md-search {
  box-shadow: none;
  margin-bottom: 10px;
}
.md-locations {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 460px;
  overflow-y: auto;
}
.md-loc {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
  border-left: 2px solid transparent;
  transition: background 0.12s ease;
}
.md-loc:hover {
  background: var(--bg-tertiary);
}
.md-loc.selected {
  background: var(--brand-50);
  border-left-color: var(--brand-600);
}
.md-loc-pin {
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.md-loc.selected .md-loc-pin {
  color: var(--brand-600);
}
.md-loc-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.md-loc-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-loc-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-loc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-primary);
  flex-shrink: 0;
}
.md-loc-dot.on {
  background: var(--green);
}
.md-loc-flag {
  color: var(--text-danger);
  flex-shrink: 0;
}
.md-empty {
  padding: 10px;
  font-size: 13px;
}
.md-loading-more {
  padding: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
}

.config-md-form {
  padding: 18px 22px;
  min-width: 0;
}
.md-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-tertiary);
}
.md-form-title {
  font-size: 15px;
  font-weight: 600;
}
.md-form-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.md-enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.md-form-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  color: var(--text-tertiary);
}

/* Inline form error banner */
.form-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-danger);
  color: var(--text-danger);
  font-size: 13px;
  line-height: 1.45;
}
.form-error-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.form-success-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-success);
  color: var(--text-success);
  font-size: 13px;
  line-height: 1.45;
}
.form-success-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.menu-price-amt {
  font-size: 14px;
  line-height: 1;
}

.menu-edit-icon {
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.12s;
}

/* Hover reveals the dashed border + edit icon (Image #4) */
.menu-price-chip:hover {
  border-color: var(--border-primary);
  background: var(--bg-secondary);
}

.menu-price-chip:hover .menu-edit-icon {
  opacity: 1;
}

/* Availability toggle — small, smooth, labelled ON/OFF pill */
.menu-toggle {
  position: relative;
  display: inline-block; /* width/height don't apply to inline elements */
  width: 38px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.menu-toggle.on {
  background: var(--green);
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.menu-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: left 0.2s ease;
}

.menu-toggle.on .menu-toggle-knob {
  left: 22px;
}

.menu-toggle-text {
  position: absolute;
  top: 0;
  right: 5px; /* OFF label sits on the right (knob is on the left) */
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #64748b;
  transition: color 0.2s ease;
}

.menu-toggle.on .menu-toggle-text {
  right: auto;
  left: 6px; /* ON label sits on the left (knob is on the right) */
  color: #fff;
}

/* Location filter dropdown panel */
button.filter-select {
  font: inherit;
  text-align: left;
}

.filter-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  width: 280px;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}

.filter-dropdown-panel.align-right {
  left: auto;
  right: 0;
}

.filter-dropdown-panel .ms-picker {
  border: 0;
}

/* Search inside a single-select dropdown panel (e.g. Category) */
.filter-dropdown-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-tertiary);
  color: var(--text-tertiary);
}

.filter-dropdown-search input {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.dropdown-check {
  color: var(--blue);
  flex-shrink: 0;
}

/* Note clarifying that the Location selector scopes edits, not the list */
.menu-scope-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-info);
  color: var(--text-info);
  font-size: 13px;
}

.menu-scope-note svg {
  flex-shrink: 0;
}

/* ─── MultiSelectPicker (searchable multi-select for large lists) ─── */
.ms-picker {
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  overflow: hidden;
}

.ms-picker-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.ms-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-tertiary);
  background: var(--bg-secondary);
  flex-wrap: wrap;
  border-radius: inherit;
  margin-top: 3px;
}

.ms-picker-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 160px;
  color: var(--text-tertiary);
}

.ms-picker-search input {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.ms-picker-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.ms-picker-count {
  color: var(--text-tertiary);
  white-space: nowrap;
}

.ms-picker-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.ms-picker-link:disabled {
  color: var(--text-tertiary);
  cursor: default;
}

.ms-picker-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.ms-picker-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

.ms-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  color: var(--text-primary);
}

.ms-picker-row:hover {
  background: var(--bg-tertiary);
}

.ms-picker-row.selected {
  background: var(--brand-50);
  color: var(--brand-800);
}

.ms-picker-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  color: white;
}

.ms-picker-row.selected .ms-picker-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.ms-picker-label {
  flex: 1;
}

.ms-picker-sublabel {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* Shared "All / Specific" scope toggle (categories + stores) */
.scope-toggle {
  display: inline-flex;
  margin-bottom: 12px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.scope-toggle-btn {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-primary);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.14s,
    color 0.14s;
}
.scope-toggle-btn + .scope-toggle-btn {
  border-left: 1px solid var(--border-secondary);
}
.scope-toggle-btn:hover:not(.active) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.scope-toggle-btn.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

/* ── Image upload field + cropper ─────────────────────────────── */
.img-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.img-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  padding: 22px 16px;
  border: 1.5px dashed var(--border-secondary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
.img-dropzone:hover {
  border-color: var(--brand-500);
  color: var(--brand-600);
  background: var(--brand-50);
}
.img-dropzone-spec {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.img-preview {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.img-preview img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-tertiary);
  background: var(--bg-tertiary);
}
.img-preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.img-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--red, #c0392b);
}
.img-error svg {
  flex-shrink: 0;
}

.cropper-modal {
  width: 560px;
}

.cropper-stage {
  position: relative;
  width: 100%;
  height: 340px;
  background: #15191e;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cropper-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cropper-zoom input[type="range"] {
  flex: 1;
  accent-color: var(--brand-600);
}

/* ── Schedule type selector + holiday + image ─────────────────── */
.schedule-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}
.schedule-type-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}
.schedule-type-tab:hover {
  border-color: var(--brand-500);
}
.schedule-type-tab.active {
  border-color: var(--brand-600);
  background: var(--brand-50);
  color: var(--text-primary);
}
.schedule-type-tab svg {
  flex-shrink: 0;
  color: var(--brand-600);
}
.schedule-type-tab span {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.schedule-type-tab strong {
  font-size: 13.5px;
  font-weight: 600;
}
.schedule-type-tab em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.schedule-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: var(--bg-info);
  color: var(--text-info);
  font-size: 13px;
  line-height: 1.45;
}
.schedule-info-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
}
.schedule-info-banner.error {
  background: #fef2f2;
  color: #b91c1c;
}

.pub-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

.date-range-row {
  display: flex;
  gap: 14px;
}
.date-range-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.date-range-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.schedule-field-optional {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* Card: holiday accent + image thumb + type badge */
.schedule-card.holiday {
  border-left: 3px solid var(--brand-500);
}
.schedule-card-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}
.schedule-thumb {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-tertiary);
  flex-shrink: 0;
}
.schedule-type-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.schedule-meta-info {
  color: var(--brand-700) !important;
}

/* ── Categories (per-category image + description override) ───── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.cat-card-head {
  margin-bottom: 14px;
}
.cat-name {
  font-size: 15px;
  font-weight: 600;
}
.cat-pos-id {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.cat-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.cat-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.cat-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.cat-card-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-tertiary);
  display: flex;
  justify-content: flex-end;
}

/* ── Item detail modal (per-aggregator settings) ─────────────── */
.menu-item-name-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.menu-item-name-btn:hover {
  color: var(--brand-600);
  text-decoration: underline;
}

.modal.modal-xl {
  width: min(960px, 94vw);
}

.item-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.item-modal-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  overflow: hidden;
  flex-shrink: 0;
}
.item-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agg-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.agg-settings-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.agg-settings-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.agg-cards {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.agg-setting-card {
  flex: 0 0 232px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg-primary);
}
.agg-setting-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agg-setting-card-head strong {
  font-size: 14px;
}
.agg-badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  background: var(--swatch-color);
}

.agg-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.agg-price-input {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  background: var(--bg-primary);
}
.agg-price-input:focus-within {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.agg-price-cur {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-right: 4px;
}
.agg-price-input input {
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  width: 72px;
  text-align: right;
}

/* ── Sync History / sync engine ──────────────────────────────── */
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover td {
  background: var(--bg-secondary);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  text-transform: uppercase;
}
.sync-pill.ok {
  background: var(--brand-50);
  color: var(--brand-700);
}
.sync-pill.warn {
  background: #fef3c7;
  color: #92400e;
}
.sync-pill.err {
  background: #fee2e2;
  color: #b91c1c;
}
.sync-pill.info {
  background: #e0f2fe;
  color: #075985;
}
.sync-pill.neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.sync-spinner {
  display: inline-flex;
  animation: sync-spin 1s linear infinite;
}
@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}

.sync-fail-count {
  color: #b91c1c;
  font-weight: 500;
}

.sync-modal .modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-progress {
  margin-bottom: 22px;
}
.sync-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.sync-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  overflow: hidden;
}
.sync-progress-fill {
  height: 100%;
  width: var(--progress-pct, 0%);
  background: var(--brand-600);
  transition: width 0.4s ease;
}
.sync-stat-row {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 13px;
}
.sync-stat {
  color: var(--text-secondary);
}
.sync-stat.ok {
  color: var(--brand-700);
  font-weight: 600;
}
.sync-stat.err {
  color: #b91c1c;
  font-weight: 600;
}

.sync-section-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin: 20px 0 8px;
}
.sync-section-title svg {
  vertical-align: middle;
  margin-right: 4px;
}
.sync-items table {
  width: 100%;
}
.sync-item-detail {
  font-size: 12px;
  color: var(--text-tertiary);
}
.sync-err-msg {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  color: #b91c1c;
  max-width: 480px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.sync-err-msg svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.sync-log {
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  padding: 12px 14px;
  max-height: 240px;
  overflow-y: auto;
  font-size: 12.5px;
}
.sync-log-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  color: var(--text-secondary);
}
.sync-log-time {
  flex-shrink: 0;
  width: 64px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.sync-log-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  align-self: center;
}
.sync-log-line.warning .sync-log-dot {
  background: #d97706;
}
.sync-log-line.error .sync-log-dot {
  background: #dc2626;
}
.sync-log-line.error .sync-log-msg {
  color: #b91c1c;
}
.sync-log-msg {
  flex: 1;
}

/* ── Schedule "Location publish" modal ───────────────────────── */
.pub-section {
  margin-bottom: 22px;
}
.pub-section:last-child {
  margin-bottom: 0;
}
.pub-section-head {
  margin-bottom: 12px;
}
.pub-section-title {
  font-size: 15px;
  font-weight: 600;
}
.pub-section-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.pub-empty {
  font-size: 13px;
}

.pub-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.pub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.pub-row + .pub-row {
  border-top: 1px solid var(--border-tertiary);
}
.pub-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.pub-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.pub-logo-badge {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  background: var(--swatch-color);
}

.pub-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}
.pub-status.success {
  color: var(--brand-700);
}
.pub-status.failed {
  color: #b91c1c;
}
.pub-status.partial {
  color: #b45309;
}
.pub-status.publishing {
  color: var(--text-secondary);
}
.pub-spin {
  animation: sync-spin 0.8s linear infinite;
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.pub-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-size: 13px;
  font-weight: 500;
}

/* ── Slide-over drawer (reuses .modal-header/.modal-body/.modal-footer) ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 32, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  justify-content: flex-end;
  z-index: 1000;
  animation: overlay-in 0.16s ease;
}
.drawer {
  width: 520px;
  max-width: 94vw;
  height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: drawer-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drawer-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
.drawer .modal-body {
  flex: 1;
}

/* Sync run detail — per-combo change set (expandable) */
.sync-expand-cell {
  width: 26px;
  color: var(--text-tertiary);
}
.sync-changes-row td {
  background: var(--bg-secondary);
}

/* Location group → nested aggregator rows */
.sync-loc-row td {
  background: var(--bg-secondary);
}
.sync-loc-row:hover td {
  background: var(--bg-tertiary);
}
.sync-loc-count {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}
.sync-expand-nested {
  padding-left: 18px;
}
.sync-agg-name {
  padding-left: 12px;
}
.sync-changes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}
.sync-change {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.sync-change-name {
  font-weight: 600;
  min-width: 160px;
}
.sync-change-type {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}
.sync-change-vals {
  color: var(--text-secondary);
}
.sync-change-vals .review-arrow {
  color: var(--text-tertiary);
  margin: 0 2px;
}

/* ── Toast (ephemeral, bottom-right) ─────────────────────────── */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  max-width: 380px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.toast-msg {
  flex: 1;
}
.toast-close {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 2px;
  display: flex;
}
.toast-close:hover {
  color: var(--text-primary);
}
.toast-success {
  border-left: 3px solid var(--brand-600);
}
.toast-success > svg:first-child {
  color: var(--brand-600);
}
.toast-warning {
  border-left: 3px solid #d97706;
}
.toast-warning > svg:first-child {
  color: #d97706;
}
.toast-error {
  border-left: 3px solid #dc2626;
}
.toast-error > svg:first-child {
  color: #dc2626;
}

/* ── Sync failures "needs attention" banner ──────────────────── */
.sync-fail-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13.5px;
}
.sync-fail-banner > svg:first-child {
  flex-shrink: 0;
  color: #dc2626;
}
.sync-fail-banner span {
  flex: 1;
  line-height: 1.45;
}
.sync-fail-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Per-combo failure cell: error message + Fix-config CTA */
.sync-err-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.sync-fix-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  cursor: pointer;
}
.sync-fix-btn:hover {
  background: var(--brand-100);
}
.sync-footer-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #b45309;
  margin-right: auto;
}

/* Self-contained login screen (shown on 401 — no external auth-service) */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: 24px;
}
.login-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--brand-600);
  margin-bottom: 16px;
}
.login-card h1 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.login-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.login-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
}
.login-input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.login-error {
  font-size: 12.5px;
  color: var(--text-danger);
  margin-bottom: 12px;
  text-align: left;
}
.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 11px;
}

/* ===========================================================================
   Store status + Stock-out screens
   =========================================================================== */

/* Button variants used by the timed-action modal + bulk bars */
.btn-success {
  background: var(--brand-600);
  color: #fff;
  border-color: var(--brand-600);
}
.btn-success:hover:not(:disabled) {
  background: var(--brand-700);
}
.btn-warning {
  background: var(--text-warning);
  color: #fff;
  border-color: var(--text-warning);
}
.btn-warning:hover:not(:disabled) {
  filter: brightness(0.95);
}

.pill.warning {
  background: var(--bg-warning, #fff7ed);
  color: var(--text-warning, #b45309);
}

/* Timed-action modal fields */
.modal-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.modal-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
}
.modal-input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.modal-target-list {
  padding: 10px 14px;
  margin-bottom: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}

/* Store status — one section per aggregator, rows per location */
.ss-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
}
.ss-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--border-tertiary);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ss-header:hover {
  background: var(--bg-secondary);
}
.ss-header.is-collapsed {
  border-bottom: none;
}
.ss-header-main {
  flex: 1;
}
.ss-chevron {
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
}
.ss-header.is-collapsed .ss-chevron {
  transform: rotate(-90deg);
}
.ss-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}
.ss-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #18181b;
}
.ss-name {
  font-size: 15px;
  font-weight: 600;
}
.ss-meta {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 2px;
}
.ss-list {
  padding: 0;
}

.store-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-tertiary);
}
.store-row:last-child {
  border-bottom: none;
}
.store-row:hover {
  background: var(--bg-secondary);
}
.store-row.is-paused {
  background: #fffbf3;
}
.store-row.is-paused:hover {
  background: #fef8e7;
}
.store-row-name {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.store-row-name strong {
  font-size: 14px;
}
.store-row-loc {
  color: var(--text-tertiary);
  font-size: 12px;
}
.store-row-reason {
  color: var(--text-warning);
  font-size: 12px;
  margin-top: 2px;
  font-style: italic;
}
.store-row-setup {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-600);
}
.store-row-setup:hover {
  text-decoration: underline;
}

/* Bulk action bar (shared by both screens) */
.bulk-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--navbar-bg);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.bulk-bar-count {
  font-weight: 600;
  font-size: 14px;
}
.bulk-bar-spacer {
  flex: 1;
}
.bulk-bar .btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: transparent;
}
.bulk-bar .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}
.bulk-bar .btn-success {
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.bulk-bar .btn-success:hover:not(:disabled) {
  background: var(--brand-700);
  border-color: var(--brand-700);
}

/* Stock-out table extras */
.data-table .numeric,
.data-table th.numeric {
  text-align: right;
}
.out-pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}
.out-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #fff7ed;
  color: #b45309;
  font-size: 12px;
  font-weight: 600;
}
.out-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--swatch-color);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===========================================================================
   Dashboard
   =========================================================================== */
.pill.danger {
  background: #fef2f2;
  color: #b91c1c;
}

.dash-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-card.dash-card-spaced {
  margin-bottom: 16px;
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-tertiary);
}
.dash-card-header h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}
.dash-card-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 600;
}
.dash-card-link:hover {
  text-decoration: underline;
}
.dash-card-body {
  padding: 6px 18px 12px;
}
.dash-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 4px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 12px 18px 16px;
}
@media (max-width: 1100px) {
  .quick-action-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.12s;
}
.quick-action-btn:hover {
  border-color: var(--brand-600);
  color: var(--text-primary);
  background: var(--bg-secondary);
}
.quick-action-btn svg {
  color: var(--brand-600);
}

.agg-status-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agg-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-tertiary);
}
.agg-status-row:last-child {
  border-bottom: none;
}
.agg-status-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
}
.agg-status-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #18181b;
  background: var(--swatch-color);
}
.agg-status-info {
  flex: 1;
}
.agg-status-info strong {
  font-size: 14px;
}
.agg-status-meta {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 2px;
}

.activity-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-tertiary);
}
.activity-row:last-child {
  border-bottom: none;
}
.activity-time {
  color: var(--text-tertiary);
  font-size: 12px;
  min-width: 66px;
}
.activity-text {
  flex: 1;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.activity-text strong {
  color: var(--text-primary);
}
.dash-drift-pill {
  font-size: 10px;
  margin-right: 6px;
}

/* ===========================================================================
   QA tools
   =========================================================================== */
.qa-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  margin-bottom: 18px;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
}
.qa-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-tertiary);
}
.qa-tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.qa-tab.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600);
}
.qa-select,
.qa-input {
  padding: 8px 12px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
}
.qa-src-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}
.qa-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.qa-detail-meta {
  color: var(--text-secondary);
  font-size: 13px;
}
.qa-issues {
  margin-bottom: 16px;
}
.qa-issue {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #b91c1c;
  font-size: 13px;
  padding: 3px 0;
}
.qa-json-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 14px 0 6px;
}
.qa-json {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 340px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.qa-json-error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #b91c1c;
  font-size: 12.5px;
  margin: 8px 0;
}
.qa-readiness {
  margin: 8px 0;
}
.qa-readiness-ok {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #15803d;
  font-size: 12.5px;
  margin: 8px 0;
}

.qa-place-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .qa-place-grid {
    grid-template-columns: 1fr;
  }
}
.qa-place-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.qa-place-controls .qa-input {
  flex: 1;
}
.qa-payload {
  width: 100%;
  min-height: 360px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}
.qa-place-result {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.qa-result-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}
.qa-result-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.qa-result-banner.ok {
  background: var(--bg-info);
  color: var(--brand-700);
}
.qa-result-banner.drift {
  background: #fff7ed;
  color: #b45309;
}
.qa-result-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.qa-result-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* ===========================================================================
   QA admin — separate app shell + login
   =========================================================================== */
.qa-shell {
  min-height: 100vh;
  background: var(--bg-secondary);
}
.qa-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #1e293b;
  color: #fff;
}
.qa-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.qa-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
}
.qa-logout:hover {
  background: rgba(255, 255, 255, 0.22);
}
.qa-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Support console: shared panel shell (every tab) ─────────────── */
.qa-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.qa-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.qa-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.qa-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.qa-field select,
.qa-field input {
  padding: 8px 12px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-width: 140px;
}
.qa-field input {
  min-width: 110px;
}

.qa-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-md);
}
.qa-alert.err {
  background: #fef2f2;
  color: #b91c1c;
}

.qa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  color: var(--text-tertiary);
  text-align: center;
  border: 1px dashed var(--border-secondary);
  border-radius: var(--radius-lg);
}
.qa-empty p {
  margin: 0;
  font-size: 14px;
}

.qa-menu-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qa-menu-preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.qa-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}
.qa-pill.ok {
  background: #dcfce7;
  color: #166534;
}
.qa-pill.neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.qa-json {
  margin: 0;
  padding: 16px;
  max-height: 60vh;
  overflow: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre;
  tab-size: 2;
}

.qa-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
}
.qa-login-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 340px;
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.qa-login-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto;
  background: var(--bg-info);
  color: var(--brand-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qa-login-card h1 {
  font-size: 20px;
  margin: 14px 0 4px;
}
.qa-login-card p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 18px;
}
.qa-login-card .login-input {
  margin-bottom: 10px;
  text-align: left;
}
.qa-login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 11px;
}

/* QA place-order — menu-driven builder */
.qa-po-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.qa-po-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
}
.qa-po-field .qa-input {
  width: 130px;
}
.qa-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.qa-po-field .qa-select {
  min-width: 130px;
}

/* Payload schema reference panel */
.qa-schema-panel {
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  margin-bottom: 18px;
  overflow: hidden;
}
.qa-schema-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-secondary);
  background: var(--bg-secondary);
}
.qa-schema-title {
  font-size: 12px;
  font-weight: 700;
}
.qa-schema-doc {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #2563eb);
  text-decoration: none;
}
.qa-schema-toggle {
  margin-left: auto;
  color: var(--text-tertiary);
  display: inline-flex;
}
.qa-schema-body {
  padding: 10px 14px 14px;
  max-height: 320px;
  overflow-y: auto;
}
.qa-schema-note {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.qa-schema-field {
  padding-left: calc(var(--schema-depth, 0) * 14px);
}
.qa-schema-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}
.qa-schema-row.is-expandable {
  cursor: pointer;
}
.qa-schema-caret {
  width: 13px;
  display: inline-flex;
  flex: none;
  color: var(--text-tertiary);
}
.qa-schema-name {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  color: var(--text-primary);
  font-weight: 600;
}
.qa-schema-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border-radius: 4px;
  padding: 1px 6px;
  flex: none;
}
.qa-schema-desc {
  color: var(--text-tertiary);
}

.qa-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 900px) {
  .qa-builder-grid {
    grid-template-columns: 1fr;
  }
}
.qa-menu-panel,
.qa-order-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 14px;
  max-height: 460px;
  overflow-y: auto;
}
.qa-menu-cat {
  margin-bottom: 12px;
}
.qa-menu-cat-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 6px 0;
}
.qa-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.qa-menu-item:hover:not(:disabled) {
  border-color: var(--brand-600);
  background: var(--bg-secondary);
}
.qa-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}
.qa-menu-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.qa-order-line {
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 8px;
}
.qa-order-line-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qa-order-line-head strong {
  flex: 1;
  font-size: 13px;
}
.qa-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.qa-qty button {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-secondary);
  border-radius: 5px;
  background: var(--bg-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qa-line-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
}
.qa-line-remove:hover {
  color: var(--text-danger);
}
.qa-mod-group {
  margin-top: 8px;
  padding-left: 4px;
}
.qa-mod-group-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.qa-mod-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  margin-right: 14px;
  color: var(--text-secondary);
}
.qa-build-btn {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.review-footer-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  margin-right: auto;
}

/* ===========================================================================
   Aggregators — redesigned listing + configuration
   =========================================================================== */

/* Filter pills */
.agg-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.agg-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-secondary);
  background: var(--bg-primary);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.agg-pill:hover {
  border-color: var(--border-primary);
  color: var(--text-primary);
}
.agg-pill.active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.agg-pill.active .dot {
  background: #fff;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  background: var(--text-tertiary);
}
.dot.connected {
  background: #16a34a;
}
.dot.not-connected {
  background: var(--text-tertiary);
}
.dot.unavailable {
  background: #f59e0b;
}

/* Connection status badge (pill w/ dot) */
.agg-conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  width: auto;
  height: auto;
  text-transform: uppercase;
}
.agg-conn-badge.connected {
  background: #dcfce7;
  color: #15803d;
}
.agg-conn-badge.connected .dot {
  background: #16a34a;
}
.agg-conn-badge.not-connected {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.agg-conn-badge.unavailable {
  background: #fee2e2;
  color: #b91c1c;
}
.agg-conn-badge.unavailable .dot {
  background: #dc2626;
}

/* Card body */
.agg-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.agg-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.45;
  /* Reserve two lines so every card is the same height and text can wrap. */
  min-height: calc(1.45em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.agg-card-divider {
  border-top: 1px solid var(--border-secondary);
  margin: 4px 0;
}
.agg-loc-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.agg-logo-badge.lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

/* ── Config detail ────────────────────────────────────────────────────── */
.config-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.config-breadcrumb button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.config-breadcrumb button:hover {
  color: var(--brand-600);
}
.config-breadcrumb strong {
  color: var(--text-primary);
}

.agg-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.agg-active-toggle .on {
  color: #15803d;
  font-weight: 700;
}
.agg-active-toggle .off {
  color: var(--text-tertiary);
  font-weight: 700;
}

.agg-cfg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.agg-cfg-head-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.agg-cfg-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.agg-cfg-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.agg-cfg-head-actions {
  display: flex;
  gap: 10px;
}

.agg-cfg-head {
  margin-bottom: 2px;
}
.agg-cfg-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.agg-cfg-card-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.agg-cfg-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand-600);
}
.agg-cfg-card-title h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.agg-cfg-card-title p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 2px 0 0;
}
.agg-cfg-card-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.agg-cfg-count {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.agg-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}
.agg-unverified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.agg-cfg-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 13px;
  line-height: 1.45;
}
.agg-cfg-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* Location creds modal — "fetch sites" helper */
.agg-site-fetch {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agg-site-fetch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.agg-site-fetch-label {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.agg-site-fetch-error {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--danger-600, #dc2626);
}
.agg-site-fetch-error svg {
  flex: 0 0 auto;
}

/* Location table */
.agg-loc-table td,
.agg-loc-table th {
  vertical-align: middle;
}
.agg-loc-table th.center,
.agg-loc-table td.center {
  text-align: center;
}
.agg-loc-table th.right,
.agg-loc-table td.right {
  text-align: right;
}
.agg-loc-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.agg-loc-pin {
  color: var(--text-tertiary);
  flex: 0 0 auto;
}
.agg-loc-name .loc-name {
  font-weight: 600;
  color: var(--text-primary);
}
.agg-loc-name .loc-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}
.agg-pos-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.agg-cred {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.agg-cred.global {
  color: var(--text-secondary);
}
.agg-cred.custom {
  color: var(--brand-600);
}

.agg-loc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.agg-cfg-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.btn-link:hover:not(:disabled) {
  background: var(--brand-50);
}
.btn-link:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.6;
}

.filter-search.sm {
  min-width: 200px;
}
.filter-search.sm input {
  font-size: 13px;
}
/* ── Catalogue (Modifiers / Modifier Groups / Categories — list + detail) ── */
.cat-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}
.cat-badge.accent {
  color: var(--brand-700);
  background: var(--brand-50);
  border-color: var(--brand-200);
}
.cat-muted {
  color: var(--text-tertiary);
}

.cat-veg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  vertical-align: middle;
  flex: 0 0 auto;
}
.cat-veg.veg {
  color: var(--green);
}
.cat-veg.nonveg {
  color: var(--text-danger);
}
.cat-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* List table (clickable rows → detail modal) */
.cat-list-row {
  cursor: pointer;
  transition: background 0.1s;
}
.cat-list-row:hover {
  background: var(--bg-secondary);
}
.cat-go {
  text-align: right;
  color: var(--text-tertiary);
  width: 40px;
}
.cat-list-row:hover .cat-go,
.order-table-row:hover .cat-go {
  color: var(--brand-600);
}
.cat-thumb {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  overflow: hidden;
  flex: 0 0 auto;
}
.cat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Detail modal — master (default) block + read-only group options */
.item-modal-kind {
  font-weight: 700;
  color: var(--text-tertiary);
  font-size: 18px;
}
.cat-master-block {
  margin-bottom: 20px;
}
.cat-master-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  margin-top: 10px;
  align-items: start;
}
.cat-options {
  margin: 4px 0 20px;
}
.cat-options-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cat-options-block {
  margin-bottom: 16px;
}
.cat-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  padding: 5px 10px;
}
.cat-option-name {
  font-weight: 500;
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .cat-master-grid {
    grid-template-columns: 1fr;
  }
}

/* Tabbed detail (items / modifiers) */
.cat-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-secondary);
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cat-tab:hover {
  color: var(--text-primary);
}
.cat-tab.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600);
}

/* Location × aggregator pricing matrix */
.cat-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
}
/* Fill the container (min-width:100%) so there's no empty gap with few
   aggregators, but the Location column (below) absorbs the slack — keeping the
   aggregator columns compact. With many aggregators the table overflows and
   .cat-matrix-wrap scrolls horizontally. */
.cat-matrix {
  border-collapse: collapse;
  width: auto;
  min-width: 100%;
  font-size: 13px;
}
.cat-matrix th,
.cat-matrix td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-secondary);
  text-align: left;
  white-space: pre-wrap;
}
/* Aggregator columns (everything but the Location column) are centered. */
.cat-matrix th:not(.cat-matrix-loc),
.cat-matrix td:not(.cat-matrix-loc) {
  text-align: center;
}
.cat-matrix thead th {
  background: var(--bg-secondary);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
}
.cat-matrix th .agg-badge.sm {
  margin-right: 6px;
}
.agg-badge.sm {
  width: 18px;
  height: 18px;
  font-size: 9px;
}
.cat-matrix-loc {
  position: sticky;
  left: 0;
  width: 100%; /* absorb slack so aggregator columns stay compact */
  min-width: 200px;
  background: var(--bg-primary);
  font-weight: 600;
  color: var(--text-primary);
  z-index: 1;
}
.cat-matrix thead .cat-matrix-loc {
  background: var(--bg-secondary);
  z-index: 2;
}
.cat-matrix-default td {
  background: var(--brand-50);
}
.cat-matrix-default .cat-matrix-loc {
  background: var(--brand-50);
  color: var(--brand-700);
}
.cat-matrix tr:last-child td {
  border-bottom: none;
}
/* One unified price+availability field per aggregator cell: currency, price
   input, and a small availability toggle, all in a single bordered control. */
.cat-price-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 160px;
  padding: 0 8px 0 9px;
  height: 34px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
}
.cat-price-field:focus-within {
  border-color: var(--brand-500);
}
.cat-price-field.custom {
  border-color: var(--brand-500);
  box-shadow: inset 0 0 0 1px var(--brand-500);
}
.cat-price-field.off {
  background: var(--bg-secondary);
}
.cat-price-cur {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  flex: 0 0 auto;
}
.cat-price-field input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}
.cat-price-field.off input {
  color: var(--text-tertiary);
}
.cat-price-field.is-readonly {
  background: var(--bg-secondary, #f8fafc);
  border-color: var(--border-primary, #e2e8f0);
  cursor: not-allowed;
  opacity: 0.75;
}
.cat-price-field.is-readonly input {
  color: var(--text-tertiary, #94a3b8);
  cursor: not-allowed;
}
.cat-price-field.is-readonly .cat-price-cur {
  color: var(--text-tertiary, #94a3b8);
}
.cat-price-field input::-webkit-outer-spin-button,
.cat-price-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Compact availability toggle inside the field */
.cat-avail-toggle {
  flex: 0 0 auto;
  width: 30px;
  height: 17px;
  border-radius: 999px;
  border: none;
  background: var(--border-primary);
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.cat-avail-toggle.on {
  background: #16a34a;
}
.cat-avail-toggle:disabled,
.cat-avail-toggle[disabled] {
  cursor: not-allowed;
  opacity: 0.4;
  filter: grayscale(0.85);
  box-shadow: none;
}
.cat-avail-toggle:disabled .cat-avail-knob {
  box-shadow: none;
  background: #e2e8f0;
}
.cat-avail-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.cat-avail-toggle.on .cat-avail-knob {
  transform: translateX(13px);
}

.cat-matrix.is-readonly {
  user-select: none;
}

.cat-readonly-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-primary, #e2e8f0);
  color: var(--text-secondary, #64748b);
  font-size: 12.5px;
  font-weight: 500;
}
.cat-readonly-banner svg {
  flex-shrink: 0;
  color: var(--text-tertiary, #94a3b8);
}

.cat-matrix-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 10px;
}

/* Taller detail modal so tabbed content has room */
.cat-detail-modal {
  min-height: 80vh;
}
.cat-detail-modal .modal-body {
  flex: 1 1 auto;
}

/* Aggregator image manager (upload once → assign to platforms) */
.img-mgr {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.img-mgr-drop {
  border: 2px dashed var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--brand-50);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--brand-700);
  cursor: pointer;
  padding: 20px;
  text-align: center;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.img-mgr-drop:hover {
  border-color: var(--brand-500);
}
.img-mgr-drop.busy {
  opacity: 0.7;
  cursor: default;
}
.img-mgr-drop b {
  color: var(--brand-600);
}
.img-mgr-staged {
  max-height: 200px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.img-mgr-assign {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.img-mgr-assign .btn {
  align-self: flex-start;
}

.img-mgr-specific {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.img-mgr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.img-mgr-card {
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-primary);
}
.img-mgr-card > img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
  background: var(--bg-secondary);
}
.img-mgr-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.img-mgr-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Aggregator multi-select */
.agg-ms {
  position: relative;
}
.agg-ms-control {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 5px 10px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13.5px;
}
.agg-ms-control:disabled {
  cursor: default;
}
.agg-ms-ph {
  color: var(--text-tertiary);
}
.agg-ms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.agg-ms-chip {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 600;
}
.agg-ms-caret {
  color: var(--text-tertiary);
  flex: 0 0 auto;
}
.img-mgr-card .agg-ms-caret {
  transition: transform 0.15s ease;
}
.img-mgr-card .agg-ms.is-open .agg-ms-caret {
  transform: rotate(180deg);
}
.agg-ms-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 150px;
  overflow-y: auto;
  padding: 4px;
  box-sizing: border-box;
}
.img-mgr-card .agg-ms-menu {
  top: auto;
  bottom: calc(100% + 4px);
}
.agg-ms-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
}
.agg-ms-opt:hover {
  background: var(--bg-secondary);
}
.agg-ms-opt input {
  accent-color: var(--brand-600);
}

/* ── Locations menu-sync screen ───────────────────────────────────────── */
.loc-table th.loc-check,
.loc-table td.loc-check {
  width: 36px;
  text-align: center;
}
.loc-table input[type="checkbox"] {
  accent-color: var(--brand-600);
  cursor: pointer;
}
.loc-row {
  cursor: pointer;
  transition: background 0.1s;
}
.loc-row:hover {
  background: var(--bg-secondary);
}
.loc-name {
  font-weight: 600;
  color: var(--text-primary);
}
.loc-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.loc-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.loc-lastsync {
  display: flex;
  align-items: center;
  gap: 8px;
}
.loc-lastsync-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.loc-bulkbar {
  position: sticky;
  bottom: 16px;
  margin: 16px auto 0;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
}
.loc-bulkbar-actions {
  display: flex;
  gap: 8px;
}

/* ── Location drawer ──────────────────────────────────────────────────── */
.loc-drawer {
  width: 760px;
}
/* The item detail modal opens from within the drawer — lift it above the drawer. */
.loc-drawer .modal-overlay {
  z-index: 1100;
}
.loc-drawer-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.loc-drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loc-drawer-tabs {
  padding: 0 20px;
}

/* Sync platform picker (multi-aggregator location) */
.sync-picker {
  width: 420px;
}
.sync-picker-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sync-picker-all {
  width: 100%;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 14px;
}
.sync-picker-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 600;
}
.sync-picker-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin: 14px 0 6px;
}
.sync-picker-divider::before,
.sync-picker-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}
.sync-picker-divider span {
  padding: 0 12px;
}
.sync-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sync-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
}
.sync-picker-agg {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sync-picker-agg .platform-logo {
  width: 26px;
  height: 26px;
}
.sync-picker-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-picker-row .btn {
  flex-shrink: 0;
  gap: 6px;
}

.loc-tab {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.loc-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.loc-tab-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}
.loc-tab-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

/* Read-only location info list */
.loc-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.loc-info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-secondary);
}
.loc-info-row:last-child {
  border-bottom: none;
}
.loc-info-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.loc-info-value {
  font-size: 14px;
  color: var(--text-primary);
}

.loc-platforms-block {
  border-top: 1px solid var(--border-secondary);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Configured platform: logo-only bubble (name shown as a tooltip). */
.loc-platform-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  overflow: hidden;
  padding: 6px;
  flex: 0 0 auto;
}
.loc-platform-bubble img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.loc-platform-bubble-badge {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  background: var(--swatch-color);
}

/* Catalogue tab stats */
.loc-cat-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.loc-cat-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  color: var(--brand-600);
}
.loc-cat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.loc-cat-lbl {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Schedules tab */
.loc-sched-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.loc-sched-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.1s;
}
.loc-sched-item:hover {
  background: var(--bg-secondary);
}
.loc-sched-icon {
  color: var(--brand-600);
  display: flex;
}
.loc-sched-main {
  flex: 1;
  min-width: 0;
}
.loc-sched-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.loc-sched-edit {
  color: var(--text-tertiary);
  flex: 0 0 auto;
}

/* Logs tab */
.loc-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.loc-log {
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.loc-log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.loc-log-head:hover {
  background: var(--bg-secondary);
}
.loc-log-caret {
  color: var(--text-tertiary);
  transition: transform 0.12s;
  flex: 0 0 auto;
}
.loc-log-caret.open {
  transform: rotate(90deg);
}
.loc-log-caret-spacer {
  width: 15px;
  flex: 0 0 auto;
}
.loc-log-agg {
  font-weight: 600;
  font-size: 13px;
}
.loc-log-meta {
  font-size: 12.5px;
  color: var(--text-tertiary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loc-log-time {
  font-size: 12px;
  color: var(--text-tertiary);
  flex: 0 0 auto;
}
.loc-log-detail {
  padding: 10px 12px 12px 37px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}
.loc-log-error {
  color: var(--text-danger);
}
.loc-log-changes {
  color: var(--text-secondary);
}
.loc-log-event {
  display: flex;
  gap: 10px;
  color: var(--text-secondary);
}
.loc-log-event.lvl-error {
  color: var(--text-danger);
}
.loc-log-event.lvl-warning {
  color: var(--text-warning, #b45309);
}
.loc-log-event-time {
  color: var(--text-tertiary);
  flex: 0 0 auto;
  min-width: 64px;
}

/* Catalogue → Taxes: tax-inclusive/exclusive note */
.cat-tax-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  font-size: 13px;
  color: var(--text-secondary);
}

/* Menu-sync row button — stable width so the label (Sync / Syncing… / Cooldown m:ss) doesn't jump */
.loc-sync-btn {
  min-width: 118px;
  justify-content: center;
}

/* Error source badge — aggregator-side vs our system-side, in sync logs */
.err-src {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  margin-right: 7px;
  white-space: nowrap;
}
.err-src.agg {
  background: #fef3c7;
  color: #92400e;
} /* aggregator's side */
.err-src.sys {
  background: #e0e7ff;
  color: #3730a3;
} /* our system side */
.loc-log-error {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-wrap: wrap;
}

/* "View response" link + raw aggregator response viewer */
.btn-link.sm {
  font-size: 12px;
  padding: 2px 4px;
  margin-left: 8px;
}
.sync-response-body {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow: auto;
}

/* ─── Price field error styling with smooth transition ─── */
.agg-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.cat-price-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  vertical-align: middle;
}

.agg-price-error-wrap,
.cat-price-error-wrap {
  display: block;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  line-height: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease-in-out,
    opacity 0.35s ease-in-out,
    margin-bottom 0.35s ease-in-out;
}
.agg-price-error-wrap.visible,
.cat-price-error-wrap.visible {
  max-height: 24px;
  opacity: 1;
  margin-bottom: 3px;
  line-height: 1.1;
}

.agg-price-error,
.cat-price-error {
  display: flex;
  align-items: center;
  gap: 3.5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--red, #c0392b);
  line-height: 1.1;
  white-space: nowrap;
  transform: translateY(-4px);
  transition: transform 0.35s ease-in-out;
}
.agg-price-error svg,
.cat-price-error svg {
  flex-shrink: 0;
}
.cat-price-error {
  font-size: 10.5px;
}
.agg-price-error-wrap.visible .agg-price-error,
.cat-price-error-wrap.visible .cat-price-error {
  transform: translateY(0);
}

.agg-price-input,
.cat-price-field {
  transition:
    border-color 0.12s,
    background 0.12s,
    opacity 0.12s;
}
.agg-price-input.error,
.cat-price-field.error {
  border-color: var(--red, #c0392b) !important;
  box-shadow: none;
}

/* Disable mouse wheel spin buttons on number inputs */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Access Denied Component ── */
.access-denied-wrap {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.access-denied-icon {
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}
.access-denied-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.access-denied-message {
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.5;
  font-size: 14px;
}

/* ── Order History Page & Table ── */
.order-data-table {
  min-width: 860px;
}
.order-data-table th,
.order-data-table td {
  white-space: nowrap;
}

.order-modal .modal-header .platform-logo {
  height: 26px;
  max-width: 96px;
  object-fit: contain;
  vertical-align: middle;
}
.order-table-row {
  cursor: pointer;
}
.order-number-title {
  font-weight: 600;
}
.order-ext-id {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono, monospace);
}
.order-cell-text {
  font-size: 13px;
}
.order-total-cell {
  text-align: right;
  font-weight: 600;
}
.order-time-text {
  font-size: 12px;
  color: var(--text-tertiary);
}
.order-pagination-wrap {
  padding: 12px 16px;
  border-top: 1px solid var(--border-secondary);
}
.cell-center,
th.cell-center,
td.cell-center {
  text-align: center;
}
.cell-right,
th.cell-right,
td.cell-right {
  text-align: right;
}
.pill-icon {
  display: inline;
  vertical-align: middle;
  margin-right: 2px;
}

/* Date navigation in filter row */
.filter-date-nav {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  padding: 0 8px;
  height: 44px;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.filter-date-nav:focus-within {
  border-color: var(--color-primary, #1a73e8);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.filter-date-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.filter-date-nav-btn:hover:not(:disabled) {
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
  color: var(--text-primary);
}

.filter-date-nav-btn:disabled,
.filter-date-nav-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.filter-date-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.filter-date-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.filter-date-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  padding: 0;
}

.filter-refresh-btn {
  height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease;
}

.filter-refresh-btn:hover:not(:disabled) {
  background: var(--bg-tertiary, #f8fafc);
  border-color: var(--border-primary, #cbd5e1);
}

/* ── Order Detail Modal Content ── */
.modal.order-modal {
  width: min(780px, 94vw);
  max-height: 90vh;
}
.order-modal .modal-body {
  height: auto;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
  padding: 20px 24px;
}
.order-modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-drift-banner {
  background: var(--color-amber-50, #fffbeb);
  border: 1px solid var(--color-amber-300, #fcd34d);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
/* Order already force-pushed despite the drift — informational history, not
   an active warning needing the Force Push button, so it reads as resolved
   (green) instead of amber. */
.order-drift-banner-resolved {
  background: var(--color-green-50, #f0fdf4);
  border-color: var(--color-green-300, #86efac);
}
.order-drift-banner-resolved .order-drift-icon {
  color: var(--color-green-600, #16a34a);
}
.order-drift-icon {
  color: var(--color-amber-600, #d97706);
  flex-shrink: 0;
  margin-top: 2px;
}
.order-drift-content {
  flex: 1;
}
.order-drift-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.order-drift-title {
  color: var(--color-amber-900, #78350f);
  font-size: 13.5px;
  font-weight: 600;
}
.order-drift-btn {
  background: #d97706;
  color: #ffffff !important;
  border: 1px solid #b45309;
  border-radius: var(--radius-sm, 6px);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 0.14s ease;
  white-space: nowrap;
}
.order-drift-btn:hover:not(:disabled) {
  background: #b45309;
}
.order-drift-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.order-drift-body {
  color: var(--color-amber-800, #92400e);
  font-size: 13px;
  margin-top: 6px;
}
.order-drift-list {
  margin: 4px 0 0 16px;
  padding: 0;
}

.order-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.order-summary-card {
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
}
.order-summary-card-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.order-summary-card-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text-primary);
}
.order-summary-card-value-status {
  margin-top: 4px;
}
.order-summary-card-value-time {
  font-size: 13px;
  margin-top: 4px;
  color: var(--text-primary);
}

.order-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
}
.order-info-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12.5px;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.order-info-text {
  font-size: 13px;
  color: var(--text-primary);
}
.order-info-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.order-item-mods {
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--border-secondary);
  font-size: 12px;
  color: var(--text-tertiary);
}

.order-notes-box {
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border-secondary);
  color: var(--text-primary);
}

.order-modal-table th {
  padding: 10px 14px;
}
.order-modal-table td {
  padding: 11px 14px;
}

/* Common utilities extracted from inline styles */
.table-empty-cell {
  padding: 28px !important;
  color: var(--text-tertiary);
  text-align: center;
}
.th-action-col {
  width: 40px;
}
.th-status-col {
  width: 90px;
}
.th-fill {
  width: 100%;
}
.text-capitalize {
  text-transform: capitalize;
}
.chip-group-spaced {
  margin-bottom: 22px;
}
.cat-badge-spaced {
  margin-left: 8px;
}
.modal-target-sub {
  margin-top: 4px;
}
.page-loading-wrapper {
  padding: 4rem 0;
}
.cat-muted-empty {
  padding: 24px 0;
  text-align: center;
}
.order-modal-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Error Boundary UI */
.error-boundary-view {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.error-boundary-icon {
  color: #ef4444;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.error-boundary-icon svg {
  margin: 0;
  display: block;
}

.error-boundary-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin-bottom: 0.5rem;
}

.error-boundary-text {
  color: var(--text-secondary, #64748b);
  max-width: 420px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
  font-size: 14px;
}

.error-boundary-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.error-boundary-btn-retry {
  min-width: 90px;
}

.error-boundary-btn-reload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 120px;
}

.error-boundary-btn-reload svg {
  margin: 0;
  display: block;
  flex-shrink: 0;
}

/* ══ Support console ═══════════════════════════════════════════════════════
   The console is its own app (qa.tsx pack) with its own shell, so it carries
   its own `sc-` namespace rather than borrowing the merchant chrome. Tokens
   below are local to it; everything else in this file belongs to the merchant
   app and is untouched by these rules. */
.sc-shell {
  --sc-bg: #f5f5f4;
  --sc-card: #fff;
  --sc-card-2: #fafaf9;
  --sc-nav: #1e2733;
  --sc-ink: #16181c;
  --sc-ink-2: #5f6570;
  --sc-ink-3: #9aa0a8;
  --sc-line: #e6e6e3;
  --sc-line-2: #d6d6d2;
  --sc-green: #3a8a4f;
  --sc-green-bg: #e4f4e9;
  --sc-amber: #8a5f14;
  --sc-amber-bg: #fbf0d9;
  --sc-red: #b03030;
  --sc-red-bg: #fbe9e9;
  --sc-blue: #2a5f9e;
  --sc-blue-bg: #e8f0f9;
  --sc-violet: #6a4a9e;
  --sc-violet-bg: #efeafa;
  --sc-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  min-height: 100vh;
  background: var(--sc-bg);
  color: var(--sc-ink);
  font-size: 14px;
  line-height: 1.5;
}

.sc-nav {
  background: var(--sc-nav);
  color: #fff;
  padding: 13px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sc-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sc-nav-r {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: #b9c0c9;
}

.sc-role {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
  font-weight: 700;
}

.sc-signout {
  background: #2c3846;
  border: 0;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sc-signout:hover {
  background: #384657;
}

.sc-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 26px 70px;
}
.sc-wrap h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
}
.sc-lede {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--sc-ink-2);
}

/* ── Global filters: one set, every tab ── */
.sc-filters {
  background: var(--sc-card);
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 16px;
}

.sc-frow {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.sc-fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sc-fld > span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sc-ink-3);
}

.sc-fld select,
.sc-fld input {
  border: 1px solid var(--sc-line-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: inherit;
  background: var(--sc-card);
  min-width: 130px;
}

.sc-fld-wide input {
  min-width: 230px;
}
.sc-fld-id input {
  min-width: 104px;
  font-family: var(--sc-mono);
}
.sc-fld input[type="datetime-local"] {
  min-width: 190px;
  font-family: var(--sc-mono);
  font-size: 12px;
}

.sc-fld select:focus,
.sc-fld input:focus {
  outline: 2px solid var(--sc-green);
  outline-offset: 0;
  border-color: var(--sc-green);
}

.sc-btn {
  border: 1px solid var(--sc-line-2);
  background: var(--sc-card);
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sc-ink);
  cursor: pointer;
}

.sc-btn:hover {
  border-color: var(--sc-ink-3);
}
.sc-btn.sm {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sc-ink-2);
}

.sc-fmeta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--sc-line);
  font-size: 12.5px;
  color: var(--sc-ink-2);
}

.sc-fmeta b {
  color: var(--sc-ink);
}
.sc-fspacer {
  flex: 1;
}
.sc-fscope {
  color: var(--sc-ink-3);
}

.sc-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--sc-line);
  margin-bottom: 18px;
}

.sc-tabs button {
  background: none;
  border: 0;
  padding: 0 2px 11px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sc-ink-2);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.sc-tabs button[aria-current="true"] {
  color: var(--sc-green);
  border-bottom-color: var(--sc-green);
}

.sc-card {
  background: var(--sc-card);
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  overflow: hidden;
}
.sc-card + .sc-card {
  margin-top: 14px;
}

.sc-chead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 17px;
  border-bottom: 1px solid var(--sc-line);
}

.sc-chead h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}
.sc-sub {
  font-size: 11.5px;
  color: var(--sc-ink-3);
}
.sc-cbody {
  padding: 16px 17px;
}
.sc-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--sc-ink-3);
  font-size: 13.5px;
}

.sc-note {
  margin-top: 12px;
  border: 1px dashed var(--sc-line-2);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--sc-ink-2);
}

/* ── Overview ── */
.sc-mgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 11px;
  margin-bottom: 14px;
}

.sc-metric {
  background: var(--sc-card);
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  padding: 13px 15px;
}
.sc-mk {
  font-size: 11.5px;
  color: var(--sc-ink-3);
}
.sc-mv {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 2px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.sc-mv.bad {
  color: var(--sc-red);
}
.sc-mv.warn {
  color: var(--sc-amber);
}
.sc-mv.ok {
  color: var(--sc-green);
}
.sc-md {
  font-size: 11px;
  color: var(--sc-ink-3);
  margin-top: 3px;
}

.sc-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px;
}
@media (max-width: 880px) {
  .sc-two {
    grid-template-columns: 1fr;
  }
}

.sc-brow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
}
.sc-bname {
  width: 118px;
  flex: none;
  font-size: 12.5px;
}
.sc-bvia {
  display: block;
  font-size: 10.5px;
  color: var(--sc-ink-3);
}
.sc-track {
  flex: 1;
  height: 8px;
  background: #f0f0ee;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}
.sc-fill {
  height: 100%;
  background: var(--sc-green);
}
.sc-fill.bad {
  background: var(--sc-red);
}
.sc-bnums {
  width: 112px;
  flex: none;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: baseline;
}
.sc-btotal {
  font-family: var(--sc-mono);
  font-size: 11.5px;
  color: var(--sc-ink-2);
}
.sc-bfail {
  font-family: var(--sc-mono);
  font-size: 11px;
  color: var(--sc-red);
}

.sc-frow-err {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--sc-line);
  font-size: 12.5px;
}

.sc-frow-err:last-child {
  border-bottom: none;
}
.sc-frow-err code {
  font-family: var(--sc-mono);
  font-size: 11.5px;
  color: var(--sc-red);
}
.sc-ct {
  font-family: var(--sc-mono);
  font-size: 11.5px;
  color: var(--sc-ink-2);
}

.sc-stage {
  display: inline-block;
  font-family: var(--sc-mono);
  font-size: 10px;
  background: #f0f0ee;
  color: var(--sc-ink-2);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ── Activity log ── */
.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sc-table thead td {
  padding: 10px 14px;
  background: var(--sc-card-2);
  color: var(--sc-ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--sc-line);
}

.sc-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--sc-line);
  vertical-align: middle;
}
.sc-rw {
  cursor: pointer;
}
.sc-rw:hover,
.sc-rw.open {
  background: var(--sc-card-2);
}
.sc-m {
  font-family: var(--sc-mono);
  font-size: 12px;
}
.sc-s2 {
  font-size: 11px;
  color: var(--sc-ink-3);
  margin-top: 2px;
}
.sc-dash {
  color: var(--sc-ink-3);
}
.sc-rel {
  border-bottom: 1px dotted var(--sc-line-2);
  cursor: help;
  white-space: nowrap;
}
.sc-caret {
  color: var(--sc-ink-3);
  font-size: 11px;
  display: inline-block;
  transition: transform 0.15s;
}
.sc-rw.open .sc-caret {
  transform: rotate(90deg);
}
@media (prefers-reduced-motion: reduce) {
  .sc-caret {
    transition: none;
  }
}

.sc-reftype {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sc-ink-3);
  font-weight: 700;
  margin-bottom: 2px;
}

/* Outcome badges. Colour is doubled by the word, never carrying it alone. */
.sc-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
}

.sc-bd {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}
.sc-act.ok {
  background: var(--sc-green-bg);
  color: var(--sc-green);
}
.sc-act.ok .sc-bd {
  background: var(--sc-green);
}
.sc-act.fail {
  background: var(--sc-red-bg);
  color: var(--sc-red);
}
.sc-act.fail .sc-bd {
  background: var(--sc-red);
}
.sc-act.warn {
  background: var(--sc-amber-bg);
  color: var(--sc-amber);
}
.sc-act.warn .sc-bd {
  background: var(--sc-amber);
}
.sc-act.info {
  background: var(--sc-blue-bg);
  color: var(--sc-blue);
}
.sc-act.info .sc-bd {
  background: var(--sc-blue);
}
.sc-act.alt {
  background: var(--sc-violet-bg);
  color: var(--sc-violet);
}
.sc-act.alt .sc-bd {
  background: var(--sc-violet);
}

.sc-chan {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sc-logo {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--sc-mono);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}

.sc-cname {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}
.sc-cvia {
  font-size: 10.5px;
  color: var(--sc-ink-3);
}

/* ── The timeline, opened in place ── */
.sc-detrow td {
  background: #fbfbfa;
  padding: 0;
  border-bottom: 1px solid var(--sc-line);
}
.sc-det {
  padding: 16px 20px 18px;
}
.sc-step {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 13px;
}
.sc-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
}
.sc-node {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--sc-green);
}
.sc-node.bad {
  background: var(--sc-red);
  width: 11px;
  height: 11px;
}
.sc-node.warn {
  background: var(--sc-amber);
}
.sc-node.skip {
  background: var(--sc-ink-3);
}
.sc-wire {
  width: 1px;
  flex: 1;
  background: var(--sc-line-2);
  min-height: 14px;
}
/* Dashed where nothing happened, so a skipped step reads as absence. */
.sc-wire.d {
  background: none;
  border-left: 1px dashed var(--sc-line-2);
}
.sc-sb {
  padding: 8px 0 13px;
}
.sc-st {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.sc-st b {
  font-size: 13px;
  font-weight: 600;
}
.sc-st b.bad {
  color: var(--sc-red);
}
.sc-t {
  font-family: var(--sc-mono);
  font-size: 11px;
  color: var(--sc-ink-3);
}
.sc-sb p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--sc-ink-2);
}

.sc-err {
  border-left: 3px solid var(--sc-red);
  background: var(--sc-red-bg);
  padding: 9px 12px;
  margin-top: 8px;
}
.sc-err code {
  display: block;
  font-family: var(--sc-mono);
  font-size: 11.5px;
  color: var(--sc-red);
}

.sc-rr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 9px;
}
@media (max-width: 760px) {
  .sc-rr {
    grid-template-columns: 1fr;
  }
}

.sc-rr div {
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  padding: 8px 11px;
  font-family: var(--sc-mono);
  font-size: 11px;
  color: var(--sc-ink-2);
  background: var(--sc-card);
}

.sc-rr div span {
  display: block;
  color: var(--sc-ink-3);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-family: inherit;
  font-weight: 700;
}

/* The jump from a rejected order to the menu that caused it. */
.sc-crosslink {
  margin-top: 6px;
  border: 1px solid var(--sc-line);
  border-left: 3px solid var(--sc-green);
  border-radius: 0 9px 9px 0;
  padding: 11px 13px;
  background: var(--sc-card);
}

.sc-crosshead {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.sc-missing {
  margin: 0 0 8px;
  padding-left: 20px;
  font-family: var(--sc-mono);
  font-size: 11.5px;
}
.sc-missing li::marker {
  color: var(--sc-red);
}

.sc-diff {
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--sc-mono);
  font-size: 11.5px;
  margin-top: 9px;
  background: var(--sc-card);
}

.sc-diff div {
  padding: 7px 11px;
  border-bottom: 1px solid var(--sc-line);
}
.sc-diff div:last-child {
  border: none;
}
.sc-diff .del {
  background: var(--sc-red-bg);
  color: var(--sc-red);
}
.sc-diff .mod {
  background: var(--sc-amber-bg);
  color: var(--sc-amber);
}
.sc-diff .same {
  color: var(--sc-ink-3);
}

/* ── Support console: Menu Preview ─────────────────────────────────────── */
.sc-outlets {
  display: flex;
  flex-direction: column;
}

.sc-outlet {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 17px;
  border: 0;
  border-bottom: 1px solid var(--sc-line);
  border-left: 3px solid transparent;
  background: var(--sc-card);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.sc-outlet:last-child {
  border-bottom: 0;
}
.sc-outlet:hover {
  background: var(--sc-card-2);
}
.sc-outlet.on {
  background: var(--sc-card-2);
  border-left-color: var(--sc-green);
}
.sc-outlet-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sc-outlet-nums {
  text-align: right;
  font-family: var(--sc-mono);
  font-size: 12px;
  color: var(--sc-ink-2);
}

.sc-menu-items {
  max-height: 320px;
  overflow-y: auto;
  border-bottom: 1px solid var(--sc-line);
}

.sc-mrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 17px;
  border-bottom: 1px solid var(--sc-line);
  font-size: 13px;
}

.sc-mrow:last-child {
  border-bottom: 0;
}
.sc-mname {
  flex: 1;
  min-width: 0;
}
.sc-sku {
  display: block;
  font-family: var(--sc-mono);
  font-size: 10.5px;
  color: var(--sc-ink-3);
  margin-top: 2px;
}
.sc-mprice {
  font-family: var(--sc-mono);
  font-size: 12px;
  color: var(--sc-ink-2);
}
.sc-more {
  color: var(--sc-ink-3);
  font-size: 12px;
  justify-content: center;
}

.sc-klabel {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-ink-3);
  margin: 0 0 7px;
}

.sc-pre {
  margin: 0;
  background: #fbfbfa;
  border: 1px solid var(--sc-line-2);
  border-radius: 9px;
  padding: 12px;
  font-family: var(--sc-mono);
  font-size: 11px;
  color: var(--sc-ink-2);
  overflow: auto;
  max-height: 420px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* ── Support console: payload documents ────────────────────────────────────
   Support's two actions on a payload are copy it into a reply, or download it
   to attach to a ticket — so both sit on the block itself rather than in a
   toolbar somewhere else. */
.sc-doc {
  margin-top: 10px;
}

.sc-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.sc-doc-acts {
  display: flex;
  gap: 8px;
  flex: none;
}
.sc-doc-acts .sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Sits inside a what-was-sent box, so it reads as an affordance on that value
   rather than a separate control. */
.sc-viewlink {
  display: inline-block;
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sc-green);
}

.sc-viewlink:hover {
  text-decoration: underline;
}

/* ── Support console: Simulator ────────────────────────────────────────────
   Menu on the left, cart and the rest of the payload on the right — the order
   is built by picking from a real menu rather than editing JSON. */
.sc-grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 15px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .sc-grid2 {
    grid-template-columns: 1fr;
  }
}

.sc-btn.go {
  background: var(--sc-green);
  border-color: var(--sc-green);
  color: #fff;
}
.sc-btn.go:hover:not(:disabled) {
  background: #337946;
}
.sc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sc-note.warn {
  border-style: solid;
  border-color: #e3c98a;
  background: var(--sc-amber-bg);
  color: var(--sc-amber);
}

/* Category chips over the menu. */
.sc-cats {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 11px 15px;
  border-bottom: 1px solid var(--sc-line);
}

.sc-cat {
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--sc-line-2);
  background: var(--sc-card);
  color: var(--sc-ink-2);
  cursor: pointer;
}

.sc-cat.on {
  background: var(--sc-nav);
  color: #fff;
  border-color: var(--sc-nav);
}

.sc-plus {
  width: 27px;
  height: 27px;
  flex: none;
  border: 1px solid var(--sc-line-2);
  border-radius: 8px;
  background: var(--sc-card);
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  color: var(--sc-ink-2);
  cursor: pointer;
}

.sc-plus:hover {
  border-color: var(--sc-green);
  color: var(--sc-green);
}

.sc-crow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--sc-line);
  font-size: 13px;
}

.sc-num {
  border: 1px solid var(--sc-line-2);
  border-radius: 8px;
  padding: 6px 8px;
  font-family: var(--sc-mono);
  font-size: 12px;
  background: var(--sc-card);
  width: 88px;
}

.sc-num.sm {
  width: 74px;
}

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

.sc-qty button {
  width: 23px;
  height: 23px;
  border: 1px solid var(--sc-line-2);
  border-radius: 6px;
  background: var(--sc-card);
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  color: var(--sc-ink-2);
  cursor: pointer;
}

.sc-qty span {
  font-family: var(--sc-mono);
  font-size: 12px;
  min-width: 12px;
  text-align: center;
}
.sc-lt {
  font-family: var(--sc-mono);
  font-size: 12px;
  min-width: 56px;
  text-align: right;
  color: var(--sc-ink-2);
}

.sc-tot {
  padding: 13px 15px;
  border-top: 1px solid var(--sc-line);
  font-size: 12.5px;
}
.sc-tot div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--sc-ink-2);
  font-variant-numeric: tabular-nums;
}

.sc-tot div.g {
  color: var(--sc-ink);
  font-weight: 700;
  border-top: 1px solid var(--sc-line);
  margin-top: 7px;
  padding-top: 8px;
}

.sc-sim-acts {
  display: flex;
  gap: 9px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.sc-sim-acts .sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sc-res {
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  padding: 15px;
  background: var(--sc-card);
  font-size: 13px;
}

.sc-detail-meta {
  font-size: 12px;
  color: var(--sc-ink-3);
  margin-top: 8px;
}

/* An item the platform is holding as unavailable — shown, because ordering one
   is a case QA needs to stage. */
.sc-mrow.out {
  opacity: 0.5;
}

.sc-oos {
  font-family: var(--sc-mono);
  font-size: 10px;
  color: var(--sc-red);
  background: var(--sc-red-bg);
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 6px;
}

/* ── Simulator: per-line modifiers ─────────────────────────────────────────
   Options are chosen on the cart line rather than in a dialog when adding, so
   a selection can be changed without rebuilding the order. */
.sc-mods {
  padding: 8px 15px 10px 15px;
  border-bottom: 1px solid var(--sc-line);
  background: var(--sc-card-2);
}

.sc-mods-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sc-ink-2);
  margin-bottom: 6px;
}

.sc-mods-rule {
  font-weight: 400;
  font-size: 10.5px;
  color: var(--sc-ink-3);
}

.sc-mods-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sc-mod {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--sc-line-2);
  border-radius: 20px;
  background: var(--sc-card);
  font: inherit;
  font-size: 12px;
  color: var(--sc-ink-2);
  cursor: pointer;
}

.sc-mod:hover:not(:disabled) {
  border-color: var(--sc-green);
}
.sc-mod.on {
  background: var(--sc-green-bg);
  border-color: var(--sc-green);
  color: var(--sc-green);
  font-weight: 600;
}
.sc-mod.off {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}
.sc-mod-price {
  font-family: var(--sc-mono);
  font-size: 10.5px;
}

/* Marks a menu row whose item carries options, so it is obvious before adding. */
.sc-hasmods {
  font-size: 10px;
  color: var(--sc-ink-3);
  border: 1px solid var(--sc-line-2);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 6px;
}

.sc-menu-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.sc-outlet-pick {
  border: 1px solid var(--sc-line-2);
  border-radius: 8px;
  padding: 5px 8px;
  font-family: var(--sc-mono);
  font-size: 12px;
  background: var(--sc-card);
  color: inherit;
}


/*# sourceMappingURL=71-1f26050c.css.map*/