/* ==========================================================================
   GR02 Projektportal – Fluent / SharePoint-Stil
   Keine externen Ressourcen (Systemschriften, eigene Icons) – DSGVO-konform.
   ========================================================================== */

:root {
  --brand: #0078d4;
  --brand-dark: #005a9e;
  --brand-darker: #004578;
  --brand-light: #deecf9;
  --brand-lighter: #eff6fc;

  --text: #323130;
  --text-2: #605e5c;
  --text-3: #8a8886;
  --border: #edebe9;
  --border-strong: #c8c6c4;
  --input-border: #8a8886;
  --bg: #faf9f8;
  --surface: #ffffff;
  --surface-2: #f3f2f1;
  --surface-3: #edebe9;
  --nav-bg: #ffffff;
  --suitebar: #0078d4;
  --suitebar-text: #ffffff;
  --suitebar-hover: rgba(255, 255, 255, .14);

  --success: #107c10;
  --success-bg: #dff6dd;
  --warning: #8a6100;
  --warning-bg: #fff4ce;
  --warning-solid: #ffb900;
  --danger: #a4262c;
  --danger-bg: #fde7e9;
  --danger-solid: #d13438;
  --info-bg: #deecf9;

  --depth-4: 0 1.6px 3.6px rgba(0, 0, 0, .132), 0 .3px .9px rgba(0, 0, 0, .108);
  --depth-8: 0 3.2px 7.2px rgba(0, 0, 0, .132), 0 .6px 1.8px rgba(0, 0, 0, .108);
  --depth-16: 0 6.4px 14.4px rgba(0, 0, 0, .132), 0 1.2px 3.6px rgba(0, 0, 0, .108);
  --depth-64: 0 25.6px 57.6px rgba(0, 0, 0, .22), 0 4.8px 14.4px rgba(0, 0, 0, .18);

  --radius: 2px;
  --radius-lg: 4px;
  --font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, "DejaVu Sans Mono", monospace;
  --nav-w: 232px;
  --bar-h: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2899f5;
    --brand-dark: #6cb8f6;
    --brand-darker: #82c7ff;
    --brand-light: #0f3a5e;
    --brand-lighter: #0c2a44;
    --text: #f3f2f1;
    --text-2: #c8c6c4;
    --text-3: #a19f9d;
    --border: #3b3a39;
    --border-strong: #605e5c;
    --input-border: #8a8886;
    --bg: #1b1a19;
    --surface: #252423;
    --surface-2: #2d2c2b;
    --surface-3: #3b3a39;
    --nav-bg: #201f1e;
    --suitebar: #1f1f1f;
    --suitebar-text: #ffffff;
    --success: #92c353;
    --success-bg: #1d3b1a;
    --warning: #fce100;
    --warning-bg: #3d3409;
    --danger: #f1707b;
    --danger-bg: #442726;
    --info-bg: #0f3a5e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 600; margin: 0 0 8px; color: var(--text); }
h1 { font-size: 24px; line-height: 32px; }
h2 { font-size: 18px; line-height: 24px; }
h3 { font-size: 15px; line-height: 20px; }
p { margin: 0 0 10px; }
code, pre, kbd { font-family: var(--mono); font-size: 12.5px; }
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 10px;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.muted { color: var(--text-2); }
.small { font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.skip-link { position: absolute; left: -999px; top: 4px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.icon { flex: none; vertical-align: middle; }

/* ---------- Suite bar (Kopfleiste) ---------- */
.suitebar {
  position: sticky; top: 0; z-index: 40;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 4px;
  background: var(--suitebar); color: var(--suitebar-text);
  padding: 0 8px 0 0;
}
.suitebar-btn {
  height: var(--bar-h); min-width: var(--bar-h);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: inherit; cursor: pointer; padding: 0 8px;
}
.suitebar-btn:hover { background: var(--suitebar-hover); }
.suitebar-brand { display: flex; align-items: center; gap: 10px; color: inherit; padding: 0 12px 0 14px; height: 100%; }
.suitebar-brand:hover { color: inherit; text-decoration: none; background: var(--suitebar-hover); }
.brand-mark {
  width: 24px; height: 24px; display: grid; place-items: center;
  background: #fff; color: var(--suitebar); font-weight: 700; font-size: 14px; border-radius: 2px;
}
.brand-text { font-size: 16px; font-weight: 400; white-space: nowrap; }
.brand-text strong { font-weight: 600; }
.suitebar-site {
  font-size: 14px; opacity: .9; padding-left: 12px; margin-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, .35); white-space: nowrap;
}
.suitebar-search {
  margin: 0 auto; display: flex; align-items: center; gap: 8px;
  width: min(460px, 40vw); height: 32px; padding: 0 10px;
  background: rgba(255, 255, 255, .92); color: #605e5c; border-radius: var(--radius-lg);
}
.suitebar-search input[type=search] { flex: 1; border: 0; background: transparent; font: inherit; color: #323130; outline: none; min-width: 0; height: 30px; padding: 0; box-shadow: none; }
.suitebar-search input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.suitebar-user { position: relative; margin-left: auto; }
.suitebar-search + .suitebar-user { margin-left: 0; }

.dropdown {
  position: absolute; right: 0; top: calc(var(--bar-h) - 2px); width: 260px;
  background: var(--surface); color: var(--text); box-shadow: var(--depth-16);
  border-radius: var(--radius-lg); padding: 6px 0; z-index: 60;
}
.dropdown-head { display: flex; gap: 12px; align-items: center; padding: 10px 16px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 16px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown form { margin: 0; }

/* ---------- Shell / Navigation ---------- */
.shell { display: flex; min-height: calc(100vh - var(--bar-h) - 41px); }
.sidenav {
  width: var(--nav-w); flex: none;
  background: var(--nav-bg); border-right: 1px solid var(--border);
  padding: 8px 0 16px; position: sticky; top: var(--bar-h);
  height: calc(100vh - var(--bar-h)); overflow-y: auto;
}
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a {
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 16px 0 18px; color: var(--text);
  border-left: 3px solid transparent;
}
.sidenav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.sidenav a.active { background: var(--surface-3); border-left-color: var(--brand); font-weight: 600; }
.sidenav a .icon { color: var(--brand); }
.nav-group {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding: 14px 20px 4px; text-transform: none; letter-spacing: .1px;
}
.nav-foot { padding: 16px 20px 0; font-size: 12px; color: var(--text-3); }
.nav-foot a { display: inline; padding: 0; height: auto; border: 0; color: var(--text-2); }
.nav-backdrop { display: none; }

.content { flex: 1; min-width: 0; padding: 20px 32px 40px; max-width: 1480px; }
.content-wide { max-width: none; }
.content:focus { outline: none; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-header h1 { margin: 0; }
.page-subtitle { color: var(--text-2); margin: 4px 0 0; }

.command-bar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 16px; min-width: 80px;
  font: 600 14px/1 var(--font);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--input-border); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn:active { background: var(--surface-3); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-primary:active { background: var(--brand-darker); }
.btn-danger { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-subtle, .command-bar .btn {
  background: transparent; border-color: transparent; font-weight: 400; min-width: 0; padding: 0 10px;
}
.command-bar .btn .icon { color: var(--brand); }
.command-bar .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; padding: 0 14px; }
.command-bar .btn-primary .icon { color: #fff; }
.btn-subtle:hover, .command-bar .btn:not(.btn-primary):hover { background: var(--surface-2); }
.btn-icon { min-width: 32px; width: 32px; padding: 0; background: transparent; border-color: transparent; }
.btn-icon:hover { background: var(--surface-2); }
.btn-danger-text { color: var(--danger); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 13px; min-width: 0; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* ---------- Karten / Raster ---------- */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--depth-4); padding: 16px 20px; margin-bottom: 16px; min-width: 0;
}
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-header h2, .card-header h3 { margin: 0; }
.card-header a { font-size: 13px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-header { padding: 14px 20px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- KPI-Kacheln ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); box-shadow: var(--depth-4); border-radius: var(--radius-lg);
  padding: 16px; color: var(--text); border-top: 3px solid var(--brand); min-width: 0;
}
a.kpi:hover { box-shadow: var(--depth-8); text-decoration: none; color: var(--text); }
.kpi-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-lighter); color: var(--brand); flex: none; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.kpi-value { font-size: 26px; line-height: 34px; font-weight: 600; }
.kpi-hint { font-size: 12px; color: var(--text-2); }
.kpi-success { border-top-color: var(--success); } .kpi-success .kpi-icon { background: var(--success-bg); color: var(--success); }
.kpi-warning { border-top-color: var(--warning-solid); } .kpi-warning .kpi-icon { background: var(--warning-bg); color: var(--warning); }
.kpi-danger { border-top-color: var(--danger-solid); } .kpi-danger .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi-neutral { border-top-color: var(--border-strong); } .kpi-neutral .kpi-icon { background: var(--surface-2); color: var(--text-2); }

/* ---------- Tabellen (SharePoint-Liste) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.row-done td { color: var(--text-2); }
.table tr.row-group td { background: var(--surface-2); font-weight: 600; }
.table .actions { white-space: nowrap; text-align: right; width: 1%; }
.table-compact td, .table-compact th { padding: 6px 10px; }
.card-flush .table th:first-child, .card-flush .table td:first-child { padding-left: 20px; }
.card-flush .table th:last-child, .card-flush .table td:last-child { padding-right: 20px; }
.cell-title { font-weight: 600; color: var(--text); }
a.cell-title:hover { color: var(--brand); }
.overdue { color: var(--danger); font-weight: 600; }

/* ---------- Formulare ---------- */
.form { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label, .label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12px; color: var(--text-2); }
.req::after { content: " *"; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=url], input[type=search], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--input-border); border-radius: var(--radius);
  height: 32px; padding: 0 8px; width: 100%; min-width: 0;
}
textarea { height: auto; min-height: 90px; padding: 6px 8px; resize: vertical; line-height: 20px; }
textarea.code { font-family: var(--mono); font-size: 12.5px; }
input:hover, select:hover, textarea:hover { border-color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-size: 16px; font-weight: 600; margin-bottom: 10px; padding: 0; }
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--surface); box-shadow: var(--depth-4); border-radius: var(--radius-lg);
  padding: 8px 12px; margin-bottom: 16px;
}
.toolbar select, .toolbar input { width: auto; min-width: 140px; }
.toolbar .spacer { flex: 1; }

/* ---------- Badges / Persona / Progress ---------- */
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text);
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-info { background: var(--info-bg); color: var(--brand-dark); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.tag { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 2px; background: var(--surface-2); color: var(--text-2); font-family: var(--mono); }
.role-chip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 2px; font-weight: 700; font-size: 12px; }
.role-D { background: var(--brand); color: #fff; }
.role-M { background: var(--brand-light); color: var(--brand-dark); }
.role-I { background: var(--surface-2); color: var(--text-2); }

.persona { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.persona-coin {
  --hue: 210;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: hsl(var(--hue), 55%, 42%); color: #fff; font-size: 10px; font-weight: 600; flex: none;
}
.persona-md .persona-coin { width: 32px; height: 32px; font-size: 12px; }
.persona-lg .persona-coin { width: 48px; height: 48px; font-size: 17px; }
.persona-name { white-space: nowrap; }

.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 3px; }
.progress-success .progress-fill { background: var(--success); }
.progress-warning .progress-fill { background: var(--warning-solid); }
.progress-danger .progress-fill { background: var(--danger-solid); }
.progress-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 48px; gap: 12px; align-items: center; padding: 6px 0; }
.progress-row .val { text-align: right; font-size: 12px; color: var(--text-2); }

/* ---------- Message bar ---------- */
.message-bar {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px; margin-bottom: 12px; border-radius: var(--radius);
  background: var(--info-bg); color: var(--text); font-size: 14px;
}
.message-bar > span { flex: 1; }
.message-success { background: var(--success-bg); } .message-success .icon:first-child { color: var(--success); }
.message-error { background: var(--danger-bg); } .message-error .icon:first-child { color: var(--danger); }
.message-warning { background: var(--warning-bg); } .message-warning .icon:first-child { color: var(--warning); }
.message-info .icon:first-child { color: var(--brand); }
.message-close { background: none; border: 0; cursor: pointer; color: var(--text-2); padding: 2px; }

/* ---------- Pivot ---------- */
.pivot { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.pivot a {
  padding: 10px 12px; color: var(--text); white-space: nowrap; position: relative;
}
.pivot a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.pivot a.active { font-weight: 600; }
.pivot a.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--brand); }

/* ---------- Listen / Feeds ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { font-size: 12px; color: var(--text-2); }
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--text-2); font-weight: 600; }
.dl dd { margin: 0; min-width: 0; }

.empty-state { text-align: center; padding: 32px 16px; color: var(--text-2); }
.empty-state .icon { color: var(--text-3); margin-bottom: 8px; }

/* ---------- Kanban-Board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board-col { background: var(--surface-2); border-radius: var(--radius-lg); padding: 10px; min-height: 160px; }
.board-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; padding: 2px 4px 10px; }
.board-col-head .count { font-weight: 400; color: var(--text-2); font-size: 12px; }
.board-col.drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; }
.board-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.board-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--depth-4);
  padding: 10px 12px; cursor: grab; border-left: 3px solid transparent;
}
.board-card:hover { box-shadow: var(--depth-8); }
.board-card.dragging { opacity: .5; }
.board-card .title { font-weight: 600; margin-bottom: 6px; display: block; color: var(--text); }
.board-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.prio-kritisch { border-left-color: var(--danger-solid); }
.prio-hoch { border-left-color: var(--warning-solid); }
.prio-mittel { border-left-color: var(--brand); }
.prio-niedrig { border-left-color: var(--border-strong); }

/* ---------- Gantt / Zeitplan ---------- */
.gantt { --day-w: 22px; overflow-x: auto; background: var(--surface); box-shadow: var(--depth-4); border-radius: var(--radius-lg); }
.gantt-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.gantt-table th, .gantt-table td { border-bottom: 1px solid var(--border); padding: 0; height: 28px; }
.gantt-table .g-label {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  min-width: 300px; max-width: 300px; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--border);
}
.gantt-table tr.g-phase .g-label { font-weight: 600; }
.gantt-table .g-day { width: var(--day-w); min-width: var(--day-w); text-align: center; color: var(--text-2); font-weight: 400; }
.gantt-table .g-weekend { background: var(--surface-2); }
.gantt-table .g-today { box-shadow: inset 2px 0 0 var(--danger-solid); }
.gantt-table .g-month { text-align: left; padding-left: 6px; font-weight: 600; border-left: 1px solid var(--border); }
.g-bar { height: 14px; margin: 0 -1px; background: var(--brand); }
.g-bar.g-start { border-radius: 2px 0 0 2px; margin-left: 2px; }
.g-bar.g-end { border-radius: 0 2px 2px 0; margin-right: 2px; }
.g-bar.st-erledigt { background: var(--success); }
.g-bar.st-in_arbeit { background: var(--brand); }
.g-bar.st-offen { background: #8bb8e8; }
.g-bar.st-overdue { background: var(--danger-solid); }
.g-bar.g-phasebar { background: var(--text-2); height: 8px; }
.g-ms { color: var(--warning-solid); font-size: 16px; line-height: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin: 10px 0; }
.legend i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }

/* ---------- Risikomatrix ---------- */
.heatmap { display: grid; grid-template-columns: 28px repeat(5, 1fr); gap: 3px; max-width: 420px; font-size: 12px; }
.heatmap .hm-cell { aspect-ratio: 1.6; display: grid; place-items: center; border-radius: 2px; font-weight: 600; color: #fff; }
.heatmap .hm-axis { display: grid; place-items: center; color: var(--text-2); }
.hm-1 { background: #8cbd18; } .hm-2 { background: #c9cf2d; color: #323130 !important; } .hm-3 { background: #ffb900; color: #323130 !important; }
.hm-4 { background: #f7630c; } .hm-5 { background: #d13438; }

/* ---------- Kalender-Streifen (Tagesprotokolle) ---------- */
.day-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; }
.day-strip a, .day-strip span {
  display: grid; place-items: center; height: 36px; border-radius: 2px; font-size: 12px;
  background: var(--surface-2); color: var(--text-2);
}
.day-strip .d-full { background: var(--success); color: #fff; }
.day-strip .d-part { background: var(--warning-solid); color: #323130; }
.day-strip .d-missing { background: var(--danger-bg); color: var(--danger); }
.day-strip .d-today { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ---------- Ampel ---------- */
.ampel { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.ampel-gruen { background: #13a10e; } .ampel-gelb { background: #ffb900; } .ampel-rot { background: #d13438; }

/* ---------- Balkendiagramm (CSS) ---------- */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 14px; background: var(--surface-2); border-radius: 2px; overflow: hidden; display: flex; }
.bar-seg { height: 100%; background: var(--brand); }
.bar-seg.alt { background: #8764b8; }
.bar-row .val { text-align: right; color: var(--text-2); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); box-shadow: var(--depth-64); border-radius: var(--radius-lg); padding: 24px; width: min(480px, 100%); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Footer ---------- */
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 24px; font-size: 12px; color: var(--text-2);
  border-top: 1px solid var(--border); background: var(--surface);
}
.app-footer a { color: var(--text-2); }

/* ---------- Öffentliche Seiten (Login, Rechtliches) ---------- */
.layout-public .shell { justify-content: center; }
.layout-public .content { max-width: 880px; }
.login-wrap { min-height: calc(100vh - var(--bar-h) - 41px); display: grid; place-items: center; padding: 24px 16px; width: 100%; }
.login-card { width: min(440px, 100%); background: var(--surface); box-shadow: var(--depth-16); padding: 44px 44px 36px; border-radius: var(--radius-lg); }
.login-card h1 { font-size: 24px; margin: 18px 0 4px; }
.login-card .field { margin-bottom: 14px; }
.login-card input { height: 36px; border-width: 0 0 1px; border-radius: 0; padding: 0 2px; }
.login-card input:focus { box-shadow: none; border-bottom: 2px solid var(--brand); }
.login-logo { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 15px; }
.login-logo .brand-mark { background: var(--brand); color: #fff; }
.login-foot { margin-top: 24px; font-size: 12px; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; }
.layout-public .page-header:empty { display: none; }
.legal h2 { margin-top: 24px; }
.legal p, .legal li { max-width: 760px; }

.error-page { background: var(--bg); }
.error-box { max-width: 640px; margin: 80px auto; background: var(--surface); padding: 32px; box-shadow: var(--depth-8); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidenav {
    position: fixed; left: 0; top: var(--bar-h); z-index: 50; transform: translateX(-100%);
    transition: transform .18s ease; box-shadow: var(--depth-16);
  }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--bar-h) 0 0 0; background: rgba(0, 0, 0, .3); z-index: 45; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .suitebar-site { display: none; }
  .suitebar-search { width: auto; flex: 1; margin: 0 8px; }
  .dl { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 60px; }
}
@media (max-width: 560px) {
  .brand-text { display: none; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .login-card { padding: 28px 22px; }
  .table th, .table td { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Druck ---------- */
@media print {
  .suitebar, .sidenav, .command-bar, .app-footer, .toolbar, .pivot, .btn, .message-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .content { padding: 0; max-width: none; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
