/* VGG Media Planner – Stylesheet
   Systemschrift (keine externen Fonts, DSGVO-freundlich), semantische Farb-Tokens, Hell & Dunkel. */

/* ------------------------------------------------------------------ Tokens */
:root {
  color-scheme: light;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --accent: #4f46e5;
  --on-accent: #ffffff;
  --accent-hover: color-mix(in srgb, var(--accent) 85%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --accent-soft-2: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent) 85%, #000);
  --focus: color-mix(in srgb, var(--accent) 55%, transparent);

  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --hover: rgba(16, 24, 40, 0.05);
  --active: rgba(16, 24, 40, 0.09);
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #111827;
  --text-2: #444c5c;
  --text-3: #626b7a;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, 0.12), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 56px -12px rgba(16, 24, 40, 0.28);
  --scrim: rgba(15, 20, 30, 0.5);

  --sidebar-bg: #12151c;
  --sidebar-text: #d4d8e0;
  --sidebar-muted: #8f97a6;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(255, 255, 255, 0.11);
  --sidebar-border: rgba(255, 255, 255, 0.07);

  /* Status (feste Rollen – immer mit Icon + Text) */
  --good: #0ca30c;
  --good-text: #067306;
  --good-soft: #e5f5e5;
  --progress: #2a78d6;
  --critical: #d03b3b;
  --critical-text: #b42318;
  --critical-soft: #fdeceb;
  --warning: #fab219;
  --warning-text: #8a5a00;
  --warning-soft: #fff3d6;
  --info-soft: #e8f1fc;
  --mark-neutral: #a4aab5;
  --chart-track: #eceef2;
  --chart-grid: #e7e9ee;

  /* Kategorische Palette (validiert, feste Reihenfolge) – Bezeichnungen, Projekte, Diagramme */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4;
  --c6: #008300; --c7: #4a3aa7; --c8: #e34948; --c9: #0e7490; --c10: #64748b;
  --s1: var(--c1); --s2: var(--c2); --s3: var(--c3); --s4: var(--c4); --s5: var(--c5); --s6: var(--c6); --s7: var(--c7); --s8: var(--c8);

  /* Profilfarben (weiße Initialen ≥ 4,5:1) */
  --a1: #4f46e5; --a2: #0f766e; --a3: #b45309; --a4: #be185d; --a5: #1d4ed8;
  --a6: #7e22ce; --a7: #15803d; --a8: #b91c1c; --a9: #0369a1; --a10: #475569;

  /* Sequenzielle Skala (Blau) */
  --seq-0: transparent; --seq-1: #e3eefc; --seq-2: #b7d3f6; --seq-3: #86b6ef; --seq-4: #2a78d6; --seq-5: #184f95;
  --seq-ink-strong: #ffffff;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --sidebar-w: 252px;
  --topbar-h: 60px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 160ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0f14;
    --surface: #161a21;
    --surface-2: #1b2029;
    --surface-3: #232935;
    --hover: rgba(255, 255, 255, 0.05);
    --active: rgba(255, 255, 255, 0.09);
    --border: #2a303b;
    --border-strong: #3b4351;
    --text: #eef0f4;
    --text-2: #bcc3cf;
    --text-3: #949cab;
    --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
    --accent-soft-2: color-mix(in srgb, var(--accent) 28%, var(--surface));
    --accent-text: color-mix(in srgb, var(--accent) 50%, #fff);
    --focus: color-mix(in srgb, var(--accent) 60%, #fff);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, 0.7);
    --scrim: rgba(0, 0, 0, 0.62);
    --sidebar-bg: #0a0c10;
    --good-text: #4fd14f;
    --good-soft: rgba(12, 163, 12, 0.16);
    --progress: #3987e5;
    --critical-text: #f19a9a;
    --critical-soft: rgba(208, 59, 59, 0.2);
    --warning-text: #f5c35b;
    --warning-soft: rgba(250, 178, 25, 0.15);
    --info-soft: rgba(57, 135, 229, 0.16);
    --mark-neutral: #6c7482;
    --chart-track: #262c37;
    --chart-grid: #2a303b;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181;
    --c6: #1a9a1a; --c7: #9085e9; --c8: #e66767; --c9: #2b9cb8; --c10: #8492a6;
    --seq-1: #16304f; --seq-2: #1c4a80; --seq-3: #2a6bbf; --seq-4: #5598e7; --seq-5: #9ec5f4;
    --seq-ink-strong: #0b1220;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f14;
  --surface: #161a21;
  --surface-2: #1b2029;
  --surface-3: #232935;
  --hover: rgba(255, 255, 255, 0.05);
  --active: rgba(255, 255, 255, 0.09);
  --border: #2a303b;
  --border-strong: #3b4351;
  --text: #eef0f4;
  --text-2: #bcc3cf;
  --text-3: #949cab;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
  --accent-soft-2: color-mix(in srgb, var(--accent) 28%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent) 50%, #fff);
  --focus: color-mix(in srgb, var(--accent) 60%, #fff);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, 0.7);
  --scrim: rgba(0, 0, 0, 0.62);
  --sidebar-bg: #0a0c10;
  --good-text: #4fd14f;
  --good-soft: rgba(12, 163, 12, 0.16);
  --progress: #3987e5;
  --critical-text: #f19a9a;
  --critical-soft: rgba(208, 59, 59, 0.2);
  --warning-text: #f5c35b;
  --warning-soft: rgba(250, 178, 25, 0.15);
  --info-soft: rgba(57, 135, 229, 0.16);
  --mark-neutral: #6c7482;
  --chart-track: #262c37;
  --chart-grid: #2a303b;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181;
  --c6: #1a9a1a; --c7: #9085e9; --c8: #e66767; --c9: #2b9cb8; --c10: #8492a6;
  --seq-1: #16304f; --seq-2: #1c4a80; --seq-3: #2a6bbf; --seq-4: #5598e7; --seq-5: #9ec5f4;
  --seq-ink-strong: #0b1220;
}

/* ------------------------------------------------------------------ Basis */
*, *::before, *::after { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-modal { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; }
code, kbd { font-family: var(--mono); font-size: 12px; }
kbd {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: var(--radius-xs); background: var(--surface); color: var(--text-2); line-height: 1.5;
}
::selection { background: var(--accent-soft-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1000; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius); }
.skip-link:focus { top: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.spacer { flex: 1 1 auto; }
.pad { padding: 12px 16px; }
.text-critical { color: var(--critical-text); font-weight: 600; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.strike-soft { text-decoration: line-through; color: var(--text-3); }
.desktop-only { }
.mobile-only { display: none !important; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

#app.boot { display: grid; place-items: center; }
.boot-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 80ms;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-ghost.danger { color: var(--critical-text); }
.btn-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); box-shadow: none; }
.btn-danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--critical) 85%, #000); }
.btn-danger-ghost { color: var(--critical-text); border-color: color-mix(in srgb, var(--critical) 40%, transparent); background: transparent; box-shadow: none; }
.btn-danger-ghost:hover { background: var(--critical-soft); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; min-height: 42px; }
.btn-file { position: relative; }
.btn .count, .tab .count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700;
}
.btn-timer-running { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 40%, transparent); color: var(--critical-text); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:disabled { opacity: 0.4; }
.icon-btn-sm { width: 28px; height: 28px; border-radius: var(--radius-sm); }
.icon-btn-xs { width: 22px; height: 22px; border-radius: var(--radius-xs); }
.star { color: var(--text-3); }
.star.is-fav { color: #e0a100; }
.star.is-fav svg { fill: currentColor; }
.star.static { display: inline-flex; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.link-btn, .link-inline { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 600; text-align: left; }
.link-btn:hover, .link-inline:hover { text-decoration: underline; }
.link-inline { font-weight: 600; color: var(--text); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ Formulare */
.input {
  width: 100%; min-height: 38px; padding: 7px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: var(--text-3); opacity: 0.85; }
.input:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--border-strong)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.input:disabled { background: var(--surface-2); color: var(--text-2); cursor: default; }
.input-sm { min-height: 32px; padding: 4px 9px; font-size: 13px; border-radius: var(--radius-sm); }
.input-bare { border-color: transparent; background: transparent; box-shadow: none; padding-left: 6px; }
.input-bare:hover { border-color: transparent; background: var(--hover); }
.input-bare:focus { background: var(--surface); border-color: var(--accent); }
.input-critical { border-color: color-mix(in srgb, var(--critical) 55%, var(--border-strong)); }
select.input { padding-right: 30px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select.input-sm { padding-right: 26px; background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%; }
textarea.input { resize: vertical; line-height: 1.5; }
input[type="date"].input { min-width: 0; }
.input-icon { position: relative; display: inline-flex; align-items: center; }
.input-icon > svg { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 32px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; padding: 0; }
.field-help { font-size: 12px; color: var(--text-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.field-inline .input { width: 96px; }
.req { color: var(--critical-text); }
.form-error { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--critical-soft); color: var(--critical-text); font-weight: 600; font-size: 13px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.inline-field .input { width: auto; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; font-size: 13px; }
.check-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { accent-color: var(--accent); }
.radio span { display: inline-flex; align-items: center; gap: 6px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--border-strong); transition: background var(--dur) var(--ease); flex: none; }
.switch-ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: 0.5; }
.switch-sm { font-size: 12px; }
.switch span { display: inline-flex; align-items: center; gap: 4px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-pick { position: relative; cursor: pointer; }
.swatch-pick input[type="radio"] { position: absolute; opacity: 0; }
.swatch-pick span { display: block; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); transition: transform var(--dur) var(--ease); }
.swatch-pick input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch-pick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 4px; }
.swatch-pick:hover span { transform: scale(1.08); }
.swatch-custom input[type="color"] { width: 32px; height: 32px; padding: 0; border: 1px dashed var(--border-strong); border-radius: 50%; background: none; cursor: pointer; }
.swatch-custom input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.swatch-custom input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.member-pick { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.member-pick:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.member-pick input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ------------------------------------------------------------------ App-Rahmen */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100%; }
.shell.is-collapsed { --sidebar-w: 68px; }
.sidebar {
  background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column;
  min-height: 0; border-right: 1px solid var(--sidebar-border); position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 12px 14px 16px; min-height: var(--topbar-h); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; flex: 1; }
.brand-text strong { color: #fff; font-size: 15px; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { color: var(--sidebar-muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.logo-mark { flex: none; border-radius: 8px; }
.sidebar .icon-btn { color: var(--sidebar-muted); }
.sidebar .icon-btn:hover { background: var(--sidebar-hover); color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; }
.nav-item, .nav-project {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 10px; border-radius: var(--radius);
  color: var(--sidebar-text); font-weight: 550; text-decoration: none; position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item:hover, .nav-project:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active, .nav-project.active { background: var(--sidebar-active); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item svg { flex: none; color: var(--sidebar-muted); }
.nav-item.active svg, .nav-item:hover svg { color: #fff; }
.nav-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-badge.danger { background: var(--critical); }
.nav-projects { flex: 1; overflow-y: auto; padding: 8px 10px 12px; min-height: 0; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-project { min-height: 36px; padding: 6px 10px; font-weight: 500; font-size: 13.5px; gap: 10px; }
.nav-empty { padding: 4px 10px; color: var(--sidebar-muted); font-size: 13px; }
.sidebar-foot { padding: 8px 10px 14px; border-top: 1px solid var(--sidebar-border); }
.shell.is-collapsed .brand-text, .shell.is-collapsed .nav-text, .shell.is-collapsed .nav-heading, .shell.is-collapsed .nav-empty, .shell.is-collapsed .nav-badge { display: none; }
.shell.is-collapsed .brand { flex-direction: column; padding: 14px 8px; gap: 8px; }
.shell.is-collapsed .nav-item, .shell.is-collapsed .nav-project { justify-content: center; padding: 8px; }
.shell.is-collapsed .nav-projects { padding-top: 12px; }
.nav-backdrop { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 20;
}
.search { position: relative; display: flex; align-items: center; flex: 0 1 460px; min-width: 0; }
.search > svg { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search-input { width: 100%; height: 38px; padding: 6px 70px 6px 36px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.search-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.search kbd { position: absolute; right: 10px; pointer-events: none; font-size: 11px; }
.search-input:not(:placeholder-shown) ~ kbd, .search-input:focus ~ kbd { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bell-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.avatar-btn { border: 0; padding: 2px; border-radius: 50%; background: none; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px var(--accent-soft-2); }
.timer-chip { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 20px; background: var(--critical-soft); color: var(--critical-text); font-weight: 600; font-size: 13px; }
.timer-chip .icon-btn { color: inherit; }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--critical); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.timer-task { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: inherit; font-weight: 600; padding: 2px 0; }
.timer-elapsed { font-variant-numeric: tabular-nums; }
.timer-title { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 500; }

.content { flex: 1; overflow: auto; min-height: 0; outline: none; }
.page { padding: 28px 32px 48px; max-width: 1560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.page-sub { color: var(--text-2); margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-inner { margin-bottom: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.panel-plain { background: none; border: 0; box-shadow: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-plain .panel-head { padding: 0 0 12px; }
.panel > .legend { padding: 0 16px; }

/* ------------------------------------------------------------------ Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.stat-label svg { color: var(--text-3); }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 650; line-height: 1.2; margin-top: 6px; letter-spacing: -0.02em; }
.stat-sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.stat.tone-critical { border-color: color-mix(in srgb, var(--critical) 35%, var(--border)); background: linear-gradient(var(--critical-soft), var(--surface) 70%); }
.stat.tone-critical .stat-label svg { color: var(--critical); }
.stat.tone-warning .stat-label svg { color: var(--warning-text); }
.delta { font-weight: 700; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--critical-text); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px 12px; }
.mini-stats .stat { padding: 10px 12px; box-shadow: none; background: var(--surface-2); }
.mini-stats .stat-value { font-size: 20px; }

/* ------------------------------------------------------------------ Dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.task-list { display: flex; flex-direction: column; padding: 0 6px 6px; }
.task-list.compact { padding: 0; }
.task-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.task-row + .task-row { border-top: 1px solid var(--border); }
.task-row:hover { background: var(--hover); }
.task-row:hover + .task-row { border-top-color: transparent; }
.task-row-main { flex: 1; min-width: 0; }
.task-row-title { font-weight: 550; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row.is-done .task-row-title { color: var(--text-3); text-decoration: line-through; }
.task-row-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.row-project { display: inline-flex; align-items: center; gap: 6px; }
.task-row-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.deadline-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.deadline { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; background: none; border-radius: var(--radius); text-align: left; }
.deadline:hover { background: var(--hover); }
.deadline-date { display: flex; flex-direction: column; width: 72px; flex: none; font-size: 13px; line-height: 1.3; }
.deadline-date span { color: var(--text-3); font-size: 12px; }
.deadline.is-late .deadline-date { color: var(--critical-text); }
.deadline-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.deadline-body { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.deadline-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-body .muted { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.activity-list { list-style: none; margin: 0; padding: 0 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.activity-list.compact { padding: 8px 0 0; gap: 10px; }
.activity { display: flex; gap: 10px; font-size: 13px; align-items: flex-start; }
.activity p { color: var(--text-2); }
.activity p strong { color: var(--text); }
.activity .muted { font-size: 12px; }

/* ------------------------------------------------------------------ Kleine Bausteine */
.avatar {
  --size: 28px; width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; background: var(--av, var(--a10)); color: #fff;
  font-size: calc(var(--size) * 0.4); font-weight: 650; letter-spacing: 0.02em; user-select: none; line-height: 1;
}
.avatar.is-inactive { filter: grayscale(1); opacity: 0.6; }
.avatar-more { background: var(--surface-3); color: var(--text-2); font-size: 11px; }
.avatar-empty { background: var(--surface-3); color: var(--text-3); }
.avatar-system { background: var(--surface-3); color: var(--text-3); }
.avatar-stack { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -6px; }
.avatar-stack .avatar:last-child { margin-left: 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-3); white-space: nowrap; line-height: 1.6; }
.chip-overdue { background: var(--critical-soft); color: var(--critical-text); }
.chip-today { background: var(--warning-soft); color: var(--warning-text); }
.chip-muted { background: transparent; color: var(--text-3); padding-left: 0; }
.meta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.meta-good { color: var(--good-text); }
.meta-timer { color: var(--critical-text); }
.label { --lc: var(--c1); display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--lc) 16%, var(--surface)); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.label::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--lc); flex: none; }
.label-sm { font-size: 11.5px; padding: 1px 7px 1px 6px; }
.label-empty { padding: 2px; width: 32px; }
.swatch { --lc: var(--c1); width: 12px; height: 12px; border-radius: 3px; background: var(--lc); flex: none; display: inline-block; }
.pdot { --s: 10px; width: var(--s); height: var(--s); border-radius: 3px; background: var(--pc, var(--c1)); flex: none; display: inline-block; }
.project-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 20px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2); line-height: 1.6; }
.pill-ok, .pill-done { background: var(--good-soft); color: var(--good-text); }
.pill-risk { background: var(--warning-soft); color: var(--warning-text); }
.pill-late { background: var(--critical-soft); color: var(--critical-text); }
.pill-planned, .pill-active { background: var(--info-soft); color: var(--accent-text); }
.pill-paused, .pill-archived { background: var(--surface-3); color: var(--text-2); }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.tag-admin { background: var(--accent-soft-2); color: var(--accent-text); }
.tag-viewer { background: var(--warning-soft); color: var(--warning-text); }
.tag-warn { background: var(--critical-soft); color: var(--critical-text); }
.status-badge, .prio-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.prio { display: inline-grid; place-items: center; flex: none; }
.prio-urgent { color: var(--critical); }
.prio-important { color: #d9630f; }
.prio-low { color: var(--c1); }
.prio-medium { color: var(--text-3); }
.milestone-icon { color: var(--c7); display: inline-flex; flex: none; }
.milestone-icon svg { fill: currentColor; }
.progress { height: 6px; min-height: 6px; border-radius: 3px; background: var(--chart-track); overflow: hidden; flex: 1 1 auto; min-width: 40px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 300ms var(--ease); }
.progress.tone-critical > span { background: var(--critical); }
.progress.tone-warning > span { background: var(--warning); }
.hours-meter { display: flex; flex-direction: column; gap: 4px; min-width: 120px; font-size: 12px; }

/* Status-Knopf (Kreis → Häkchen) */
.status-btn { display: inline-grid; place-items: center; flex: none; border: 0; background: none; padding: 2px; border-radius: 50%; color: var(--text-3); }
.status-btn:hover { color: var(--good); }
.status-btn .st-hover-check { opacity: 0; transition: opacity var(--dur) var(--ease); }
.status-btn:hover .st-hover-check { opacity: 1; }
.status-btn:hover .st-progress path:not(.st-hover-check) { opacity: 0; }
.status-btn .st-done { animation: pop 260ms var(--ease); }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.status-btn-lg { padding: 4px; }

/* ------------------------------------------------------------------ Projekte */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.project-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  border-top: 3px solid var(--pc);
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.project-card-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.project-card-link:focus-visible { outline-offset: -2px; }
.project-card .star, .project-card .avatar { position: relative; z-index: 2; }
.project-card-head { display: flex; gap: 12px; align-items: flex-start; }
.project-swatch { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--pc) 15%, var(--surface)); color: var(--pc); }
.project-swatch.lg { width: 48px; height: 48px; border-radius: 12px; }
.project-card-titles { flex: 1; min-width: 0; }
.project-card-titles h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card-titles p { color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card-progress { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.project-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.project-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px 0; box-shadow: var(--shadow-sm); }
.project-head-top { display: flex; align-items: flex-start; gap: 14px; }
.project-head-titles { flex: 1; min-width: 0; }
.title-row { display: flex; align-items: center; gap: 4px; }
.title-row h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; color: var(--text-2); font-size: 13px; }
.project-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.project-meta svg { color: var(--text-3); }
.project-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.project-desc { margin-top: 12px; color: var(--text-2); max-width: 900px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-progress { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.project-progress .progress { max-width: 360px; }
.tabs { display: flex; gap: 2px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; background: none;
  color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs-pills { margin: 0; gap: 4px; padding: 3px; background: var(--surface-3); border-radius: var(--radius); }
.tabs-pills .tab { padding: 5px 12px; border: 0; border-radius: var(--radius-sm); font-size: 13px; }
.tabs-pills .tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs-pills .tab .count { background: var(--surface-3); color: var(--text-2); }
.tabs-pills .tab.active .count { background: var(--accent); color: var(--on-accent); }
.project-body { min-width: 0; }
.page-project { max-width: none; padding-bottom: 24px; }
.page-project.view-board, .page-project.view-zeitplan { height: 100%; }
.page-project.view-board .project-body, .page-project.view-zeitplan .project-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Segment-Schalter */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--radius); flex: none; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 11px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: 13px; min-height: 30px; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented-block { display: flex; width: 100%; }
.segmented-block button { flex: 1; justify-content: center; }
.filterbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filterbar .input-icon .input { width: 220px; }

/* ------------------------------------------------------------------ Board */
.board { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 12px; align-items: stretch; flex: 1; min-height: 420px; }
.col {
  flex: 0 0 300px; width: 300px; display: flex; flex-direction: column; min-height: 0; max-height: 100%;
  background: var(--surface-3); border-radius: var(--radius-lg); border: 1px solid transparent; transition: border-color var(--dur), background var(--dur);
}
.col.drop-target { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.col.dragging { opacity: 0.45; }
.col.drop-left { box-shadow: -8px 0 0 -5px var(--accent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 12px; min-height: 46px; }
.col-head[draggable="true"] { cursor: grab; }
.col-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.col-title > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-title[data-action] { cursor: text; border-radius: var(--radius-xs); }
.col-title-input { flex: 1; }
.col-count { font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--surface); border-radius: 10px; padding: 0 8px; line-height: 20px; }
.col-add { display: flex; align-items: center; gap: 8px; margin: 0 8px 6px; padding: 8px 10px; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text-2); font-weight: 600; box-shadow: var(--shadow-sm); text-align: left; }
.col-add:hover { color: var(--accent-text); background: var(--accent-soft); }
.col-add-form { margin: 0 8px 8px; padding: 8px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 8px; }
.col-add-row { display: flex; gap: 6px; align-items: center; }
.col-add-row input[type="date"] { flex: 1; }
.col-body { position: relative; flex: 1; overflow-y: auto; padding: 2px 8px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col-empty { padding: 18px 10px; text-align: center; color: var(--text-3); font-size: 13px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); }
.col-done-toggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: 13px; padding: 6px 4px; border-radius: var(--radius-sm); }
.col-done-toggle:hover { background: var(--hover); }
.col-new, .col-new-btn { flex: 0 0 280px; align-self: flex-start; }
.col-new { padding: 10px; gap: 8px; }
.col-new-btn { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--text-2); font-weight: 600; border-radius: var(--radius-lg); }
.col-new-btn:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.drop-indicator { position: absolute; left: 8px; right: 8px; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; z-index: 2; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: 0.4; }
.card.is-overdue { border-left: 3px solid var(--critical); padding-left: 10px; }
.card.is-done { background: var(--surface-2); }
.card.is-done .card-title { color: var(--text-3); text-decoration: line-through; }
.card-project { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.card-title-row { display: flex; align-items: flex-start; gap: 6px; }
.card-title-row .status-btn { margin: -1px 0 0 -4px; }
.card-title { font-weight: 550; line-height: 1.4; word-break: break-word; display: flex; gap: 5px; }
.card-title .milestone-icon { margin-top: 3px; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }
.card-checklist { list-style: none; margin: 0; padding: 0 0 0 26px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.card-checklist li { display: flex; align-items: flex-start; gap: 8px; }
.card-checklist .is-done { text-decoration: line-through; color: var(--text-3); }
.mini-check, .checkbox-btn, .checkbox {
  width: 16px; height: 16px; flex: none; border-radius: 4px; border: 1.5px solid var(--border-strong); background: var(--surface);
  display: inline-grid; place-items: center; color: #fff; padding: 0; margin-top: 2px;
}
.mini-check.checked, .checkbox-btn.checked, .checkbox.checked { background: var(--good); border-color: var(--good); }
.mini-check:hover, .checkbox-btn:hover { border-color: var(--good); }
.checkbox { margin-top: 0; }
.checkbox.checked { background: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------------ Listen & Tabellen */
.list-view { display: flex; flex-direction: column; gap: 12px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.quick-add { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 300px; max-width: 900px; padding: 4px 6px 4px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text-3); }
.quick-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.quick-add .input-bare { flex: 1; min-width: 120px; }
.quick-add select { width: auto; max-width: 180px; }
.quick-add input[type="date"] { width: 150px; }
.bulkbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); position: sticky; top: 0; z-index: 3; }
.bulkbar select { width: auto; }
.bulk-sep { width: 1px; height: 20px; background: color-mix(in srgb, var(--accent) 30%, transparent); margin: 0 4px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel .table-wrap { border: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: none; border-top: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th.num { text-align: right; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-action] { cursor: pointer; }
.table tbody tr:hover { background: var(--hover); }
.table tr.is-selected { background: var(--accent-soft); }
.table tr.is-done .cell-title span:not(.meta) { color: var(--text-3); text-decoration: line-through; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; color: inherit; font-weight: inherit; font-size: inherit; text-transform: inherit; }
.th-sort svg { opacity: 0.45; }
.th-sort.active, .th-sort:hover { color: var(--text); }
.th-sort.active svg { opacity: 1; }
.col-check { width: 36px; }
.col-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.col-status { width: 36px; padding-right: 0 !important; }
.col-title { min-width: 240px; }
.cell-title { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.cell-labels { display: flex; gap: 4px; flex-wrap: wrap; max-width: 260px; }
.cell-user { display: inline-flex; align-items: center; gap: 8px; }
.cell-progress { display: flex; align-items: center; gap: 8px; min-width: 140px; font-size: 12.5px; color: var(--text-2); }

.grouped-list { display: flex; flex-direction: column; gap: 14px; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; border-radius: var(--radius-lg); }
.group-head:hover { background: var(--hover); }
.group-head h2 { font-size: 15px; }
.group-head .count { font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--surface-3); padding: 0 8px; border-radius: 10px; }
.group-critical .group-head h2 { color: var(--critical-text); }
.simple-list { list-style: none; margin: 0; padding: 0 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.simple-list li { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ Zeitplan / Gantt */
.gantt { --label-w: 300px; position: relative; overflow: auto; flex: 1; min-height: 300px; max-height: calc(100vh - 290px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.roadmap .gantt { max-height: calc(100vh - 300px); }
.g-head { position: sticky; top: 0; z-index: 6; display: flex; width: max-content; min-width: 100%; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.g-corner { position: sticky; left: 0; z-index: 7; width: var(--label-w); flex: none; padding: 10px 14px; font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--surface-2); border-right: 1px solid var(--border); display: flex; align-items: flex-end; }
.g-scale { position: relative; height: 52px; flex: none; }
.g-months { position: relative; height: 26px; border-bottom: 1px solid var(--border); }
.g-month { position: absolute; top: 0; height: 26px; padding: 4px 8px; font-size: 12px; font-weight: 700; color: var(--text-2); border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.g-days { position: relative; height: 26px; }
.g-day { position: absolute; top: 0; height: 26px; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.g-day span { color: var(--text-3); opacity: 0.8; }
.g-day.is-weekend { color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.g-day.is-today { color: var(--on-accent); }
.g-day.is-today::before { content: ""; position: absolute; inset: 3px 50% 3px auto; width: 22px; transform: translateX(50%); border-radius: 6px; background: var(--accent); z-index: -1; }
.g-week { justify-content: flex-start; padding-left: 6px; border-left: 1px solid var(--border); }
.g-body { position: relative; width: max-content; min-width: 100%; }
.g-bg { position: absolute; top: 0; bottom: 0; left: var(--label-w); pointer-events: none; z-index: 0; }
.g-weekend { position: absolute; top: 0; bottom: 0; background: var(--surface-2); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 3; }
.g-today span { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700; color: var(--accent-text); background: var(--surface); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.g-marker { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--text-3); z-index: 2; opacity: 0.6; }
.g-marker span { position: absolute; bottom: 6px; left: 4px; font-size: 10.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; background: var(--surface); padding: 0 4px; border-radius: 4px; }
.g-row { position: relative; display: flex; width: max-content; min-width: 100%; min-height: 40px; border-bottom: 1px solid var(--border); z-index: 1; }
.g-row:hover { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.g-label { position: sticky; left: 0; z-index: 4; width: var(--label-w); flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 12px; background: var(--surface); border-right: 1px solid var(--border); min-width: 0; font-size: 13px; }
.g-group .g-label { font-weight: 700; color: var(--text-2); background: var(--surface-2); gap: 8px; }
.g-group { min-height: 34px; background: var(--surface-2); }
.g-task { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 0; text-align: left; color: var(--text); font-weight: 550; text-decoration: none; }
.g-task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-task .is-done { text-decoration: line-through; color: var(--text-3); }
.g-task:hover span { text-decoration: underline; }
.g-sub { display: inline-flex; align-items: center; gap: 6px; padding-left: 18px; color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.g-sub svg { color: var(--c7); fill: var(--c7); flex: none; }
.g-track { position: relative; flex: none; }
.g-track[data-action] { cursor: copy; }
.g-bar {
  --bar: var(--accent); position: absolute; top: 9px; height: 22px; border-radius: 6px;
  background: color-mix(in srgb, var(--bar) 24%, var(--surface)); border: 1.5px solid var(--bar);
  cursor: grab; touch-action: none; overflow: hidden; transition: box-shadow var(--dur) var(--ease);
}
.g-bar.status-progress { background: color-mix(in srgb, var(--bar) 55%, var(--surface)); }
.g-bar.status-done { --bar: var(--good); background: color-mix(in srgb, var(--good) 30%, var(--surface)); }
.g-bar.is-overdue { --bar: var(--critical); }
.g-bar:hover, .g-bar:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bar) 25%, transparent); }
.g-bar.is-dragging { cursor: grabbing; box-shadow: var(--shadow-md); z-index: 5; }
.g-bar[data-action] { cursor: pointer; }
.g-progress { position: absolute; inset: 0 auto 0 0; background: var(--bar); opacity: 0.85; }
.g-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.g-handle-l { left: 0; }
.g-handle-r { right: 0; }
.g-bar:hover .g-handle::after { content: ""; position: absolute; top: 5px; bottom: 5px; left: 3px; width: 2px; border-radius: 1px; background: var(--bar); }
.g-bar-label { position: absolute; top: 10px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; pointer-events: none; font-weight: 550; }
.g-milestone { position: absolute; top: 12px; width: 16px; height: 16px; transform: rotate(45deg); background: var(--c7); border-radius: 3px; cursor: grab; box-shadow: 0 0 0 2px var(--surface); touch-action: none; }
.g-milestone.status-done { background: var(--good); }
.g-milestone.is-overdue { background: var(--critical); }
.g-milestone[data-action] { cursor: pointer; }
.g-nodate { position: absolute; left: 12px; top: 10px; font-size: 12px; color: var(--text-3); font-style: italic; pointer-events: none; white-space: nowrap; }
.g-empty { padding: 24px; color: var(--text-3); }
.drag-tip { position: fixed; z-index: 2000; padding: 4px 9px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 700; pointer-events: none; box-shadow: var(--shadow-md); }

/* ------------------------------------------------------------------ Kalender */
.cal-wrap { display: flex; flex-direction: column; gap: 12px; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 18px; min-width: 170px; text-align: center; }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-head, .cal-week { display: grid; grid-template-columns: 36px repeat(7, minmax(0, 1fr)); }
.cal-head { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-head span { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.cal-kw { display: flex; justify-content: center; padding-top: 10px; font-size: 11px; color: var(--text-3); background: var(--surface-2); border-right: 1px solid var(--border); }
.cal-week + .cal-week { border-top: 1px solid var(--border); }
.cal-day { min-height: 124px; padding: 6px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background var(--dur); }
.cal-day:nth-child(2) { border-left: 0; }
.cal-day.is-weekend { background: var(--surface-2); }
.cal-day.is-outside .cal-num { color: color-mix(in srgb, var(--text-3) 55%, transparent); }
.cal-day.drop-day { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; }
.cal-num { font-size: 12.5px; font-weight: 650; color: var(--text-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.is-today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-add { opacity: 0; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 5px; width: 100%; padding: 3px 6px; border: 0; border-left: 3px solid var(--pc); border-radius: 5px; background: var(--surface-3); font-size: 12px; text-align: left; color: var(--text); cursor: pointer; min-width: 0; }
.cal-chip:hover { background: var(--active); }
.cal-chip.status-done .cal-chip-title { text-decoration: line-through; color: var(--text-3); }
.cal-chip.is-overdue { background: var(--critical-soft); }
.cal-chip-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.cal-more { border: 0; background: none; color: var(--accent-text); font-size: 12px; font-weight: 600; text-align: left; padding: 2px 6px; }
.day-pop h3 { padding: 8px 10px; }

/* ------------------------------------------------------------------ Diagramme */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-grid .span-2 { grid-column: span 2; }
.chart-card { padding-bottom: 14px; }
.chart-card > .legend { margin-bottom: 8px; }
.chart-empty { padding: 20px 16px; color: var(--text-3); }
.donut-wrap { display: flex; align-items: center; gap: 28px; padding: 6px 20px 8px; flex-wrap: wrap; }
.donut { position: relative; flex: none; }
.donut svg { display: block; }
.donut-arc { cursor: pointer; transition: opacity var(--dur); }
.donut-arc:hover, .donut-arc:focus-visible { opacity: 0.8; outline: none; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { font-size: 24px; font-family: var(--font-display); }
.donut-center span { font-size: 12px; color: var(--text-3); }
.donut-wrap .legend { flex-direction: column; gap: 8px; min-width: 180px; padding: 0; }
.legend { list-style: none; margin: 0; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend strong { margin-left: auto; padding-left: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.key { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.key-line { width: 16px; height: 3px; border-radius: 2px; flex: none; }
.hbars { display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 4px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 64px; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); }
.hbar-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: flex; gap: 2px; height: 16px; align-items: stretch; border-left: 1px solid var(--chart-grid); }
.hbar-seg { display: block; min-width: 3px; height: 100%; cursor: pointer; transition: filter var(--dur); }
.hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-seg:hover, .hbar-seg:focus-visible { filter: brightness(1.12); outline: none; }
.hbar-value { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.colchart, .linechart { position: relative; height: var(--h); margin: 10px 16px 30px 52px; }
.chart-lines { position: absolute; inset: 0; pointer-events: none; }
.gridline { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--chart-grid); }
.gridline.baseline { border-top-color: var(--border-strong); }
.gridline span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.colchart-plot { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.col-group { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 2px; cursor: pointer; border-radius: 4px; }
.col-group:hover, .col-group:focus-visible { background: var(--hover); outline: none; }
.col-bar { display: block; width: 100%; max-width: 20px; border-radius: 4px 4px 0 0; min-height: 0; }
.colchart-x { position: absolute; left: 0; right: 0; top: calc(100% + 6px); display: flex; gap: 2px; }
.colchart-x span { flex: 1; text-align: center; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: visible; }
.linechart-plot { position: absolute; inset: 0; }
.linechart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.line-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.line-hit { position: absolute; top: 0; bottom: 0; z-index: 2; }
.line-hit i { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--text-3); opacity: 0; }
.line-hit:hover i { opacity: 0.5; }
.linechart-x { position: absolute; left: 0; right: 0; top: calc(100% + 6px); height: 16px; }
.linechart-x span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ------------------------------------------------------------------ Team */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; }
.person-head { display: flex; align-items: center; gap: 12px; }
.person-titles { flex: 1; min-width: 0; }
.person-titles h3 { font-size: 15px; }
.person-titles p { color: var(--text-3); font-size: 13px; }
.person-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.person-tags .email { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.person-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--border); }
.person-stats div { display: flex; flex-direction: column; gap: 1px; }
.person-stats dt { font-size: 11.5px; color: var(--text-3); }
.person-stats dd { margin: 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.heat-table td.heat { text-align: center; font-variant-numeric: tabular-nums; }
.heat strong { display: block; font-size: 14px; }
.heat span { display: block; font-size: 11px; opacity: 0.85; }
.heat-0 { color: var(--text-3); }
.heat-1 { background: var(--seq-1); }
.heat-2 { background: var(--seq-2); }
.heat-3 { background: var(--seq-3); }
.heat-4 { background: var(--seq-4); color: var(--seq-ink-strong); }
.heat-5 { background: var(--seq-5); color: var(--seq-ink-strong); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 10px 16px 14px; font-size: 12px; color: var(--text-3); }
.heat-legend i { width: 22px; height: 10px; border-radius: 2px; display: inline-block; }

/* ------------------------------------------------------------------ Einstellungen */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.settings-grid .panel .form { padding: 4px 16px 16px; }
.settings-grid .panel > .shortcuts { padding: 4px 16px 16px; }
.profile-preview { display: flex; align-items: center; gap: 12px; }
.profile-preview div { display: flex; flex-direction: column; }
.callout { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--critical) 25%, var(--border)); background: var(--critical-soft); }
.callout > div { flex: 1; }
.callout p { font-size: 13px; }
.shortcuts { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.shortcuts div { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 13px; }
.shortcuts dd { margin: 0; color: var(--text-2); text-align: right; }

/* ------------------------------------------------------------------ Dialoge */
.modal-layer:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto; animation: fade 160ms var(--ease);
}
.modal {
  position: relative; width: 100%; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: 90vh; animation: rise 200ms var(--ease); outline: none;
}
.modal-sm { max-width: 460px; }
.modal-md { max-width: 620px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1120px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 22px; border-bottom: 1px solid var(--border); flex: none; }
.modal-title { flex: 1; min-width: 0; font-size: 17px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 0; }
.crumbs a { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs svg { color: var(--text-3); flex: none; }
.crumbs > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-head-actions { display: flex; align-items: center; gap: 6px; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-xl) var(--radius-xl); flex: none; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 300; background: var(--scrim); display: grid; place-items: center; padding: 16px; animation: fade 140ms var(--ease); }
.dialog { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 22px; animation: rise 180ms var(--ease); }
.dialog-title { font-size: 18px; margin-bottom: 8px; }
.dialog-text { color: var(--text-2); }
.dialog-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Aufgaben-Detail */
.td { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
.td-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.td-title-row { display: flex; align-items: flex-start; gap: 6px; }
.td-title { flex: 1; border: 1px solid transparent; background: transparent; font-family: var(--font-display); font-size: 21px; font-weight: 650; line-height: 1.3; padding: 4px 8px; border-radius: var(--radius); resize: none; field-sizing: content; min-height: 40px; overflow: hidden; }
.td-title:hover { background: var(--hover); }
.td-title:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.td-people { display: flex; flex-direction: column; gap: 10px; padding-left: 40px; }
.td-inline { display: flex; align-items: flex-start; gap: 12px; }
.td-inline-label { width: 128px; flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; font-weight: 600; padding-top: 5px; }
.td-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 30px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; border-radius: 20px; background: var(--surface-3); font-size: 13px; font-weight: 550; }
.chip-x { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 0; background: none; color: var(--text-3); }
.chip-x:hover { background: var(--active); color: var(--text); }
.td-section { display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius); }
.td-section h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.td-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.td-notes { min-height: 96px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 6px; padding: 1px 2px; border-radius: var(--radius-sm); }
.checklist li:hover { background: var(--hover); }
.checklist li .checkbox-btn { margin: 0 4px; }
.checklist li.is-done .input { text-decoration: line-through; color: var(--text-3); }
.checklist .icon-btn { opacity: 0; }
.checklist li:hover .icon-btn, .checklist .icon-btn:focus-visible { opacity: 1; }
.checklist-add { display: flex; align-items: center; gap: 6px; padding-left: 8px; color: var(--text-3); }
.checklist-add .input { flex: 1; }
.attachments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.attachments li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.att-icon { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); border: 1px solid var(--border); flex: none; }
.att-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; flex: none; border: 1px solid var(--border); }
.att-name { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.att-meta { font-size: 12px; margin-left: auto; white-space: nowrap; }
.link-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.link-form .input { flex: 1 1 180px; }
[data-filedrop].is-dropping { outline: 2px dashed var(--accent); outline-offset: 6px; background: var(--accent-soft); }
.drop-hint { padding: 10px; border: 1.5px dashed var(--border); border-radius: var(--radius); text-align: center; }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-head .icon-btn { margin-left: auto; opacity: 0; }
.comment:hover .comment-head .icon-btn, .comment-head .icon-btn:focus-visible { opacity: 1; }
.comment-text { margin-top: 3px; padding: 8px 12px; border-radius: 0 var(--radius) var(--radius) var(--radius); background: var(--surface-3); word-break: break-word; }
.mention { color: var(--accent-text); font-weight: 650; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; }
.comment-input { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.td-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.td-fields { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.td-time { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.td-time h3 { display: flex; align-items: center; gap: 6px; }
.time-summary { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.time-summary strong { font-size: 20px; font-family: var(--font-display); }
.time-form { display: grid; grid-template-columns: 70px 1fr; gap: 6px; }
.time-form .time-note { grid-column: 1 / -1; }
.time-form button { grid-column: 1 / -1; }
.time-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.time-list li { display: flex; align-items: center; gap: 8px; }
.time-list .muted { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-amount { font-weight: 650; font-variant-numeric: tabular-nums; }
.td-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.td-meta p { display: flex; align-items: center; gap: 6px; }
.td-activity summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 650; list-style: none; padding: 6px 0; }
.td-activity summary::-webkit-details-marker { display: none; }
.td-activity .activity p { font-size: 12.5px; }

/* Vorlagen & Bezeichnungs-Editor */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.template { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); text-align: left; transition: border-color var(--dur), background var(--dur); }
.template:hover { border-color: var(--border-strong); background: var(--surface-2); }
.template.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.template-head { display: flex; align-items: center; gap: 8px; }
.template-desc { font-size: 12.5px; color: var(--text-2); }
.template-meta { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.label-editor { display: flex; flex-direction: column; gap: 6px; }
.label-row { display: grid; grid-template-columns: 130px 1fr 32px; gap: 6px; align-items: center; }
.label-color { border-left: 6px solid var(--lc); }

/* ------------------------------------------------------------------ Popover & Menüs */
.popover {
  position: fixed; z-index: 400; min-width: 200px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: rise 140ms var(--ease);
}
.popover-scroll { max-height: min(520px, 75vh); overflow-y: auto; }
.menu { display: flex; flex-direction: column; padding: 6px; gap: 1px; }
.menu > .input { margin: 2px 2px 6px; width: auto; }
.menu-scroll { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; color: var(--text); font-size: 13.5px; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item:disabled { opacity: 0.4; }
.menu-item svg { color: var(--text-3); flex: none; }
.menu-item.danger { color: var(--critical-text); }
.menu-item.danger svg { color: currentColor; }
.menu-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-hint { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-caption { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px 4px; }
.menu-user { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.menu-user div { display: flex; flex-direction: column; min-width: 0; }
.menu-user span { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.menu .segmented { margin: 2px 4px 4px; }
.filter-pop { display: flex; flex-direction: column; padding: 6px; }
.filter-section { padding: 4px 0 6px; border-bottom: 1px solid var(--border); }
.filter-section h3 { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px 4px; }
.filter-foot { padding: 6px 4px 2px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: min(520px, 70vh); overflow-y: auto; padding: 6px; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--radius); background: none; text-align: left; position: relative; }
.notif-item:hover { background: var(--hover); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item.unread:hover { background: var(--accent-soft-2); }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 13px; }
.notif-meta { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.search-results { padding: 6px; max-height: min(480px, 70vh); overflow-y: auto; }
.search-group { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; }
.search-item:hover, .search-item.selected { background: var(--hover); }
.search-item.selected { box-shadow: inset 2px 0 0 var(--accent); }
.search-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .muted { margin-left: auto; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.search-empty { padding: 16px; color: var(--text-3); }

/* ------------------------------------------------------------------ Toasts & Tooltips */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100vw - 32px)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; width: 100%;
  background: #1c2230; color: #f2f4f7; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); font-size: 13.5px;
  opacity: 0; transform: translateY(10px); transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast-icon { display: grid; place-items: center; color: #9db8f5; flex: none; }
.toast-success .toast-icon { color: #4fd14f; }
.toast-error .toast-icon { color: #f19a9a; }
.toast-msg { flex: 1; min-width: 0; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 700; padding: 5px 10px; border-radius: var(--radius-sm); }
.toast-action:hover { background: rgba(255, 255, 255, 0.18); }
.toast-close { border: 0; background: none; color: #b8c0cc; width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.toast-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
#tooltip { position: fixed; z-index: 600; pointer-events: none; min-width: 120px; max-width: 280px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: 12.5px; }
.tip-title { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; font-weight: 600; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.tip-row span { color: var(--text-2); }
.tip-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }

/* ------------------------------------------------------------------ Login & Einrichtung */
.auth { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft-2), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand strong { font-size: 18px; font-family: var(--font-display); }
.auth-brand span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.auth-card h1 { font-size: 24px; }
.auth-hint { font-size: 12.5px; color: var(--text-3); text-align: center; }
.auth-foot { color: var(--text-3); font-size: 13px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 40px; }
.pw-wrap .icon-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------------ Leere Zustände */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--text-2); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
.empty h3 { font-size: 16px; color: var(--text); }
.empty p { max-width: 420px; color: var(--text-3); }
.empty .btn { margin-top: 8px; }

/* ------------------------------------------------------------------ Responsiv */
@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .td { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-grid .span-2 { grid-column: auto; }
}
@media (max-width: 900px) {
  .shell, .shell.is-collapsed { grid-template-columns: 1fr; --sidebar-w: 280px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform 220ms var(--ease); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.is-collapsed .brand-text, .shell.is-collapsed .nav-text, .shell.is-collapsed .nav-heading, .shell.is-collapsed .nav-empty, .shell.is-collapsed .nav-badge { display: revert; }
  .shell.is-collapsed .brand { flex-direction: row; }
  .shell.is-collapsed .nav-item, .shell.is-collapsed .nav-project { justify-content: flex-start; }
  .sidebar-toggle { display: none; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 25; background: var(--scrim); }
  .shell.nav-open .nav-backdrop { display: block; }
  .mobile-only { display: inline-grid !important; }
  .desktop-only { display: none !important; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search-input { padding-right: 12px; }
  .page { padding: 18px 16px 40px; }
  .td { grid-template-columns: 1fr; }
  .td-people { padding-left: 0; }
  .project-head { padding: 14px 14px 0; }
  .project-head-top { flex-wrap: wrap; }
  .project-head-actions { width: 100%; justify-content: flex-end; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { max-height: none; min-height: 100%; border-radius: 0; max-width: none !important; }
  .modal-foot { border-radius: 0; }
  .gantt { --label-w: 180px; max-height: calc(100vh - 260px); }
  .cal-day { min-height: 92px; }
}
@media (max-width: 640px) {
  .input, .search-input { font-size: 16px; } /* verhindert automatisches Zoomen in iOS Safari */
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 24px; }
  .col { flex-basis: 85vw; width: 85vw; }
  .task-row-meta .chip, .task-row-meta .meta { display: none; }
  .task-row-meta .chip-overdue, .task-row-meta .chip-today { display: inline-flex; }
  .td-inline { flex-direction: column; gap: 4px; }
  .td-inline-label { width: auto; padding-top: 0; }
  .cal-head, .cal-week { grid-template-columns: 0 repeat(7, minmax(0, 1fr)); }
  .cal-kw { visibility: hidden; border: 0; }
  .cal-chip-title { display: none; }
  .cal-chip { justify-content: center; padding: 3px; }
  .filterbar .input-icon .input { width: 160px; }
  .settings-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr; }
  .hbar-row { grid-template-columns: 90px minmax(0, 1fr) 54px; }
  .label-row { grid-template-columns: 100px 1fr 32px; }
  .person-stats { grid-template-columns: repeat(2, 1fr); }
  .quick-add { min-width: 0; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .sidebar, .topbar, .toolbar, .tabs, .project-head-actions { display: none !important; }
  .shell { display: block; height: auto; }
  .content { overflow: visible; }
  body { background: #fff; }
}

/* ------------------------------------------------------------------ Webversion */
.hint-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.picked > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.people-hits { display: flex; flex-direction: column; gap: 1px; max-height: 220px; overflow-y: auto; margin-top: 6px; }
.people-hits .menu-item:disabled { opacity: 0.55; }

/* ------------------------------------------------------------------ Supabase-Version */
.form-info { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--good-soft); color: var(--good-text); font-weight: 600; font-size: 13px; }
.callout-info { padding: 10px 12px; border-radius: var(--radius); background: var(--info-soft); color: var(--text-2); font-size: 13px; }
.panel-attention { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft); }
.panel-attention .simple-list li { flex-wrap: wrap; }
.auth-hint .link-btn { font-size: inherit; }
.auth-body { display: flex; flex-direction: column; gap: 14px; }
