:root {
  --chart-track: #edf0f6;
  --chart-grid: #eef1f7;
  --chart-label: #a6afbf;
}
.theme-toggle {
  padding: 7px 10px;
  background: transparent;
  color: #69778d;
  border: 1px solid var(--line);
  box-shadow: none;
  white-space: nowrap;
  font-size: 11px;
}
.theme-toggle:hover { background: #eeedff; color: #635bff; }
.theme-toggle .icon { width: 16px; height: 16px; }
.theme-sun { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
[data-theme="dark"] .theme-moon { display: none; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101521;
  --bg2: #171e2d;
  --card: #171e2d;
  --card2: #1e2738;
  --line: #2b3548;
  --txt: #e5eaf4;
  --dim: #a2aec3;
  --acc: #847aff;
  --ok: #43c69c;
  --warn: #eabf6a;
  --err: #f28b99;
  --glow: #2b2549;
  --chart-track: #30394f;
  --chart-grid: #2b3548;
  --chart-label: #8e9bb3;
}
[data-theme="dark"] .sidebar,
[data-theme="dark"] .stat,
[data-theme="dark"] .card,
[data-theme="dark"] .modal,
[data-theme="dark"] .status-ring-inner,
[data-theme="dark"] .table-search,
[data-theme="dark"] .period-chip,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] button.ghost,
[data-theme="dark"] .chart-filter { background: var(--card); border-color: var(--line); }
[data-theme="dark"] header.topbar { background: #171e2def; }
[data-theme="dark"] .brand,
[data-theme="dark"] .page-heading h2,
[data-theme="dark"] .card-title,
[data-theme="dark"] .auth-form h2,
[data-theme="dark"] .status-line b { color: var(--txt); }
[data-theme="dark"] .stat .val { color: var(--txt) !important; }
[data-theme="dark"] .nav-item,
[data-theme="dark"] .stat .lbl,
[data-theme="dark"] .page-heading p,
[data-theme="dark"] .section-heading h3,
[data-theme="dark"] .status-line,
[data-theme="dark"] .chart-filter,
[data-theme="dark"] .chart-legend,
[data-theme="dark"] .period-chip,
[data-theme="dark"] .auth-form label,
[data-theme="dark"] .auth-form > p,
[data-theme="dark"] button.ghost,
[data-theme="dark"] .theme-toggle { color: #b0bdd2; }
[data-theme="dark"] .stat .sub,
[data-theme="dark"] .card-sub,
[data-theme="dark"] .chart-foot,
[data-theme="dark"] .status-ring-inner small,
[data-theme="dark"] .status-note,
[data-theme="dark"] .nav-label,
[data-theme="dark"] .tool-meta,
[data-theme="dark"] .table-footer,
[data-theme="dark"] .footer-note,
[data-theme="dark"] .section-heading span,
[data-theme="dark"] .auth-note,
[data-theme="dark"] .auth-footer,
[data-theme="dark"] .topbar-breadcrumb,
[data-theme="dark"] .live-indicator,
[data-theme="dark"] .devmeta { color: #8e9cb4; }
[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] button.ghost:hover,
[data-theme="dark"] .theme-toggle:hover { background: #252e43; color: var(--txt); }
[data-theme="dark"] .nav-item.active { background: #2b2549; color: #b4aaff; }
[data-theme="dark"] .avatar,
[data-theme="dark"] .nav-item .count-badge,
[data-theme="dark"] .b-owner,
[data-theme="dark"] .tag-ours,
[data-theme="dark"] .tool-icon { background: #2b2549; color: #b4aaff; }
[data-theme="dark"] .workspace-dot { background: #263047; color: #b0bdd2; }
[data-theme="dark"] .tool-icon.mail { background: #22354e; color: #87b8ff; }
[data-theme="dark"] .pill.ok,
[data-theme="dark"] .b-ready,
[data-theme="dark"] .tag-cur { background: #183b33; color: #72dfb7; }
[data-theme="dark"] .pill.warn,
[data-theme="dark"] .b-qr_pending,
[data-theme="dark"] .tag-phone { background: #3c3222; color: #f0c87c; }
[data-theme="dark"] .pill.err,
[data-theme="dark"] .b-failed,
[data-theme="dark"] .b-needs_login { background: #422631; color: #f5a5b0; }
[data-theme="dark"] button.danger { background: #30222e; border-color: #573342; color: #f5a5b0; }
[data-theme="dark"] button.danger:hover { background: #442b37; }
[data-theme="dark"] .round-action { color: #a9b7cd !important; }
[data-theme="dark"] .round-action:hover { background: #2b2549 !important; color: #b4aaff !important; }
[data-theme="dark"] input::placeholder { color: #8492aa; }
[data-theme="dark"] th { background: #1c2536; color: #a2b1c9; }
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] .table-filters,
[data-theme="dark"] .tool-history,
[data-theme="dark"] .status-note { border-color: var(--line); }
[data-theme="dark"] tbody tr:hover { background: #1e283c; }
[data-theme="dark"] .auth-overlay { background: var(--bg); }
[data-theme="dark"] .auth-art { background: #201e38; }
[data-theme="dark"] .auth-art:before { background: radial-gradient(circle, #6457b34d, transparent 65%); }
[data-theme="dark"] .auth-art:after { background: #302747; }
[data-theme="dark"] .auth-art h3 { color: #ded7ff; }
[data-theme="dark"] .auth-art p,
[data-theme="dark"] .art-features,
[data-theme="dark"] .art-label,
[data-theme="dark"] .art-window-top span { color: #b2a8d7; }
[data-theme="dark"] .auth-eyebrow { color: #b4aaff; }
[data-theme="dark"] .art-window { background: #1b2034; border-color: #39324f; }
[data-theme="dark"] .art-tile { background: #252942; border-color: #39324f; }
[data-theme="dark"] .art-list,
[data-theme="dark"] .art-list div { border-color: #39324f; }
[data-theme="dark"] .art-list i,
[data-theme="dark"] .art-list span,
[data-theme="dark"] .art-dots i,
[data-theme="dark"] .skeleton { background: #464164; }
[data-theme="dark"] .skeleton.wide { background: #6a5e9f; }
[data-theme="dark"] .art-list b { background: #27473d; }
[data-theme="dark"] .auth-error { background: #422631; color: #f5a5b0; }
[data-theme="dark"] .overlay:not(.auth-overlay) { background: #050913ad; }
[data-theme="dark"] .toast { background: #e5eaf4; color: #172136; }

@media (max-width: 650px) {
  .topbar-right .theme-toggle { width: 31px; height: 31px; padding: 6px; }
  .topbar-right .theme-toggle [data-theme-label] { display: none; }
  .auth-top { gap: 10px; }
  .auth-top .theme-toggle { padding: 7px; }
}
