/* ============================================================
   FAHRZEUGE – Karten-Übersicht, Fälligkeiten, Kosten-Belege
   Präfix: fz-
   ============================================================ */
.fz-seite [hidden], .fz-dialog [hidden] { display: none !important; }

.fz-inaktiv-schalter { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fz-grau { color: var(--ink-faint, #888); }
.fz-klein { font-size: 12px; }
.fz-nowrap { white-space: nowrap; }
.fz-rot { color: var(--danger, #c62828); font-weight: 600; }
.fz-orange { color: var(--pal-orange-dunkel, #b45309); font-weight: 600; }

/* ---------- Karten ---------- */
.fz-karten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.fz-karte {
  --fz-farbe: var(--line, #ddd);
  display: flex; flex-direction: column;
  background: var(--paper, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-top: 4px solid var(--fz-farbe);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
  transition: box-shadow .15s ease, transform .15s ease;
  min-width: 0;
}
.fz-karte:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .09); }
.fz-karte:focus-visible { outline: 2px solid var(--accent-dark, #835c30); outline-offset: 2px; }
.fz-karte:active { transform: scale(.995); }
.fz-karte.fz-inaktiv { opacity: .6; }
.fz-bild {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  background: var(--neutral-100, #f3f3f3);
  overflow: hidden;
}
.fz-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fz-bild-leer .material-icons { font-size: 64px; color: var(--fz-farbe); opacity: .75; }
.fz-inhalt { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fz-kennzeichen { font-size: 1.35rem; font-weight: 800; letter-spacing: .5px; line-height: 1.2; }
.fz-modell { font-size: 14px; color: var(--ink-soft, #555); }
.fz-zeilen { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.fz-zeile { display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 0; }
.fz-zeile .material-icons { font-size: 17px; color: var(--ink-faint, #999); }
.fz-warnungen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fz-warn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.fz-warn .material-icons { font-size: 14px; }
.fz-warn-orange { background: color-mix(in srgb, var(--pal-orange, #f28c28) 16%, var(--paper, #fff)); color: var(--pal-orange-dunkel, #b45309); }
.fz-warn-rot { background: var(--danger-tint, #fde8e8); color: var(--danger, #c62828); }

/* ---------- Dialog ---------- */
dialog.fz-dialog { width: min(1000px, 96vw); max-width: 1000px; }
.fz-farbwahl { height: 40px; padding: 2px 4px; cursor: pointer; }
.fz-foto-bereich { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 10px; }
.fz-foto-vorschau {
  position: relative;
  width: 200px; height: 130px;
  border: 1px solid var(--line, #ddd); border-radius: 10px;
  background: var(--neutral-100, #f3f3f3);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fz-foto-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.fz-foto-vorschau > .material-icons { font-size: 48px; color: var(--ink-faint, #aaa); opacity: .6; }
.fz-foto-neu { position: absolute; top: 6px; right: 6px; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 600; background: var(--pal-gruen, #2e7d32); color: #fff; }
.fz-foto-knoepfe { display: flex; flex-direction: column; gap: 8px; }
.fz-foto-waehlen { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
fieldset:disabled .fz-foto-waehlen { opacity: .5; pointer-events: none; }

/* Kosten */
.fz-k-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 18px; margin-bottom: 10px; }
.fz-k-jahr { width: auto; min-width: 190px; }
.fz-k-summe { font-size: 14px; line-height: 1.5; }
.fz-k-liste-wrap { overflow-x: auto; }
.fz-k-tabelle, .fz-i-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.fz-k-tabelle th, .fz-k-tabelle td, .fz-i-tabelle th, .fz-i-tabelle td {
  padding: 7px 8px; border-bottom: 1px solid var(--line, #eee); text-align: left; vertical-align: top;
}
.fz-k-tabelle th, .fz-i-tabelle th { font-size: 12px; font-weight: 600; color: var(--ink-soft, #666); text-transform: uppercase; letter-spacing: .3px; }
.fz-k-tabelle .text-right, .fz-i-tabelle .text-right { text-align: right; }
.fz-k-tabelle td .action-btn { vertical-align: middle; }
.fz-nc { font-size: 18px; color: var(--pal-blau, #1e6fb8); vertical-align: middle; margin-left: 4px; cursor: help; }
.fz-sd-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--pal-gruen, #2e7d32); white-space: nowrap; }
.fz-sd-ok .material-icons { font-size: 16px; }
.fz-sd-knopf { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.fz-sd-knopf .material-icons { font-size: 16px; }
.fz-sd-fehler { margin-top: 4px; font-size: 12px; color: var(--danger, #c62828); max-width: 260px; }
.fz-i-zeile { cursor: pointer; }
.fz-i-zeile:hover, .fz-i-zeile:focus-visible { background: var(--accent-tint, #faf5ec); outline: none; }

/* ---------- Handy ---------- */
@media (max-width: 768px) {
  .fz-faellig { margin: 0 12px 12px; }
  .fz-karten { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 12px 24px; }
  .fz-bild { height: 130px; }
  .fz-faellig { font-size: 13px; }
  .fz-foto-vorschau { width: 100%; height: 160px; }
  .fz-foto-knoepfe { flex-direction: row; flex-wrap: wrap; }
  .fz-k-jahr { width: 100%; }
  /* Belege als kleine Karten statt breiter Tabelle */
  .fz-k-tabelle thead { display: none; }
  .fz-k-tabelle, .fz-k-tabelle tbody { display: block; }
  .fz-k-tabelle tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
    padding: 10px 0; border-bottom: 1px solid var(--line, #eee);
  }
  .fz-k-tabelle td { border: 0; padding: 0; }
  .fz-k-tabelle td:nth-child(2) { font-weight: 600; }
  .fz-k-tabelle td:nth-child(3) { margin-left: auto; }
  .fz-k-tabelle td:nth-child(3) .fz-klein { display: none; }
  .fz-k-tabelle td:nth-child(4):not(:empty)::after { content: " km"; }
  .fz-k-tabelle td:nth-child(5) { flex: 1 1 100%; }
  .fz-k-tabelle td:nth-child(5):empty { display: none; }
  .fz-k-tabelle td:nth-child(8) { margin-left: auto; }
  .fz-k-tabelle td[colspan] { flex: 1 1 100%; }
}
/* lange Beleg-Links umbrechen, Tabelle bei Bedarf scrollen */
.fz-k-liste-wrap { overflow-x: auto; }
.fz-k-tabelle td:nth-child(5) { overflow-wrap: anywhere; min-width: 180px; }

/* ============================================================
   Übersicht im Aufbau der Zeiterfassung (thd-top, thd-main)
   ============================================================ */
.fz-kopfzeile { align-items: center; gap: 16px; flex-wrap: wrap; }
.fz-untertitel { margin: 2px 0 0; font-size: 14px; }
.fz-kopf-knoepfe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fz-suche { min-width: 240px; }

.fz-k { cursor: default; min-height: 128px; }
.fz-k .thd-new-icon { margin-bottom: 10px !important; }
.fz-k-zahl { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-k.is-gruen { --we: var(--pal-gruen, #2e7d32); } .fz-k.is-gruen .fz-k-zahl { color: var(--pal-gruen, #2e7d32); }
.fz-k.is-rot { --we: var(--danger, #c62828); } .fz-k.is-rot .fz-k-zahl { color: var(--danger, #c62828); }
.fz-k.is-orange { --we: var(--pal-orange-dunkel, #b45309); } .fz-k.is-orange .fz-k-zahl { color: var(--pal-orange-dunkel, #b45309); }

.fz-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.fz-rechts { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.fz-main .thd-panel { min-height: 0; }
.fz-main .fz-panel { min-height: 420px; }
.fz-leer { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; color: var(--ink-soft); }
.fz-leer i { font-size: 40px; color: var(--accent-dark); } .fz-leer strong { color: var(--ink); font-size: 16px; }

/* Termine */
.fz-termine { display: flex; flex-direction: column; gap: 6px; }
.fz-termin { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper, #fff); color: var(--ink); font: inherit; cursor: pointer; }
.fz-termin:hover { border-color: var(--accent, #e8b923); }
.fz-termin.is-rot { border-left: 4px solid var(--danger, #c62828); }
.fz-termin.is-orange { border-left: 4px solid var(--pal-orange, #f28c28); }
.fz-termin-text { display: flex; flex-direction: column; min-width: 0; }
.fz-termin-text strong { font-size: 14.5px; }
.fz-termin-text small { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-termin-wann { font-size: 12.5px; color: var(--ink-soft); text-align: right; }
.fz-termin.is-rot .fz-termin-wann { color: var(--danger, #c62828); font-weight: 600; }
.fz-termin.is-orange .fz-termin-wann { color: var(--pal-orange-dunkel, #b45309); font-weight: 600; }

/* Kosten */
.fz-kosten { display: flex; flex-direction: column; gap: 4px; }
.fz-kosten-zeile { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  padding: 7px 6px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.fz-kosten-zeile:hover { background: var(--surface, #f6f5f2); }
.fz-kosten-name { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-punkt { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fz-kosten-balken { height: 8px; border-radius: 999px; background: var(--surface, #f3f3f3); border: 1px solid var(--line); overflow: hidden; }
.fz-kosten-balken span { display: block; height: 100%; background: var(--accent-dark, #c8a45a); }
.fz-kosten-zeile b { font-variant-numeric: tabular-nums; }
.fz-arten { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fz-art-chip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface, #f3f3f3); color: var(--ink-soft); }
.fz-art-chip b { color: var(--ink); }

@media (max-width: 1100px) {
  .fz-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  .fz-main { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
  .fz-k { min-height: 0; padding: 14px !important; }
  .fz-k-zahl { font-size: 21px; }
  .fz-suche { min-width: 0; flex: 1 1 100%; }
  .fz-kopf-knoepfe { width: 100%; }
  .fz-main .thd-panel { padding: 14px; }
}
