:root {
  --ink: #1d2528;
  --muted: #667177;
  --line: #d9dee0;
  --soft: #f3f5f4;
  --surface: #ffffff;
  --sidebar: #202728;
  --sidebar-text: #eef2f0;
  --yellow: #e0bd00;
  --yellow-soft: #fff8cf;
  --teal: #087d78;
  --teal-soft: #e5f4f2;
  --green: #2f7d4a;
  --green-soft: #e8f5ec;
  --red: #b43c35;
  --red-soft: #fcecea;
  --amber: #9a6200;
  --amber-soft: #fff1d1;
  --focus: #176ea6;
  --shadow: 0 5px 18px rgba(25, 32, 34, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--soft); color: var(--ink); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px 14px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 54px; color: white; padding: 3px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand:hover { text-decoration: none; }
.brand img { width: 46px; height: 46px; object-fit: cover; object-position: 50% 34%; border-radius: 50%; background: white; }
.brand span { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: #b9c4c2; font-size: 11px; margin-top: 2px; }
.sidebar nav { margin-top: 18px; display: grid; gap: 4px; }
.sidebar nav a { min-height: 42px; padding: 10px 11px; border-radius: 5px; display: flex; align-items: center; gap: 11px; color: #cdd5d3; font-weight: 600; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: white; text-decoration: none; }
.sidebar nav a.active { color: white; background: #394445; box-shadow: inset 3px 0 0 var(--yellow); }
.system-boundary { margin-top: auto; padding: 14px 8px 4px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.system-boundary strong, .system-boundary small { display: block; }
.system-boundary strong { font-size: 12px; }
.system-boundary small { color: #aeb9b7; font-size: 10px; }
.signal-dot { width: 9px; height: 9px; border-radius: 50%; background: #64b67a; box-shadow: 0 0 0 3px rgba(100,182,122,.18); }

.main-column { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 62px; display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 0 26px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.topbar-context { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-context a { color: var(--ink); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-actions form { margin: 0; }
.page-content { max-width: 1540px; margin: 0 auto; padding: 28px 32px 60px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 28px; line-height: 1.2; }
h2 { margin-bottom: 2px; font-size: 18px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 4px !important; color: var(--teal) !important; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.muted { color: var(--muted); }

.button, .icon-button { border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 5px; font-weight: 700; text-decoration: none; transition: background .15s, border-color .15s; }
.button { min-height: 38px; padding: 8px 14px; }
.button:hover, .icon-button:hover { text-decoration: none; }
.button.primary { background: var(--ink); color: white; }
.button.primary:hover { background: #303b3e; }
.button.secondary { color: var(--ink); background: white; border-color: #bfc7c9; }
.button.secondary:hover { background: var(--soft); }
.button.danger { color: white; background: var(--red); }
.button.compact { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.button.wide { width: 100%; }
.icon-button { width: 38px; height: 38px; padding: 0; color: var(--ink); background: transparent; }
.icon-button:hover { background: var(--soft); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-only { display: none; }

.alert { margin-bottom: 18px; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 4px; display: flex; align-items: center; gap: 9px; background: white; }
.alert.success { border-left-color: var(--green); background: var(--green-soft); }
.alert.warning { border-left-color: var(--amber); background: var(--amber-soft); }
.alert.error { border-left-color: var(--red); background: var(--red-soft); }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.metric { position: relative; min-height: 106px; padding: 15px; background: white; border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: 6px; color: var(--ink); }
.metric:hover { box-shadow: var(--shadow); text-decoration: none; }
.metric span { display: block; color: var(--muted); font-size: 12px; padding-right: 24px; }
.metric strong { display: block; margin-top: 10px; font-size: 26px; }
.metric svg { position: absolute; top: 14px; right: 13px; color: var(--teal); }
.metric.danger { border-top-color: var(--red); }
.metric.danger svg { color: var(--red); }
.metric.amber { border-top-color: var(--amber); }
.metric.amber svg { color: var(--amber); }
.metric.teal { border-top-color: var(--green); }
.metric.teal svg { color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); gap: 18px; align-items: start; }
.heading-actions { display: flex; align-items: flex-end; gap: 10px; }
.dashboard-metrics { grid-template-columns: repeat(4, minmax(150px, 1fr)); margin-bottom: 14px; }
.metric.danger-outline { border-top-color: #d67b73; }
.metric.danger-outline svg { color: var(--red); }
.metric.neutral { border-top-color: #7b878c; }
.metric.neutral svg { color: #667177; }
.process-legend { margin-bottom: 22px; display: grid; grid-template-columns: repeat(9, minmax(95px, 1fr)); overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 5px; }
.process-legend span { min-height: 44px; padding: 8px 7px; display: flex; align-items: center; gap: 6px; border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.process-legend span:last-child { border-right: 0; }
.process-legend b { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: white; background: #657174; font-size: 10px; }
.dashboard-worklist { display: grid; gap: 24px; }
.work-board { scroll-margin-top: 78px; }
.work-board-heading { min-height: 48px; padding: 0 2px 8px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 2px solid #aeb8ba; }
.work-board-heading h2 { font-size: 16px; }
.work-board-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.count-badge { min-width: 27px; height: 27px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: white; background: #657174; font-size: 11px; font-weight: 900; }
#critical .work-board-heading { border-bottom-color: var(--red); }
#critical .count-badge { background: var(--red); }
#waiting .work-board-heading { border-bottom-color: #7b878c; }
#upcoming .work-board-heading { border-bottom-color: var(--amber); }
#on-track .work-board-heading { border-bottom-color: var(--green); }
.dashboard-records { background: white; border: 1px solid var(--line); border-top: 0; }
.dashboard-record { min-height: 92px; padding: 12px 14px 10px 11px; display: grid; grid-template-columns: minmax(180px, .85fr) minmax(210px, 1.05fr) minmax(180px, .8fr) minmax(220px, 1.25fr) 105px; gap: 10px 16px; align-items: center; border-bottom: 1px solid var(--line); border-left: 4px solid #8b9699; }
.dashboard-record:last-child { border-bottom: 0; }
.dashboard-record.attention-red { border-left-color: var(--red); background: #fffafa; }
.dashboard-record.attention-amber { border-left-color: var(--amber); background: #fffdf8; }
.dashboard-record.attention-green { border-left-color: var(--green); }
.dashboard-record.attention-gray { border-left-color: #7b878c; background: #fafbfb; }
.attention-state { min-width: 0; display: flex; align-items: center; gap: 9px; }
.attention-state svg { width: 22px; height: 22px; }
.attention-red .attention-state { color: var(--red); }
.attention-amber .attention-state { color: var(--amber); }
.attention-green .attention-state { color: var(--green); }
.attention-gray .attention-state { color: #667177; }
.attention-state strong, .attention-state small, .dashboard-identity strong, .dashboard-identity small, .phase-state strong, .phase-state small, .next-action span, .next-action strong, .record-deadline strong, .record-deadline small { display: block; }
.attention-state small, .dashboard-identity small, .phase-state small, .next-action span, .record-deadline small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.attention-state small, .dashboard-identity small, .next-action strong { overflow-wrap: anywhere; }
.dashboard-identity .id-link { display: block; margin-bottom: 2px; font-size: 11px; }
.phase-state > span { display: block; }
.stage-track { margin-top: 8px; display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.stage-track i { height: 5px; background: #d8ddde; }
.stage-track i.complete { background: #879496; }
.stage-track i.current { background: var(--teal); }
.next-action span { text-transform: uppercase; font-weight: 800; }
.record-deadline { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.record-deadline svg { width: 17px; }
.record-tags { grid-column: 2 / 6; min-height: 18px; display: flex; flex-wrap: wrap; gap: 5px; }
.record-tags span { padding: 2px 6px; border-radius: 3px; color: #4b565a; background: #e9edef; font-size: 9px; font-weight: 800; }
.board-empty { margin: 0; background: white; }

.data-section { background: white; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.section-heading { min-height: 62px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 9px 12px; background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid #e8ebec; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.overdue-row { background: #fff7f6; }
.overdue-text { color: var(--red) !important; font-weight: 800; }
.id-link { color: var(--teal); font-weight: 800; white-space: nowrap; }
.empty-state { padding: 26px !important; text-align: center; color: var(--muted); }

.task-list { border-top: 1px solid var(--line); }
.task-list.full { border: 1px solid var(--line); border-radius: 5px; }
.task-row { min-height: 58px; padding: 10px 13px; border-bottom: 1px solid #e8ebec; display: grid; grid-template-columns: 18px minmax(0,1fr) auto auto; gap: 10px; align-items: center; color: var(--ink); }
a.task-row:hover { background: var(--soft); text-decoration: none; }
.task-row:last-child { border-bottom: 0; }
.task-row strong, .task-row small { display: block; }
.task-row small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.task-row time { color: var(--muted); font-size: 12px; }
.task-check { width: 15px; height: 15px; border-radius: 3px; border: 2px solid #aeb8ba; }
.task-check.done { background: var(--green); border-color: var(--green); }
.actor { width: 30px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; background: #e8edef; color: #364145; font-size: 11px; font-weight: 800; }
.status-form select { min-height: 31px; max-width: 150px; }

.filter-bar { margin-bottom: 14px; display: grid; grid-template-columns: minmax(250px, 1.6fr) repeat(3, minmax(130px, .7fr)) auto auto; gap: 8px; align-items: center; }
.filter-bar select, .filter-bar input, .inline-filter select { min-height: 38px; }
.search-field { position: relative; }
.search-field svg { position: absolute; top: 10px; left: 10px; color: var(--muted); }
.search-field input { width: 100%; padding-left: 36px; }

label { color: #465156; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; margin-top: 5px; padding: 8px 9px; color: var(--ink); background: white; border: 1px solid #bfc7c9; border-radius: 4px; outline: none; }
input, select { min-height: 37px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(23,110,166,.13); }
.checkbox-line { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; white-space: nowrap; }
.checkbox-line input, .choice-row input, .gate-checks input { width: 16px; height: 16px; min-height: 0; margin: 0; }
.form-layout { display: grid; gap: 18px; }
.form-section { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.form-section h2 { margin-bottom: 15px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.choice-row label { display: inline-flex; align-items: center; gap: 6px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.compact-form { padding: 16px; background: #fafbfa; border-top: 1px solid var(--line); }
.inline-form { display: flex; align-items: flex-end; gap: 10px; padding: 14px; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form .grow { flex: 1 1 230px; }
.classification-questions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.classification-questions label { min-height: 54px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--line); background: #fafbfa; }
.classification-questions label:last-child { border-right: 0; }
.classification-questions input, .conditional-switches input { width: 17px; height: 17px; min-height: 0; margin: 0; flex: 0 0 auto; }
.classification-result { min-width: 190px; padding: 9px 12px; border-left: 3px solid var(--green); background: var(--green-soft); }
.classification-result.project { border-left-color: #5d3d75; background: #f1eaf6; }
.classification-result span, .classification-result strong, .classification-result small { display: block; }
.classification-result span { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.classification-result strong { margin-top: 2px; }
.classification-result small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.special-fa1 { margin-top: 12px; white-space: normal; }
.dependency-panel, .dependency-empty { margin-top: 12px; min-height: 52px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; color: #765510; background: var(--amber-soft); border-left: 3px solid var(--amber); }
.dependency-panel[hidden], .conditional-field[hidden] { display: none; }
.dependency-panel strong, .dependency-panel small { display: block; }
.dependency-panel small { color: var(--muted); font-size: 10px; }
.dependency-empty { margin: 0; min-height: 82px; color: var(--green); background: var(--green-soft); border-left-color: var(--green); }
.dependency-empty div { flex: 1; }
.dependency-empty p { margin: 2px 0 0; color: var(--muted); }

.record-header { padding: 2px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.record-header h1 { margin-top: 8px; }
.record-header p { margin: 4px 0 0; color: var(--muted); }
.record-id { display: flex; align-items: center; gap: 9px; }
.record-id strong { font-size: 16px; }
.type-badge { width: 28px; height: 25px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-weight: 900; color: white; background: var(--teal); }
.type-badge.p { background: #5d3d75; }
.record-next { min-width: 300px; max-width: 450px; padding: 11px 14px; border-left: 3px solid var(--yellow); background: white; }
.record-next span, .record-next strong, .record-next small { display: block; }
.record-next span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.record-next strong { margin: 2px 0; }
.record-next small { color: var(--muted); }
.record-nav { position: sticky; top: 62px; z-index: 10; margin: 0 -32px 18px; padding: 0 32px; display: flex; overflow-x: auto; background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.record-nav a { padding: 11px 13px; color: #4b585c; font-size: 12px; font-weight: 700; white-space: nowrap; }
.record-nav a:hover { background: var(--soft); text-decoration: none; }
.record-section { margin-top: 14px; scroll-margin-top: 118px; background: white; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.quiet-section { background: transparent; border-style: dashed; }
.status-chip, .path-chip, .result-chip, .warning-label { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 3px 7px; border-radius: 4px; background: #edf1f1; color: #465155; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-chip.large { min-height: 29px; padding: 5px 9px; }
.path-chip { background: var(--teal-soft); color: #08615e; }
.result-chip.positiv { background: var(--green-soft); color: var(--green); }
.result-chip.negativ { background: var(--red-soft); color: var(--red); }
.warning-label { background: var(--amber-soft); color: var(--amber); }
.blocker-list { margin: 0 16px 14px; padding: 11px 13px; display: flex; flex-wrap: wrap; gap: 8px 15px; background: var(--red-soft); border-left: 3px solid var(--red); }
.blocker-list strong { flex-basis: 100%; }
.blocker-list span { display: inline-flex; gap: 5px; align-items: center; color: #7e2e29; font-size: 12px; }
.blocker-list svg { width: 15px; height: 15px; }
.fact-grid, .boundary-grid { padding: 15px 17px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }
.fact-grid span, .fact-grid strong, .boundary-grid span, .boundary-grid strong { display: block; }
.fact-grid span { color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 800; }
.fact-grid strong { margin-top: 3px; font-size: 13px; }
.boundary-grid div { padding-left: 10px; border-left: 3px solid var(--yellow); }
.boundary-grid span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.break-text { overflow-wrap: anywhere; }
.history-line { margin: 0 16px 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 12px; }

.position-list { border-top: 1px solid var(--line); }
.position-item { min-height: 86px; padding: 13px 16px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 13px; align-items: start; border-bottom: 1px solid #e8ebec; }
.position-item.blocked { background: #fff7f6; }
.position-number { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: var(--ink); color: white; font-weight: 800; }
.position-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.position-main p { margin: 4px 0 7px; color: var(--muted); }
.activity-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.activity-tags span { padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; font-size: 10px; }
.blocked-text { display: inline-flex; align-items: center; gap: 5px; color: var(--red) !important; font-weight: 700; }
.blocked-text svg { width: 15px; }
.activity-choices { padding: 10px; background: white; border: 1px solid var(--line); border-radius: 4px; }
.inline-edit { margin-top: 9px; }
.inline-edit > summary { width: fit-content; cursor: pointer; color: var(--teal); font-size: 11px; font-weight: 800; }
.inline-edit > .compact-form { margin: 9px 0 2px; border: 1px solid var(--line); border-radius: 4px; }

.action-details, .work-order-row { border-top: 1px solid var(--line); }
.action-details summary, .work-order-row summary { min-height: 48px; padding: 12px 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--teal); font-weight: 800; list-style: none; }
.action-details summary::-webkit-details-marker, .work-order-row summary::-webkit-details-marker { display: none; }
.action-details[open] summary, .work-order-row[open] summary { background: var(--soft); }
.danger-details summary { color: var(--red); }
.work-order-row summary { justify-content: space-between; color: var(--ink); }
.work-order-row summary span { min-width: 0; }
.work-order-row summary strong, .work-order-row summary small { display: block; }
.work-order-row summary small { color: var(--muted); font-weight: 500; }

.reference-grid { padding: 0 16px 16px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.reference-item { min-height: 58px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; display: flex; gap: 9px; align-items: center; color: var(--ink); }
.reference-item:hover { background: var(--soft); text-decoration: none; }
.reference-item svg { color: var(--teal); }
.reference-item strong, .reference-item small { display: block; }
.reference-item small { color: var(--muted); font-size: 11px; }
.decision-timeline { padding: 0 18px 14px; }
.decision-timeline article { position: relative; margin-left: 7px; padding: 0 0 18px 20px; border-left: 2px solid var(--line); }
.timeline-dot { position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.decision-title { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.decision-timeline p { margin: 5px 0; }
.decision-timeline small, .decision-timeline time { display: block; color: var(--muted); font-size: 11px; }
.decision-timeline time { margin-top: 5px; }
.gate-checks { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 4px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 14px; }
.gate-checks legend { padding: 0 5px; font-weight: 800; }
.gate-checks label { display: flex; align-items: center; gap: 7px; }
.change-list { padding: 0 16px 14px; display: grid; gap: 8px; }
.change-list article { padding: 12px; border-left: 3px solid var(--teal); background: var(--soft); }
.change-list article > div { display: flex; justify-content: space-between; gap: 12px; }
.change-list p { margin: 5px 0; }
.change-list small { color: var(--muted); }

.fa1-launch { min-height: 74px; padding: 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.fa1-launch > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fa1-launch small { flex-basis: 100%; color: var(--muted); }
.fa1-header { padding: 2px 0 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.fa1-header h1 { margin-top: 8px; }
.fa1-header p { margin: 4px 0 0; color: var(--muted); }
.fa1-progress { width: min(290px, 100%); }
.fa1-progress div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fa1-progress strong { font-size: 24px; }
.fa1-progress span { color: var(--muted); font-size: 12px; font-weight: 800; }
.fa1-progress progress { width: 100%; height: 8px; margin-top: 7px; accent-color: var(--teal); }
.fa1-boundary { margin-bottom: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; color: #765510; background: var(--amber-soft); border-left: 3px solid var(--amber); font-size: 12px; font-weight: 700; }
.fa1-boundary svg { width: 17px; flex: 0 0 auto; }
.fa1-stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); background: white; }
.fa1-stepper a { min-width: 0; min-height: 84px; padding: 10px; display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 7px; align-content: center; color: var(--muted); border-right: 1px solid var(--line); }
.fa1-stepper a:last-child { border-right: 0; }
.fa1-stepper a:hover { background: var(--soft); text-decoration: none; }
.fa1-stepper a > span { grid-row: 1 / 3; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #aeb8ba; border-radius: 50%; font-size: 11px; font-weight: 900; }
.fa1-stepper strong { color: var(--ink); font-size: 12px; }
.fa1-stepper small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.fa1-stepper a.visited > span { color: white; background: var(--teal); border-color: var(--teal); }
.fa1-stepper a.active { box-shadow: inset 0 -3px 0 var(--yellow); background: #fafcfb; }
.fa1-section { margin-top: 14px; }
.fa1-form input, .fa1-form select, .fa1-form textarea { font-weight: 500; }
.fa1-readonly-grid, .fa1-review-grid { padding: 14px 16px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); background: var(--soft); }
.fa1-readonly-grid span, .fa1-readonly-grid strong, .fa1-review-grid span, .fa1-review-grid strong { display: block; }
.fa1-readonly-grid span, .fa1-review-grid span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.fa1-readonly-grid strong, .fa1-review-grid strong { margin-top: 3px; overflow-wrap: anywhere; }
.required-mark, .conditional-mark, .optional-mark, .requirement-chip { display: inline-flex; width: fit-content; padding: 2px 5px; border-radius: 3px; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.required-mark, .requirement-chip { color: #9a2f27; background: var(--red-soft); }
.conditional-mark { color: #765510; background: var(--amber-soft); }
.optional-mark { color: var(--muted); background: #edf1f1; }
.requirement-chip { min-height: 25px; align-items: center; padding: 4px 8px; }
.assessment-list { border-top: 1px solid var(--line); }
.assessment-row { min-height: 70px; padding: 10px 16px; display: grid; grid-template-columns: minmax(250px, 1.25fr) 82px minmax(135px, .45fr) minmax(260px, 1fr); gap: 10px; align-items: center; border-bottom: 1px solid #e8ebec; }
.assessment-row > div strong, .assessment-row > div small { display: block; }
.assessment-row > div small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.assessment-row input, .assessment-row select { margin-top: 0; }
.fa1-subsection { border-bottom: 1px solid var(--line); }
.gate-summary { min-height: 54px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; background: var(--amber-soft); border-left: 3px solid var(--amber); }
.gate-summary.complete { background: var(--green-soft); border-left-color: var(--green); }
.gate-summary svg { flex: 0 0 auto; }
.gate-summary div { flex: 1; }
.gate-summary strong, .gate-summary span { display: block; }
.gate-summary span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.inline-choice { margin: 0; padding: 10px 12px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 4px; }
.inline-choice legend { padding: 0 4px; font-size: 12px; font-weight: 800; }
.inline-choice label { display: inline-flex; align-items: center; gap: 6px; }
.inline-choice input { width: 16px; min-height: 16px; margin: 0; }
.risk-list { border-top: 1px solid var(--line); }
.risk-row { border-bottom: 1px solid var(--line); }
.risk-row > summary { min-height: 62px; padding: 10px 16px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 20px; gap: 10px; align-items: center; cursor: pointer; list-style: none; }
.risk-row > summary::-webkit-details-marker { display: none; }
.risk-row[open] > summary { background: var(--soft); }
.risk-row summary strong, .risk-row summary small { display: block; }
.risk-row summary small { margin-top: 3px; color: var(--muted); }
.risk-score { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--amber); background: var(--amber-soft); font-weight: 900; }
.risk-score.high { color: var(--red); background: var(--red-soft); }
.risk-archive { border-top: 1px dashed var(--line); background: #fffafa; }
.success-list { margin: 0 16px 14px; padding: 11px 13px; display: flex; align-items: center; gap: 8px; color: var(--green); background: var(--green-soft); border-left: 3px solid var(--green); }
.gate-overview { padding: 0 16px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gate-overview > div { min-height: 58px; padding: 10px; display: flex; align-items: center; gap: 8px; background: var(--amber-soft); border-left: 3px solid var(--amber); }
.gate-overview > div.complete { background: var(--green-soft); border-left-color: var(--green); }
.gate-overview svg { flex: 0 0 auto; }
.gate-overview strong, .gate-overview small { display: block; }
.gate-overview small { margin-top: 2px; color: var(--muted); }
.register-heading { min-height: 62px; padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.register-heading h3 { margin: 0; font-size: 14px; }
.register-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.register-heading > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.structured-register { border-top: 1px solid var(--line); }
.register-row { border-bottom: 1px solid var(--line); }
.register-row > summary { min-height: 62px; padding: 10px 16px; display: grid; grid-template-columns: minmax(72px, auto) minmax(0, 1fr) 20px; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.register-row > summary::-webkit-details-marker { display: none; }
.register-row[open] > summary { background: var(--soft); }
.register-row summary strong, .register-row summary small { display: block; }
.register-row summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.register-status, .register-date, .register-amount { width: fit-content; min-width: 62px; padding: 5px 7px; color: #4d5a5d; background: #e9edef; border-radius: 3px; text-align: center; font-size: 10px; font-weight: 900; }
.register-status.erfüllt, .register-status.geklärt { color: var(--green); background: var(--green-soft); }
.register-status.abweichung, .register-status.offen { color: var(--amber); background: var(--amber-soft); }
.register-amount { color: var(--ink); background: #eef2f2; }
.calculation-totals { display: flex; gap: 18px; }
.calculation-totals span, .calculation-totals strong { display: block; }
.calculation-totals span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.calculation-totals strong { margin-top: 2px; color: var(--ink); font-size: 12px; }
.conditional-switches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.conditional-switches label { min-height: 48px; padding: 9px 10px; display: flex; align-items: center; gap: 7px; border-right: 1px solid var(--line); }
.conditional-switches label:last-child { border-right: 0; }

.admin-heading { align-items: flex-end; }
.admin-boundary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: white; }
.admin-boundary > div { min-height: 78px; padding: 14px; display: flex; align-items: flex-start; gap: 10px; border-right: 1px solid var(--line); }
.admin-boundary > div:last-child { border-right: 0; }
.admin-boundary svg { flex: 0 0 auto; color: var(--teal); }
.admin-boundary strong, .admin-boundary span { display: block; }
.admin-boundary strong { margin-bottom: 3px; }
.admin-boundary span { color: var(--muted); font-size: 11px; }
.admin-boundary span strong { color: var(--ink); font-size: 12px; }
.admin-index { margin-bottom: 14px; padding: 9px 10px; display: flex; gap: 6px; overflow-x: auto; border: 1px solid var(--line); background: var(--soft); }
.admin-index a { flex: 0 0 auto; padding: 6px 9px; color: var(--teal); background: white; border: 1px solid var(--line); border-radius: 3px; font-size: 10px; font-weight: 800; }
.admin-index a:hover { text-decoration: none; border-color: var(--teal); }
.admin-group { scroll-margin-top: 16px; }
.count-chip, .lock-chip { width: fit-content; padding: 4px 7px; border-radius: 3px; font-size: 10px; font-weight: 900; }
.count-chip { color: var(--muted); background: #edf1f1; }
.lock-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); background: #e5f1ef; }
.lock-chip svg { width: 13px; height: 13px; }
.admin-option-head, .admin-option-row { display: grid; grid-template-columns: minmax(180px, 1.25fr) minmax(150px, 1fr) 86px 104px 72px minmax(190px, 1.2fr) 38px; gap: 9px; align-items: center; }
.admin-option-head { padding: 8px 16px; color: var(--muted); background: var(--soft); border-top: 1px solid var(--line); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.admin-option-row { min-height: 61px; padding: 9px 16px; border-top: 1px solid #e8ebec; }
.admin-option-row:first-child { border-top: 0; }
.admin-option-row.inactive { background: #f6f7f7; }
.admin-option-row label { min-width: 0; }
.admin-option-row input, .admin-option-row select { width: 100%; min-height: 36px; margin-top: 0; }
.admin-code { min-width: 0; }
.admin-code code { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.admin-active { min-width: 0; }
.switch-label { min-height: 36px; display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 11px; font-weight: 800; }
.switch-label input { width: 16px; min-height: 16px; margin: 0; }
.mobile-field-label { display: none; }
.admin-add .inline-form { padding: 14px 16px; }

.login-page { min-height: 100vh; background: #e9edeb; display: grid; place-items: center; padding: 24px; }
.login-layout { width: min(780px, 100%); min-height: 430px; display: grid; grid-template-columns: 1fr 1fr; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.login-brand { padding: 38px; background: var(--sidebar); color: white; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.login-brand img { width: min(230px, 100%); aspect-ratio: 1/1; object-fit: contain; background: white; border-radius: 50%; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { margin-top: 20px; font-size: 21px; }
.login-brand span { color: #b9c4c2; }
.login-form { padding: 46px 38px; display: flex; flex-direction: column; justify-content: center; gap: 15px; }
.login-form h1 { margin-bottom: 8px; }
.login-form .alert { margin: 0; }

.print-page { background: #e6e8e7; }
.print-sheet { width: 210mm; min-height: 297mm; margin: 20px auto; padding: 16mm; background: white; box-shadow: var(--shadow); }
.print-sheet header { display: flex; align-items: center; gap: 18px; padding-bottom: 12mm; border-bottom: 2px solid var(--ink); }
.print-sheet header img { width: 28mm; height: 28mm; object-fit: contain; }
.print-sheet header p { margin: 0; color: var(--teal); font-weight: 800; text-transform: uppercase; }
.print-sheet header h1 { font-size: 21px; }
.print-sheet section { padding: 8mm 0; border-bottom: 1px solid var(--line); }
.print-sheet h2 { font-size: 15px; margin-bottom: 4mm; }
.print-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5mm; }
.print-facts span, .print-facts strong { display: block; }
.print-facts span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.print-facts strong { margin-top: 2px; }
.pre-line { white-space: pre-line; }
.print-sheet footer { margin-top: 10mm; color: var(--muted); font-size: 10px; }
.print-button { position: fixed; right: 24px; bottom: 24px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 5px; background: var(--ink); color: white; cursor: pointer; }

@media (max-width: 1380px) {
  .dashboard-record { grid-template-columns: minmax(170px, .8fr) minmax(200px, 1fr) minmax(190px, 1fr); }
  .phase-state { grid-column: 1; }
  .next-action { grid-column: 2; }
  .record-deadline { grid-column: 3; }
  .record-tags { grid-column: 1 / 4; }
}

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span-4 { grid-column: span 2; }
  .reference-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-bar { grid-template-columns: minmax(230px,1fr) repeat(2,minmax(130px,.6fr)); }
  .fa1-stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fa1-stepper a:nth-child(3) { border-right: 0; }
  .fa1-stepper a:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .fa1-readonly-grid, .fa1-review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .assessment-row { grid-template-columns: minmax(220px, 1fr) 80px minmax(130px, .5fr); }
  .assessment-row > input { grid-column: 1 / 4; }
  .gate-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classification-questions, .conditional-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classification-questions label:nth-child(2), .conditional-switches label:nth-child(2) { border-right: 0; }
  .classification-questions label:nth-child(-n+2), .conditional-switches label:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-record { grid-template-columns: minmax(170px, .8fr) minmax(200px, 1fr) minmax(190px, 1fr); }
  .phase-state { grid-column: 1; }
  .next-action { grid-column: 2; }
  .record-deadline { grid-column: 3; }
  .record-tags { grid-column: 1 / 4; }
  .admin-boundary { grid-template-columns: 1fr; }
  .admin-boundary > div { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-boundary > div:last-child { border-bottom: 0; }
  .admin-option-head { display: none; }
  .admin-option-row { grid-template-columns: minmax(190px, 1fr) minmax(150px, .8fr) 90px 110px; }
  .admin-option-row > label:nth-of-type(3) { grid-column: 1; }
  .admin-option-row > label:nth-of-type(4) { grid-column: 2 / 4; }
  .admin-option-row > .icon-button { grid-column: 4; grid-row: 2; justify-self: end; }
  .mobile-field-label { margin-bottom: 3px; display: block; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; width: 228px; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,.2); }
  .mobile-only { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .topbar-actions .button { width: 38px; padding: 0; }
  .topbar-actions .button span { display: none; }
  .page-content { padding: 20px 14px 45px; }
  .page-heading, .record-header { align-items: flex-start; flex-direction: column; }
  .record-next { min-width: 0; width: 100%; }
  .record-nav { margin-left: -14px; margin-right: -14px; padding: 0 8px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-heading .heading-actions { width: 100%; align-items: stretch; }
  .dashboard-heading .inline-filter { flex: 1; }
  .dashboard-record { grid-template-columns: 1fr 90px; gap: 10px; }
  .attention-state, .dashboard-identity, .phase-state, .next-action { grid-column: 1 / 3; }
  .record-deadline { grid-column: 1; }
  .record-tags { grid-column: 1 / 3; }
  .register-heading { align-items: flex-start; flex-direction: column; }
  .calculation-totals { width: 100%; justify-content: space-between; }
  .filter-bar { grid-template-columns: 1fr; }
  .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .form-layout, .form-section, .form-grid { min-width: 0; width: 100%; }
  .form-section .section-heading { align-items: flex-start; flex-direction: column; }
  .form-section .classification-result { min-width: 0; width: 100%; }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
  .fact-grid, .boundary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .reference-grid { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form .grow { flex-basis: auto; width: 100%; }
  .position-item { grid-template-columns: 34px minmax(0,1fr); }
  .position-item > .icon-button { grid-column: 2; }
  .gate-checks { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { padding: 24px; flex-direction: row; gap: 14px; align-items: center; justify-content: flex-start; }
  .login-brand img { width: 74px; }
  .login-brand strong { margin-top: 0; font-size: 17px; }
  .login-form { padding: 30px 24px; }
  .fa1-header { align-items: flex-start; flex-direction: column; }
  .fa1-progress { width: 100%; }
  .fa1-stepper { grid-template-columns: 1fr 1fr; }
  .fa1-stepper a, .fa1-stepper a:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .fa1-stepper a:nth-child(even) { border-right: 0; }
  .fa1-stepper a:nth-last-child(-n+2) { border-bottom: 0; }
  .fa1-readonly-grid, .fa1-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assessment-row { grid-template-columns: 1fr; align-items: stretch; }
  .assessment-row > input { grid-column: auto; }
  .fa1-launch { align-items: stretch; flex-direction: column; }
  .admin-heading { align-items: stretch; }
  .admin-option-row { grid-template-columns: 1fr 1fr; padding: 12px 14px; }
  .admin-option-row > label:nth-of-type(3), .admin-option-row > label:nth-of-type(4) { grid-column: auto; }
  .admin-option-row > .icon-button { grid-column: 2; grid-row: auto; justify-self: end; }
}

@media (max-width: 440px) {
  .metric-grid, .fact-grid, .boundary-grid { grid-template-columns: 1fr; }
  .topbar-context { display: none; }
  .task-row { grid-template-columns: 18px minmax(0,1fr) auto; }
  .task-row .status-form { grid-column: 2 / 4; }
  .fa1-readonly-grid, .fa1-review-grid, .gate-overview { grid-template-columns: 1fr; }
  .heading-actions { align-items: stretch; flex-direction: column; }
  .classification-questions, .conditional-switches { grid-template-columns: 1fr; }
  .classification-questions label, .classification-questions label:nth-child(2), .conditional-switches label, .conditional-switches label:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .classification-questions label:last-child, .conditional-switches label:last-child { border-bottom: 0; }
  .register-row > summary { grid-template-columns: 70px minmax(0, 1fr); }
  .register-row > summary > svg { display: none; }
  .admin-option-row { grid-template-columns: 1fr; }
  .admin-option-row > label:nth-of-type(4), .admin-option-row > .icon-button { grid-column: 1; }
  .admin-option-row > .icon-button { justify-self: stretch; width: 100%; }
}

@media print {
  .print-page { background: white; }
  .print-sheet { width: auto; min-height: 0; margin: 0; padding: 12mm; box-shadow: none; }
  .print-button { display: none; }
}
