/* HFM Betriebssoftware – Gestaltung nach Corporate Identity V1 (November 2026).
   Eine Markenfarbe (hfm-blau), viel Weiss, Haarlinien statt Kästen, gerade Kanten
   (Software höchstens 4 px), Abstände im 4-px-Raster, Bedienelemente min. 40 px hoch. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap;
  src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap;
  src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap;
  src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap;
  src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap;
  src: url("../fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }

:root {
  /* Farben (CI 3) */
  --hfm-blau: #1D5091;
  --hfm-blau-hell: #E7EEF7;
  --stahlgrau: #B9B9B9;
  --ink: #111418;
  --ink-muted: #5A6472;
  --surface: #FFFFFF;
  --surface-alt: #F3F5F8;
  --line: #D7DCE3;
  --status-ok: #1E7A46;
  --status-offen: #9A5B00;
  --status-stop: #B42318;

  /* Schrift (CI 4) */
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-sans: "Barlow", Arial, sans-serif;

  /* Abstände (CI 5) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-md: 4px;
  --control-height: 44px; /* Tablet im Hangar: min. 40 px */
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 22px;
  color: var(--ink);
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--hfm-blau); }
a:hover { text-decoration: none; }

/* --- Titel ------------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; margin: 0 0 var(--space-4); }
h1 { font-size: 36px; line-height: 38px; font-weight: 700; }
h2 { font-size: 26px; line-height: 30px; font-weight: 700; }
h3 { font-size: 18px; line-height: 24px; font-weight: 600; font-family: var(--font-sans); }

/* Akzentbalken über Titeln (4 × 32 px) */
.accent::before {
  content: ""; display: block; width: 32px; height: 4px;
  background: var(--hfm-blau); margin-bottom: var(--space-2);
}

.label {
  font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-muted);
}
.muted { color: var(--ink-muted); }
.small { font-size: 13px; line-height: 18px; }

/* --- Hinweisband Testsystem (status-offen, immer mit Text) ------------------- */
.env-banner {
  background: var(--status-offen); color: #fff; text-align: center;
  font-size: 13px; line-height: 18px; font-weight: 600; padding: var(--space-1) var(--space-4);
}

/* --- Kopfzeile --------------------------------------------------------------- */
.site-header {
  display: flex; align-items: center; gap: var(--space-6);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.site-header__logo img { height: 56px; width: auto; display: block; } /* CI: min. 140 px breit */
.site-nav { display: flex; gap: var(--space-1); flex: 1; flex-wrap: wrap; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: var(--control-height);
  padding: 0 var(--space-4); color: var(--ink); text-decoration: none; font-weight: 500;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--hfm-blau); }
.site-nav a[aria-current="page"] { color: var(--hfm-blau); border-bottom-color: var(--hfm-blau); }
.site-user { display: flex; align-items: center; gap: var(--space-3); }
.site-user form { margin: 0; }

/* --- Inhalt ------------------------------------------------------------------ */
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--space-8) var(--space-6); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  margin-bottom: var(--space-6); flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.section { padding: var(--space-6) 0; border-top: 1px solid var(--line); }
.panel { background: var(--surface-alt); padding: var(--space-6); border-radius: var(--radius-md); }
.grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.site-footer {
  border-top: 1px solid var(--line); color: var(--ink-muted);
  font-size: 13px; line-height: 18px; padding: var(--space-4) var(--space-6);
}

/* --- Schaltflächen ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height); padding: 0 var(--space-6);
  font: 600 1rem/1 var(--font-sans); text-decoration: none; cursor: pointer;
  border-radius: var(--radius-md); border: 1px solid var(--hfm-blau);
  background: var(--hfm-blau); color: #fff;
}
.btn:hover { background: #163f73; border-color: #163f73; }
.btn:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--hfm-blau-hell); outline-offset: 1px;
}
.btn--secondary { background: var(--surface); color: var(--hfm-blau); }
.btn--secondary:hover { background: var(--hfm-blau-hell); color: var(--hfm-blau); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--surface-alt); border-color: transparent; }
.btn--danger { background: var(--status-stop); border-color: var(--status-stop); }
.btn-row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* --- Status-Chips: Farbe immer mit Wort (CI 3) -------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px var(--space-2); border-radius: var(--radius-md);
  font-size: 13px; line-height: 18px; font-weight: 600;
  border: 1px solid currentColor; background: var(--surface); white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip--ok { color: var(--status-ok); }
.chip--offen { color: var(--status-offen); }
.chip--stop { color: var(--status-stop); }
.chip--neutral { color: var(--ink-muted); }
.tag { display: inline-block; padding: 0 6px; margin: 0 4px 4px 0; border-radius: var(--radius-md);
  background: var(--hfm-blau-hell); color: var(--hfm-blau); font-size: 13px; font-weight: 600; }

/* --- Tabellen ---------------------------------------------------------------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 500; padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--ink); }
table.list td { padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:hover td { background: var(--surface-alt); }
.table-wrap { overflow-x: auto; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-6); margin: 0; }
dl.facts dt { color: var(--ink-muted); }
dl.facts dd { margin: 0; }

/* --- Formulare --------------------------------------------------------------- */
.form { max-width: 640px; }
.field { margin-bottom: var(--space-4); }
.field > label { display: block; font-weight: 600; margin-bottom: var(--space-1); }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; min-height: var(--control-height); padding: var(--space-2) var(--space-3);
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md);
}
.field textarea { min-height: 72px; }
.field .help { font-size: 13px; color: var(--ink-muted); margin-top: var(--space-1); }
.field .errors { color: var(--status-stop); font-size: 13px; margin: var(--space-1) 0 0; padding: 0; list-style: none; }
.field--checkbox label { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-height); font-weight: 600; }
.field ul.checkboxes, .field div.checkboxes { list-style: none; margin: 0; padding: 0; }
.field .checkboxes label { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-height); font-weight: 400; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--hfm-blau); }

/* --- Meldungen --------------------------------------------------------------- */
.messages { list-style: none; padding: 0; margin: 0 0 var(--space-6); }
.message { padding: var(--space-3) var(--space-4); border-left: 4px solid var(--hfm-blau);
  background: var(--hfm-blau-hell); margin-bottom: var(--space-2); }
.message--success { border-color: var(--status-ok); background: #E9F4EE; }
.message--warning { border-color: var(--status-offen); background: #FBF2E4; }
.message--error { border-color: var(--status-stop); background: #FBEAE8; }

/* --- Verlauf ----------------------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.timeline .meta { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.timeline .reason { margin: var(--space-2) 0 0; }
.diff { width: 100%; border-collapse: collapse; margin-top: var(--space-2); font-size: 13px; }
.diff td, .diff th { padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--line); text-align: left; }
.diff .old { color: var(--status-stop); text-decoration: line-through; }
.diff .new { color: var(--status-ok); }

/* --- Anmeldung --------------------------------------------------------------- */
.login { max-width: 400px; margin: var(--space-12) auto; }
.login__logo { width: 220px; height: auto; margin-bottom: var(--space-8); }

@media (max-width: 640px) {
  main { padding: var(--space-6) var(--space-4); }
  h1 { font-size: 28px; line-height: 32px; }
}

/* Unterschriftsbild (Vorschau) */
.signature-preview { max-height: 64px; max-width: 240px; display: block; margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--line); }

/* Filterleiste über Listen */
.filter-bar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-4); }
.filter-bar input[type=search], .filter-bar input[type=date] { min-height: var(--control-height); padding: 0 var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-md); font: inherit; }
.tree { list-style: none; margin: 0; padding-left: 0; }
.tree .tree { padding-left: var(--space-6); border-left: 1px solid var(--line); margin-left: var(--space-2); }
.tree li { padding: var(--space-2) 0; }
.unknown { color: var(--status-offen); font-weight: 600; }
table.matrix th, table.matrix td { text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; }
