/* Farbpalette konsistent mit dem Struktur- und Dashboard-Mockup (validiert gegen
   scripts/validate_palette.js aus der dataviz-Referenz). */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --blue: #2a78d6;
  --orange: #eb6834;
  --aqua: #1baf7a;
  --violet: #4a3aa7;
  --good: #0ca30c;
  --good-bg: #e3f6e3;
  --warning: #fab219;
  --warning-bg: #fdf1d8;
  --serious: #ec835a;
  --serious-bg: #fce3d8;
  --critical: #d03b3b;
  --critical-bg: #fbe1e1;
  --neutral-bg: #eceae4;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --blue: #3987e5;
  --orange: #d95926;
  --aqua: #199e70;
  --violet: #9085e9;
  --good: #0ca30c;
  --good-bg: #123312;
  --warning: #fab219;
  --warning-bg: #3a2c0c;
  --serious: #ec835a;
  --serious-bg: #3a2118;
  --critical: #e66767;
  --critical-bg: #3a1414;
  --neutral-bg: #2a2a28;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.topbar .brand { font-weight: 700; font-size: 15px; }
.topbar .brand a { color: var(--text-primary); }
.topbar .user { color: var(--text-secondary); font-size: 12.5px; display:flex; gap:12px; align-items:center; }

.tabs { display: flex; gap: 2px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-secondary); font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text-primary); border-bottom-color: var(--blue); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text-primary); }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 24px 0 10px; }
p.lead { color: var(--text-secondary); margin: 0 0 20px; font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; }
tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.st-Freigegeben { background: var(--good-bg); color: var(--good); }
.badge.st-Eingereicht { background: var(--warning-bg); color: #9a6c00; }
:root[data-theme="dark"] .badge.st-Eingereicht { color: var(--warning); }
.badge.st-Ausstehend { background: var(--neutral-bg); color: var(--muted); }
.badge.st-Abgelehnt { background: var(--critical-bg); color: var(--critical); }

form.inline { display: inline; }
label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
input, select, textarea {
  font: inherit; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-primary); width: 100%;
}
input[type=checkbox] { width: auto; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 160px; }

button, .btn {
  font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--blue); color: white; cursor: pointer; font-weight: 600; font-size: 13px;
}
button.secondary, .btn.secondary { background: var(--surface-2); color: var(--text-primary); }
button.danger { background: var(--critical); }
button:hover { opacity: .92; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.flash.ok { background: var(--good-bg); color: var(--good); }
.flash.err { background: var(--critical-bg); color: var(--critical); }

.gantt-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.gantt-grid { display: grid; min-width: 1100px; }
.gantt-row { display: grid; grid-template-columns: 230px 1fr; border-bottom: 1px solid var(--grid); }
.gantt-row.header { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.gantt-label { padding: 6px 10px; font-size: 12px; border-right: 1px solid var(--grid); display:flex; align-items:center; gap:6px; }
.gantt-track { position: relative; height: 30px; }
.gantt-bar { position: absolute; top: 6px; height: 18px; border-radius: 4px; }
.gantt-bar.plan { background: var(--baseline); opacity: .55; }
.gantt-bar.ist-Freigegeben { background: var(--good); }
.gantt-bar.ist-Eingereicht { background: var(--warning); }
.gantt-bar.ist-Ausstehend { background: var(--muted); }
.gantt-bar.ist-Abgelehnt { background: var(--critical); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--critical); }
.gantt-milestone { position: absolute; top: 3px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); background: var(--violet); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; margin-bottom: 20px; }
.kpi-tile .label { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; margin-bottom: 6px; }
.kpi-tile .value { font-size: 24px; font-weight: 700; }

.pill-nav { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.pill-nav a, .pill-nav button { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; }
.pill-nav a.active, .pill-nav button.active { background: var(--blue); color: white; border-color: var(--blue); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
footer.foot { padding: 24px 20px; color: var(--muted); font-size: 12px; text-align: center; }
details.helptext { margin: 6px 0 16px; font-size: 12.5px; color: var(--text-secondary); }
details.helptext summary { cursor: pointer; color: var(--blue); }

.login-wrap { max-width: 360px; margin: 12vh auto; }
.login-wrap .card { padding: 28px; }
