/* =========================================================================
   ARGUS – Designsystem (Farbwelt Nachtblau)
   Grundlage: docs/design/ARGUS_Design-Uebergabe/referenz/argus.css
   Aufbau dieser Datei:
     1. Schriften (selbst gehostet, keine Verbindung zu Google – DSGVO)
     2. Designsystem aus der Referenz (Tokens, Komponenten, Responsive)
     3. Ergänzungen für ARGUS (Formulare, Meldungen, Dialog, Suche, …)
   Farben nur über die Variablen in :root setzen, keine festen Farbwerte.
   ========================================================================= */

/* ---------- 1. Schriften ---------- */
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/unbounded-latin-700-normal.woff2") format("woff2");
}

/* ---------- 2. Designsystem aus der Referenz ---------- */
:root {
  /* Marke */
  --argus-nachtblau: #16283A;
  --argus-nachtblau-linie: #2C4258;
  --argus-nachtblau-text: #C9D3DD;
  --argus-ofenglut: #F2A33A;
  --argus-ofenglut-hover: #E8952A;
  --argus-link: #1E4D78;
  --argus-tint: #E6ECF2;

  /* Flächen und Linien */
  --bg: #F6F3EE;
  --surface: #FFFFFF;
  --surface-muted: #FAF8F4;
  --surface-sunken: #F1EEE8;
  --border: #E6E1D8;
  --border-strong: #CFC7BA;
  --border-input: #D9D3C9;
  --border-dashed: #C9C1B4;
  --divider: #EFEAE2;

  /* Text */
  --text: #1B2430;
  --text-muted: #5B6672;
  --icon: #3E4A57;

  /* Status */
  --status-offen-bg: #E3EEF9;       --status-offen-fg: #1D4E80;
  --status-bearbeitung-bg: #FDF0D9; --status-bearbeitung-fg: #8A5300;
  --status-geloest-bg: #E2F2E6;     --status-geloest-fg: #23673A;

  /* Priorität */
  --prio-kritisch: #C8372D; --prio-kritisch-text: #A12B22; --prio-kritisch-zeile: #FFF7F5;
  --prio-hoch: #E07B1F;     --prio-hoch-text: #9A4A00;
  --prio-mittel: #D9A21B;
  --prio-niedrig: #9AA4AE;

  /* Hinweise */
  --warn-bg: #FFF8EC; --warn-border: #F0D8AE; --warn-text: #8A5300; --warn-label: #6B4A12;
  --danger: #B3261E;

  /* Form */
  --radius-s: 8px;
  --radius-m: 10px;
  --radius-l: 12px;
  --tap: 44px;

  /* Schrift */
  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-wortmarke: "Unbounded", "Arial Black", sans-serif;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--argus-link); }
a:hover { color: var(--argus-nachtblau); }
:focus-visible { outline: 3px solid var(--argus-link); outline-offset: 2px; }
.kopf :focus-visible { outline-color: var(--argus-ofenglut); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 19px; line-height: 1.3; }
.zahl { font-variant-numeric: tabular-nums; }
.gedaempft { color: var(--text-muted); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 18px; height: 18px; flex-shrink: 0; }

.container { max-width: 1280px; margin: 0 auto; padding-inline: 24px; }
.seite { padding-top: 32px; padding-bottom: 16px; }
.seitenkopf { margin-bottom: 24px; }
.seitenkopf p { margin: 6px 0 0; color: var(--text-muted); }

/* ---------- Kopfzeile ---------- */
.kopf { background: var(--argus-nachtblau); color: #FFFFFF; }
.kopf__inner { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.marke { display: flex; align-items: center; gap: 16px; }
.marke__link { display: flex; align-items: center; gap: 10px; min-height: var(--tap); color: #FFFFFF; text-decoration: none; }
.marke__link:hover { color: #FFFFFF; }
.marke__text { display: flex; flex-direction: column; gap: 2px; }
.marke__wort { font-family: var(--font-wortmarke); font-weight: 700; font-size: 19px; letter-spacing: 0.04em; line-height: 1; }
.marke__zeile { font-size: 11px; line-height: 1.2; color: var(--argus-nachtblau-text); }
.marke__trenner { width: 1px; height: 28px; background: var(--argus-nachtblau-linie); }
.marke__firma { display: block; height: 32px; width: auto; } /* nicht höher als die ARGUS-Marke (34 px) */
/* Mehr Luft zwischen Firmenlogo und Navigation (doppelter Abstand) */
@media (min-width: 1024px) { .marke { margin-right: 28px; } }
.hauptnav__firma { display: none; }

.hauptnav { display: flex; align-items: center; gap: 22px; flex: 1; }
.hauptnav > a,
.hauptnav summary {
  display: flex; align-items: center; gap: 4px; min-height: 64px;
  padding-top: 3px; border-bottom: 3px solid transparent;
  color: var(--argus-nachtblau-text); text-decoration: none; cursor: pointer; list-style: none;
}
.hauptnav summary::-webkit-details-marker { display: none; }
.hauptnav > a:hover, .hauptnav summary:hover { color: #FFFFFF; }
.hauptnav [aria-current="page"] { color: #FFFFFF; font-weight: 600; border-bottom-color: var(--argus-ofenglut); }

.ausklapp { position: relative; }
.ausklapp > summary { list-style: none; }
.ausklapp > summary::-webkit-details-marker { display: none; }
.ausklapp__liste {
  position: absolute; top: calc(100% - 4px); left: -12px; z-index: 20; min-width: 200px;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgba(22, 40, 58, 0.14);
}
.ausklapp__liste a {
  display: flex; align-items: center; min-height: var(--tap); padding: 0 12px;
  border-radius: var(--radius-s); color: var(--text); text-decoration: none;
}
.ausklapp__liste a:hover { background: var(--surface-muted); }
.ausklapp--rechts .ausklapp__liste { left: auto; right: 0; }

.kopf__aktionen { display: flex; align-items: center; gap: 12px; }
.konto summary {
  display: flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 4px;
  color: var(--argus-nachtblau-text); cursor: pointer; list-style: none;
}
.konto summary::-webkit-details-marker { display: none; }
.konto__kreis {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--argus-nachtblau-linie); color: #FFFFFF; font-size: 13px; font-weight: 600;
}
.menu-knopf {
  display: none; width: var(--tap); height: var(--tap); align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-m); background: transparent; color: #FFFFFF; cursor: pointer;
}

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-m);
  font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn--akzent { background: var(--argus-ofenglut); color: var(--argus-nachtblau); }
.btn--akzent:hover { background: var(--argus-ofenglut-hover); color: var(--argus-nachtblau); }
.btn--primaer { background: var(--argus-nachtblau); color: #FFFFFF; }
.btn--primaer:hover { background: #0F1E2C; color: #FFFFFF; }
.btn--sekundaer { background: var(--surface); border-color: var(--border-strong); color: var(--argus-nachtblau); }
.btn--sekundaer:hover { background: var(--surface-muted); color: var(--argus-nachtblau); }
.btn--klein { padding: 0 14px; font-size: 14px; }
.btn-icon {
  width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-m);
  background: var(--surface); color: var(--icon); cursor: pointer;
}
.btn-icon:hover { background: var(--surface-muted); }
.btn-icon--still { border-color: transparent; background: transparent; }

/* ---------- Karten, Pills, Chips ---------- */
.karte { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 24px; }
.karte__kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 16px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill--offen { background: var(--status-offen-bg); color: var(--status-offen-fg); }
.pill--bearbeitung { background: var(--status-bearbeitung-bg); color: var(--status-bearbeitung-fg); }
.pill--geloest, .pill--aktiv { background: var(--status-geloest-bg); color: var(--status-geloest-fg); }

.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #EEF1F4; color: var(--icon); font-size: 12px; font-weight: 600; }

.prio { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.prio::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.prio--kritisch { color: var(--prio-kritisch-text); }
.prio--kritisch::before { background: var(--prio-kritisch); }
.prio--hoch { color: var(--prio-hoch-text); }
.prio--hoch::before { background: var(--prio-hoch); }
.prio--mittel::before { background: var(--prio-mittel); }
.prio--niedrig::before { background: var(--prio-niedrig); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--argus-tint); color: var(--argus-nachtblau); font-size: 12px; font-weight: 600;
}
.person { display: flex; align-items: center; gap: 10px; }

.leer { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--radius-m); background: var(--surface-muted); }
.leer__icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--argus-tint); color: var(--argus-nachtblau);
}
.leer p { margin: 4px 0 0; color: var(--text-muted); max-width: 60ch; }

/* ---------- Ticket-Übersicht ---------- */
.kennzahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kennzahl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-l);
  background: var(--surface); font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.kennzahl[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--argus-nachtblau); }
.kennzahl__wert { font-size: 32px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.kennzahl__label { font-size: 14px; color: var(--text-muted); }
.kennzahl--kritisch .kennzahl__wert { color: var(--danger); }

.filterleiste { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding: 16px 20px; }
.suchfeld { position: relative; }
.suchfeld .icon { position: absolute; left: 13px; top: 13px; color: var(--text-muted); }
.feld, .suchfeld input, .filter select {
  height: var(--tap); border: 1px solid var(--border-input); border-radius: var(--radius-s);
  background: var(--surface); font: inherit; color: var(--text);
}
.suchfeld input { width: 100%; padding: 0 14px 0 42px; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter select { padding: 0 12px; font-size: 14px; }
.filter__nur-aktiv { display: flex; align-items: center; gap: 8px; min-height: var(--tap); margin-left: auto; font-size: 14px; cursor: pointer; }
.filter__nur-aktiv input { width: 18px; height: 18px; margin: 0; accent-color: var(--argus-nachtblau); }

.tabelle-karte { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; }
.tabelle-scroll { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
  padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-muted); border-bottom: 1px solid var(--divider); white-space: nowrap;
}
.tabelle td { padding: 14px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tr.ist-kritisch { background: var(--prio-kritisch-zeile); }
.ticket-titel { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.unterzeile { display: block; font-size: 13px; color: var(--text-muted); }
.nr-mobil { display: none; }
.tabelle-leer { padding: 48px 20px; text-align: center; color: var(--text-muted); }

/* ---------- Gerätedetail ---------- */
.pfad { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; color: var(--text-muted); }
.pfad a { font-weight: 500; }

.geraet-kopf { display: flex; flex-wrap: wrap; align-items: stretch; gap: 20px 28px; padding: 20px; margin-bottom: 16px; }
.geraet-kopf__foto { flex: 1 1 240px; max-width: 320px; }
.geraet-kopf__info { flex: 999 1 360px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.titelzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; font-size: 14px; color: var(--text-muted); }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.titelbild {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--radius-m); background: var(--surface-sunken); cursor: pointer;
}
.titelbild img { display: block; width: 100%; height: 100%; object-fit: cover; }
.titelbild__anzahl {
  position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px;
  background: rgba(22, 40, 58, 0.88); color: #FFFFFF; font-size: 12px; font-weight: 600;
}
.titelbild--leer {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--border-dashed); background: var(--surface-muted);
  color: var(--text-muted); font: inherit; font-weight: 600;
}
.titelbild--leer small { font-size: 13px; font-weight: 400; }
/* Nur für die Referenz: Platzhalter statt echtem Foto */
.platzhalter-foto {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background-color: #E7E1D7;
  background-image: repeating-linear-gradient(45deg, rgba(22, 40, 58, 0.05) 0 10px, transparent 10px 20px);
  color: #4A5560; font-size: 13px;
}

.fakten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.fakt { padding: 18px 20px; }
.fakt__label { font-size: 14px; color: var(--text-muted); }
.fakt__wert { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 22px; font-weight: 600; }
.fakt__zusatz { font-size: 14px; color: var(--text-muted); }
.fakt--warnung { background: var(--warn-bg); border-color: var(--warn-border); }
.fakt--warnung .fakt__label { color: var(--warn-label); }
.fakt--warnung .fakt__wert { color: var(--warn-text); }
.fakt--warnung a { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 500; color: #7A4A00; }

.spalten { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; margin-bottom: 16px; }
.spalte { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.medien { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.medium { position: relative; display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
.medium:hover { color: var(--text); }
.medium__vorschau {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-s);
  background: var(--surface-sunken); color: var(--argus-nachtblau);
}
.medium__vorschau img { width: 100%; height: 100%; object-fit: cover; }
.medium__badge {
  position: absolute; left: 6px; top: 6px; padding: 2px 6px; border-radius: 5px;
  background: #FFFFFF; color: var(--argus-nachtblau); font-size: 11px; font-weight: 600;
}
.medium__name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.medium__meta { font-size: 13px; color: var(--text-muted); }
.medium--upload { cursor: pointer; }
.medium--upload .medium__vorschau {
  flex-direction: column; gap: 4px; border: 1.5px dashed var(--border-dashed);
  background: var(--surface-muted); color: var(--text-muted);
}
.medium--upload .medium__aufruf { font-size: 14px; font-weight: 600; color: var(--argus-link); }
.medium--upload.ist-drueber .medium__vorschau { border-color: var(--argus-nachtblau); background: var(--argus-tint); }

.stammdaten { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: 14px; }
.stammdaten dt { color: var(--text-muted); }
.stammdaten dd { margin: 0; }

.historie { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.eintrag { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
.eintrag__icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--argus-tint); color: var(--argus-nachtblau);
}
.eintrag__inhalt { min-width: 0; max-width: 72ch; }
.eintrag__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.eintrag__inhalt p { margin: 4px 0 10px; }
.anhang {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-s); font-size: 14px; text-decoration: none;
}
.anhang span { overflow-wrap: anywhere; }
.eintrag__fuss { margin-top: 8px; font-size: 13px; color: var(--text-muted); }

/* ---------- Fußzeile ---------- */
.fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 40px; font-size: 14px; color: var(--text-muted); }
.fuss a { font-weight: 500; }
.fuss__firma { display: none; height: 40px; width: auto; }

/* =========================================================================
   Responsive
   Tablet: 768–1023 px, Handy: bis 767 px
   ========================================================================= */
@media (max-width: 1023px) {
  .kopf__inner { gap: 20px; }
  .marke__trenner, .marke__firma { display: none; }
  .fuss__firma { display: block; flex-basis: 100%; max-width: max-content; }
  .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabelle { min-width: 960px; }
  .spalten { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .container { padding-inline: 16px; }
  .seite { padding-top: 20px; }
  .fuss { padding-bottom: 96px; } /* Platz für den schwebenden Knopf, er verdeckt sonst das Logo */
  h1 { font-size: 26px; }

  /* Kopfzeile: Menü-Knopf statt Navigation, „Neues Ticket“ schwebt unten rechts */
  .kopf__inner { flex-wrap: wrap; gap: 0 8px; min-height: 60px; }
  .marke { order: 1; flex: 1; }
  .kopf__aktionen { order: 2; }
  .menu-knopf { display: inline-flex; order: 3; }
  .hauptnav {
    order: 4; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding-bottom: 8px; border-top: 1px solid var(--argus-nachtblau-linie);
  }
  .hauptnav.ist-offen { display: flex; }
  .hauptnav > a, .hauptnav summary {
    min-height: 48px; padding: 0 12px; border-bottom: 0; border-left: 3px solid transparent;
  }
  .hauptnav [aria-current="page"] { border-left-color: var(--argus-ofenglut); }
  .hauptnav__firma {
    display: block; align-self: stretch; box-sizing: content-box; height: 30px; width: auto;
    margin: 8px 0 4px; padding: 16px 15px 8px; border-top: 1px solid var(--argus-nachtblau-linie);
    object-fit: contain; object-position: left center;
  }
  .hauptnav .ausklapp__liste { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 4px 12px; }
  .hauptnav .ausklapp__liste a { color: var(--argus-nachtblau-text); }
  .hauptnav .ausklapp__liste a:hover { background: var(--argus-nachtblau-linie); color: #FFFFFF; }
  .btn-neu {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30;
    min-height: 52px; padding: 0 20px; box-shadow: 0 6px 20px rgba(22, 40, 58, 0.28);
  }

  /* Ticket-Übersicht */
  .kennzahl { padding: 14px 16px; }
  .kennzahl__wert { font-size: 26px; }
  .filterleiste { padding: 12px; }
  .filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter select { width: 100%; }
  .filter__nur-aktiv { grid-column: 1 / -1; margin-left: 0; }

  /* Tabelle wird zur Kartenliste */
  .tabelle { min-width: 0; }
  .tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabelle, .tabelle tbody { display: block; }
  .tabelle tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px;
    grid-template-areas: "ticket status" "filiale filiale" "prio erstellt" "person person";
    padding: 14px 16px; border-bottom: 1px solid var(--divider);
  }
  .tabelle tbody tr:last-child { border-bottom: 0; }
  .tabelle td { display: block; padding: 0; border: 0; }
  .tabelle .s-nr { display: none; }
  .tabelle .s-ticket { grid-area: ticket; }
  .tabelle .s-status { grid-area: status; text-align: right; }
  .tabelle .s-filiale { grid-area: filiale; font-size: 14px; color: var(--text-muted); }
  .tabelle .s-prio { grid-area: prio; }
  .tabelle .s-erstellt { grid-area: erstellt; text-align: right; }
  .tabelle .s-person { grid-area: person; }
  .nr-mobil { display: inline; color: var(--text-muted); font-weight: 500; }

  /* Gerätedetail */
  .geraet-kopf { padding: 16px; }
  .geraet-kopf__foto { max-width: none; flex-basis: 100%; }
  .aktionen .btn { flex: 1 1 auto; }
  .fakten { grid-template-columns: minmax(0, 1fr); }
  .karte { padding: 18px; }
  .medien { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* =========================================================================
   3. Ergänzungen für ARGUS
   Komponenten, die die Referenz nicht zeigt, im selben Stil.
   ========================================================================= */
:root {
  --erfolg-bg: #E2F2E6; --erfolg-border: #BFE0C8; --erfolg-text: #23673A;
  --fehler-bg: #FCEBEA; --fehler-border: #F2C4C0; --fehler-text: #8E2019;
  --schatten-karte: 0 8px 24px rgba(22, 40, 58, 0.14);
}

/* Kontomenü: Name und Rolle als Kopf, Trennlinie zwischen Gruppen */
.konto__kopf { padding: 8px 12px 10px; border-bottom: 1px solid var(--divider); margin-bottom: 4px; }
.konto__kopf strong { display: block; color: var(--text); }
.konto__kopf span { font-size: 13px; color: var(--text-muted); }
.ausklapp__trenner { height: 1px; margin: 4px 6px; background: var(--divider); }
.ausklapp__liste .ist-gefahr { color: var(--danger); }
.ausklapp__liste button {
  display: flex; align-items: center; width: 100%; min-height: var(--tap); padding: 0 12px;
  border: 0; border-radius: var(--radius-s); background: transparent;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.ausklapp__liste button:hover { background: var(--surface-muted); }
.ausklapp__liste li > form { margin: 0; }

/* Meldungen nach Aktionen (Flask-Flash) */
.meldungen { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.meldung {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
  border: 1px solid; border-radius: var(--radius-m); font-weight: 500;
}
.meldung .icon { margin-top: 1px; }
.meldung a { color: inherit; font-weight: 600; }
.meldung--erfolg { background: var(--erfolg-bg); border-color: var(--erfolg-border); color: var(--erfolg-text); }
.meldung--fehler { background: var(--fehler-bg); border-color: var(--fehler-border); color: var(--fehler-text); }
.meldung--warnung { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }

/* Formulare */
form { margin: 0; }
.form-group { margin-bottom: 18px; }
.form-group > label:not(.datei-feld), .feld-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-group select, .form-group textarea, .feld {
  width: 100%; min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--border-input); border-radius: var(--radius-s);
  background: var(--surface); font: inherit; color: var(--text);
}
.form-group textarea { min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .feld:focus {
  outline: 3px solid var(--argus-link); outline-offset: 0; border-color: var(--argus-link);
}
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: 18px; height: 18px; accent-color: var(--argus-nachtblau); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.hint { margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.formular-aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Suche mit Live-Vorschlägen (Feld liegt in .suchfeld, siehe Referenz) */
.suchzeile { display: flex; gap: 10px; width: 100%; }
.suche-wrap { position: relative; flex: 1; min-width: 0; }
.suche-eingabe {
  width: 100%; height: var(--tap); padding: 0 14px 0 42px;
  border: 1px solid var(--border-input); border-radius: var(--radius-s);
  background: var(--surface); font: inherit; color: var(--text);
}
.suche-wrap > .icon { position: absolute; left: 13px; top: 13px; color: var(--text-muted); pointer-events: none; }
.vorschlag-liste {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); box-shadow: var(--schatten-karte);
}
.vorschlag-liste.offen { display: block; }
.vorschlag-liste a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--divider); color: var(--text); text-decoration: none; }
.vorschlag-liste a:last-child { border-bottom: 0; }
.vorschlag-liste a.aktiv, .vorschlag-liste a:hover { background: var(--surface-muted); }
.vorschlag-liste .v-titel { font-weight: 600; color: var(--argus-link); }
.vorschlag-liste .v-info { margin-top: 2px; font-size: 13px; color: var(--text-muted); }
.vorschlag-liste mark { background: #FDF0D9; color: inherit; border-radius: 2px; }
.vorschlag-leer { padding: 10px 14px; font-size: 14px; color: var(--text-muted); }

/* Bestätigungsdialog für Löschen u. ä. */
.dialog {
  width: min(440px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border);
  border-radius: var(--radius-l); background: var(--surface); color: var(--text); box-shadow: var(--schatten-karte);
}
.dialog::backdrop { background: rgba(22, 40, 58, 0.45); }
.dialog h2 { margin-bottom: 8px; }
.dialog p { margin: 0 0 20px; color: var(--text-muted); }
.dialog__aktionen { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.btn--gefahr { background: var(--danger); color: #FFFFFF; }
.btn--gefahr:hover { background: #921F18; color: #FFFFFF; }

/* Anmeldeseite */
.login-box { max-width: 400px; margin: 48px auto; }
.login-box__logo { display: block; width: 100%; max-width: 260px; height: auto; margin: 8px auto 28px; }

/* Ticket-Übersicht: Kennzahlen sind Links (Filter bleibt in der Adresse, auch beim Blättern) */
a.kennzahl { text-decoration: none; }
a.kennzahl:hover { border-color: var(--border-strong); color: var(--text); }
.kennzahl[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--argus-nachtblau); }
.pill--geschlossen { background: #EEF1F4; color: var(--icon); }
.filterleiste form { display: flex; flex-direction: column; gap: 12px; }
.filter__hinweis { margin: 0; font-size: 14px; color: var(--text-muted); }
.tabelle th .sortlink { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; color: inherit; text-decoration: none; }
.tabelle th .sortlink:hover { color: var(--argus-nachtblau); text-decoration: underline; }
.tabelle-leer-zustand { padding: 20px; }
.seiten { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.seiten__nr, .seiten__aktuell {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); height: var(--tap);
  border-radius: var(--radius-m); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
}
.seiten__nr:hover { background: var(--surface); }
.seiten__aktuell { background: var(--argus-nachtblau); color: #FFFFFF; }
.seiten__gesamt { margin-left: auto; font-size: 14px; color: var(--text-muted); }

/* Gerätedetail */
.pill--defekt { background: var(--fehler-bg); color: var(--prio-kritisch-text); }
.aktionen form { display: contents; }
.titelbild--leer { text-align: center; }
.medium-kachel { position: relative; min-width: 0; }
.medium__menue { position: absolute; top: 6px; right: 6px; }
.medium__menue > summary { background: rgba(255, 255, 255, 0.92); }
/* Link „Prüfaufgabe anlegen“ in der Hinweis-Kachel: Klickfläche mind. 44 px hoch */
.fakt--warnung a { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: 0; }
.medium__menue .ausklapp__liste { top: calc(100% + 4px); min-width: 220px; }
[data-ablage].ist-drueber .medium__vorschau,
.titelbild--leer.ist-drueber, .datei-feld.ist-drueber { border-color: var(--argus-nachtblau); background: var(--argus-tint); }
.zeilenliste { list-style: none; margin: 0; padding: 0; }
.zeilenliste__eintrag {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 12px 0; border-bottom: 1px solid var(--divider);
}
.zeilenliste__eintrag:first-child { padding-top: 0; }
.zeilenliste__eintrag:last-child { border-bottom: 0; padding-bottom: 0; }
.zeilenliste__titel { font-weight: 600; text-decoration: none; }
.zeilenliste__rechts { display: flex; align-items: center; gap: 12px; }
.einblendung { margin-bottom: 24px; padding: 20px; border-radius: var(--radius-m); background: var(--surface-muted); }
.datei-feld {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 14px;
  border: 1.5px dashed var(--border-dashed); border-radius: var(--radius-s);
  background: var(--surface); color: var(--argus-link); font-weight: 500; cursor: pointer;
}
.datei-feld:focus-within { outline: 3px solid var(--argus-link); outline-offset: 2px; }
.anhaenge { display: flex; flex-wrap: wrap; gap: 8px; }
.eintrag__fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.link-knopf {
  min-height: 32px; padding: 0; border: 0; background: none; font: inherit; color: var(--text-muted);
  text-decoration: underline; cursor: pointer;
}
.link-knopf:hover { color: var(--danger); }
.ist-laedt { opacity: 0.6; pointer-events: none; }

/* Schmales Tablet (768–900 px): In der Referenz ist die Kopfzeile hier ~11 px zu
   breit (die Seite ließe sich seitlich verschieben), daher etwas engere Abstände. */
@media (min-width: 768px) and (max-width: 900px) {
  .kopf__inner { gap: 14px; }
  .hauptnav { gap: 16px; }
  .kopf__aktionen { gap: 8px; }
  .btn-neu { padding: 0 14px; }
}

/* Fußzeile: Firmenlogo nur unter 1024 px (Regel in der Referenz) */
.fuss__version { margin-left: auto; }

/* Weitere Formularbausteine */
.sortpfeil { color: var(--argus-link); }
.checkbox-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.checkbox-liste label { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 12px; border-radius: var(--radius-s); background: var(--surface-muted); font-weight: 400; cursor: pointer; }
.role-desc { margin-top: 6px; padding: 8px 12px; border-radius: var(--radius-s); background: var(--surface-muted); font-size: 13px; color: var(--text-muted); }
@media (max-width: 767px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .fuss__version { margin-left: 0; }
}

/* Ticket-Detail */
.ticket-kopf { margin-bottom: 16px; }
.fliesstext { margin: 0; white-space: pre-line; overflow-wrap: anywhere; max-width: 72ch; }
.meta__geraet { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.eintrag__avatar { width: 36px; height: 36px; }
.protokoll { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.protokoll li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.protokoll li:last-child { border-bottom: 0; }
.protokoll__zeit { color: var(--text-muted); }
.schnellwahl { margin-bottom: 16px; }
.schnellwahl__zeile { display: flex; gap: 8px; }
.schnellwahl__zeile select { flex: 1 1 auto; min-width: 0; min-height: 44px; }
@media (max-width: 767px) {
  .protokoll li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Formularseiten */
.formular-karte { max-width: 760px; }
.feld-optional { font-weight: 400; color: var(--text-muted); }
.geraet-info { margin-top: 8px; padding: 10px 14px; background: var(--surface-muted); border-left: 3px solid var(--argus-nachtblau); border-radius: var(--radius-s); font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.geraet-info strong { color: var(--text); font-weight: 500; }
.foto-reihe { display: flex; flex-wrap: wrap; gap: 8px; }
.foto-reihe img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--border); }

/* Listen- und Verwaltungsseiten */
.seitenkopf--aktion { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.tabelle th.rechts, .tabelle td.rechts { text-align: right; }
.tabelle .umbruch { overflow-wrap: anywhere; }
.zeile-aktionen { white-space: nowrap; text-align: right; }
.zeile-aktionen > * { vertical-align: middle; }
.zeile-aktionen .ausklapp { display: inline-block; margin-left: 4px; text-align: left; }
.stapel-kopf > a { display: inline-flex; align-items: center; min-height: var(--tap); }
.text-warnung { color: var(--warn-text); font-weight: 500; }
.haken-feld { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 600; cursor: pointer; }
.raster-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.balkenliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.balkenliste li { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 3em; align-items: center; gap: 12px; }
.balkenliste__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balkenliste__balken { height: 10px; border-radius: 5px; background: var(--surface-sunken); overflow: hidden; }
.balkenliste__balken > span { display: block; height: 100%; border-radius: 5px; background: var(--argus-nachtblau); }
.balkenliste__balken > .balken--kritisch { background: var(--prio-kritisch); }
.balkenliste__balken > .balken--hoch { background: var(--prio-hoch); }
.balkenliste__balken > .balken--mittel { background: var(--prio-mittel); }
.balkenliste__balken > .balken--niedrig { background: var(--prio-niedrig); }
.balkenliste__wert { text-align: right; font-weight: 600; }
@media (max-width: 1023px) {
  .raster-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  /* Verwaltungstabellen als gestapelte Karten */
  .tabelle--stapel thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabelle--stapel, .tabelle--stapel tbody, .tabelle--stapel tr, .tabelle--stapel td { display: block; }
  .tabelle--stapel tr { padding: 14px 16px; border-bottom: 1px solid var(--divider); }
  .tabelle--stapel tbody tr:last-child { border-bottom: 0; }
  .tabelle--stapel td { padding: 4px 0; border: 0; text-align: left; }
  .tabelle--stapel td.rechts { text-align: left; }
  .tabelle--stapel td[data-label] { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 8px; font-size: 14px; }
  .tabelle--stapel td[data-label]::before { content: attr(data-label); color: var(--text-muted); }
  .tabelle--stapel td[data-label] > * { grid-column: 2; justify-self: start; }
  .tabelle--stapel td.stapel-kopf { padding-bottom: 8px; }
  .tabelle--stapel .zeile-aktionen { padding-top: 10px; text-align: left; }
}
@media (max-width: 767px) {
  .balkenliste li { grid-template-columns: minmax(0, 1fr) 3em; }
  .balkenliste__balken { grid-column: 1 / -1; grid-row: 2; }
}

/* Wartung: Prüfaufgaben-Listen */
.gruppe { margin-bottom: 16px; scroll-margin-top: 16px; }
.gruppe--ueberfaellig { border-left: 4px solid var(--prio-kritisch); }
.gruppe--bald { border-left: 4px solid var(--prio-hoch); }
.faellig { text-align: right; }
.zeilenliste__titel { display: inline-flex; align-items: center; min-height: var(--tap); }
@media (max-width: 767px) {
  .zeilenliste__eintrag { flex-wrap: wrap; }
  .zeilenliste__rechts { width: 100%; justify-content: space-between; }
  .faellig { text-align: left; }
}

/* Geräteliste */
.geraet-zeile { display: flex; align-items: center; gap: 12px; min-height: var(--tap); color: inherit; text-decoration: none; }
.geraet-zeile strong { color: var(--argus-link); }
.geraet-zeile:hover strong { text-decoration: underline; }
.geraet-zeile__bild { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-muted); border: 1px solid var(--border); color: var(--icon); }
.geraet-zeile__bild img { width: 100%; height: 100%; object-fit: cover; }
.feld-schmal { max-width: 260px; }
.formular-abschnitt { margin: 28px 0 16px; padding-top: 20px; border-top: 1px solid var(--divider); }

/* Ausklappmenüs in Verwaltungstabellen dürfen über den Kartenrand hinausragen */
.tabelle-karte:has(.tabelle--stapel) { overflow: visible; }
.tabelle--stapel thead th:first-child { border-top-left-radius: var(--radius-l); }
.tabelle--stapel thead th:last-child { border-top-right-radius: var(--radius-l); }
