/* Theme overrides are shared by the landing page and all dashboard views. */
:root { color-scheme: dark; }
:root[data-theme="light"] {
  color-scheme: light;
  --bg-page: #fafafa;
  --bg-sidebar: #f5f5f5;
  --bg-card: #ffffff;
  --bg-card-hover: #ededed;
  --bg-surface: #ffffff;
  --bg-input: #f5f5f5;
  --bg-active: #e7e7e7;
  --border-subtle: #e5e5e5;
  --border-default: #d4d4d4;
  --border-hover: #a3a3a3;
  --text-primary: #171717;
  --text-secondary: #525252;
  --text-muted: #666666;
  --text-inverse: #ffffff;
  --accent-surface: #ededed;
  --accent-white: #171717;
  --accent-text: #404040;
  --accent-success: #157347;
  --accent-warning: #8a5200;
  --accent-error: #b4232c;
}
:root[data-theme="light"] .landing-header,
:root[data-theme="light"] .workspace-topbar { background: rgba(250, 250, 250, .94); }
:root[data-theme="light"] .brand-logo img { filter: invert(1); }
:root[data-theme="light"] ::selection { background: rgba(0, 0, 0, .15); }
:root[data-theme="light"] :focus-visible { outline-color: #525252; }
:root[data-theme="light"] .form-input:focus { box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
:root[data-theme="light"] .btn-primary:hover:not(:disabled) { background: #404040; border-color: #404040; }
:root[data-theme="light"] .sidebar-item.is-admin,
:root[data-theme="light"] .text-danger,
:root[data-theme="light"] .badge-danger,
:root[data-theme="light"] .btn-danger { color: var(--accent-error); }
:root[data-theme="light"] .health-bad { background: var(--accent-error); }
:root[data-theme="light"] .tab-badge { color: white; }
:root[data-theme="light"] .nav-badge { color: var(--text-inverse); }
:root[data-theme="light"] .modal-content { box-shadow: 0 16px 48px rgba(0, 0, 0, .15); }
:root[data-theme="light"] .toast {
  background: var(--bg-card); border-color: var(--border-default);
  color: var(--text-primary); box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
:root[data-theme="light"] .toast-success { color: var(--accent-success); border-color: var(--accent-success); }
:root[data-theme="light"] .toast-error { color: var(--accent-error); border-color: var(--accent-error); }
:root[data-theme="light"] #auth-pass-hint,
:root[data-theme="light"] #reset-pass-hint { color: var(--text-secondary) !important; }
/* Logs retain their console surface, with their own readable text palette. */
.terminal-container {
  color-scheme: dark;
  --text-primary: #fafafa;
  --text-secondary: #b5b5b5;
  --text-muted: #969696;
  --accent-text: #d4d4d4;
  --accent-success: #3ecf8e;
  --accent-warning: #f5a524;
  --accent-error: #ff6467;
}
:root[data-theme="light"] .terminal-container { box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
:root[data-theme="light"] .terminal-container :focus-visible { outline-color: #b5b5b5; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: .625rem;
  min-width: 44px; min-height: 44px; flex-shrink: 0;
  padding: .5rem .75rem; border: 1px solid var(--border-default);
  border-radius: var(--radius-md); color: var(--text-secondary);
  background: transparent; cursor: pointer; font: inherit; font-size: .875rem;
}
.theme-toggle:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.theme-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
.theme-toggle-sidebar { margin: .5rem .75rem .75rem; justify-content: flex-start; }
.theme-toggle-landing { padding: .5rem; }
.theme-toggle-landing .theme-label { display: none; }
.theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-sun { display: block; }
[data-theme="light"] .theme-icon-moon { display: none; }
