/* Rahmen MVP 2 – Seitenleiste nach der Skizze, Inhalt = eingebundene Module. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e2e5ea;
  --text: #1a1d23;
  --muted: #6b7280;
  --primary: #2453d4;
  --ok: #1e8e4e;
  --warn: #b7791f;
  --danger: #c0392b;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
/* Hell/Dunkel (Anmerkungen 29.11.2026): Vorgabe folgt dem System; data-theme="light"/"dark" am <html> erzwingt eine Darstellung */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318;
    --surface: #1a1d24;
    --surface-2: #232731;
    --border: #2e333d;
    --text: #e7e9ee;
    --muted: #9aa1ad;
    --primary: #5b82f0;
    --ok: #4cc47f;
    --warn: #e0b04a;
    --danger: #ef6b5b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111318;
  --surface: #1a1d24;
  --surface-2: #232731;
  --border: #2e333d;
  --text: #e7e9ee;
  --muted: #9aa1ad;
  --primary: #5b82f0;
  --ok: #4cc47f;
  --warn: #e0b04a;
  --danger: #ef6b5b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a { color: var(--primary); }

.sidebar {
  width: 240px; flex: none; display: flex; flex-direction: column; gap: 12px; padding: 16px 12px;
  background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 0 8px 8px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px;
  background: var(--primary); color: #fff; font-size: 13px;
}
.group { margin-top: 10px; }
.group-title {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted);
}
.nav-item { display: block; padding: 6px 8px 6px 26px; border-radius: 6px; color: var(--text); text-decoration: none; }
.nav-item:first-child { padding-left: 8px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--surface-2); font-weight: 600; }
.nav-item.dim { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--border); }
.dot.done { background: var(--ok); }
.dot.planned { background: var(--warn); }
.foot { margin-top: auto; padding: 0 8px; font-size: 12px; color: var(--muted); }

.content { flex: 1; min-width: 0; height: 100vh; overflow: auto; }
iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.placeholder { max-width: 1100px; margin: 0 auto; padding: 24px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card ul { margin: 8px 0 0; padding-left: 18px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.done { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.planned { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

@media (max-width: 720px) {
  body { flex-direction: column; }
  .sidebar { width: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .content { height: auto; flex: 1; }
  iframe { height: 80vh; }
}
.count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 600; text-align: center; }
.shell { display: flex; height: 100vh; }
.userbox { padding: 8px; margin: 0 0 4px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.userbox:empty { display: none; }
.logout { margin-top: 6px; border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 12px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.login-card input { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; min-height: 32px; }
.login-card .btn { font: inherit; padding: 8px 14px; border-radius: 6px; border: 0; background: var(--primary); color: #fff; cursor: pointer; }
.login-card .hint { font-size: 12px; color: var(--muted); margin: 0; }
.login-card .error { color: #c0392b; margin: 0; }
@media (max-width: 720px) { .shell { flex-direction: column; height: auto; } }
.setup-card { width: min(640px, 100%); }
.setup-card fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.setup-card legend { font-weight: 600; padding: 0 6px; }
.setup-card .row { display: flex; gap: 10px; flex-wrap: wrap; }
.setup-card .row label { flex: 1; min-width: 120px; }
.setup-card textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.setup-card .errors { margin: 0; padding: 8px 12px 8px 28px; border-radius: 6px; color: #c0392b; background: color-mix(in srgb, #c0392b 10%, transparent); }
.setup-card .link { border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; }
.login-card select { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; min-height: 32px; }
.login-card .link { border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; }
/* Leiste oben rechts: Bearbeitung sperren und Vollbild (Stil: Umriss, abgerundet, Symbol + Text) */
.content { display: flex; flex-direction: column; }
.content iframe { flex: 1; height: auto; min-height: 0; }
.pagebar { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.pill:hover { background: var(--surface-2); color: var(--text); }
.pill.active { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
/* Seitenleiste ein-/ausklappen (auch im Vollbild sichtbar, Zustand je Browser) */
body.sidebar-collapsed .sidebar { display: none; }
.pagebar-gap { flex: 1; }

/* Aufgabenterminal */
.nav-item.top { padding-left: 8px; }
.tasks-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tasks-total { font-size: 13px; color: var(--muted); white-space: nowrap; margin-top: 6px; }
.tasks-total .mono { font-size: 22px; font-weight: 600; color: var(--text); }
.tasks-group { margin-bottom: 14px; }
.tasks-group .card-head { display: flex; align-items: center; gap: 8px; }
.tasks-group .card-head .count { margin-left: 0; }
ul.tasks { list-style: none; margin: 0; padding: 0; }
ul.tasks li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
ul.tasks li:first-child { border-top: 0; }
ul.tasks .muted { font-size: 12px; margin-top: 2px; }
.tasks-empty { padding: 8px 0; margin: 0; }
.tasks-group h2 { margin: 0; font-size: 15px; }
ul.tasks .btn { display: inline-block; padding: 4px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; background: var(--surface); }
ul.tasks .btn:hover { background: var(--surface-2); }

/* Prognose-Frist überschritten (Änderungsauftrag Punkt 14b) */
.tasks li.overdue strong, .tasks .overdue-text { color: var(--danger, #c0392b); }

/* Übersicht = Startseite (Änderungsauftrag Punkt 23) */
.ov-head h1 { margin-bottom: 2px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.ov-card h2 { font-size: 16px; margin: 0; }
.ov-wide { grid-column: 1 / -1; }
.ov-tasks { list-style: none; margin: 10px 0 0; padding: 0; }
.ov-tasks li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ov-tasks li:last-child { border-bottom: 0; }
.ov-tasks li.overdue strong, .overdue-text { color: var(--danger); }
.ov-area { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.ov-foot { margin: 10px 0 0; }
.ov-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.ov-kpi { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.ov-kpi-label { font-size: 12px; color: var(--muted); }
.ov-kpi-value { font-family: var(--mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ov-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.ov-quick-group { display: flex; flex-direction: column; gap: 4px; }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; vertical-align: middle; background: var(--border); }
.light.green { background: var(--ok); }
.light.yellow { background: var(--warn); }
.light.red { background: var(--danger); }
.ov-tasks .btn { display: inline-block; padding: 4px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; background: var(--surface); }
.ov-tasks .btn:hover { background: var(--surface-2); }

/* Firmenmenü oben links (wie Workspaces in Linear, Anmerkungen 29.11.2026) */
.ws { position: relative; }
.ws-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none;
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.ws-btn:hover, .ws-btn[aria-expanded="true"] { background: var(--surface-2); }
.ws-mark { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--primary);
  color: #fff; font-size: 12px; font-weight: 700; }
.ws-mark.plus { background: var(--surface-2); color: var(--muted); }
.ws-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-menu .ws-name { overflow: visible; }
.ws-caret { color: var(--muted); font-size: 11px; }
.ws-menu { position: fixed; z-index: 50; min-width: 300px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); }
.ws-head { padding: 4px 8px 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ws-item { display: flex; white-space: nowrap; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none;
  color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ws-item:hover, .ws-item:focus-visible { background: var(--surface-2); outline: none; }
.ws-item.active { font-weight: 600; }
.ws-check { color: var(--primary); }
.ws-hint { font-size: 11px; color: var(--muted); }
.ws-sep { height: 1px; margin: 6px 2px; background: var(--border); }
