/* Kogga Cars — Gestaltungssystem.
 *
 * Übernommen aus docs/design/mockup-v1.html (Masterplan §3). Kein Bauschritt,
 * kein Tailwind: die Vorschau ist bereits die Referenz und bleibt es.
 *
 * Die Inhaltsrichtlinie des Servers erlaubt kein 'unsafe-inline'. Deshalb steht
 * hier jede Regel — im HTML gibt es keine style-Attribute.
 */

/* ---------------------------------------------------------------- Schriften */
/* Vorerst Systemschriften (Entscheidung Sebastian, 2026-08-23). Für das
 * Bündeln von Outfit, Source Sans 3 und Barlow Condensed als WOFF2 werden
 * später nur @font-face-Blöcke hier und die drei Variablen unten getauscht;
 * am übrigen Stylesheet ändert sich nichts. Siehe docs/DEV-LOG.md. */

:root {
  --font-head: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-plate: "Roboto Condensed", "Arial Narrow", "Liberation Sans Narrow", system-ui, sans-serif;

  /* Farben hell (Masterplan §3.1) */
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #0a1628;
  --ink-2: #475569;
  --line: #e2e8f0;
  --brand: #1a6ff5;
  --brand-dark: #1559cc;
  --brand-soft: #e8f0fe;
  --ok: #159f6b;
  --ok-soft: #dcf5ea;
  --warn: #d9880b;
  --warn-soft: #fdf0d5;
  --bad: #ff3d5a;
  --bad-soft: #ffe4e8;
  --muted-soft: #eef1f6;
  --shadow: 0 1px 2px rgba(10, 22, 40, .06), 0 6px 20px rgba(10, 22, 40, .06);
  --plate-band: #0b3fb8;
  --radius: 12px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1628;
    --card: #0f2240;
    --ink: #f7f8fb;
    --ink-2: #94a3b8;
    --line: #162d50;
    --brand-soft: #12305e;
    --ok-soft: #0f3b2c;
    --warn-soft: #3d2a08;
    --bad-soft: #4a1622;
    --muted-soft: #132a4d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1628;
  --card: #0f2240;
  --ink: #f7f8fb;
  --ink-2: #94a3b8;
  --line: #162d50;
  --brand-soft: #12305e;
  --ok-soft: #0f3b2c;
  --warn-soft: #3d2a08;
  --bad-soft: #4a1622;
  --muted-soft: #132a4d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* -------------------------------------------------------------------- Basis */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* Randbereiche moderner Handys (Notch, Home-Balken) freihalten. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  margin: 0;
  text-wrap: balance;
  line-height: 1.15;
}
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }

a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.label {
  font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 600;
}
.versteckt { display: none !important; }

.nur-fuer-vorleser {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------------- Kopfleiste */

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.0625rem;
  white-space: nowrap;
}

.mark {
  width: 28px; height: 28px; border-radius: 7px; background: #0a1628; flex: none;
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: .8rem;
}

.screens { display: flex; gap: 4px; margin-left: 4px; }
.screens button {
  background: transparent; border: 0; color: var(--ink-2);
  padding: 8px 10px; border-radius: 8px; font-weight: 500; min-height: 44px;
}
.screens button[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }

.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.sync {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: transparent; color: var(--ink-2);
  font-size: .8125rem; white-space: nowrap;
  min-height: 44px; padding: 0 8px; border-radius: 8px;
}
.sync:hover { background: var(--muted-soft); }
.sync i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); flex: none; }
.sync[data-zustand="offen"] i,
.sync[data-zustand="laeuft"] i { background: var(--brand); }
.sync[data-zustand="synchronisiert"] i { background: var(--ok); }
.sync[data-zustand="offline"] i { background: var(--warn); }
.sync[data-zustand="fehler"] i { background: var(--bad); }
/* Der Punkt pulst, solange übertragen wird. */
.sync[data-zustand="laeuft"] i { animation: pulsieren 1.1s ease-in-out infinite; }
@keyframes pulsieren { 50% { opacity: .3; } }

.iconbtn {
  width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); flex: none;
  display: grid; place-items: center; font-size: 1.05rem;
}

/* -------------------------------------------------------------------- Knöpfe */

.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 14px; border-radius: 10px; font-weight: 600; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: transparent; }
.btn.gefahr { color: var(--bad); border-color: var(--bad-soft); background: var(--bad-soft); }
.btn.gefahr:hover { border-color: var(--bad); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.breit { width: 100%; }

/* ------------------------------------------------------------------- Gerüst */

main { max-width: 1100px; margin: 0 auto; padding: 20px 14px 40px; }

/* Ansichten (Laden / Anmeldung / App) und Bereiche innerhalb der App.
 * Ausgeblendet wird über :not(.aktiv), damit die Regel eine eigene
 * Anzeigeart wie `display: grid` der Anmeldehülle sicher überstimmt. */
.ansicht:not(.aktiv) { display: none; }
.bereich:not(.aktiv) { display: none; }

.pagehead {
  display: flex; align-items: end; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}

.section { display: grid; gap: 10px; margin-top: 22px; }
.section:first-child { margin-top: 0; }
.sectionhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pad { padding: 14px; display: grid; gap: 10px; }

/* -------------------------------------------------------------------- Chips */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600;
  background: var(--muted-soft); color: var(--ink-2);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.brand { background: var(--brand-soft); color: var(--brand); }

/* -------------------------------------------------------- Kennzeichen-Schild */

.plate {
  display: inline-flex; align-items: stretch; height: 28px;
  border-radius: 4px; overflow: hidden;
  background: #fff; border: 1.5px solid #0a1628; color: #0a1628;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .15);
}
.plate-eu {
  background: var(--plate-band); color: #fff;
  font: 600 .6rem/1 var(--font-plate);
  display: grid; place-items: end center; padding: 0 4px 3px; min-width: 16px;
}
.plate-num {
  font: 600 1.05rem/1 var(--font-plate); letter-spacing: .06em;
  padding: 0 9px; display: grid; place-items: center; white-space: nowrap;
  font-stretch: condensed;
}

/* ------------------------------------------------------------------- Listen */

.list { display: grid; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow-wrap: anywhere; }
.row .s { color: var(--ink-2); font-size: .875rem; }

/* ----------------------------------------------------------------- Formular */

.sheet { max-width: 640px; margin: 0 auto; }
.form { padding: 16px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9375rem; }
.field .hint { color: var(--ink-2); font-size: .8125rem; }

.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit;
}
.input:focus { border-color: var(--brand); }

.meldung {
  border-radius: 10px; padding: 10px 12px;
  font-size: .9375rem; font-weight: 500;
  background: var(--bad-soft); color: var(--bad);
}
.meldung.info { background: var(--brand-soft); color: var(--brand); }
.meldung.ok { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------------ Anmeldeschirm */

.login-huelle {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.login-karte { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.login-kopf { display: grid; gap: 10px; justify-items: center; text-align: center; }
.login-kopf .mark { width: 46px; height: 46px; border-radius: 12px; font-size: 1.25rem; }

/* ------------------------------------------------------------- Leerzustände */

.leer {
  display: grid; gap: 10px; justify-items: center; text-align: center;
  padding: 34px 18px; color: var(--ink-2);
}
.leer svg { width: 96px; max-width: 55%; fill: var(--line); }
.leer h2 { color: var(--ink); }

/* ------------------------------------------------------------ Offline-Balken */

.offline-balken {
  background: var(--warn-soft); color: var(--warn);
  font-size: .875rem; font-weight: 600;
  padding: 8px 14px; text-align: center;
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------------------- Handy */

@media (max-width: 719px) {
  .brand span.wort { display: none; }
  .screens button { padding: 8px; }
  /* Auf dem Handy zählt jeder Pixel in der Kopfleiste. Der Punkt allein trägt
     die Aussage; der volle Text steht im Kurzhinweis (title). */
  #sync-text { display: none; }
  .sync { min-width: 44px; padding: 0; }
  main { padding-top: 16px; }
  .pagehead { align-items: start; }
  .row { padding: 12px; }
}

@media (min-width: 720px) {
  main { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===================================================================== *
 *  Fahrzeuge (M1) — Bausteine aus docs/design/mockup-v1.html
 * ===================================================================== */

/* --------------------------------------------------------- Filterleiste */

.seg {
  display: inline-flex; background: var(--muted-soft);
  border-radius: 10px; padding: 3px; gap: 2px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 8px 12px; border-radius: 8px; font-weight: 500;
  min-height: 44px; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* -------------------------------------------------------- Fahrzeugkarte */

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.vcard {
  overflow: hidden; cursor: pointer; text-align: left;
  padding: 0; border: 1px solid var(--line); font: inherit; color: inherit;
  transition: transform .12s ease;
  display: block; width: 100%;
}
.vcard:hover { transform: translateY(-2px); }
.vcard[data-archiviert="ja"] { opacity: .62; }

.photo {
  aspect-ratio: 16 / 9; position: relative; display: grid; place-items: center;
  background: linear-gradient(135deg, #162d50, #1a6ff5 160%);
}
.photo svg { width: 46%; fill: rgba(255, 255, 255, .22); }
.photo .plate { position: absolute; left: 12px; bottom: 12px; }
/* Zwei weitere Verläufe, damit gleich aussehende Karten unterscheidbar
   bleiben, solange es noch keine Titelbilder gibt (die kommen mit M3). */
.photo[data-ton="1"] { background: linear-gradient(135deg, #2b3a55, #0a1628 140%); }
.photo[data-ton="2"] { background: linear-gradient(135deg, #1e3a8a, #475569 160%); }

.vbody { padding: 12px 14px 14px; display: grid; gap: 8px; }
.vtitle { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vtitle h3 { font-size: 1.0625rem; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------- Fahrzeugseite */

.vhead { display: grid; grid-template-columns: 1fr; overflow: hidden; }
.vhead .photo { aspect-ratio: 16 / 8; }
.vinfo { padding: 16px; display: grid; gap: 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }

.tabs {
  display: flex; gap: 2px; overflow-x: auto;
  border-bottom: 1px solid var(--line); margin: 18px 0 14px; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 10px 12px; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 44px;
}
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9375rem; margin: 0; }
.kv dt { color: var(--ink-2); margin: 0; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Formular */

.two { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.drei { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: none; }

.suffix { position: relative; }
.suffix .input { padding-right: 52px; }
.suffix b {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-2); font-weight: 500; pointer-events: none;
}

details.group { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--card); }
details.group + details.group { margin-top: 10px; }
details.group summary {
  cursor: pointer; padding: 14px 0; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  min-height: 44px;
}
details.group summary::-webkit-details-marker { display: none; }
details.group summary::after { content: "+"; color: var(--ink-2); font-size: 1.2rem; }
details.group[open] summary::after { content: "–"; }
details.group .form { padding: 0 0 16px; }

.formfoot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 0 0; }
.formfoot .btn { min-width: 120px; }

@media (max-width: 719px) {
  .two, .drei { grid-template-columns: 1fr; }
  /* Deutsche Feldnamen sind lang. Nebeneinander bliebe für den Wert kaum
     Platz — auf dem Handy steht die Beschriftung deshalb über dem Wert. */
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
  .kv dd { margin-bottom: 12px; }
  .kv dd:last-of-type { margin-bottom: 0; }
  .formfoot {
    position: sticky; bottom: 0;
    background: var(--bg); border-top: 1px solid var(--line);
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    margin: 16px -14px 0; padding-left: 14px; padding-right: 14px;
    z-index: 4;
  }
  .formfoot .btn { flex: 1; min-width: 0; }
}

@media (min-width: 720px) {
  .vhead { grid-template-columns: 320px 1fr; }
  .vhead .photo { aspect-ratio: auto; min-height: 200px; }
  .drei { grid-template-columns: 1fr 1fr 1fr; }
  .actions .btn { flex: 0 0 auto; }
}

/* ===================================================================== *
 *  Vorgänge und Fälligkeiten (M2)
 * ===================================================================== */

/* ------------------------------------------------------------ Hinweis */

.hinweis {
  background: var(--brand-soft); color: var(--brand);
  font-size: .875rem; font-weight: 600;
  padding: 10px 14px; text-align: center;
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------- Reiterinhalte */

.reiterinhalt:not(.aktiv) { display: none; }

.tabs .count {
  font-size: .75rem; background: var(--muted-soft); color: var(--ink-2);
  border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}
.tabs button[aria-selected="true"] .count { background: var(--brand-soft); color: var(--brand); }

/* --------------------------------------------------------- Zeitleiste */

.timeline { position: relative; padding-left: 26px; display: grid; gap: 12px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px;
  width: 2px; background: var(--line);
}

.tl {
  position: relative; padding: 12px 14px; display: grid; gap: 6px;
  text-align: left; cursor: pointer;
}
.tl::before {
  content: ""; position: absolute; left: -23px; top: 18px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--brand);
}
.tl.offen { border-style: dashed; }
.tl.offen::before { background: var(--card); box-shadow: 0 0 0 2px var(--warn); }
.tl:hover { border-color: var(--ink-2); }

.tl .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl .when { font-size: .8125rem; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; }
.tl h3 { font-size: 1rem; overflow-wrap: anywhere; }
.tl .foot {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: .875rem; color: var(--ink-2); align-items: center;
}
.tl .cost { font-weight: 600; color: var(--ink); }
.tl .btn { justify-self: start; margin-top: 4px; }

.badge {
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px;
  background: var(--muted-soft); color: var(--ink-2); white-space: nowrap;
}
.badge.rep { background: var(--brand-soft); color: var(--brand); }
.badge.wart { background: var(--ok-soft); color: var(--ok); }
.badge.hu { background: var(--warn-soft); color: var(--warn); }

/* ------------------------------------------------------------ Fließtext */

.fliesstext p { margin: 0 0 8px; }
.fliesstext p:last-child { margin-bottom: 0; }
.fliesstext .textliste { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.fliesstext .textliste:last-child { margin-bottom: 0; }
.fliesstext a { overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Positionen */

.position { margin-bottom: 12px; }
.position .form { padding: 14px; }
.position .actions { justify-content: flex-end; }

textarea.input.hoch { min-height: 150px; }

.row.summe { border-top-width: 2px; font-weight: 700; }
.row.summe .t { font-weight: 700; }

/* Der Ampel-Streifen auf der Fahrzeugseite braucht etwas Luft. */
#fz-ampeln:not(:empty) { margin: 4px 0 0; }

@media (max-width: 719px) {
  .timeline { padding-left: 20px; }
  .timeline::before { left: 5px; }
  .tl::before { left: -19px; }
}

/* ===================================================================== *
 *  Anhänge (M3)
 * ===================================================================== */

/* Titelbild füllt die Bildfläche der Karte und des Fahrzeugkopfs. */
.photo .titelbild {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.anhang-raster {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.anhang {
  margin: 0; display: grid; gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}

.anhang-bild {
  position: relative; display: block; width: 100%;
  aspect-ratio: 4 / 3; padding: 0; border: 0;
  background: var(--muted-soft); overflow: hidden;
}
.anhang-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anhang-bild.dokument { display: grid; place-items: center; }
.anhang-bild.dokument svg { width: 38%; fill: var(--ink-2); opacity: .55; }

/* Kleiner Punkt oben rechts, solange die Datei noch nicht übertragen ist. */
.anhang-wartet {
  position: absolute; right: 8px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--warn); border: 2px solid var(--card);
}
.anhang-wartet.fehler { background: var(--bad); }

.anhang figcaption { padding: 0 10px; display: grid; gap: 2px; min-width: 0; }
.anhang figcaption .t {
  font-weight: 600; font-size: .875rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.anhang figcaption .s { color: var(--ink-2); font-size: .75rem; }

/* Eine Kachel ist schmal, drei Knöpfe nebeneinander wären zu klein zum
   Treffen. Sie stehen deshalb untereinander und behalten die volle
   Tippfläche — in der Werkstatt zählt das mehr als eine kurze Kachel. */
.anhang-aktionen {
  display: flex; flex-direction: column; gap: 2px; padding: 2px 6px 8px;
}
.anhang-aktionen .btn {
  padding: 8px; font-size: .8125rem; min-height: 44px;
  border-color: transparent; justify-content: flex-start;
}
.anhang-aktionen .btn:hover { background: var(--muted-soft); }

/* Fahrzeugschein-Scan in voller Breite. */
.card.scan {
  display: block; width: 100%; padding: 0; overflow: hidden;
  border: 1px solid var(--line); cursor: zoom-in;
}
.card.scan img { display: block; width: 100%; height: auto; }

@media (max-width: 719px) {
  .anhang-raster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ===================================================================== *
 *  Auswertung (M4)
 * ===================================================================== */

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.tablewrap table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.tablewrap th {
  text-align: left; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--muted-soft); font-weight: 600; white-space: nowrap;
}
.tablewrap td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tablewrap td.r, .tablewrap th.r { text-align: right; }
.tablewrap td.num { font-variant-numeric: tabular-nums; }
.tablewrap tbody tr:last-child td { border-bottom: 0; }
.tablewrap tfoot td {
  border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700;
  background: var(--muted-soft);
}

/* Anklickbare Listenzeile — sieht aus wie eine Zeile, verhält sich wie ein Knopf. */
.row.klickbar {
  width: 100%; text-align: left; background: transparent; border-left: 0;
  border-right: 0; border-bottom: 0; font: inherit; color: inherit; cursor: pointer;
}
.row.klickbar:hover { background: var(--muted-soft); }

/* Ein Verweis, der wie ein Knopf aussieht. */
a.btn { text-decoration: none; }
