/* Donatos · un sistema de componentes, dos paletas explícitas.
   Preferencia visual separada de los datos de negocio. Sin inversión de imágenes. */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #191716;
  --surface: #24211f;
  --surface-raised: #302b27;
  --surface-muted: #201d1b;
  --text: #f7f0e4;
  --text-muted: #c8bfb2;
  --text-subtle: #ada292;
  --border: #494139;
  --border-strong: #8f8275;
  --brand: #b5222b;
  --brand-hover: #941b24;
  --on-brand: #ffffff;
  --accent: #efcf70;
  --on-accent: #2a211c;
  --link: #f3978c;
  --focus: #f2d878;
  --shadow: 0 18px 44px rgb(0 0 0 / 28%);
  --overlay: rgb(15 11 8 / 72%);
  --hero-start: #191716;
  --hero-mid: rgb(25 23 22 / 88%);
  --hero-end: rgb(25 23 22 / 4%);
  --hero-edge-overlay: linear-gradient(180deg,var(--page-bg),transparent 5%,transparent 94%,var(--page-bg)),linear-gradient(270deg,var(--page-bg),transparent 3%);
  --hero-accent: #efcf70;
  --success-bg: #243c2c;
  --success-text: #b5e2b6;
  --warning-bg: #42351f;
  --warning-text: #f2d88e;
  --info-bg: #243641;
  --info-text: #add7f2;
  --danger-bg: #46292b;
  --danger-text: #f4b2ae;
  --neutral-bg: #37312b;
  --neutral-text: #d8cec0;
  --selection-bg: #594524;
  --field-bg: #201d1b;
  --chart-grid: #51473e;
  --chart-bar: #de6962;
  --status-new-bg: #46292b;
  --status-new-text: #f6b6af;
  --status-preparing-bg: #42351f;
  --status-preparing-text: #f2d88e;
  --status-ready-bg: #243c2c;
  --status-ready-text: #b5e2b6;
  --status-completed-bg: #37312b;
  --status-completed-text: #e0d4c6;
  --status-cancelled-bg: #38262a;
  --status-cancelled-text: #e9bcc2;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f6efdf;
  --surface: #fffbf3;
  --surface-raised: #f2e7d3;
  --surface-muted: #eee2cd;
  --text: #2a211c;
  --text-muted: #68594b;
  --text-subtle: #72614e;
  --border: #d8c6aa;
  --border-strong: #91795e;
  --brand: #b5222b;
  --brand-hover: #941b24;
  --on-brand: #ffffff;
  --accent: #efcf70;
  --on-accent: #2a211c;
  --link: #b5222b;
  --focus: #8f1721;
  --shadow: 0 16px 36px rgb(42 33 28 / 12%);
  --overlay: rgb(31 22 16 / 55%);
  --hero-start: #f6efdf;
  --hero-mid: rgb(246 239 223 / 93%);
  --hero-end: rgb(246 239 223 / 3%);
  --hero-edge-overlay: linear-gradient(transparent,transparent);
  --hero-accent: #b5222b;
  --success-bg: #e7f0e4;
  --success-text: #335c35;
  --warning-bg: #fff0cc;
  --warning-text: #725117;
  --info-bg: #e5eff5;
  --info-text: #28566e;
  --danger-bg: #f9e5e3;
  --danger-text: #96323a;
  --neutral-bg: #eadfce;
  --neutral-text: #65523e;
  --selection-bg: #f5dda5;
  --field-bg: #fffbf3;
  --chart-grid: #dfcfb4;
  --chart-bar: #b5222b;
  --status-new-bg: #f9e5e3;
  --status-new-text: #96323a;
  --status-preparing-bg: #fff0cc;
  --status-preparing-text: #725117;
  --status-ready-bg: #e7f0e4;
  --status-ready-text: #335c35;
  --status-completed-bg: #eadfce;
  --status-completed-text: #65523e;
  --status-cancelled-bg: #f3e6ea;
  --status-cancelled-text: #7e3748;
}

::selection { background: var(--selection-bg); color: var(--text); }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text-muted);
  flex-shrink: 0;
  vertical-align: middle;
}
.theme-switch > button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  flex: 1 1 auto;
  margin: 0;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-family: Manrope, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}
.theme-switch > button[aria-pressed="true"] {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
}
.theme-switch svg {
  display: block;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button[data-theme-set]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
@media (hover: hover) {
  .theme-switch > button:not([aria-pressed="true"]):hover {
    background: var(--surface);
    color: var(--text);
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-switch > button { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .theme-switch { border-color: ButtonText; }
  .theme-switch > button { color: ButtonText; }
  .theme-switch > button[aria-pressed="true"] { border-color: Highlight; outline: 1px solid Highlight; }
  button[data-theme-set]:focus-visible { outline-color: Highlight; }
}
