/* Gemeinsame Design-Tokens für Hauptfenster und Widget */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1022;
  --bg-elev: #10172f;
  --surface: rgba(150, 165, 255, 0.045);
  --surface-2: rgba(150, 165, 255, 0.085);
  --surface-solid: #121a35;
  --border: rgba(150, 165, 255, 0.11);
  --border-strong: rgba(150, 165, 255, 0.2);
  --text: #e8ebf7;
  --muted: #9098b6;
  --faint: #5f688c;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --glow-a: rgba(45, 212, 191, 0.10);
  --glow-b: rgba(139, 92, 246, 0.12);
  --danger: #fb7185;
  --ok: #34d399;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --surface-solid: #ffffff;
  --border: #e2e6f0;
  --border-strong: #cfd5e4;
  --text: #141a2e;
  --muted: #5b6380;
  --faint: #8f97b2;
  --shadow: 0 8px 24px -14px rgba(30, 40, 80, 0.25);
  --glow-a: rgba(45, 212, 191, 0.10);
  --glow-b: rgba(139, 92, 246, 0.08);
  --danger: #e11d48;
  --ok: #059669;
}

:root { --accent: #2dd4bf; --accent-2: #8b5cf6; }
:root[data-accent="teal"]   { --accent: #2dd4bf; --accent-2: #8b5cf6; }
:root[data-accent="violet"] { --accent: #a78bfa; --accent-2: #22d3ee; }
:root[data-accent="blue"]   { --accent: #60a5fa; --accent-2: #a78bfa; }
:root[data-accent="rose"]   { --accent: #fb7185; --accent-2: #f59e0b; }
:root[data-accent="amber"]  { --accent: #f5b33b; --accent-2: #fb7185; }
:root[data-theme="light"][data-accent="teal"]  { --accent: #0d9488; }
:root[data-theme="light"][data-accent="violet"]{ --accent: #7c3aed; }
:root[data-theme="light"][data-accent="blue"]  { --accent: #2563eb; }
:root[data-theme="light"][data-accent="rose"]  { --accent: #e11d48; }
:root[data-theme="light"][data-accent="amber"] { --accent: #d97706; }

:root {
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 40%, transparent);
  --radius: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.avatar {
  --h: 180;
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 50) 65% 45%));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
:root[data-theme="light"] .avatar { background: linear-gradient(135deg, hsl(var(--h) 65% 50%), hsl(calc(var(--h) + 50) 60% 42%)); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; white-space: nowrap; font-weight: 500;
  color: var(--text); text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--border-strong); background: color-mix(in oklab, var(--surface-2) 70%, var(--text) 6%); }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: #06121a; }
:root[data-theme="light"] .btn.primary { color: #fff; }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 88%, white); }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
/* Kopfzeile, Benutzermenü und reine Symbolknöpfe bleiben rahmenlos und gedämpft */
.kopfzeile .btn.ghost, .benutzermenue .btn.ghost, .menue .btn.ghost, .btn.ghost.icon, .btn.ghost.zurueck, .btn.ghost.tp-zp-umschalter { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.sm.icon { width: 30px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.confirm:hover { border-color: var(--accent-line); color: var(--accent); }
.btn:focus-visible, input:focus-visible, select:focus-visible, .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Alltagsbegleitung: Erweiterungen */
:root { --warn: #f5b33b; --sidebar: 248px; }
:root[data-theme="light"] { --warn: #b45309; }
a { color: var(--accent); }

/* Geburtstage: Marke „Mitarbeiter“ in eigener Farbe (Violett), Klient in Akzentfarbe; bei violettem Akzent Cyan */
:root { --person-mitarbeiter: #a78bfa; }
:root[data-theme="light"] { --person-mitarbeiter: #7c3aed; }
:root[data-accent="violet"] { --person-mitarbeiter: #22d3ee; }
:root[data-theme="light"][data-accent="violet"] { --person-mitarbeiter: #0e7490; }
