:root {
  color-scheme: dark;
  --bg: #1C1C1B;
  --bg-elev: #2D2D2B;
  --bg-card: #252524;
  --bg-hover: #2D2D2B;
  --text: #F1EEE7;
  --heading: #F1EEE7;
  --text-dim: #B4B0A7;
  --accent: #D4AF57;
  --accent-hover: #E2C379;
  --accent-text: #D4AF57;
  --accent-2: #D4AF57;
  --on-accent: #17150F;
  --border: #3B3B38;
  --input-border: #55534E;
  --nav-bg: #252524;
  --accent-wash: rgba(212, 175, 87, 0.06);
  --secondary-wash: rgba(212, 175, 87, 0.03);
  --accent-soft: #2D2D2B;
  --accent-border: #55534E;
  --secondary-soft: #2D2D2B;
  --secondary-border: #55534E;
  --feature-end: #2D2D2B;
  --success: #91E5B9;
  --success-surface: #193329;
  --success-border: #539177;
  --danger: #FFADB8;
  --danger-surface: #40252D;
  --danger-border: #AB6874;
  --warning: #F7D28C;
  --warning-surface: #3B2F1C;
  --warning-border: #9B7B42;
  --chart-positive: #68D7A7;
  --chart-negative: #D38396;
  --side-bg: #252524;
  --side-selected: #2D2D2B;
  --shadow: rgba(0, 0, 0, 0.24);
  --overlay: rgba(0, 0, 0, 0.6);
  --success-solid: #176142;
  --danger-solid: #9C2E43;
  --on-status: #FFFFFF;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F8F1E3;
  --bg-elev: #F3EADA;
  --bg-card: #FFFCF5;
  --bg-hover: #F3EADA;
  --text: #0F1F47;
  --heading: #0B2D52;
  --text-dim: #546484;
  --accent: #0B2D52;
  --accent-hover: #173F65;
  --accent-text: #0B2D52;
  --accent-2: #796520;
  --on-accent: #FFFCF5;
  --border: #E0D5BE;
  --input-border: #CFC0A2;
  --nav-bg: #FFFCF5;
  --accent-wash: rgba(121, 101, 32, 0.05);
  --secondary-wash: rgba(121, 101, 32, 0.03);
  --accent-soft: #F3EADA;
  --accent-border: #CFC0A2;
  --secondary-soft: #F3EADA;
  --secondary-border: #CFC0A2;
  --feature-end: #F3EADA;
  --success: #176142;
  --success-surface: #E1EFE5;
  --success-border: #5D8B72;
  --danger: #912738;
  --danger-surface: #F8E5E6;
  --danger-border: #B87179;
  --warning: #72500F;
  --warning-surface: #F9ECD0;
  --warning-border: #A88646;
  --chart-positive: #33816A;
  --chart-negative: #AD4258;
  --side-bg: #F3EADA;
  --side-selected: #E0D5BE;
  --shadow: rgba(74, 58, 26, 0.14);
  --overlay: rgba(15, 31, 71, 0.5);
}

html { background: var(--bg); color: var(--text); }
h1, h2, h3, h4, h5, h6 { color: var(--heading); }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}
:where(input, select, textarea) { accent-color: var(--accent); }
:where(input, textarea)::placeholder { color: var(--text-dim); opacity: 1; }
:where(select, option) { color: var(--text); background: var(--bg-card); }

.site-theme-toggle {
  display: inline-grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 1.36rem;
  line-height: 1;
  cursor: pointer;
}
.site-theme-toggle svg { display: block; width: 24px; height: 24px; }
.site-theme-toggle:hover { background: var(--bg-hover); border-color: var(--secondary-border); }
.site-theme-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.site-theme-toggle .theme-for-light { display: none; }
:root[data-theme="light"] .site-theme-toggle .theme-for-dark { display: none; }
:root[data-theme="light"] .site-theme-toggle .theme-for-light { display: inline; }

.theme-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.admin-theme-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.admin-login-box > .admin-theme-actions, .login-box > .admin-theme-actions { margin-bottom: 12px; }
