/* Theme-Ergänzung: Das helle Grunddesign bleibt in styles.css unverändert. */
:root {
  color-scheme: light;
  --project-blue: #5674c9;
  --project-blue-bg: #edf2fd;
  --project-purple: #9473bc;
  --project-purple-bg: #f2eef9;
  --project-teal: #408e83;
  --project-teal-bg: #eaf5f1;
  --project-orange: #bd8752;
  --project-orange-bg: #faf2e8;
  --project-pink: #b77d99;
  --project-pink-bg: #f8edf3;
}

:is(#theme-toggle, #auth-theme-toggle) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #e0e6f1;
  border-radius: 7px;
  background: #fff;
  color: #64728b;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
:is(#theme-toggle, #auth-theme-toggle):hover { color: #4566dd; background: #edf1ff; border-color: #cfd9f5; }
:is(#theme-toggle, #auth-theme-toggle) .icon { width: 16px; height: 16px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101827;
  --paper: #172235;
  --ink: #e6edf9;
  --muted: #a0afc4;
  --soft: #91a1b9;
  --line: #29384e;
  --blue: #91a7ff;
  --blue-light: #263657;
  --night-sidebar: #121d2e;
  --night-hover: #203048;
  --night-field: #111c2d;
  --night-active: #1d2d48;
  --night-accent-border: #3c5180;
  --project-blue: #9aafff;
  --project-blue-bg: #243353;
  --project-purple: #c1a5ed;
  --project-purple-bg: #322b48;
  --project-teal: #81cabb;
  --project-teal-bg: #1e3b3c;
  --project-orange: #edbc82;
  --project-orange-bg: #403427;
  --project-pink: #dfadc6;
  --project-pink-bg: #3e2b3e;
}

:root[data-theme="dark"] body { background: var(--canvas); }
:root[data-theme="dark"] :is(.sidebar, .topbar) { background: var(--night-sidebar); border-color: var(--line); }
:root[data-theme="dark"] :is(.workspace-avatar, .profile-avatar, .mini-avatar) { color: #b4c3e1; background: #223149; border-color: #34455e; }
:root[data-theme="dark"] :is(.nav-item, .sidebar-project) { color: #b3c0d4; }
:root[data-theme="dark"] :is(.nav-item:hover, .sidebar-project:hover) { color: var(--ink); background: var(--night-hover); }
:root[data-theme="dark"] .nav-item.selected { color: #c0ceff; background: #233554; }
:root[data-theme="dark"] .sidebar-project .running-mark { border-color: var(--blue); }
:root[data-theme="dark"] :is(.nav-count, .project-count) { color: #b8c6df; background: #26364e; }
:root[data-theme="dark"] :is(.section-label, .sidebar-add, .demo-card, .demo-card small, .profile small) { color: var(--muted); }
:root[data-theme="dark"] .sidebar-add:hover { color: var(--blue); }
:root[data-theme="dark"] .demo-dot { background: var(--blue); }
:root[data-theme="dark"] .breadcrumb { color: var(--muted); }
:root[data-theme="dark"] .breadcrumb strong { color: #c4cfe1; }
:root[data-theme="dark"] .breadcrumb > span { color: #73849f; }
:root[data-theme="dark"] .preview-label { color: #b2c2e4; background: #223149; }
:root[data-theme="dark"] .icon-button { color: #b2c0d6; }
:root[data-theme="dark"] .icon-button:hover { color: #c9d4ff; background: var(--night-hover); }
:root[data-theme="dark"] :is(#theme-toggle, #auth-theme-toggle) { background: #1c2a40; color: #c0cde3; border-color: #34455f; }
:root[data-theme="dark"] :is(#theme-toggle, #auth-theme-toggle):hover { background: #293c5d; color: #e0e7ff; border-color: #4b6292; }
:root[data-theme="dark"] :is(.date-kicker, .quiet-label) { color: var(--muted); }

:root[data-theme="dark"] .button-primary { background: #4964ce; color: #fff; box-shadow: 0 3px 8px #00000014; }
:root[data-theme="dark"] .button-primary:hover { background: #5874e2; box-shadow: 0 3px 10px #00000020; }
:root[data-theme="dark"] :is(.button-secondary, .button-today) { color: #c4d0e3; background: #1c2a40; border-color: #35465e; }
:root[data-theme="dark"] :is(.button-secondary:hover, .button-today:hover) { color: #e1e8f5; background: #293a53; border-color: #4a5d7d; }
:root[data-theme="dark"] .button-dark { background: #dbe5ff; color: #1b2a47; }
:root[data-theme="dark"] .button-dark:hover { background: #fff; color: #15213b; }
:root[data-theme="dark"] .button-archive { color: #efbb96; background: #392b27; border-color: #62473a; }
:root[data-theme="dark"] .search-panel { background: var(--paper); border-color: var(--line); color: var(--muted); }
:root[data-theme="dark"] .search-panel input { color: var(--ink); }
:root[data-theme="dark"] .search-panel input::placeholder { color: var(--soft); }

:root[data-theme="dark"] .active-session { background: linear-gradient(108deg, #202f4d, #18263e 78%); border-color: #344a72; }
:root[data-theme="dark"] .active-session.idle { background: #1a2940; }
:root[data-theme="dark"] .active-orb { background: #293c5e; border-color: #3b527c; box-shadow: 0 3px 12px #0000000d; }
:root[data-theme="dark"] .equalizer i { background: #a4b6ff; }
:root[data-theme="dark"] .live-dot { background: #8bd6bc; box-shadow: 0 0 0 3px #8bd6bc12; }
:root[data-theme="dark"] :is(.live-label, .active-copy p, .active-timer small, .idle-hint) { color: #b1c0db; }
:root[data-theme="dark"] .timer-value { color: #e0e8ff; }

:root[data-theme="dark"] #week-label { color: #b6c4dc; }
:root[data-theme="dark"] .timeline-shell { background: var(--paper); border-color: var(--line); box-shadow: 0 3px 12px #00000008; }
:root[data-theme="dark"] :is(.project-column-label, .project-info, .add-project-row) { background: var(--paper); border-color: var(--line); }
:root[data-theme="dark"] :is(.project-column-label, .add-project-row) { color: var(--muted); }
:root[data-theme="dark"] :is(.timeline-header, .project-row, .day-label, .day-cell) { border-color: var(--line); }
:root[data-theme="dark"] .day-label { color: #a0afc7; }
:root[data-theme="dark"] .day-label strong { color: #c4d0e4; }
:root[data-theme="dark"] :is(.day-label.today, .day-cell.today) { background: #1c2b46; }
:root[data-theme="dark"] .day-label.today > span { background: #30456f; color: #d1dcff; }
:root[data-theme="dark"] .day-label.today strong { color: #d1dcff; }
:root[data-theme="dark"] :is(.day-label.weekend, .day-label.weekend strong) { color: #91a1b9; }
:root[data-theme="dark"] .day-cell.weekend { background: #152032; }
:root[data-theme="dark"] .project-row.is-running .project-info { background: #1b2942; }
:root[data-theme="dark"] .project-name { color: #d9e3f4; }
:root[data-theme="dark"] .project-name:hover { color: #b4c4ff; }
:root[data-theme="dark"] .project-total { color: var(--muted); }
:root[data-theme="dark"] .project-total .running-text { color: #b0c1ff; }
:root[data-theme="dark"] .project-play { background: #1d2a40; border-color: #34445e; color: #b7c7e5; }
:root[data-theme="dark"] .project-play:hover { background: #2b3e60; border-color: #5972a4; color: #d8e2ff; }
:root[data-theme="dark"] .project-play.is-running { background: #2a3d63; border-color: #425d91; color: #b7c8ff; }
:root[data-theme="dark"] .session-excerpt { opacity: 1; }
:root[data-theme="dark"] .session-block.running-block { background: #293c62; color: #c1d0ff; border-color: #829be5; border-left-color: #a6bbff; }
:root[data-theme="dark"] .session-block.running-block .live-dot { background: #bdceff; }
:root[data-theme="dark"] .add-project-row:hover { background: #1d2c43; color: #bdccff; }
:root[data-theme="dark"] :is(.week-summary, .page-footer) { color: var(--muted); }
:root[data-theme="dark"] .week-summary strong { color: #ced9ed; }
:root[data-theme="dark"] .summary-separator { background: #61718b; }
:root[data-theme="dark"] .summary-note .icon { color: #9cbdba; }

:root[data-theme="dark"] .text-button { color: #aabbd9; }
:root[data-theme="dark"] .text-button:hover { color: #d1dbff; }
:root[data-theme="dark"] .activity-row { border-color: var(--line); }
:root[data-theme="dark"] .activity-outcome { color: #c5d1e6; }
:root[data-theme="dark"] .activity-row:hover .activity-outcome { color: #b7c8ff; }
:root[data-theme="dark"] :is(.activity-meta, .activity-time) { color: var(--muted); }
:root[data-theme="dark"] .activity-meta strong { color: #bccbe4; }
:root[data-theme="dark"] .empty-state { color: var(--muted); border-color: #3c4e69; }
:root[data-theme="dark"] .empty-state .icon { color: #a5b7d7; }
:root[data-theme="dark"] .empty-state h3 { color: #d5e0f2; }
:root[data-theme="dark"] .archive-card { background: var(--paper); border-color: var(--line); }
:root[data-theme="dark"] .archive-card p { color: var(--muted); }

:root[data-theme="dark"] dialog { color: var(--ink); background: var(--paper); border-color: #35465f; box-shadow: 0 25px 100px #00000055; }
:root[data-theme="dark"] dialog::backdrop { background: #070d1880; }
:root[data-theme="dark"] .modal-symbol { color: #c2cfff; background: #2a3c5f; }
:root[data-theme="dark"] .modal p { color: #b0bfd5; }
:root[data-theme="dark"] :is(.modal label, .color-picker legend) { color: #c9d5e7; }
:root[data-theme="dark"] .modal label span { color: var(--muted); }
:root[data-theme="dark"] :is(.modal input, .modal textarea) { color: #e0e8f5; background: var(--night-field); border-color: #3a4d69; }
:root[data-theme="dark"] :is(.modal input::placeholder, .modal textarea::placeholder) { color: #95a6c1; }
:root[data-theme="dark"] :is(input:focus, textarea:focus) { border-color: #a1b7ff; box-shadow: 0 0 0 3px #91a7ff20; }
:root[data-theme="dark"] .color-radio span { border-color: var(--paper); box-shadow: 0 0 0 1px #536581; }
:root[data-theme="dark"] .color-radio input:checked + span { box-shadow: 0 0 0 2px var(--project-color); }
:root[data-theme="dark"] .form-error { color: #ffb5ad !important; }
:root[data-theme="dark"] :is(.drawer-description, .drawer-total-label, .drawer-empty) { color: var(--muted); }
:root[data-theme="dark"] .drawer-session { background: #1b2a41; border-color: #34455e; }
:root[data-theme="dark"] .drawer-session:hover { border-color: #738cc3; }
:root[data-theme="dark"] :is(.drawer-session .session-date, .drawer-session .session-duration) { color: #a9bad6; }
:root[data-theme="dark"] .drawer-session .session-text { color: #d0dbed; }
:root[data-theme="dark"] .toast { color: #ecf2ff; background: #2e4266; border: 1px solid #5872a0; box-shadow: 0 8px 25px #00000030; }

:root[data-theme="dark"] :is(button, a, input, textarea, [tabindex]):focus-visible { outline-color: #b2c3ff; }
:root[data-theme="dark"] .color-radio input:focus-visible + span { outline-color: #b2c3ff; }
:root[data-theme="dark"] .timeline-scroll { scrollbar-color: #4a5c7a #172235; }
:root[data-theme="dark"] .auth-card { box-shadow: 0 18px 65px #00000018; }
:root[data-theme="dark"] .app-error { background: #362d22; border-color: #7b6343; color: #e5c393; }
:root[data-theme="dark"] .stage-done { background: #203d34; color: #a0d8bb; }
:root[data-theme="dark"] .stage-in_progress { background: #293c62; color: #bdcdff; }
:root[data-theme="dark"] .stage-planned { background: #2b3749; color: #b7c5db; }

@media (max-width: 600px) {
  :is(#theme-toggle, #auth-theme-toggle) { width: 34px; min-width: 34px; padding: 7px; }
  :is(#theme-toggle, #auth-theme-toggle) .theme-toggle-label { display: none; }
  .topbar-right { gap: 7px; }
  :root[data-theme="dark"] .mobile-view-nav button { color: #bac8df; background: #1b2940; border-color: #3a4d69; }
  :root[data-theme="dark"] .mobile-view-nav button.selected { color: #d0dbff; background: #2c3e62; border-color: #5c77ad; }
}
@media (max-width: 380px) { .topbar .preview-label { display: none; } }
