/* Projekt-Dashboard — Brandner-Redesign 20.08.2026
   Navy #1e3a5f + Akzent #267BBD · Sora (Zahlen/Titel) + IBM Plex Sans (Text)
   Themes: hell (Default) / dunkel via [data-theme] + prefers-color-scheme */
:root {
  color-scheme: light;
  --page: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --ink: #12263f;
  --ink-2: #51637a;
  --muted: #8595a8;
  --grid: #edf1f6;
  --baseline: #d7dfe9;
  --border: #e3e9f0;
  --band: #1e3a5f;
  --band-ink: #ffffff;
  --band-sub: #b9c9dc;
  --hero: #1e3a5f;
  --hero-ink: #ffffff;
  --hero-sub: #b9c9dc;
  --hero-chip: rgba(255, 255, 255, 0.10);
  --accent: #267BBD;
  --accent-soft: rgba(38, 123, 189, 0.10);
  --live: #2f9e5f;
  --live-bg: rgba(47, 158, 95, 0.12);
  --s1: #267BBD;
  --s2: #d97a3d;
  --s3: #1baf7a;
  --s4: #eda100;
  --good-text: #0f8a5f;
  --critical: #c93b3b;
  --seq-0: rgba(38, 123, 189, 0);
  --seq-100: #d7e6f5;
  --seq-250: #9cc3e8;
  --seq-400: #4a90d0;
  --seq-450: #267BBD;
  --seq-550: #1f6aa3;
  --seq-700: #123f66;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.10);
  --shadow-lg: 0 12px 20px -8px rgba(16, 24, 40, 0.18), 0 4px 8px -4px rgba(16, 24, 40, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b1526;
    --surface: #111e33;
    --surface-2: #182740;
    --ink: #eef4fb;
    --ink-2: #a9b9cd;
    --muted: #6f8199;
    --grid: #1c2b45;
    --baseline: #31435e;
    --border: rgba(255, 255, 255, 0.09);
    --band: #0e1a2e;
    --band-ink: #f2f6fb;
    --band-sub: #8fa3bb;
    --hero: #152845;
    --hero-ink: #f2f6fb;
    --hero-sub: #9db1c9;
    --hero-chip: rgba(255, 255, 255, 0.07);
    --accent: #4da3e8;
    --accent-soft: rgba(77, 163, 232, 0.14);
    --live: #35c26b;
    --live-bg: rgba(53, 194, 107, 0.14);
    --s1: #4da3e8;
    --s2: #e08a4e;
    --s3: #2fbf85;
    --s4: #d9a13a;
    --good-text: #35c26b;
    --critical: #e06767;
    --seq-0: rgba(77, 163, 232, 0);
    --seq-100: #16304d;
    --seq-250: #1f4d7a;
    --seq-400: #3178b8;
    --seq-450: #4da3e8;
    --seq-550: #78bdf2;
    --seq-700: #b7dcfa;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 14px 24px -10px rgba(0, 0, 0, 0.6), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1526;
  --surface: #111e33;
  --surface-2: #182740;
  --ink: #eef4fb;
  --ink-2: #a9b9cd;
  --muted: #6f8199;
  --grid: #1c2b45;
  --baseline: #31435e;
  --border: rgba(255, 255, 255, 0.09);
  --band: #0e1a2e;
  --band-ink: #f2f6fb;
  --band-sub: #8fa3bb;
  --hero: #152845;
  --hero-ink: #f2f6fb;
  --hero-sub: #9db1c9;
  --hero-chip: rgba(255, 255, 255, 0.07);
  --accent: #4da3e8;
  --accent-soft: rgba(77, 163, 232, 0.14);
  --live: #35c26b;
  --live-bg: rgba(53, 194, 107, 0.14);
  --s1: #4da3e8;
  --s2: #e08a4e;
  --s3: #2fbf85;
  --s4: #d9a13a;
  --good-text: #35c26b;
  --critical: #e06767;
  --seq-0: rgba(77, 163, 232, 0);
  --seq-100: #16304d;
  --seq-250: #1f4d7a;
  --seq-400: #3178b8;
  --seq-450: #4da3e8;
  --seq-550: #78bdf2;
  --seq-700: #b7dcfa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 14px 24px -10px rgba(0, 0, 0, 0.6), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, .disp { font-family: 'Sora', 'Segoe UI', system-ui, sans-serif; }
.num { font-variant-numeric: tabular-nums; }

/* ---- Kopfleiste ---- */
.band {
  background: var(--band);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
}
.band .wordmark {
  color: var(--band-ink);
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.22em;
}
.band .divider { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.22); }
.band .appname { color: var(--band-sub); font-size: 13px; font-weight: 500; }
.band .spacer { flex: 1; }
.band .icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--band-sub);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.band .icon-btn:hover { color: var(--band-ink); border-color: rgba(255, 255, 255, 0.4); }
.band .user {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--band-sub); font-size: 12.5px;
}
.band .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-family: 'Sora', sans-serif; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.band .logout {
  background: none; border: none; cursor: pointer; font: inherit;
  color: var(--band-sub); font-size: 12.5px; padding: 0;
}
.band .logout:hover { color: var(--band-ink); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }

.pagehead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { font-family: 'Sora', sans-serif; font-size: 23px; font-weight: 700; margin: 0; }
.pagehead .sub { font-size: 13px; color: var(--muted); }
.pagehead .grow { flex: 1; }
.pagehead .meta { font-size: 12px; color: var(--muted); }

/* ---- Pills / Badges ---- */
.pill-live {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--live-bg); border: 1px solid var(--live); color: var(--live);
  border-radius: 99px; padding: 2px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  vertical-align: 2px;
}
.pill-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.status-done {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--muted);
}

/* ---- Live-Hero (Projektliste) ---- */
.hero {
  display: flex; align-items: center; gap: 26px;
  background: var(--hero);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 22px 26px;
  margin-bottom: 18px;
  color: var(--hero-ink);
}
.hero:hover { text-decoration: none; }
a.hero { color: var(--hero-ink); }
.hero .left { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.hero .toprow { display: flex; align-items: center; gap: 10px; }
.hero .nr { font-family: 'Sora', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--hero-sub); }
.hero h2 { font-family: 'Sora', sans-serif; font-size: 21px; font-weight: 700; margin: 0; color: var(--hero-ink); }
.hero .progress-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.hero .track { width: 220px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.hero .fill { height: 5px; border-radius: 3px; background: var(--accent); }
.hero .plabel { font-size: 12px; color: var(--hero-sub); }
.hero .kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .chip {
  background: var(--hero-chip); border-radius: 12px; padding: 12px 18px;
  display: flex; flex-direction: column; gap: 3px; min-width: 116px;
}
.hero .chip b { font-family: 'Sora', sans-serif; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; color: var(--hero-ink); }
.hero .chip span { font-size: 11.5px; color: var(--hero-sub); }

/* ---- Projekt-Karten ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  color: inherit;
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card .head { display: flex; align-items: center; gap: 10px; }
.card .nrchip {
  font-family: 'Sora', sans-serif; font-variant-numeric: tabular-nums;
  background: var(--surface-2); border-radius: 7px; padding: 3px 9px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.card .dates { font-size: 12px; color: var(--muted); }
.card .head .grow { flex: 1; }
.card h2 { font-family: 'Sora', sans-serif; font-size: 15.5px; font-weight: 600; margin: 0; line-height: 1.3; }
.card hr { border: none; border-top: 1px solid var(--border); margin: 0; }
.card .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.card .kpis b { display: block; font-family: 'Sora', sans-serif; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; }
.card .kpis span { font-size: 10.5px; color: var(--muted); }

/* ---- Breadcrumb + Projektkopf ---- */
.crumbrow { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 14px; }
.crumbrow .back { display: inline-flex; align-items: center; gap: 6px; }
.crumbrow .grow { flex: 1; }
.crumbrow .meta { font-size: 12px; color: var(--muted); }
.projhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.projhead h1 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; margin: 0; }
.projhead .dates { font-size: 13px; color: var(--muted); }

/* ---- KPI-Band ---- */
.kpiband {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap;
  padding: 16px 0;
  margin-bottom: 16px;
}
.kpiband .cell {
  display: flex; flex-direction: column; gap: 3px;
  padding: 2px 22px;
  border-left: 1px solid var(--border);
  min-width: 130px;
}
.kpiband .cell:first-child { border-left: none; }
.kpiband b { font-family: 'Sora', sans-serif; font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 600; }
.kpiband span { font-size: 11.5px; color: var(--ink-2); }

/* ---- Panels ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.panel h3 { font-family: 'Sora', sans-serif; margin: 0; font-size: 15px; font-weight: 600; }
.panel .headrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel .headrow .grow { flex: 1; }
.panel .note { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.chart { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Segmented Controls ---- */
.seg {
  display: inline-flex; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.seg button {
  font: inherit; font-size: 12.5px;
  color: var(--ink-2);
  background: transparent; border: none; border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
}
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }

/* ---- Karten-Panel ---- */
.maprow { display: flex; gap: 26px; align-items: center; justify-content: center; flex-wrap: wrap; }
#map { max-width: 640px; flex: 1 1 480px; }
.map-aside { display: flex; flex-direction: column; gap: 12px; width: 240px; }
.map-aside .expl { font-size: 12.5px; color: var(--ink-2); }
.map-aside .legend { display: flex; align-items: center; gap: 8px; }
.map-aside .legend .bar {
  flex: 1; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2), var(--seq-450));
}
.map-aside .legend span { font-size: 11px; color: var(--muted); }
.map-aside .stats { font-size: 12px; color: var(--muted); }

/* ---- Buttons ---- */
button, .btn {
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 12px; cursor: pointer;
}
button:hover { border-color: var(--baseline); }
button.primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); border-color: var(--accent); color: #fff;
  font-weight: 600; border-radius: 9px; padding: 7px 14px;
}
button.primary:hover { border-color: var(--accent); filter: brightness(1.06); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { color: var(--ink-2); border-color: transparent; }

/* ---- Login ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box {
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: flex; flex-direction: column; gap: 16px;
}
.login-box .brand { display: flex; flex-direction: column; gap: 6px; align-items: center; padding-bottom: 6px; }
.login-box .brand .wordmark {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px;
  letter-spacing: 0.22em; color: var(--ink);
}
.login-box .brand .sub { font-size: 12.5px; color: var(--muted); }
.login-box label { font-size: 12px; font-weight: 500; color: var(--ink-2); display: block; margin-bottom: 6px; }
.login-box input {
  width: 100%; height: 42px; font: inherit; font-size: 13.5px;
  padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink);
}
.login-box input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.login-box button { width: 100%; height: 44px; margin-top: 4px; font-size: 14px; justify-content: center; }
.login-box .foot { font-size: 11.5px; color: var(--muted); text-align: center; }
.login-error { color: var(--critical); font-size: 13px; min-height: 18px; }

/* ---- Tabellen ---- */
.tbl-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--baseline); padding: 6px 10px 6px 0;
}
td { border-bottom: 1px solid var(--grid); padding: 8px 10px 8px 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }

/* ---- Massnahmen-Form ---- */
.mn-form { display: grid; grid-template-columns: repeat(6, 1fr) auto; gap: 8px; align-items: end; margin-top: 14px; }
.mn-form label { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 4px; }
.mn-form input, .mn-form select {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink);
}
@media (max-width: 900px) { .mn-form { grid-template-columns: 1fr 1fr; } }

.hint { color: var(--muted); font-size: 12px; }
.err { color: var(--critical); font-size: 13px; }

@media (max-width: 760px) {
  .hero { flex-direction: column; align-items: stretch; }
  .kpiband .cell { border-left: none; min-width: 45%; }
  .band { padding: 0 14px; }
  .band .appname { display: none; }
}
