/* Palette declarations are generated from theme-palettes.js. */
body[data-theme="blue"], [data-theme-preview="blue"] {
  --accent: #1768e5;
  --accent-gradient-start: #1e7af0;
  --accent-gradient-end: #1456c7;
  --theme-page: #f6f9fc;
  --theme-panel: #ffffff;
  --theme-card: #ffffff;
  --theme-card-alt: #edf3ff;
  --theme-tab: #ffffff;
  --theme-tab-hover: #f8faff;
  --theme-border: #c6d8f5;
  --theme-text: #31517d;
  --theme-soft-bg: rgba(23, 104, 229, 0.08);
  --theme-soft-bg-strong: rgba(23, 104, 229, 0.12);
  --theme-soft-border: rgba(23, 104, 229, 0.2);
  --theme-soft-text: #31517d;
  --theme-on-accent: #ffffff;
}

body[data-theme="gray"], [data-theme-preview="gray"] {
  --accent: #5f6b78;
  --accent-gradient-start: #5f6b78;
  --accent-gradient-end: #515b66;
  --theme-page: #fafbfb;
  --theme-panel: #fdfdfd;
  --theme-card: #f6f7f8;
  --theme-card-alt: #eff0f2;
  --theme-tab: #edeff0;
  --theme-tab-hover: #e2e4e7;
  --theme-border: #caced2;
  --theme-text: #31383e;
  --theme-soft-bg: #f1f2f3;
  --theme-soft-bg-strong: #e7e9eb;
  --theme-soft-border: #caced2;
  --theme-soft-text: #31383e;
  --theme-on-accent: #ffffff;
}

body[data-theme="black"], [data-theme-preview="black"] {
  --accent: #2f3640;
  --accent-gradient-start: #2f3640;
  --accent-gradient-end: #282e36;
  --theme-page: #f9f9f9;
  --theme-panel: #fcfcfc;
  --theme-card: #f4f4f4;
  --theme-card-alt: #eaebec;
  --theme-tab: #e8e9ea;
  --theme-tab-hover: #dadbdd;
  --theme-border: #babdc0;
  --theme-text: #181c21;
  --theme-soft-bg: #ecedee;
  --theme-soft-bg-strong: #e0e1e2;
  --theme-soft-border: #babdc0;
  --theme-soft-text: #181c21;
  --theme-on-accent: #ffffff;
}

body[data-theme="purple"], [data-theme-preview="purple"] {
  --accent: #6e5bb8;
  --accent-gradient-start: #6e5bb8;
  --accent-gradient-end: #5e4d9c;
  --theme-page: #fbfafd;
  --theme-panel: #fdfdfe;
  --theme-card: #f7f6fb;
  --theme-card-alt: #f1eff8;
  --theme-tab: #efedf7;
  --theme-tab-hover: #e5e1f2;
  --theme-border: #cfc9e8;
  --theme-text: #392f60;
  --theme-soft-bg: #f2f0f9;
  --theme-soft-bg-strong: #e9e6f4;
  --theme-soft-border: #cfc9e8;
  --theme-soft-text: #392f60;
  --theme-on-accent: #ffffff;
}

body[data-theme="green"], [data-theme-preview="green"] {
  --accent: #2f8f5b;
  --accent-gradient-start: #2b8253;
  --accent-gradient-end: #256f47;
  --theme-page: #f9fcfa;
  --theme-panel: #fcfdfd;
  --theme-card: #f4f9f6;
  --theme-card-alt: #eaf4ef;
  --theme-tab: #e8f3ed;
  --theme-tab-hover: #daebe1;
  --theme-border: #badac9;
  --theme-text: #184a2f;
  --theme-soft-bg: #ecf5f0;
  --theme-soft-bg-strong: #e0eee6;
  --theme-soft-border: #badac9;
  --theme-soft-text: #184a2f;
  --theme-on-accent: #ffffff;
}

body[data-theme="red"], [data-theme-preview="red"] {
  --accent: #b84f5a;
  --accent-gradient-start: #b84f5a;
  --accent-gradient-end: #9c434d;
  --theme-page: #fdfafa;
  --theme-panel: #fefcfd;
  --theme-card: #fbf5f6;
  --theme-card-alt: #f8edef;
  --theme-tab: #f7eced;
  --theme-tab-hover: #f2dfe1;
  --theme-border: #e8c5c9;
  --theme-text: #60292f;
  --theme-soft-bg: #f9eff0;
  --theme-soft-bg-strong: #f4e5e6;
  --theme-soft-border: #e8c5c9;
  --theme-soft-text: #60292f;
  --theme-on-accent: #ffffff;
}

body[data-theme="pink"], [data-theme-preview="pink"] {
  --accent: #b85d95;
  --accent-gradient-start: #ab568b;
  --accent-gradient-end: #914976;
  --theme-page: #fdfafc;
  --theme-panel: #fefdfd;
  --theme-card: #fbf6f9;
  --theme-card-alt: #f8eff4;
  --theme-tab: #f7edf3;
  --theme-tab-hover: #f2e2ec;
  --theme-border: #e8cadc;
  --theme-text: #60304d;
  --theme-soft-bg: #f9f0f5;
  --theme-soft-bg-strong: #f4e7ef;
  --theme-soft-border: #e8cadc;
  --theme-soft-text: #60304d;
  --theme-on-accent: #ffffff;
}

body[data-theme]:not([data-theme="blue"]) { --surface: var(--theme-panel); --surface-strong: var(--theme-panel); --bg-soft: var(--theme-card); --card-background: var(--theme-panel); --primary-color: var(--accent); }
body[data-theme]:not([data-theme="blue"])[data-shell-mode] { background: radial-gradient(ellipse at 15% 0%,var(--theme-radial-1),transparent 38%),linear-gradient(180deg,var(--theme-panel),var(--theme-page)); }
body[data-theme]:not([data-theme="blue"]) .panel { background: var(--theme-panel); border-color: var(--theme-border); }
body[data-theme]:not([data-theme="blue"]) :is(.details-card,.customer-result,.inventory-grid-card,.recommendation-card,.dashboard-ro-item,.message-card):not(.is-error,.is-danger,.is-warning,.is-success,.is-disabled) {
  background: var(--theme-card);
  border-color: var(--theme-border);
}
body[data-theme]:not([data-theme="blue"]) :is(.inventory-bucket,.inventory-vehicle-unit,.bdc-customer-vehicle-row) { background-color: var(--theme-panel); border-color: var(--theme-border); }
body[data-theme]:not([data-theme="blue"]) :is(.inventory-bucket-toggle,.bdc-customer-appointments-summary) { background: var(--theme-card-alt); color: var(--theme-text); }
body[data-theme]:not([data-theme="blue"]) .inventory-bucket-toggle:hover { background: var(--theme-tab-hover); color: var(--theme-text); }
body[data-theme]:not([data-theme="blue"]) .tab-button:not(.is-active) { background: var(--theme-tab) !important; color: var(--ink) !important; border-color: var(--theme-border); }
body[data-theme]:not([data-theme="blue"]) .tab-button:not(.is-active):hover { background: var(--theme-tab-hover) !important; }
body[data-theme]:not([data-theme="blue"]) .tab-button.is-active { background: linear-gradient(145deg,var(--accent-gradient-start),var(--accent-gradient-end)) !important; color: var(--theme-on-accent) !important; }
body[data-theme]:not([data-theme="blue"]) :is(.queue-item.is-selected,.inventory-grid-card.is-active) { background: var(--theme-card-alt); border-color: var(--accent); }
body[data-theme]:not([data-theme="blue"]) .inventory-category-tabs .is-active { background: var(--theme-card-alt); color: var(--theme-text); border-color: var(--theme-border); }
body[data-theme]:not([data-theme="blue"]) .btn-secondary:not(.bdc-delete-customer,.bdc-delete-appointment-button,.danger-button) { color: var(--accent-gradient-start); border-color: var(--accent-gradient-start); }
body[data-theme]:not([data-theme="blue"]) .app-brand-banner { background: linear-gradient(135deg,var(--theme-panel),var(--theme-card-alt)); border-color: var(--theme-border); }

.theme-modal-card { width: min(800px,calc(100vw - 28px)); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.theme-modal-card > :not(.theme-menu-grid) { flex-shrink: 0; }
.theme-modal-card .theme-menu-grid { gap: 12px; min-height: 0; overflow-y: auto; padding: 2px; }
.theme-choice-button,
.theme-choice-button.is-active { display: grid; min-width: 0; gap: 10px; padding: 12px; color: var(--ink); background: var(--theme-panel); border: 2px solid var(--theme-border); text-align: left; box-shadow: none; }
.theme-choice-button.is-active { border-color: var(--accent-gradient-start); box-shadow: 0 0 0 2px var(--theme-card-alt); }
.theme-choice-label { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; }
.theme-choice-label small { color: var(--theme-text); font-size: 11px; font-weight: 600; }
.theme-preview { display: grid; min-width: 0; gap: 8px; padding: 8px; border-radius: 8px; background: var(--theme-page); }
.theme-preview-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.theme-preview-tabs span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 5px; border-radius: 5px; font-size: 10px; font-weight: 600; background: var(--theme-tab); color: var(--theme-text); }
.theme-preview-tabs span:first-child { background: linear-gradient(145deg,var(--accent-gradient-start),var(--accent-gradient-end)); color: var(--theme-on-accent); }
.theme-preview-card { display: grid; gap: 5px; padding: 9px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-card); }
.theme-preview-card strong { font-size: 11px; }
.theme-preview-line { display: block; height: 5px; width: 75%; border-radius: 3px; background: var(--theme-border); }
.theme-preview-line:last-child { width: 50%; }
.theme-preview-caption { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
@media(max-width:600px) {
  .theme-modal-card .theme-menu-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .theme-choice-button { padding: 8px; gap: 6px; }
  .theme-preview { padding: 6px; gap: 6px; }
  .theme-preview-tabs span { height: 10px; padding: 0; font-size: 0; }
  .theme-preview-card { padding: 6px; gap: 4px; }
  .theme-preview-card strong { font-size: 10px; }
}
