/* ==========================================================================
   PyraSoft Designsystem
   Leitbild: "Leitstelle trifft Fahrzeugbeschriftung" — warmes Berichtspapier,
   anthrazitfarbene Leitstellen-Rail, Feuerrot nur als Signal, FMS-Farben als Motiv.
   Schrift: Archivo (variable Breite) + JetBrains Mono, lokal gehostet (DSGVO).
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Papier & Tinte */
  --paper: #f2eee6;
  --paper-2: #e9e3d7;
  --surface: #fffdf9;
  --ink: #16181b;
  --ink-2: #474c54;
  --ink-3: #7b8089;
  --line: #ddd6c8;
  --line-2: #cbc2b0;

  /* Leitstellen-Rail */
  --rail: #141619;
  --rail-2: #1d2024;
  --rail-3: #2a2e33;
  --rail-ink: #ece8df;
  --rail-mute: #868b93;

  /* Signal & Status */
  --signal: #d42a1e;
  --signal-deep: #a81d14;
  --signal-soft: #fbe5e0;
  --ember: #ff6b2c;
  --amber: #df9612;
  --amber-soft: #faefd8;
  --go: #23845a;
  --go-soft: #dff0e6;
  --info: #2a5fa0;
  --info-soft: #e2eaf5;

  /* FMS-Status */
  --fms-1: #2a5fa0;
  --fms-2: #23845a;
  --fms-3: #df9612;
  --fms-4: #d42a1e;
  --fms-5: #8a3ec2;
  --fms-6: #6b7079;

  /* Typo */
  --font: "Archivo", ui-sans-serif, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  /* Form */
  --r-xs: 4px;
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 18px;
  --shadow-1: 0 1px 0 rgba(22, 24, 27, .04), 0 1px 3px rgba(22, 24, 27, .06);
  --shadow-2: 0 2px 4px rgba(22, 24, 27, .04), 0 12px 32px -12px rgba(22, 24, 27, .18);
  --ring: 0 0 0 3px rgba(212, 42, 30, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --rail-w: 264px;
}

/* ---------- Reset / Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* hidden muss immer gewinnen – auch gegen display:flex/grid von Komponenten */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; font-weight: 700; }
p { margin: 0; }
::selection { background: var(--signal); color: #fff; }

.icon { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Papier-Raster als Hintergrund-Textur */
.is-app .content {
  background-image: radial-gradient(circle at 1px 1px, rgba(22, 24, 27, .07) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: local;
}

/* ==========================================================================
   App-Shell
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--rail);
  color: var(--rail-ink);
  padding: 20px 14px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rail-3) transparent;
}
.rail::after { /* Signalkante */
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .06) 20%, rgba(255, 255, 255, .06) 80%, transparent);
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 18px;
  text-decoration: none;
}
.rail__logo { width: 28px; height: 28px; color: var(--rail-ink); }
.rail__word {
  font-size: 19px;
  font-weight: 500;
  font-stretch: 125%;
  letter-spacing: -.01em;
}
.rail__word b { font-weight: 800; }

.rail__tenant {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 4px 18px;
  padding: 9px 10px;
  border: 1px solid var(--rail-3);
  border-radius: var(--r-sm);
  background: var(--rail-2);
}
.rail__tenant-no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--r-xs);
  background: var(--rail-ink);
  color: var(--rail);
  letter-spacing: .04em;
}
.rail__tenant-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail__nav { flex: 1; }
.rail__group + .rail__group { margin-top: 18px; }
.rail__label {
  display: block;
  padding: 0 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  font-stretch: 115%;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rail-mute);
}
.rail__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: #c7c3bb;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.rail__link .icon { color: var(--rail-mute); transition: color .15s; }
.rail__link:hover { background: var(--rail-2); color: var(--rail-ink); }
.rail__link:hover .icon { color: var(--rail-ink); }
.rail__link.is-active { background: var(--rail-3); color: #fff; font-weight: 600; }
.rail__link.is-active .icon { color: var(--ember); }
.rail__link.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--signal);
  box-shadow: 0 0 12px var(--signal);
}

.rail__foot { padding: 14px 6px 0; border-top: 1px solid var(--rail-3); margin-top: 16px; }
.link-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--rail-mute);
}
.link-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rail-mute);
}
.link-state--online i { background: #3ccf86; box-shadow: 0 0 0 0 rgba(60, 207, 134, .6); animation: ping 2.4s infinite; }
.link-state--offline i { background: var(--signal); }

/* ---------- Topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 32px;
  background: rgba(242, 238, 230, .82);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .topbar__menu { display: none; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 440px;
  min-width: 0;
  height: 40px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-3);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--ink-2); box-shadow: var(--shadow-1); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: var(--ink-3); }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  color: var(--ink-3);
  background: var(--paper);
}
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); }
.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  border: 2px solid var(--paper);
}
.user { display: flex; align-items: center; gap: 10px; }
.user__avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  font-stretch: 115%;
}
.user__meta { display: flex; flex-direction: column; line-height: 1.2; }
.user__meta b { font-size: 13.5px; font-weight: 600; }
.user__meta small { font-size: 12px; color: var(--ink-3); }

.content { flex: 1; padding: 32px 32px 64px; }
.content > * + * { margin-top: 20px; }

/* ---------- Seitenkopf ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-title {
  margin-top: 6px;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 800;
  font-stretch: 122%;
  letter-spacing: -.03em;
}
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Komponenten
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .12s var(--ease), background .15s, box-shadow .15s, border-color .15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.btn--signal {
  background: var(--signal);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(168, 29, 20, .35);
}
.btn--signal:hover { background: var(--signal-deep); }
.btn--signal:hover .icon { transform: translateX(3px); }
.btn--signal .icon { transition: transform .2s var(--ease); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #000; }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--line-2); background: #fff; }
.btn--quiet { background: none; color: var(--ink-2); }
.btn--quiet:hover { background: var(--paper-2); }
.btn--lg { height: 48px; font-size: 15px; padding: 0 20px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }

.link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.link-quiet .icon { width: 15px; height: 15px; transition: transform .15s var(--ease); }
.link-quiet:hover { color: var(--signal); }
.link-quiet:hover .icon { transform: translateX(2px); }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 7px; align-content: start; }
.field + .field { margin-top: 16px; }
.field label, .field__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field__hint { font-size: 12.5px; color: var(--ink-3); }
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 15px;
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover { border-color: var(--ink-3); }
.input:focus { border-color: var(--signal); box-shadow: var(--ring); background: #fff; }
.input::placeholder { color: var(--ink-3); opacity: .6; }
.input.is-invalid { border-color: var(--signal); background: var(--signal-soft); }
.input--tenant {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .5em;
  padding-left: 18px;
  height: 54px;
}
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap__btn {
  position: absolute;
  right: 4px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.input-wrap__btn:hover { color: var(--ink); background: var(--paper); }
select.input { appearance: none; padding-right: 40px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23474c54' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 12px center / 18px no-repeat; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--line-2);
  border-radius: 5px;
  background: var(--surface);
  display: grid;
  place-items: center;
  transition: background .15s, border-color .15s;
}
.check input::after {
  content: "";
  width: 9px;
  height: 5px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  rotate: -45deg;
  translate: 0 -1px;
  scale: 0;
  transition: scale .15s var(--ease);
}
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { scale: 1; }
.check input:focus-visible { box-shadow: var(--ring); outline: 0; }

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  padding: 20px 22px;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card__head h3 {
  font-size: 13px;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- Badges, Tags, Status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper-2);
  color: var(--ink-2);
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--live { background: var(--go-soft); color: var(--go); }
.badge--live i { animation: ping-go 2.4s infinite; }
.badge--danger { background: var(--signal-soft); color: var(--signal-deep); }
.badge--warn { background: var(--amber-soft); color: #8d5d06; }
.badge--info { background: var(--info-soft); color: var(--info); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
}

.kw { /* Einsatzstichwort */
  display: inline-block;
  min-width: 40px;
  padding: 3px 7px;
  border-radius: var(--r-xs);
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  font-stretch: 85%;
  text-align: center;
  letter-spacing: .03em;
}

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--amber); }
.status--live { color: var(--signal-deep); }
.status--live::before { background: var(--signal); animation: blink 1.2s steps(2) infinite; }
.status--done::before { background: var(--go); }

/* FMS-Status-Kachel — wiederkehrendes Motiv */
.fms {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--fms-6);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.fms--1 { background: var(--fms-1); }
.fms--2 { background: var(--fms-2); }
.fms--3 { background: var(--fms-3); }
.fms--4 { background: var(--fms-4); }
.fms--5 { background: var(--fms-5); }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid;
  font-size: 14px;
}
.alert--danger { background: var(--signal-soft); border-color: #f2bdb5; color: var(--signal-deep); }
.alert--warn { background: var(--amber-soft); border-color: #eed39b; color: #7a5005; }
.alert--info { background: var(--info-soft); border-color: #bfd0e8; color: var(--info); }
.alert--ok { background: var(--go-soft); border-color: #b5dcc6; color: #186241; }

/* ---------- Tabelle ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px -20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 22px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  font-stretch: 115%;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 55%, var(--surface));
  white-space: nowrap;
}
.table td { padding: 13px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--paper) 40%, var(--surface)); }
.table td b { font-weight: 600; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.incident {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 20px 24px 20px 20px;
  border-radius: var(--r);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 107, 44, .35), transparent 55%),
    linear-gradient(115deg, var(--signal-deep), var(--signal));
  color: #fff;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(168, 29, 20, .7);
}
.incident::before { /* Warnmarkierung */
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: repeating-linear-gradient(-45deg, #fff 0 7px, transparent 7px 14px);
  opacity: .9;
}
.incident__kw {
  display: grid;
  place-items: center;
  min-width: 84px;
  height: 84px;
  margin-left: 8px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .2);
  font-size: 40px;
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: -.02em;
}
.incident__live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  font-stretch: 115%;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .9;
}
.incident__live i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.2s steps(2) infinite; }
.incident h2 { margin: 6px 0 6px; font-size: 24px; font-weight: 700; font-stretch: 110%; letter-spacing: -.01em; }
.incident p { display: flex; align-items: center; gap: 6px; font-size: 14.5px; opacity: .92; }
.incident p .icon { width: 16px; height: 16px; }
.incident__meta { text-align: right; }
.incident__timer {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.incident__units { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.incident__units span {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 7px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
}

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.kpi::after { /* Messskala */
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 8px);
}
.kpi__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.kpi__value {
  font-size: 44px;
  line-height: 1;
  font-weight: 700;
  font-stretch: 72%;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.kpi__value small { font-size: 22px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.kpi__delta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.kpi__delta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.kpi--up .kpi__delta::before { background: var(--go); }
.kpi--warn .kpi__delta { color: #8d5d06; }
.kpi--warn .kpi__delta::before { background: var(--amber); }
.kpi--alert .kpi__value { color: var(--signal); }
.kpi--alert .kpi__delta { color: var(--signal-deep); }
.kpi--alert .kpi__delta::before { background: var(--signal); }

.fleet { list-style: none; margin: 0; padding: 0; }
.fleet__item {
  display: grid;
  grid-template-columns: 30px 72px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}
.fleet__item:first-child { border-top: 0; padding-top: 2px; }
.fleet__call { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.fleet__type { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; line-height: 1.25; min-width: 0; }
.fleet__type small { font-size: 12.5px; font-weight: 400; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet__state { font-size: 12.5px; color: var(--ink-2); text-align: right; }

.deadlines { list-style: none; margin: 0; padding: 0; }
.deadline {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}
.deadline:first-child { border-top: 0; padding-top: 2px; }
.deadline__days {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 0 4px;
  border-radius: var(--r-xs);
  background: var(--paper);
  line-height: 1;
}
.deadline__days b { font-size: 20px; font-weight: 700; font-stretch: 75%; }
.deadline__days small { font-size: 10px; font-weight: 600; color: var(--ink-3); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.deadline.is-soon .deadline__days { background: var(--amber-soft); color: #8d5d06; }
.deadline.is-over .deadline__days { background: var(--signal); color: #fff; }
.deadline.is-over .deadline__days small { color: rgba(255, 255, 255, .85); }
.deadline__what { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; line-height: 1.3; min-width: 0; }
.deadline__what small { font-size: 12.5px; font-weight: 400; color: var(--ink-3); }

/* ==========================================================================
   Login
   ========================================================================== */
.is-auth { background: var(--paper); }
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr);
  min-height: 100vh;
}
.auth__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px 44px;
  background: var(--rail);
  color: var(--rail-ink);
  overflow: hidden;
  isolation: isolate;
}
.auth__stage::before { /* Glut */
  content: "";
  position: absolute;
  inset: auto -20% -45% -20%;
  height: 80%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 107, 44, .42), rgba(212, 42, 30, .18) 45%, transparent 70%);
  filter: blur(20px);
  z-index: -1;
  animation: ember 9s ease-in-out infinite alternate;
}
.auth__stage::after { /* Körnung */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}
.auth__brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 500; font-stretch: 125%; }
.auth__brand b { font-weight: 800; }
.auth__logo { width: 34px; height: 34px; }
.auth__geo {
  position: absolute;
  right: -10%;
  bottom: 104px;
  width: 74%;
  height: calc(100% - 150px);
  color: rgba(236, 232, 223, .5);
  z-index: -1;
}
.auth__geo path:not(.auth__core) { stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: draw 2.4s var(--ease) forwards; }
.auth__geo path:nth-child(2) { animation-delay: .15s; }
.auth__geo path:nth-child(3) { animation-delay: .3s; }
.auth__geo path:nth-child(4) { animation-delay: .45s; }
.auth__core { fill: var(--signal); filter: drop-shadow(0 0 30px rgba(255, 107, 44, .75)); opacity: 0; animation: fadein .8s 1.2s forwards; }
.auth__claim h1 {
  margin-top: 14px;
  font-size: clamp(40px, 5.2vw, 76px);
  font-weight: 800;
  font-stretch: 125%;
  line-height: .98;
  letter-spacing: -.035em;
}
.auth__claim h1 em { font-style: normal; color: var(--ember); }
.auth__claim .eyebrow { color: var(--rail-mute); }
.auth__facts {
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 20px 0 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.auth__facts li { display: flex; flex-direction: column; gap: 2px; }
.auth__facts b { font-size: 13px; font-stretch: 115%; letter-spacing: .06em; text-transform: uppercase; }
.auth__facts span { font-size: 13px; color: var(--rail-mute); }

.auth__panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: 48px 32px;
}
.auth__panel::before { /* Warnmarkierung oben */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: repeating-linear-gradient(-45deg, var(--signal) 0 10px, var(--paper) 10px 20px);
}
.login { width: 100%; max-width: 380px; animation: rise .7s var(--ease) both; }
.login__head { margin-bottom: 28px; }
.login__head h2 { font-size: 32px; font-weight: 800; font-stretch: 120%; letter-spacing: -.025em; }
.login__head p { margin-top: 8px; color: var(--ink-2); }
.login .alert { margin-bottom: 18px; }
.login .check { margin: 20px 0 24px; }
.login__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 12px;
  color: var(--ink-3);
}
.login__foot .icon { width: 14px; height: 14px; }
.login > .alert { margin-bottom: 18px; }
.login .form-submit { margin-top: 24px; }
.login__alt { margin-top: 10px; }
.login__head .eyebrow { margin-bottom: 8px; }

/* Plattform-Variante: Bernstein statt Rot, damit Müller-IT-Bereich sofort erkennbar ist */
.auth--platform .auth__core { fill: var(--amber); filter: drop-shadow(0 0 30px rgba(223, 150, 18, .7)); }
.auth--platform .auth__claim h1 em { color: var(--amber); }
.auth--platform .auth__panel::before { background: repeating-linear-gradient(-45deg, var(--ink) 0 10px, var(--paper) 10px 20px); }

/* ==========================================================================
   Verwaltungsseiten (Phase 1)
   ========================================================================== */
.small { font-size: 13px; }
.flash { animation: rise .4s var(--ease) both; }
.content > .alert + .page-head { margin-top: 20px; }

.rail__link.is-soon { cursor: default; opacity: .5; }
.rail__link.is-soon:hover { background: none; color: #c7c3bb; }
.rail__link.is-soon small {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rail-mute);
}
.link-state--platform i { background: var(--amber); }
.is-platform .rail__tenant-no { background: var(--amber); }
.is-platform .rail__link.is-active::before { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.is-platform .rail__link.is-active .icon { color: var(--amber); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
}
.back .icon { width: 15px; height: 15px; rotate: 180deg; }
.back:hover { color: var(--ink); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

.form { padding: 24px 26px; }
.form__title {
  margin: 28px 0 14px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.form > input[type=hidden] + .form__title, .card > .form__title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .field + .field { margin-top: 0; }
.field--wide { grid-column: 1 / -1; }
.form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 28px -26px -24px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 45%, var(--surface));
  border-radius: 0 0 var(--r) var(--r);
}

.choice-list { display: grid; gap: 8px; }
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--line-2); }
.choice:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--paper) 50%, var(--surface)); }
.choice input { margin-top: 3px; accent-color: var(--ink); width: 16px; height: 16px; }
.choice span { display: flex; flex-direction: column; gap: 2px; }
.choice b { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.choice small { font-size: 13px; color: var(--ink-3); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  transition: all .15s;
}
.chip span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  transition: all .15s;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:checked + span::before { background: var(--ember); border-color: var(--ember); }
.chip input:focus-visible + span { box-shadow: var(--ring); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }

/* Einmal-Kennwort */
.secret {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-2);
  animation: rise .5s var(--ease) both;
}
.secret__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--amber); color: var(--ink); }
.secret__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.secret__label { font-size: 12.5px; font-weight: 600; color: #b9b4aa; }
.secret__value { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: .06em; word-break: break-all; }
.secret small { font-size: 12px; color: #9a958c; }
.secret .btn--ghost { background: transparent; color: var(--paper); border-color: #4a4e55; }
.secret .btn--ghost:hover { background: #24272b; }

/* Erste Schritte */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.steps li {
  counter-increment: s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 44px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--paper) 35%, var(--surface));
  font-size: 13.5px;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  top: 14px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
}
.steps li.is-done::before { content: "✓"; background: var(--go); border-color: var(--go); color: #fff; }
.steps b { font-size: 14.5px; }
.steps span { color: var(--ink-3); }
.steps .link-quiet { margin-top: auto; padding-top: 8px; }
.steps--plain { grid-template-columns: 1fr; }
.steps--plain li { padding: 12px 14px 12px 50px; background: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; }
.steps--plain li::before { top: 12px; left: 14px; }
.steps--plain code { font-family: var(--mono); font-size: 12px; }
.demo-note { font-size: 13.5px; }

/* Tabellen-Ergänzungen */
.table-wrap--flush { margin: -20px -22px; }
.table-wrap--flush .table th { border-top: 0; }
.table td small { font-size: 12.5px; }
.table__action { text-align: right; white-space: nowrap; }
.table tr.is-muted td { color: var(--ink-3); }
.table tr.is-muted b { font-weight: 500; }
.table tr.is-flagged td { background: var(--amber-soft); }
.table .tag + .tag { margin-left: 2px; }
.empty { padding: 40px 22px !important; text-align: center; color: var(--ink-3); }
.status--off::before { background: var(--ink-3); }
.pager { display: flex; justify-content: flex-end; gap: 8px; margin: 20px -2px -4px; }

/* Rollen */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.role-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.role-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.role-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.role-card h3 { font-size: 19px; font-weight: 700; font-stretch: 112%; letter-spacing: -.01em; }
.role-card p { font-size: 13.5px; color: var(--ink-3); min-height: 40px; }
.role-card footer { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
.role-card footer b { font-family: var(--mono); color: var(--ink); }
.meter { height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--v); background: linear-gradient(90deg, var(--signal-deep), var(--ember)); border-radius: inherit; }
.meter--thin { height: 4px; margin-top: 6px; }

.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.perm-group { margin: 0; padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.perm-group legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  font-stretch: 115%;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.perm-group legend .link-quiet { font-size: 11.5px; letter-spacing: 0; text-transform: none; border: 0; background: none; cursor: pointer; padding: 0; }
.check--perm { padding: 7px 0; align-items: flex-start; }
.check--perm input { margin-top: 2px; flex: none; }
.check--perm span { display: flex; flex-direction: column; color: var(--ink); }
.check--perm code { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.btn--danger { background: var(--surface); border-color: #f0b8b0; color: var(--signal-deep); }
.btn--danger:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px dashed #e4a59c;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--signal-soft) 45%, transparent);
}
.danger-zone div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.danger-zone span { font-size: 13px; color: var(--ink-3); }
.danger-zone--stacked { flex-direction: column; align-items: stretch; }
.danger-zone--stacked .btn { width: 100%; }

/* Plattform */
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi__value--sm { font-size: 34px; }
.tenant-no {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
}
.tenant-no--lg { font-size: .5em; padding: 4px 10px; vertical-align: middle; position: relative; top: -.15em; background: var(--amber); color: var(--ink); }
.facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.facts > div { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; min-width: 0; }
.facts > div + div { border-left: 1px dashed var(--line); }
.facts span { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.facts b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts small { color: var(--ink-3); font-weight: 400; }
.explainer { background: color-mix(in srgb, var(--paper) 30%, var(--surface)); }
.admin-list { list-style: none; margin: 0 0 10px; padding: 0; }
.admin-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.admin-list li:first-child { border-top: 0; padding-top: 0; }
.admin-list span { display: flex; flex-direction: column; min-width: 0; }
.admin-list small { font-size: 12px; color: var(--ink-3); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }
.timeline li { display: grid; grid-template-columns: 82px 1fr; gap: 10px; }
.timeline li > span:last-child { display: flex; flex-direction: column; }
.timeline small { color: var(--ink-3); }

form[data-busy].is-busy { opacity: .6; pointer-events: none; }

/* ==========================================================================
   Phase 2: Personal & Dokumente
   ========================================================================== */
.text-danger { color: var(--signal-deep); }
form.inline { display: inline; }
.icon-btn--sm { width: 30px; height: 30px; font-size: 18px; line-height: 1; }
.icon-btn--sm .icon { width: 16px; height: 16px; }
.table-foot { margin-top: 10px !important; padding-left: 4px; }

/* Werkzeugleiste: Filter, Suche */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .search--inline { flex: 1 1 240px; max-width: 360px; height: 38px; }
.input--sm { height: 38px; font-size: 14px; padding: 0 12px; width: auto; }
select.input--sm { padding-right: 36px; background-position: right 10px center; }
.input--num { width: 76px; }
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  overflow-x: auto;
  max-width: 100%;
}
.segmented a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.segmented a small { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.segmented a:hover { color: var(--ink); }
.segmented a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Personalliste */
.table tr.is-link { cursor: pointer; }
.person { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.person__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  font-stretch: 115%;
}
.person__name { display: flex; flex-direction: column; line-height: 1.25; }
.person__name small { font-size: 11.5px; color: var(--ink-3); }
.person:hover b { color: var(--signal-deep); }
.rank {
  display: inline-block;
  min-width: 38px;
  padding: 2px 6px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-xs);
  font-size: 11.5px;
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: .04em;
  text-align: center;
}
.rank--lg { font-size: 13px; padding: 3px 8px; }
.courses { min-width: 120px; line-height: 1.6; }
.courses span {
  display: inline-block;
  margin: 1px 2px 1px 0;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.flag { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.flag--over { background: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.flag--soon { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }

/* Personenakte */
.dossier {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 20px;
  padding: 22px 24px;
  border-radius: var(--r);
  background: var(--rail);
  color: var(--rail-ink);
  overflow: hidden;
}
.dossier::after { /* Reflexstreifen wie am Einsatzfahrzeug */
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--signal) 0 12px, #e9e5dc 12px 24px);
  opacity: .9;
}
.dossier__avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: var(--r);
  background: var(--signal);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  font-stretch: 120%;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
}
.dossier .eyebrow { color: var(--rail-mute); }
.dossier .page-title { margin: 4px 0 10px; color: #fff; font-size: clamp(26px, 3vw, 38px); }
.dossier__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dossier .rank { border-color: var(--rail-ink); color: var(--rail-ink); }
.dossier .muted { color: #a8a49b; }
.dossier .tag { border-color: var(--rail-3); color: #c7c3bb; }
.dossier .status { color: var(--rail-ink); }
.dossier__edit { align-self: start; background: transparent; color: var(--rail-ink); border-color: var(--rail-3); }
.dossier__edit:hover { background: var(--rail-2); border-color: #4a4e55; }
.split--wide { grid-template-columns: minmax(0, 1fr) 320px; }

.subhead {
  margin: 18px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  font-stretch: 115%;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card__head + .subhead { margin-top: 0; }
.quals { list-style: none; margin: 0; padding: 0; }
.qual {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 92px 150px 44px 30px;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
  font-size: 14px;
}
.quals .qual:first-child { border-top: 0; }
#funktionen .qual { grid-template-columns: minmax(0, 1fr) 140px 120px 44px 30px; }
.qual__short {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 0;
  border-radius: var(--r-xs);
  background: var(--paper-2);
  text-align: center;
  color: var(--ink-2);
}
.qual__name { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.qual__name small { font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.qual__date { font-size: 12.5px; color: var(--ink-3); }
.qual__valid { display: flex; flex-direction: column; line-height: 1.25; }
.qual__valid b { font-size: 13px; font-weight: 600; }
.qual__valid small { font-size: 12px; color: var(--ink-3); }
.qual--ok .qual__valid small { color: var(--go); }
.qual--soon .qual__short { background: var(--amber); color: var(--ink); }
.qual--soon .qual__valid small { color: #8d5d06; font-weight: 600; }
.qual--over .qual__short { background: var(--signal); color: #fff; }
.qual--over .qual__valid b, .qual--over .qual__valid small { color: var(--signal-deep); font-weight: 600; }
.qual--old { opacity: .5; }
.qual--old .qual__name { text-decoration: line-through; text-decoration-color: var(--line-2); }

.addbox { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.addbox summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}
.addbox summary::-webkit-details-marker { display: none; }
.addbox summary .icon { width: 16px; height: 16px; transition: rotate .2s var(--ease); }
.addbox[open] summary .icon { rotate: 45deg; }
.addbox summary:hover { color: var(--signal); }
.addbox__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.addbox__form .field + .field { margin-top: 0; }
.addbox__form .field { flex: 0 1 170px; }
.addbox__form .field--grow { flex: 1 1 220px; }
.note { margin-top: 14px; padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); font-size: 13.5px; border-radius: 0 var(--r-xs) var(--r-xs) 0; }

.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--span2 { grid-column: span 2; }

/* Dokumente */
.docs { list-style: none; margin: 0 0 4px; padding: 0; }
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.docs .doc:first-child { border-top: 0; padding-top: 0; }
.doc--row { padding: 0; border: 0; }
.doc__type {
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  flex: none;
  border-radius: 4px 12px 4px 4px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .06);
}
.doc__type--pdf { background: var(--signal-soft); color: var(--signal-deep); }
.doc__type--jpg, .doc__type--jpeg, .doc__type--png, .doc__type--webp, .doc__type--heic { background: var(--info-soft); color: var(--info); }
.doc__type--docx, .doc__type--odt { background: #e4ebf8; color: #2b5797; }
.doc__type--xlsx, .doc__type--ods, .doc__type--csv { background: var(--go-soft); color: #186241; }
.doc__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.doc__main a { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc__main a:hover { color: var(--signal-deep); text-decoration: underline; }
.doc__main small { font-size: 12.5px; color: var(--ink-3); }

.upload { margin-top: 14px; }
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--paper) 40%, var(--surface));
  color: var(--ink-2);
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon { width: 26px; height: 26px; color: var(--ink-3); margin-bottom: 4px; }
.dropzone small { font-size: 12px; color: var(--ink-3); }
.dropzone:hover, .dropzone.is-over { border-color: var(--signal); background: var(--signal-soft); }
.dropzone.has-files { border-style: solid; border-color: var(--ink); }
.upload__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; align-items: end; }
.upload__meta[hidden] { display: none; }
.upload__meta .field + .field { margin-top: 0; }
.upload__meta .btn { grid-column: 1 / -1; justify-self: end; }

.quota { display: flex; flex-direction: column; gap: 4px; min-width: 200px; font-size: 13px; color: var(--ink-3); }
.quota b { color: var(--ink); }
.tag--link { text-decoration: none; color: var(--ink-2); margin: 1px 0; }
.tag--link:hover { border-color: var(--ink-2); color: var(--ink); }

/* Stammdaten-Tabelle */
.table--edit td { padding-top: 8px; padding-bottom: 8px; }
.table--edit .input--sm { width: 100%; min-width: 90px; }
.table--edit .input--num { width: 76px; min-width: 0; }
.table--edit tr.is-new td { background: color-mix(in srgb, var(--paper) 45%, var(--surface)); }
.deadlines--page .deadline { grid-template-columns: 58px 1fr auto; }
.deadline__what a { text-decoration: none; }
.deadline__what a:hover { color: var(--signal-deep); text-decoration: underline; }

/* ==========================================================================
   Styleguide
   ========================================================================== */
.sg-section h2 {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.sg-swatch span { display: block; height: 64px; }
.sg-swatch code { display: block; padding: 8px 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.sg-type > * + * { margin-top: 14px; }
.sg-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.sg-form .field + .field { margin-top: 0; }

/* ==========================================================================
   Bewegung
   ========================================================================== */
.reveal { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes ember { from { transform: translateX(-6%) scale(1); } to { transform: translateX(6%) scale(1.12); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 134, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(60, 207, 134, 0); } }
@keyframes ping-go { 0% { box-shadow: 0 0 0 0 rgba(35, 132, 90, .5); } 70%, 100% { box-shadow: 0 0 0 6px rgba(35, 132, 90, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .auth__geo path { stroke-dashoffset: 0; }
  .auth__core { opacity: 1; }
}

/* ==========================================================================
   Responsiv
   ========================================================================== */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .split { grid-template-columns: minmax(0, 1fr); }
  .kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table--people th:nth-child(5), .table--people td:nth-child(5) { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts > div:nth-child(4) { border-left: 0; }
  .facts > div:nth-child(n+4) { border-top: 1px dashed var(--line); }
}
@media (max-width: 1100px) {
  .auth__facts { display: none; }
}
@media (max-width: 760px) {
  .form-grid, .form-grid--3, .perm-grid, .steps, .upload__meta { grid-template-columns: minmax(0, 1fr); }
  .field--span2 { grid-column: auto; }
  .dossier { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .dossier__avatar { width: 56px; height: 56px; font-size: 20px; }
  .dossier__edit { grid-column: 1 / -1; }
  .qual { grid-template-columns: 48px minmax(0, 1fr) 40px 30px; }
  #funktionen .qual { grid-template-columns: minmax(0, 1fr) 40px 30px; }
  .qual .clip { grid-row: 1; grid-column: -3; }
  .qual > form { grid-row: 1; grid-column: -2; }
  .qual__date { display: none; }
  .qual__valid { grid-column: 2; grid-row: 2; }
  .quals .qual__valid:has(> small.muted:only-child) { display: none; }
  #funktionen .qual__valid { grid-column: 1; }
  .table--people th:nth-child(4), .table--people td:nth-child(4), .table--people th:nth-child(5), .table--people td:nth-child(5) { display: none; }
  .toolbar .search--inline { max-width: none; }
  .kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpis--3 .kpi { padding: 12px 10px 10px; }
  .kpis--3 .kpi::after { left: 10px; right: 10px; }
  .kpis--3 .kpi__label { font-size: 11.5px; line-height: 1.25; }
  .kpis--3 .kpi__value { font-size: 30px; }
  .kpis--3 .kpi__delta { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(odd) { border-left: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px dashed var(--line); }
  .secret { grid-template-columns: 1fr; }
  .secret__icon { display: none; }
  .form { padding: 20px 16px; }
  .form__actions { margin: 24px -16px -20px; padding: 14px 16px; }
  .danger-zone { flex-direction: column; align-items: stretch; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed;
    z-index: 50;
    width: var(--rail-w);
    translate: -100% 0;
    transition: translate .25s var(--ease);
  }
  .shell.rail-open .rail { translate: 0 0; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgba(20, 22, 25, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.rail-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 16px; }
  .topbar .topbar__menu { display: grid; }
  .content { padding: 24px 16px 48px; }
  .user__meta { display: none; }
  .search kbd { display: none; }

  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__stage { min-height: 260px; padding: 28px 24px; }
  .auth__claim h1 { font-size: 36px; }
  .auth__facts, .auth__geo { display: none; }
  .auth__panel { padding: 40px 16px; }
}
@media (max-width: 640px) {
  .kpis { gap: 12px; }
  .kpi { padding: 14px 14px 12px; }
  .kpi::after { left: 14px; right: 14px; }
  .kpi__value { font-size: 34px; }
  .incident { grid-template-columns: auto 1fr; }
  .incident__meta { grid-column: 1 / -1; text-align: left; }
  .incident__units { justify-content: flex-start; }
  .incident__kw { min-width: 64px; height: 64px; font-size: 30px; }
  .fleet__item { grid-template-columns: 30px 64px 1fr; }
  .fleet__state { display: none; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
}
@media (min-width: 961px) { .scrim { display: none; } }
.table--edit td:first-child .input--sm { min-width: 190px; }
.table--edit input[name=short] { width: 90px; min-width: 0; }

/* Dokumente direkt am Nachweis / an der Funktion */
.clip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: none;
  color: var(--line-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.clip .icon { width: 16px; height: 16px; }
.clip:hover { color: var(--ink-2); background: var(--paper); }
.clip.has-docs { color: var(--info); background: var(--info-soft); }
.clip[aria-expanded="true"] { color: var(--ink); border-color: var(--line-2); background: var(--surface); }
.qual__docs {
  grid-column: 1 / -1;
  margin: 4px 0 6px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--paper) 55%, var(--surface));
  border: 1px solid var(--line);
  animation: rise .25s var(--ease) both;
}
.qual--old .qual__docs { opacity: 1; }
.qual.is-target { animation: flash 1.6s var(--ease); border-radius: var(--r-xs); }
@keyframes flash { 0%, 30% { background: var(--amber-soft); } 100% { background: transparent; } }
.docs--compact .doc { padding: 6px 0; }
.docs--compact .doc__type { width: 30px; height: 34px; font-size: 9px; }
.upload--compact { margin-top: 8px; }
.upload--compact .dropzone { flex-direction: row; justify-content: center; padding: 10px 12px; font-size: 13px; background: var(--surface); }
.dropzone--inline { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 10px 12px; font-size: 13.5px; background: var(--surface); }
.dropzone--inline .icon { width: 18px; height: 18px; margin: 0; }
.addbox__form .field--full { flex: 1 1 100%; }
.doc__context { color: var(--info); font-weight: 600; text-decoration: none; }
.doc__context:hover { text-decoration: underline; }
.qual { scroll-margin-top: 84px; }

/* ==========================================================================
   Dokument-Vorschau (Modal)
   ========================================================================== */
.icon--flip { rotate: 180deg; }
.viewer {
  width: min(1180px, 96vw);
  height: min(92vh, 1100px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--rail);
  color: var(--rail-ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; animation: viewer-in .28s var(--ease) both; }
.viewer::backdrop { background: rgba(20, 22, 25, .62); backdrop-filter: blur(4px); }
@keyframes viewer-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.viewer__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--rail-3);
}
.viewer__type {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  flex: none;
  border-radius: 4px 11px 4px 4px;
  background: var(--rail-3);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--rail-ink);
}
.viewer__title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.viewer__title b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__title small { font-size: 12.5px; color: var(--rail-mute); }
.viewer__nav { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--rail-mute); }
.viewer__nav[hidden] { display: none; }
.viewer__actions { display: flex; align-items: center; gap: 8px; }
.viewer .icon-btn { color: var(--rail-ink); }
.viewer .icon-btn:hover { background: var(--rail-2); border-color: var(--rail-3); }
.viewer .btn--ghost { background: transparent; color: var(--rail-ink); border-color: var(--rail-3); }
.viewer .btn--ghost:hover { background: var(--rail-2); }
.viewer .btn--ink { background: var(--rail-ink); color: var(--rail); }
.viewer__close { font-size: 24px; }
.viewer__stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(45deg, #24272b 25%, transparent 25%, transparent 75%, #24272b 75%) 0 0 / 22px 22px,
    linear-gradient(45deg, #24272b 25%, transparent 25%, transparent 75%, #24272b 75%) 11px 11px / 22px 22px,
    #1d2024;
}
.viewer__stage > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer__stage > img {
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  cursor: zoom-in;
}
.viewer__stage.is-zoomed { place-items: start; }
.viewer__stage.is-zoomed > img { max-width: none; max-height: none; cursor: zoom-out; margin: 16px; }
.viewer__stage > pre {
  align-self: stretch;
  justify-self: stretch;
  margin: 16px;
  padding: 18px 20px;
  overflow: auto;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
  tab-size: 4;
}
.viewer__stage > iframe, .viewer__stage > img, .viewer__stage > pre { opacity: 0; transition: opacity .2s; }
.viewer__stage > .is-ready { opacity: 1; }
.viewer__stage:focus { outline: none; }
.viewer__loading { display: flex; align-items: center; gap: 10px; color: var(--rail-mute); font-size: 14px; }
.viewer__loading[hidden] { display: none; }
.viewer__loading span {
  width: 18px;
  height: 18px;
  border: 2px solid var(--rail-3);
  border-top-color: var(--ember);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
.viewer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 28px;
  text-align: center;
}
.viewer__empty b { font-size: 18px; font-stretch: 112%; }
.viewer__empty p { color: var(--rail-mute); font-size: 14px; }
.viewer__empty .btn { margin-top: 8px; }
.viewer__stage > .viewer__empty { opacity: 1; }

@media (max-width: 760px) {
  .viewer { width: 100vw; height: 100dvh; border-radius: 0; }
  .viewer__bar { position: relative; flex-wrap: wrap; gap: 10px; padding: 10px 52px 10px 12px; }
  .viewer__title { flex: 1 1 calc(100% - 60px); }
  .viewer__close { position: absolute; top: 10px; right: 8px; }
  .viewer__actions { order: 3; width: 100%; }
  .viewer__actions .btn { flex: 1; }
  .viewer__nav { order: 2; }
}

/* ==========================================================================
   Phase 3: Fahrzeuge, Geräte, Schläuche
   ========================================================================== */
.check--pill { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13.5px; }
.check--pill:has(input:checked) { border-color: var(--ink); }
.segmented--wide { margin-bottom: 16px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; }
.empty-state > .icon { width: 40px; height: 40px; color: var(--ink-3); }
.empty-state h3 { font-size: 20px; font-stretch: 112%; }
.empty-state p { max-width: 420px; color: var(--ink-3); margin-bottom: 8px; }
.tag--on-dark { display: inline-flex; align-items: center; gap: 6px; color: #c7c3bb; border-color: var(--rail-3); text-decoration: none; }
.tag--on-dark .icon { width: 14px; height: 14px; }
.tag--on-dark:hover { color: #fff; border-color: var(--rail-mute); }
.tag--personal { border-color: #c9d6ea; color: var(--info); }
.tag--fahrzeuge { border-color: #f0c2bb; color: var(--signal-deep); }
.tag--geraete { border-color: #ead39c; color: #8d5d06; }
.tag--schlaeuche { border-color: #b9dcc8; color: #186241; }
.deadline__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Kennzeichen wie am Fahrzeug */
.plate {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: #fff linear-gradient(90deg, #2a5fa0 0 8px, transparent 8px);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Fälligkeits-Chip */
.due { display: inline-block; padding: 2px 8px; border-radius: var(--r-xs); font-family: var(--mono); font-size: 12px; font-weight: 600; background: var(--go-soft); color: #186241; white-space: nowrap; }
.due--soon { background: var(--amber-soft); color: #8d5d06; }
.due--over { background: var(--signal); color: #fff; }
.due--none { background: var(--paper-2); color: var(--ink-3); }

/* Fahrzeug-Karten */
.fleet-summary { margin: -8px 0 16px; color: var(--ink-3); }
.fleet-summary b { color: var(--ink); font-size: 18px; }
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.vcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.vcard::after { /* Warnmarkierung wie am Fahrzeugheck */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--signal) 0 10px, #fff 10px 20px);
}
.vcard--ausser_dienst::after { background: var(--ink-3); }
.vcard--ausgemustert { opacity: .6; }
.vcard--ausgemustert::after { background: var(--line-2); }
.vcard--eingeschraenkt::after { background: repeating-linear-gradient(-45deg, var(--amber) 0 10px, #fff 10px 20px); }
.vcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.vcard header { display: flex; justify-content: space-between; align-items: center; }
.vcard__call { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.vcard__type { display: flex; flex-direction: column; font-size: 20px; font-weight: 800; font-stretch: 85%; line-height: 1.1; }
.vcard__type small { font-size: 13px; font-weight: 500; font-stretch: 100%; color: var(--ink-3); margin-top: 3px; }
.vcard__facts { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.vcard__facts li { display: flex; align-items: center; gap: 7px; }
.vcard__facts .icon { width: 15px; height: 15px; color: var(--ink-3); }
.vcard__due--over { color: var(--signal-deep); font-weight: 600; }
.vcard__due--over .icon { color: var(--signal); }
.vcard__due--soon { color: #8d5d06; font-weight: 600; }
.vcard footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }

/* Akten-Kopf Varianten */
.dossier__avatar--call { width: auto; min-width: 96px; padding: 0 14px; white-space: nowrap; font-family: var(--mono); font-size: 22px; font-stretch: 100%; letter-spacing: -.02em; }
.dossier__avatar--icon { background: var(--amber); color: var(--ink); }
.dossier__avatar--icon .icon { width: 34px; height: 34px; }
.dossier--hose .dossier__avatar { background: var(--go); }
.dossier .plate { border-color: var(--rail-ink); }
.dossier .due { font-size: 12px; }

/* Prüfplan */
.plans { list-style: none; margin: 0; padding: 0; }
.plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px auto 30px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--go);
  border-radius: var(--r-sm);
}
.plan--soon { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber-soft) 50%, var(--surface)); }
.plan--over { border-left-color: var(--signal); background: color-mix(in srgb, var(--signal-soft) 55%, var(--surface)); }
.plan__name { display: flex; flex-direction: column; min-width: 0; }
.plan__name small, .plan__due small { font-size: 12px; color: var(--ink-3); }
.plan__due { display: flex; flex-direction: column; line-height: 1.25; }
.plan--over .plan__due b, .plan--over .plan__due small { color: var(--signal-deep); }
.plan--soon .plan__due small { color: #8d5d06; font-weight: 600; }
.history .qual { grid-template-columns: 92px minmax(0, 1fr) auto 110px 44px 30px; }
.defects .qual { grid-template-columns: 92px minmax(0, 1fr) auto auto 44px; }
.defect--behoben .qual__name { color: var(--ink-3); }
.defect__text { grid-column: 2 / -1; margin: -4px 0 4px; font-size: 13.5px; color: var(--ink-2); }
.chip--maengel input:checked + span { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.chip--nicht_bestanden input:checked + span { background: var(--signal); border-color: var(--signal); color: #fff; }
.chip--bestanden input:checked + span { background: var(--go); border-color: var(--go); }

/* Kilometer */
.readings { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.readings li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; }
.readings small { display: block; color: var(--ink-3); font-size: 12px; }
.reading-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reading-form .input--sm { width: 100%; }
.reading-form [name=note] { grid-column: 1 / -1; }
.reading-form .btn { grid-column: 1 / -1; }

/* Schläuche */
.hose-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hose-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; background: var(--surface); }
.hose-chip small { color: var(--signal-deep); font-weight: 600; }
.hose-chip.has-issue { border-color: #f0c2bb; }
.hose-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hose-sum {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  transition: border-color .15s;
}
.hose-sum:hover, .hose-sum.is-active { border-color: var(--ink); }
.hose-sum b { font-size: 15px; font-weight: 800; font-stretch: 90%; }
.hose-sum__n { font-family: var(--mono); font-weight: 700; font-size: 20px; line-height: 1; }
.hose-sum__bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.hose-sum__bar i { display: block; height: 100%; width: var(--ready); background: var(--go); border-radius: inherit; }
.hose-sum small { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
.hose-sum small em { font-style: normal; color: var(--signal-deep); font-weight: 600; }
.hose-type { white-space: nowrap; display: inline-block; padding: 2px 7px; border-radius: var(--r-xs); background: var(--ink); color: var(--paper); font-size: 11.5px; font-weight: 800; font-stretch: 85%; }
.col-check { width: 44px; }
.col-check .check { gap: 0; }
.table--hoses tr:has(input:checked) td { background: color-mix(in srgb, var(--info-soft) 70%, var(--surface)); }
.bulkbar {
  position: sticky;
  bottom: 16px;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5);
  animation: rise .25s var(--ease) both;
}
.bulkbar[hidden] { display: none; }
.bulkbar__count { margin-right: 6px; font-size: 14px; }
.bulkbar__count b { font-family: var(--mono); font-size: 18px; color: var(--ember); }
.bulkbar .input { background-color: #24272b; border-color: #3a3e44; color: var(--paper); }
.bulkbar__test, .event-form__test { display: contents; }
.bulkbar__test[hidden], .event-form__test[hidden] { display: none; }
.event-form { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--line); }

.timeline--events { gap: 0; }
.tev { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 0 0 14px; }
.tev::before { content: ""; position: absolute; left: 16px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.tev:last-child::before { display: none; }
.tev__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--paper-2); color: var(--ink-2); }
.tev__icon .icon { width: 16px; height: 16px; }
.tev--pruefung .tev__icon { background: var(--go-soft); color: var(--go); }
.tev--einsatz .tev__icon { background: var(--signal-soft); color: var(--signal); }
.tev--bad .tev__icon, .tev--aussonderung .tev__icon { background: var(--signal); color: #fff; }
.tev__body { display: flex; flex-direction: column; padding-top: 6px; font-size: 14px; }
.tev__body small { color: var(--ink-3); font-size: 12.5px; }

@media (max-width: 760px) {
  .plan { grid-template-columns: minmax(0, 1fr) 30px; }
  .plan__due { grid-column: 1; }
  .plan .btn { grid-column: 1; justify-self: start; }
  .plan > form { grid-row: 1; grid-column: 2; }
  .history .qual { grid-template-columns: minmax(0, 1fr) 40px 30px; }
  .history .qual__date { display: block; grid-column: 1; }
  .history .qual__name, .history .status, .history .qual__valid { grid-column: 1; }
  .defects .qual { grid-template-columns: minmax(0, 1fr) 40px; }
  .defects .qual > * { grid-column: 1; }
  .defects .clip { grid-row: 1; grid-column: 2; }
  .bulkbar { bottom: 8px; }
}
.vdot { width: 14px; height: 14px; margin: 8px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 4px var(--go-soft); }
.vdot--eingeschraenkt { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.vdot--ausser_dienst { background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); }
a.fleet__call { text-decoration: none; }
a.fleet__call:hover { color: var(--signal-deep); }

.dossier__sub { display: block; margin-top: 4px; font-size: .5em; font-weight: 600; font-stretch: 100%; letter-spacing: 0; color: #a8a49b; }
.card__head + .table-wrap--flush { margin-top: 0; }

/* .split--wide steht nach der Mobile-Regel → mit höherer Spezifität erneut einspaltig schalten */
@media (max-width: 1180px) { .split.split--wide { grid-template-columns: minmax(0, 1fr); } }
.deadlines--page .deadline { grid-template-columns: 58px minmax(0, 1fr) auto; }
.deadline__what a, .deadline__what small { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .deadlines--page .deadline { grid-template-columns: 58px minmax(0, 1fr); }
  .deadlines--page .deadline__meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
}

/* ==========================================================================
   Phase 4: Einsätze & Übungen
   ========================================================================== */
.page-title__year { font-family: var(--mono); font-weight: 500; font-stretch: 100%; color: var(--ink-3); font-size: .55em; letter-spacing: 0; vertical-align: middle; }
.inline-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.tag--open { border-color: #ead39c; color: #8d5d06; background: var(--amber-soft); }
.card--hint { display: flex; align-items: center; gap: 10px; color: var(--ink-3); text-decoration: none; border-style: dashed; box-shadow: none; }
.card--hint:hover { color: var(--ink); border-color: var(--ink-3); }
.report p { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.report .form__title + p { margin-bottom: 4px; }
.input--kw { font-weight: 700; font-size: 18px; letter-spacing: .04em; }
.input--time { width: 96px; }
.stats-row { margin-top: 12px; }

/* Stichwort-Farben je Kategorie */
.kw--brand { background: var(--signal); }
.kw--thl { background: var(--info); }
.kw--abc { background: #7a3db8; }
.kw--bma { background: var(--ink-3); }
.kw--unwetter { background: #2c7a7b; }

/* Einsatz-Banner Varianten */
.incident--done { background: linear-gradient(115deg, #24272b, #33373d); box-shadow: var(--shadow-2); }
.incident--done::before { background: repeating-linear-gradient(-45deg, var(--signal) 0 7px, transparent 7px 14px); }
.incident__timer--static { font-size: 26px; }
a.incident--link { text-decoration: none; transition: transform .2s var(--ease); }
a.incident--link:hover { transform: translateY(-2px); }

/* Einsatzliste */
.incident-list { list-style: none; margin: -6px 0; padding: 0; }
.ilist + .ilist { border-top: 1px dashed var(--line); }
.ilist__link {
  display: grid;
  grid-template-columns: 62px 58px minmax(0, 1fr) auto 120px 120px;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: background .12s;
}
.ilist__link:hover { background: color-mix(in srgb, var(--paper) 50%, var(--surface)); }
.ilist__when { display: flex; flex-direction: column; line-height: 1.2; }
.ilist__when small { color: var(--ink-3); font-size: 12px; }
.ilist__main { display: flex; flex-direction: column; min-width: 0; }
.ilist__main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ilist__main small { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ilist__units { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ilist__units span { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--r-xs); color: var(--ink-2); }
.ilist__meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.ilist__meta small { font-size: 11.5px; color: var(--ink-3); }
.ilist__state { text-align: right; }
.ilist--live .ilist__link { background: var(--signal-soft); }

/* Fahrzeug-Zeiten */
.table--times th small { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0; }
.table--times td { padding-top: 8px; padding-bottom: 8px; }

/* Besatzung */
.crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.crew__unit { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: color-mix(in srgb, var(--paper) 35%, var(--surface)); }
.crew__unit header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6px; border-bottom: 1px dashed var(--line); margin-bottom: 2px; }
.crew__unit header span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.crew__unit--base { border-style: dashed; }
.crew__person { display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; }
.crew__person small { color: var(--ink-3); font-size: 12px; flex: 1; }
.crew__person em { font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: var(--amber); color: var(--ink); }
.crew__person em.crew__csa { background: var(--fms-5); color: #fff; }
.att__booking { display: block; color: var(--ink-2); }
.att__booking em { font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: var(--amber); color: var(--ink); }
.att__booking em.is-csa { background: var(--fms-5); color: #fff; }
.crew-form__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.crew-form__tools .search--inline { flex: 1 1 200px; max-width: 280px; height: 38px; }
.crew-form__table { max-height: 520px; overflow-y: auto; margin: 0 !important; border: 1px solid var(--line); border-radius: var(--r-sm); }
.crew-form__table .table th { position: sticky; top: 0; z-index: 1; border-top: 0; }
.crew-form__table td small { display: block; font-size: 11.5px; }
.crew-form__table tr:has([data-crew-on]:checked) td { background: color-mix(in srgb, var(--go-soft) 70%, var(--surface)); }
.crew-form__table .input--sm { min-width: 110px; }
[data-crew-row].is-filtered { display: none; }

/* Schläuche wählen */
.hose-pick__list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hose-pick__group { flex-basis: 100%; margin-top: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.hose-pick .chip span { height: 30px; font-size: 12.5px; padding: 0 10px; }
a.hose-chip { text-decoration: none; }
a.hose-chip:hover { border-color: var(--ink-2); }

/* Dienstplan */
.month-head { margin: 26px 0 10px; font-size: 13px; font-weight: 700; font-stretch: 118%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.month-head:first-of-type { margin-top: 8px; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tlist__item a {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto 80px 150px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .15s, transform .15s var(--ease);
}
.tlist__item a:hover { border-color: var(--line-2); transform: translateX(2px); }
.tlist__item--abgesagt a { opacity: .55; }
.tlist__item--abgesagt .tlist__main b { text-decoration: line-through; }
.tlist__item.is-due a { border-left: 4px solid var(--amber); }
.tlist__date { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: var(--r-sm); background: var(--paper); line-height: 1; }
.tlist__date b { font-size: 22px; font-weight: 800; font-stretch: 80%; }
.tlist__date small { font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.tlist__main { display: flex; flex-direction: column; min-width: 0; }
.tlist__main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlist__main small { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlist__tags { display: flex; gap: 4px; }
.tlist__att { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.tlist__att small { font-size: 10.5px; color: var(--ink-3); }
.tlist--mini .tlist__item a { grid-template-columns: 48px minmax(0, 1fr); padding: 8px 10px; }

/* Anwesenheit */
.att { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 24px; }
.att__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }
.att__name { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.att__name small { font-size: 11.5px; color: var(--ink-3); }
.att__opts { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; flex: none; }
.att__opt input { position: absolute; opacity: 0; pointer-events: none; }
.att__opt span { display: grid; place-items: center; width: 34px; height: 30px; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; transition: background .12s, color .12s; }
.att__opt + .att__opt span { border-left: 1px solid var(--line); }
.att__opt span:hover { background: var(--paper); }
.att__opt--anwesend input:checked + span { background: var(--go); color: #fff; }
.att__opt--entschuldigt input:checked + span { background: var(--amber); color: var(--ink); }
.att__opt--unentschuldigt input:checked + span { background: var(--signal); color: #fff; }
.att__opt--none input:checked + span { background: var(--paper-2); color: var(--ink-2); }
.att__opt input:focus-visible + span { box-shadow: inset var(--ring); }
.att--read { columns: 1; }
.dossier__avatar--date { flex-direction: column; background: var(--info); line-height: 1; }
.dossier__avatar--date { display: flex; align-items: center; justify-content: center; }
.dossier__avatar--date b { font-size: 30px; }
.dossier__avatar--date small { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

/* Personenakte: Einsatzdienst */
.duty__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.duty__grid > div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: var(--r-sm); background: var(--paper); text-align: center; }
.duty__grid b { font-size: 24px; font-weight: 800; font-stretch: 80%; line-height: 1; }
.duty__grid span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.duty__grid small { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.duty__quota--ok { background: var(--go-soft) !important; }
.duty__quota--soon { background: var(--amber-soft) !important; }
.duty__quota--over { background: var(--signal-soft) !important; }
.mini-incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mini-incidents a { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 6px; border-radius: var(--r-xs); text-decoration: none; }
.mini-incidents a:hover { background: var(--paper); }
.mini-incidents .kw { min-width: 0; font-size: 11px; }
.mini-incidents span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.mini-incidents b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-incidents small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1180px) {
  .ilist__link { grid-template-columns: 56px 52px minmax(0, 1fr) 110px; }
  .ilist__units, .ilist__state { display: none; }
}
@media (max-width: 760px) {
  .ilist__link { grid-template-columns: 52px minmax(0, 1fr); gap: 8px 12px; }
  .ilist__link .kw { grid-column: 1; grid-row: 2; justify-self: start; }
  .ilist__main { grid-column: 2; grid-row: 1 / span 2; }
  .ilist__meta { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 8px; }
  .tlist__item a { grid-template-columns: 48px minmax(0, 1fr); }
  .tlist__tags, .tlist__att { display: none; }
  .tlist__item a > .status { grid-column: 2; justify-self: start; }
  .crew-form__table .input--sm { min-width: 90px; }
  .att__opt span { width: 32px; }
}
.segmented { scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.table--times th, .table--times td { padding-left: 8px; padding-right: 8px; }
.table--times th:first-child, .table--times td:first-child { padding-left: 22px; }
.table--times .input--time { width: 66px; padding: 0 6px; }
.table--times .input--time::-webkit-calendar-picker-indicator { display: none; }
.table--times .input--num { width: 64px; }
.table--times td small { display: block; }
.table--times .th-status small { display: block; margin-top: 2px; text-transform: none; }
.crew-form__table .input--sm { min-width: 0; width: 100%; max-width: 170px; }
@media (max-width: 1180px) and (min-width: 761px) {
  .tlist__tags { display: none; }
  .tlist__item a { grid-template-columns: 54px minmax(0, 1fr) 70px 140px; }
}
.page-title, .dossier .page-title { hyphens: auto; overflow-wrap: anywhere; }

/* Gruppen & Einheiten in der Personenakte */
#einheiten .qual { grid-template-columns: minmax(0, 1fr) 120px 110px auto 30px; }
#einheiten .qual--old .qual__name { text-decoration: none; }
.qual__name small.mono { display: inline; font-size: 11.5px; }
.unit-end { position: relative; }
.unit-end > summary { list-style: none; cursor: pointer; }
.unit-end > summary::-webkit-details-marker { display: none; }
.unit-end form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: grid; gap: 8px; width: 210px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-2); }
@media (max-width: 760px) {
  #einheiten .qual { grid-template-columns: minmax(0, 1fr) auto 30px; }
  #einheiten .qual__date, #einheiten .qual__valid { grid-column: 1 / -1; }
}

/* Übungen: Pflicht-Einheiten, Teilnehmergruppen, Verknüpfungen, Beteiligung */
.unit-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.unit-pick legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.unit-pick__list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; display: inline-flex; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip-check span { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; background: var(--surface); transition: background .15s var(--ease), border-color .15s var(--ease); }
.chip-check input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip-check input:focus-visible + span { box-shadow: var(--ring); }
.att__group { padding: 14px 4px 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--line); list-style: none; }
.att__group:first-child { padding-top: 2px; }
.att__linked { display: block; margin-top: 2px; font-size: 12px; color: var(--go); text-decoration: none; }
.att__linked:hover { text-decoration: underline; }
.att-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.att-add label { font-size: 13px; color: var(--ink-2); flex-basis: 100%; }
.att-add select { flex: 1 1 220px; min-width: 0; }
.linked { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.linked a { display: block; color: var(--ink); text-decoration: none; }
.linked a:hover { text-decoration: underline; }
.linked small { display: block; }
.link-form { display: flex; gap: 8px; margin-top: 12px; }
.link-form select { flex: 1; min-width: 0; }
.table__num { text-align: right; white-space: nowrap; }
.pquota { display: inline-block; min-width: 54px; padding: 2px 8px; border-radius: 999px; font-family: var(--mono); font-size: 12.5px; font-weight: 600; text-align: center; }
.pquota--ok { background: var(--go-soft); color: var(--go); }
.pquota--soon { background: var(--amber-soft); color: #8d5d06; }
.pquota--over { background: var(--signal-soft); color: var(--signal-deep); }
.pquota--none { color: var(--ink-3); }

/* ==========================================================================
   Reports: Übersicht, Druckmenü an den Akten, Designer
   ========================================================================== */
.letterhead-card { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.letterhead-card__preview { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 0 1 340px; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--signal); border-radius: var(--r-sm); background: #fff; }
.letterhead-card__preview img { max-height: 40px; max-width: 90px; object-fit: contain; }
.letterhead-card__preview b { display: block; font-weight: 800; font-stretch: 80%; font-size: 16px; line-height: 1.15; }
.letterhead-card__preview small { display: block; color: var(--ink-3); font-size: 12px; }
.letterhead-card__text { flex: 1; min-width: 0; }
.letterhead-card__text h3 { margin: 0 0 2px; font-size: 15px; }
.letterhead-card__text p { margin: 0; }

.report-type { margin-bottom: 14px; scroll-margin-top: 84px; }
.report-type__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.report-type__title { margin: 0 0 2px; font-size: 19px; font-weight: 750; font-stretch: 85%; letter-spacing: -.005em; }
.report-type__head p { margin: 0; max-width: 62ch; }
.report-type__where { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12.5px; color: var(--ink-3); }
.report-type__where .icon { width: 15px; height: 15px; }
.report-type__run { display: flex; gap: 8px; flex: none; }
.tpl-list { list-style: none; margin: 0; padding: 0; }
.tpl { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.tpl__name { display: flex; flex-direction: column; min-width: 0; }
.tpl__name b { font-weight: 600; }
.tpl__name small { font-size: 12.5px; color: var(--ink-3); }
.tpl__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tpl__actions form { display: contents; }
.tpl--used .tpl__name b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--go); }
@media (max-width: 760px) {
  .letterhead-card { flex-wrap: wrap; }
  .letterhead-card__preview { flex-basis: 100%; }
  .report-type__head { flex-direction: column; }
  .tpl { grid-template-columns: minmax(0, 1fr) auto; }
  .tpl__actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.logo-field { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.logo-field__img { max-height: 56px; max-width: 160px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-xs); background: #fff; }
.logo-field .input[type=file] { flex: 1 1 260px; min-width: 0; }

/* Druckmenü an Akten */
.report-menu { position: relative; }
.report-menu > summary { list-style: none; cursor: pointer; }
.report-menu > summary::-webkit-details-marker { display: none; }
.report-menu > summary .icon { width: 16px; height: 16px; }
.report-menu__pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 290px; max-height: 70vh; overflow: auto;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2);
}
.report-menu__group + .report-menu__group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.report-menu__title { display: block; padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.report-menu__item, .report-menu__attach {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-xs);
  background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.report-menu__item:hover, .report-menu__attach:hover { background: var(--paper); }
.report-menu__item small { font-size: 11px; color: var(--go); font-weight: 600; }
.report-menu__attach { justify-content: flex-start; color: var(--ink-2); font-size: 13px; }
.report-menu__attach .icon { width: 15px; height: 15px; }
.report-menu form.is-busy .report-menu__attach { opacity: .55; pointer-events: none; }
@media (max-width: 760px) { .report-menu__pop { right: auto; left: 0; width: min(290px, calc(100vw - 32px)); } }

/* Fehlermeldung im Vorschau-Modal */
body.report-error { display: grid; place-items: center; min-height: 100vh; margin: 0; background: #1d2024; color: var(--rail-ink); }
.report-error__box { max-width: 460px; padding: 24px; text-align: center; }
.report-error__box b { display: block; margin-bottom: 8px; font-size: 18px; font-stretch: 112%; }
.report-error__box p { color: var(--rail-mute); font-size: 14px; }

/* --- Designer ------------------------------------------------------------------- */
body.is-designer { overflow: hidden; background: var(--rail); }
.designer { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; grid-template-rows: 58px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.designer__bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 8px; background: var(--rail); color: var(--rail-ink); border-bottom: 1px solid var(--rail-3); }
.designer__back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); color: var(--rail-ink); }
.designer__back:hover { background: var(--rail-2); }
.designer__name { display: flex; flex-direction: column; min-width: 0; flex: 0 1 380px; }
.designer__name small { font-size: 11.5px; color: var(--rail-mute); }
.designer__title { width: 100%; padding: 1px 4px; margin-left: -4px; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent; color: var(--rail-ink); font: 650 16px/1.3 var(--font); font-stretch: 92%; }
.designer__title:hover { border-color: var(--rail-3); }
.designer__title:focus { outline: none; border-color: var(--rail-mute); background: var(--rail-2); }
.designer__history { display: flex; gap: 2px; }
.designer__icon { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: var(--r-xs); background: none; color: var(--rail-ink); font-size: 18px; cursor: pointer; }
.designer__icon--text { font: 600 12px var(--mono); }
.designer__icon:hover { background: var(--rail-2); }
.designer__state { flex: 1; min-width: 0; font-size: 12.5px; color: var(--rail-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.designer__state[data-kind=ok] { color: #7fd1a6; }
.designer__state[data-kind=error] { color: #ff8a7a; white-space: normal; }
.designer__actions { display: flex; align-items: center; gap: 8px; }
.designer__select { height: 32px; max-width: 260px; padding: 0 28px 0 10px; border: 1px solid var(--rail-3); border-radius: var(--r-sm); background: var(--rail-2); color: var(--rail-ink); font: 13px var(--font); }
.btn--ghost-dark { background: transparent; color: var(--rail-ink); border-color: var(--rail-3); }
.btn--ghost-dark:hover { background: var(--rail-2); }

.designer__left, .designer__right { display: flex; flex-direction: column; min-height: 0; background: var(--surface); color: var(--ink); }
.designer__left { border-right: 1px solid var(--line); }
.designer__right { border-left: 1px solid var(--line); }
.designer__tabs { display: flex; flex: none; padding: 0 10px; border-bottom: 1px solid var(--line); }
.designer__tabs button { padding: 13px 10px 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-3); font: 600 13px var(--font); cursor: pointer; }
.designer__tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--signal); }
.designer__panel { flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.designer__panel[hidden] { display: none !important; }
.designer__hint { margin: 0 0 12px; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.designer__hint code, .designer__help code, .designer__form code { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.designer__canvas { position: relative; min-width: 0; min-height: 0; background: #d8d3c7; }
.designer__canvas #gjs { height: 100%; }

.fieldgroup { margin-bottom: 16px; }
.fieldgroup__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.fieldgroup__head b { font-size: 13px; }
.fieldgroup__table { padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 11.5px var(--font); cursor: pointer; }
.fieldgroup__table:hover { border-color: var(--ink); color: var(--ink); }
.fieldgroup--list .designer__hint { margin-bottom: 7px; }
.fieldgroup__list { display: flex; flex-wrap: wrap; gap: 5px; }
.fieldchip { padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--paper); color: var(--ink); font: 12.5px var(--font); cursor: pointer; }
.fieldchip:hover { border-color: var(--ink-3); background: #fff; }
.fieldchip:active { background: var(--ink); color: var(--surface); }
.fieldgroup--list .fieldchip { border-style: dashed; border-color: #9fb4d0; }

.designer__help { margin: 4px 0 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); font-size: 12px; }
.designer__help summary { cursor: pointer; font-weight: 600; }
.designer__help p { margin: 8px 0 0; line-height: 1.45; color: var(--ink-2); }
.designer__form { display: grid; gap: 14px; }
.designer__form label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.designer__form label small { font-weight: 400; color: var(--ink-3); }
.designer__form .check { display: flex; font-weight: 400; }

/* GrapesJS an das Designsystem anpassen */
.designer .gjs-one-bg { background-color: var(--surface); }
.designer .gjs-two-color { color: var(--ink-2); }
.designer .gjs-three-bg { background-color: var(--ink); color: var(--surface); }
.designer .gjs-four-color, .designer .gjs-four-color-h:hover { color: var(--signal); }
.designer .gjs-cv-canvas { width: 100%; height: 100%; top: 0; background: #d8d3c7; }
.designer .gjs-editor { font-family: var(--font); }
.designer .gjs-block-categories, .designer .gjs-blocks-c { background: none; }
.designer .gjs-block-category .gjs-title { padding: 8px 2px; border: 0; background: none; font: 700 12px var(--font); color: var(--ink-3); }
.designer .gjs-block { width: calc(50% - 8px); min-height: 0; margin: 4px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); box-shadow: none; color: var(--ink); font: 600 12.5px var(--font); }
.designer .gjs-block:hover { border-color: var(--ink-3); background: #fff; color: var(--ink); }
.designer .gjs-block-label { font-size: 12.5px; }
.designer .gjs-layer { font: 13px var(--font); color: var(--ink); background: none; }
.designer .gjs-layer.gjs-selected .gjs-layer-item { background: var(--paper-2); }
.designer .gjs-layer-item { border-bottom: 1px solid var(--line); }
.designer .gjs-trt-trait { padding: 6px 0; font-size: 12.5px; }
.designer .gjs-trt-trait .gjs-label-wrp { width: 42%; color: var(--ink-2); font-weight: 600; }
.designer .gjs-field { border: 1px solid var(--line-2); border-radius: var(--r-xs); background: #fff; color: var(--ink); }
.designer .gjs-field input, .designer .gjs-field select { color: var(--ink); font: 12.5px var(--mono); }
.designer .gjs-sm-sector-title, .designer .gjs-clm-tags { background: none; border-color: var(--line); color: var(--ink); font: 600 12.5px var(--font); }
.designer .gjs-sm-properties { border-color: var(--line); }
.designer .gjs-sm-label { color: var(--ink-2); }
.designer .gjs-clm-tag { background: var(--paper-2); color: var(--ink); border-radius: var(--r-xs); }
.designer .gjs-toolbar { background: var(--ink); }
.designer .gjs-badge { background: var(--ink); font: 600 11px var(--font); }
.designer .gjs-selected { outline-color: var(--signal) !important; }
.designer .gjs-rte-toolbar { background: var(--ink); border: 0; border-radius: var(--r-xs); }
.designer .gjs-placeholder { border-color: transparent var(--signal); }
.designer .gjs-placeholder-int { background: var(--signal); }

.designer__dialog .viewer__stage iframe { width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity .2s; }
.designer__dialog .viewer__stage iframe.is-ready { opacity: 1; }
.code-dialog { width: min(980px, 94vw); height: min(86vh, 900px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); }
.code-dialog::backdrop { background: rgba(20, 22, 25, .62); }
.code-dialog[open] { display: flex; }
.code-dialog__inner { display: grid; grid-template-rows: auto minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; width: 100%; padding: 18px; }
.code-dialog__inner header { display: flex; flex-direction: column; gap: 2px; }
.code-dialog__inner header small { color: var(--ink-3); font-size: 12.5px; }
.code-dialog__inner label { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); min-height: 0; }
.code-dialog__inner textarea { width: 100%; height: 100%; resize: none; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; font: 12.5px/1.5 var(--mono); color: var(--ink); }
.code-dialog__inner footer { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 1100px) {
  .designer { grid-template-columns: 250px minmax(0, 1fr) 260px; }
  .designer__select { max-width: 170px; }
}
.dossier__actions { display: flex; flex-wrap: wrap; gap: 8px; border: 0; }
.dossier__actions:hover { background: transparent; }
.dossier__actions .btn--ghost { background: transparent; color: var(--rail-ink); border-color: var(--rail-3); }
.dossier__actions .btn--ghost:hover { background: var(--rail-2); border-color: #4a4e55; }
.designer__small { display: none; }
@media (max-width: 980px) {
  .designer { display: none; }
  .designer__small { display: grid; gap: 10px; place-content: center; justify-items: start; min-height: 100dvh; padding: 24px; color: var(--rail-ink); }
  .designer__small b { font-size: 20px; font-stretch: 105%; }
  .designer__small span { max-width: 40ch; color: var(--rail-mute); }
}

/* Dienstgrad-Laufbahn (neueste oben) */
.field__static { margin: 6px 0 0; font-size: 14px; }
.field__static .link-quiet { margin-left: 8px; font-size: 13px; }
.rank-history { position: relative; list-style: none; margin: 0; padding: 0; }
.rank-history::before { content: ""; position: absolute; left: 21px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.rank-history__item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 30px; align-items: center; gap: 12px; padding: 7px 0; }
.rank-history__item .rank { position: relative; z-index: 1; justify-self: center; background: var(--surface); }
.rank-history__item:not(.is-current):not(.is-future) .rank { border-color: var(--line-2); color: var(--ink-3); }
.rank-history__item.is-current .rank { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.rank-history__item.is-future .rank { border-style: dashed; }
.rank-history__name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.rank-history__item:not(.is-current) .rank-history__name { font-weight: 500; color: var(--ink-2); }
.rank-history__name small { font-weight: 400; font-size: 12px; color: var(--ink-3); }
.rank-history__range { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.rank-history__range small { font-family: var(--font); color: var(--info); font-weight: 600; }
.rank-history__item form { display: contents; }
@media (max-width: 760px) {
  .rank-history__item { grid-template-columns: 44px minmax(0, 1fr) 30px; }
  .rank-history__range { grid-column: 2; grid-row: 2; }
}

/* Einsatz-Kennzeichen */
.flag-row { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 18px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.flag-row legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.flag-row .check span small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.tag--bill { border-color: #b9d3c4; color: var(--go); background: var(--go-soft); font-weight: 700; }
@media (min-width: 1181px) { .ilist__state { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; } }

/* ==========================================================================
   Kostenersatz
   ========================================================================== */
.bill-open, .bill-mini { list-style: none; margin: 0; padding: 0; }
.bill-open li, .bill-mini li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.bill-open li:first-child, .bill-mini li:first-child { border-top: 0; }
.bill-open a, .bill-mini a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.bill-open a small { display: block; font-size: 12.5px; color: var(--ink-3); }
.bill-open a:hover b, .bill-mini a:hover b { text-decoration: underline; }
.bill-mini li > b { min-width: 92px; text-align: right; }
.bill-mini + form { margin-top: 10px; }

.bill-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 20px; padding: 20px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--go); }
.bill-head .page-title { margin: 2px 0 4px; font-size: clamp(26px, 4vw, 38px); letter-spacing: 0; }
.bill-head__incident { margin: 0; color: var(--ink-2); font-size: 14px; }
.bill-head__total { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.bill-head__total b { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.1; }
.bill-head__total small { font-size: 12.5px; color: var(--ink-3); }
.bill-lines { table-layout: fixed; min-width: 620px; }
.bill-lines__kind { width: 104px; } .bill-lines__qty { width: 78px; } .bill-lines__unit { width: 74px; } .bill-lines__price { width: 108px; } .bill-lines__amount { width: 118px; }
.bill-lines th, .bill-lines td { padding-left: 10px; padding-right: 10px; }
.bill-lines th:first-child, .bill-lines td:first-child { padding-left: 22px; }
.bill-lines th:last-child, .bill-lines td:last-child { padding-right: 22px; }
.bill-lines .input--sm { width: 100%; min-width: 0; }
.bill-lines .input--num { text-align: right; }
.bill-lines__auto { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.bill-lines tfoot th { padding-top: 12px; padding-bottom: 12px; border-top: 2px solid var(--ink); font-size: 15px; }
.bill-lines__zero td { background: var(--amber-soft); }
.bill-hint { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 4px; }
.bill-hint p { margin: 0; max-width: 60ch; }
.bill-add__row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) 70px 90px 90px auto; gap: 8px; }
.bill-payer { display: grid; gap: 12px; }
.bill-payer label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bill-payer .btn { justify-self: start; }

.items-form__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 110px 70px; gap: 6px 10px; align-items: center; margin-bottom: 14px; }
.items-form__head { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sr-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.plain { margin: 0; padding-left: 18px; }
.tariff-form { border: 0; padding: 0; margin: 0; min-width: 0; }
.tariff-vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 18px; }
.tariff-vehicle { display: grid; grid-template-columns: minmax(0, 1fr) 100px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tariff-vehicle span small { display: block; font-size: 12px; color: var(--ink-3); }
.tariff-vehicle .input { text-align: right; }
.tariff-vehicle.is-unused b { color: var(--ink-3); font-weight: 500; }
@media (max-width: 760px) {
  .bill-head { flex-direction: column; align-items: flex-start; padding: 18px; }
  .bill-head__total { align-items: flex-start; text-align: left; }
  .bill-add__row { grid-template-columns: 1fr 1fr; }
  .bill-add__row > :nth-child(2) { grid-column: 1 / -1; }
  .items-form__grid { grid-template-columns: minmax(0, 1fr) 70px 80px 40px; }
  .bill-mini li { flex-wrap: wrap; }
}
.flag-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.flag-form .btn { margin-left: auto; }

/* ==========================================================================
   Vergütungen
   ========================================================================== */
.run-form { display: grid; gap: 14px; }
.run-form__presets { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 13px var(--font); cursor: pointer; }
.chip-btn:hover { border-color: var(--ink); color: var(--ink); }
.run-form__fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.run-form__fields label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.run-form p { margin: 0; }
.runs { list-style: none; margin: 0; padding: 0; }
.runs li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.runs li:first-child { border-top: 0; }
.runs a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.runs a small { display: block; font-size: 12.5px; color: var(--ink-3); }
.runs a:hover b { text-decoration: underline; }
.runs__sum { min-width: 110px; text-align: right; }
.bill-head--pay { border-left-color: var(--info); }

.rules { list-style: none; margin: 0; padding: 0; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.rule:first-child { border-top: 0; }
.rule__main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.rule__main small { flex-basis: 100%; font-size: 12.5px; color: var(--ink-3); }
.rule--ended { opacity: .55; }
.rule__edit > summary { list-style: none; cursor: pointer; }
.rule__edit > summary::-webkit-details-marker { display: none; }
.rule__edit[open] { grid-column: 1 / -1; grid-row: 2; }
.rule__edit[open] > summary { display: none; }
.rule-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.rule-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.rule-form label[hidden] { display: none; }
.rule-form__wide { grid-column: span 2; }
.rule-form__actions { grid-column: 1 / -1; }
.rule__edit .rule-form { margin-top: 10px; padding: 14px; border-radius: var(--r-sm); background: var(--paper); }

.pay-table .pay-person__toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pay-table .pay-person__toggle .icon { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s var(--ease); }
.pay-table .pay-person__toggle[aria-expanded=true] .icon { transform: rotate(90deg); }
.pay-person__lines td { padding-top: 0; background: var(--paper); }
.pay-lines { list-style: none; margin: 0; padding: 6px 0 4px 22px; }
.pay-lines li { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto 96px 30px; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line-2); font-size: 13px; }
.pay-lines li:first-child { border-top: 0; }
.pay-lines li > b { text-align: right; }
.pay-lines form { display: contents; }
.pay-table tfoot th { padding-top: 12px; padding-bottom: 12px; border-top: 2px solid var(--ink); font-size: 15px; }
@media (max-width: 760px) {
  .run-form__fields, .rule-form { grid-template-columns: minmax(0, 1fr); }
  .rule-form__wide { grid-column: auto; }
  .rule { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-lines { padding-left: 0; }
  .pay-lines li { grid-template-columns: minmax(0, 1fr) auto 30px; }
  .pay-lines li > span:first-child, .pay-lines li > span:nth-child(3) { display: none; }
}
.table th.table__num { text-align: right; }

/* ==========================================================================
   Schnittstellen: Alamos FE2
   ========================================================================== */
.card__head--inset { padding: 18px 22px 10px; margin: 0; }
.toolbar--inline { margin: 0; padding: 0; background: none; border: 0; }
.fe2-log { list-style: none; margin: 0; padding: 0 22px 8px; }
.fe2-log li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.fe2-log li:first-child { border-top: 0; }
.fe2-log__main { display: grid; grid-template-columns: 118px auto minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.fe2-log__main:hover .fe2-log__msg { text-decoration: underline; }
.fe2-log__time { font-size: 12.5px; color: var(--ink-3); }
.fe2-log__msg { min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe2-log__msg small { margin-left: 8px; font-size: 11.5px; color: var(--ink-3); }
.fe2-log__inc { font-size: 12.5px; }
.fe2-vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.fe2-vehicle { display: grid; grid-template-columns: minmax(0, 1fr) 140px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fe2-vehicles > .btn { grid-column: 1 / -1; justify-self: start; margin-top: 10px; }
.fe2-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 12px; }
.fe2-steps dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 6px 0 0; font-size: 13px; }
.fe2-steps dt { color: var(--ink-3); }
.fe2-steps dd { margin: 0; overflow-wrap: anywhere; }
.fe2-steps dd small { color: var(--ink-3); }
.fe2-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fe2-raw { max-height: 60vh; overflow: auto; margin: 0; padding: 14px; border-radius: var(--r-sm); background: var(--rail); color: var(--rail-ink); font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.link-state-link { color: inherit; text-decoration: none; }
.link-state-link:hover .link-state { text-decoration: underline; }
@media (max-width: 760px) {
  .fe2-log { padding: 0 16px 8px; }
  .fe2-log li { grid-template-columns: minmax(0, 1fr) auto; }
  .fe2-log__main { grid-template-columns: minmax(0, 1fr); gap: 2px; grid-column: 1 / -1; }
  .fe2-log__msg { white-space: normal; }
}

/* Einstellungen */
.settings-form .form-grid { margin: 16px 0 18px; }

/* ---------- Einstellungsbereich: Seitenleiste nach Themen ---------- */
.settings-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 84px; }
.settings-nav__toggle { display: none; }
.settings-nav__groups { display: grid; gap: 18px; }
.settings-nav__group h2 { margin: 0 0 6px 10px; font-size: 12px; font-weight: 650; color: var(--ink-3); letter-spacing: .02em; }
.settings-nav__group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.settings-nav__group a {
  display: block; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: 14px;
  border-left: 3px solid transparent;
}
.settings-nav__group a:hover { background: var(--paper-2); color: var(--ink); }
.settings-nav__group a.is-active { background: var(--surface); color: var(--ink); font-weight: 650; border-left-color: var(--signal); box-shadow: var(--shadow-1); }
.settings-main { min-width: 0; }
/* neben der App-Leiste erst ab 1280 px genug Platz für eine zweite Leiste */
@media (max-width: 1279px) {
  .settings-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { position: static; }
  .settings-nav__toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 14px; border: 1px solid var(--line-2);
    border-radius: var(--r); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; text-align: left;
  }
  .settings-nav__toggle span { display: grid; font-weight: 650; }
  .settings-nav__toggle small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
  .settings-nav__toggle .icon { rotate: 90deg; transition: rotate .15s; }
  .settings-nav__toggle[aria-expanded="true"] .icon { rotate: -90deg; }
  .settings-nav__groups { display: none; margin-top: 10px; padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1);
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .settings-nav.is-open .settings-nav__groups { display: grid; }
}

/* --- Expositionsnachweis (DGUV KoAtEx-Dok) ------------------------------------------- */
.exposure-card .form__title { display: flex; align-items: center; gap: 8px; }
.exposure-card .form__title .icon { color: var(--amber); }
.exposure-card p { margin: 0 0 8px; }
.exposure-head { margin-bottom: 18px; }
.exposure-facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 16px; }
.exposure-facts dt { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.exposure-facts dd { margin: 2px 0 0; font-weight: 600; }
.exposure-head__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.stack-sm { display: grid; gap: 16px; align-content: start; }
.checks { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.checks legend { margin-bottom: 4px; }
.checks .check { align-items: flex-start; }
.checks .input { margin-top: 4px; }
.table--exposure td { vertical-align: top; }
.table--exposure th { white-space: nowrap; }
.exposure-cell { display: flex; flex-wrap: wrap; gap: 6px; max-width: 330px; }
.exposure-cell select { width: 150px; }
.exposure-cell .input--num { width: 72px; }
.exposure-cell .input--no { width: 86px; }
.exposure-cell .input--remark { flex-basis: 100%; }
.table--exposure td:nth-child(2) .exposure-cell { min-width: 228px; }
.table--exposure td:nth-child(3) .exposure-cell { min-width: 270px; }
.table--exposure .input--other { display: none; flex-basis: 100%; }
.table--exposure tr:has(select option[value="sonstiges"]:checked) .input--other { display: block; }
.table__actions { white-space: nowrap; text-align: right; }
.table__actions form { display: inline-block; }
.exposure-add { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toolbar__field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
@media (max-width: 1100px) {
  .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .exposure-head__grid, .form-grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* --- Abteilungen ------------------------------------------------------------------------ */
.terminal-division { margin-top: 6px; }
.terminal-division select { max-width: 240px; }
.catalog-cards { display: grid; gap: 14px; }
.catalog-card { display: grid; gap: 12px; }
.catalog-card--new { border: 1px dashed var(--line-2); box-shadow: none; }
.catalog-card__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px 12px; align-items: end; }
.catalog-card__grid .field + .field { margin-top: 0; }
.catalog-card__grid .input { width: 100%; }
.catalog-card__foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.catalog-card__foot > .muted { margin-right: auto; }

/* --- Vergütung: Varianten je Dienstform ------------------------------------------------------ */
.pay-form .card__head { flex-wrap: wrap; gap: 10px; }
.pay-scheme-new { display: flex; gap: 6px; align-items: center; }
.pay-scheme { padding: 12px 0 4px; border-top: 1px solid var(--line); }
.pay-scheme__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pay-scheme__head > small { margin-right: auto; }
.pay-scheme__edit > summary { list-style: none; cursor: pointer; }
.pay-scheme__edit > summary::-webkit-details-marker { display: none; }
.pay-scheme__edit[open] { flex-basis: 100%; order: 9; }
.pay-scheme__edit[open] > summary { display: none; }
.pay-scheme__edit form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pay-scheme .rules { margin-left: 14px; }
.rule--empty { display: block; }
.table__check { width: 36px; }
.work-new { margin-bottom: 16px; }
.work-new > summary { list-style: none; cursor: pointer; display: inline-flex; }
.work-new > summary::-webkit-details-marker { display: none; }
.work-new[open] > summary { margin-bottom: 16px; }
.work-new__times span { display: flex; gap: 6px; }
.work-bulk { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; }
.tag--form { background: var(--amber-soft); color: #7a5005; }
.pay-person { display: grid; gap: 8px; }
.pay-person__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.pay-person .btn { justify-self: start; }
.work-new:not([open]) { padding: 0; background: none; box-shadow: none; border: 0; }
.catalog-card__multi { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; min-width: 0; }
.catalog-card__multi legend { margin-bottom: 6px; }
.catalog-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 6px 14px; }
.catalog-multi .check { align-items: flex-start; }

/* --- Geräteakte: Zuteilung, Zusatzangaben ------------------------------------------------- */
.assign-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.assign-form select { min-width: 200px; }
.assign-history { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.assign-history li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.assign-history li:first-child { border-top: 0; }
.category-fields { margin-top: 18px; }
.card--alert { box-shadow: inset 4px 0 0 var(--signal), var(--shadow-1); }
.category-field-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

/* --- Änderungsprotokoll in der Akte ---------------------------------------------------- */
.changelog__list { list-style: none; margin: 0; padding: 0; display: grid; }
.changelog__list li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.changelog__list li:first-child { border-top: 0; padding-top: 0; }
.changelog__meta { font-size: 12px; color: var(--ink-3); }
.changelog__line { color: var(--ink-2); overflow-wrap: anywhere; }

/* Kleiderkammer */
.tag--warn { background: var(--amber-soft); color: #7a5005; }
.size-demand { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.size-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.size-grid .field { min-width: 0; margin: 0; }
.size-grid .field label { font-size: 12px; }
.size-grid .input { width: 100%; min-width: 0; }
.holdings { list-style: none; margin: 0; padding: 0; display: grid; }
.holdings li { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.holdings li:first-child { border-top: 0; }
.holdings__group { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.holdings li { flex-wrap: wrap; }
.holdings__back[open] { flex-basis: 100%; }
.holdings__back[open] summary { margin-bottom: 6px; }
.holdings__back .assign-form { display: flex; flex-wrap: wrap; gap: 6px; }
.holdings__back .input[type=number] { width: 72px; }
