/* DRK Fuhrpark – Erscheinungsbild 1:1 aus Nestwerk (betreuung/templates/base.html), plus Fuhrpark-Bausteine. */
:root {
  --rot: #E60005;
  --rot-dunkel: #C10004;
  --rot-tint: rgba(230,0,5,0.1);
  --tinte: #1D1D1F;
  --grau: #6E6E73;
  --grau-hell: #94979F;
  --linie: rgba(0,0,0,0.08);
  --flaeche: #F5F5F7;
  --oberflaeche: #FFFFFF;
  --glas: rgba(255,255,255,0.72);
  --hover-tint: rgba(0,0,0,0.045);
  --gruen: #1E7B34;
  --gruen-tint: rgba(30,123,52,0.12);
  --gelb: #B45D00;
  --gelb-tint: rgba(180,93,0,0.12);
  --schatten: 0 1px 1px rgba(20,20,22,0.02), 0 10px 24px -12px rgba(20,20,22,0.14);
  --schatten-sm: 0 1px 3px rgba(20,20,22,0.07);
  --ease: cubic-bezier(0.4,0,0.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--tinte); background: var(--flaeche);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--rot); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.seite { display: flex; width: 100%; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--glas);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--linie);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marke {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1.15rem 1.1rem 1rem; border-bottom: 1px solid var(--linie);
}
.marke-logo { width: 100%; max-width: 168px; height: auto; }
.marke-produkt {
  padding-top: 0.6rem; border-top: 1px solid var(--linie); width: 100%;
}
.nestwerk-logo { width: 100%; max-width: 150px; height: auto; display: block; }
.nav-badge { background: var(--rot); color: white; border-radius: 10px; padding: 0.05rem 0.45rem; font-size: 0.72rem; margin-left: 0.3rem; font-weight: 600; }
.kreuz {
  width: 38px; height: 38px; background: var(--rot); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kreuz svg { width: 24px; height: 24px; }
.marke-text { line-height: 1.25; }
.marke-text b { display: block; font-size: 0.92rem; letter-spacing: -0.01em; }
.marke-text span { font-size: 0.7rem; color: var(--grau); }

.nav { flex: 1; padding: 0.85rem 0.7rem; }
.nav-gruppe { margin-bottom: 1.1rem; }
.nav-label {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--grau-hell);
  padding: 0 0.55rem; margin-bottom: 0.3rem;
}
.nav-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.44rem 0.6rem; border-radius: 8px;
  color: var(--tinte); font-size: 0.875rem;
  position: relative; margin-bottom: 1px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-link:hover { background: var(--hover-tint); text-decoration: none; }
.nav-link.active { background: var(--rot); color: white; font-weight: 590; }
.nav-ico { width: 18px; text-align: center; flex-shrink: 0; opacity: 0.85; }
.nav-link.active .nav-ico { opacity: 1; }
.nav-link.active .nav-badge { background: rgba(255,255,255,0.32); }

/* Ausklappbare Untermenü-Gruppen (Verwaltung/Personal/System) */
details.nav-gruppe-klapp { margin-bottom: 0.2rem; }
details.nav-gruppe-klapp summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.55rem; border-radius: 8px;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--grau-hell); transition: background 0.15s var(--ease);
}
details.nav-gruppe-klapp summary::-webkit-details-marker { display: none; }
details.nav-gruppe-klapp summary:hover { background: var(--hover-tint); }
details.nav-gruppe-klapp summary .chev { transition: transform 0.2s var(--ease); opacity: 0.6; font-size: 0.7rem; }
details.nav-gruppe-klapp[open] summary .chev { transform: rotate(90deg); }
details.nav-gruppe-klapp .nav-unter { display: flex; flex-direction: column; gap: 1px; padding-top: 0.1rem; }

.sidebar-fuss { border-top: 1px solid var(--linie); padding: 0.85rem 1.15rem; }
.sidebar-fuss .wer { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.1rem; }
.sidebar-fuss .wer a { color: var(--tinte); }
.sidebar-fuss .rolle { font-size: 0.72rem; color: var(--grau); margin-bottom: 0.6rem; }
.sidebar-fuss .abmelden {
  display: inline-block; font-size: 0.78rem; color: var(--grau);
  border: 1px solid var(--linie); border-radius: 6px; padding: 0.28rem 0.7rem;
}
.sidebar-fuss .abmelden:hover { border-color: var(--grau); text-decoration: none; }
.sidebar-fuss .auto-logout {
  margin-top: 0.55rem; font-size: 0.7rem; color: var(--grau);
  font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 0.35rem;
}
.sidebar-fuss .auto-logout .punkt { width: 6px; height: 6px; border-radius: 50%; background: var(--gruen); flex-shrink: 0; }
.sidebar-fuss .auto-logout.bald { color: var(--rot); font-weight: 600; }
.sidebar-fuss .auto-logout.bald .punkt { background: var(--rot); }

.inhalt { flex: 1; min-width: 0; }
.container { max-width: 1240px; margin: 0 auto; padding: 1.75rem 2rem 3rem; }
.page-header { margin-bottom: 1.6rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.025em; text-wrap: balance; }
.page-header p { color: var(--grau); font-size: 0.9rem; margin-top: 0.35rem; }

/* ===== KARTEN ===== */
.card {
  background: var(--oberflaeche); border: 1px solid var(--linie); border-radius: 16px;
  padding: 1.3rem 1.4rem; margin-bottom: 1.1rem; box-shadow: var(--schatten);
}
.card-header {
  font-weight: 650; font-size: 0.95rem; margin-bottom: 0.9rem;
  display: flex; align-items: center; gap: 0.5rem;
}

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem; margin-bottom: 1.4rem; }
.stat-card { background: var(--oberflaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 1.05rem 1.2rem; box-shadow: var(--schatten-sm); }
.stat-num {
  font-size: 1.9rem; font-weight: 750; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--tinte);
}
.stat-num::after { content: ""; display: block; width: 26px; height: 3px; background: var(--rot); border-radius: 2px; margin-top: 0.4rem; }
.stat-label { font-size: 0.76rem; color: var(--grau); margin-top: 0.5rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.48rem 1.05rem; border-radius: 980px;
  font-size: 0.86rem; font-weight: 590; cursor: pointer;
  border: 1px solid transparent; transition: background 0.15s var(--ease), opacity 0.15s var(--ease);
  text-decoration: none; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--rot); color: white; }
.btn-primary:hover { background: var(--rot-dunkel); color: white; }
.btn-secondary { background: var(--flaeche); color: var(--tinte); border-color: transparent; }
.btn-secondary:hover { background: var(--hover-tint); }
.btn-success { background: var(--gruen); color: white; }
.btn-success:hover { background: #166128; color: white; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== FORMULARE ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem; }
.form-group { display: flex; flex-direction: column; gap: 0.32rem; }
.form-group label { font-size: 0.74rem; font-weight: 650; color: var(--grau); letter-spacing: 0.02em; }
.form-control {
  padding: 0.5rem 0.75rem; border: 1px solid var(--linie); border-radius: 9px;
  font-size: 0.875rem; font-family: inherit; background: var(--oberflaeche); transition: border-color 0.13s, box-shadow 0.13s;
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--rot); box-shadow: 0 0 0 3px var(--rot-tint); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 76px; }
.form-section { background: var(--oberflaeche); border: 1px solid var(--linie); border-radius: 16px; padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; box-shadow: var(--schatten); }
.form-section-title {
  font-weight: 700; font-size: 0.74rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--grau); margin-bottom: 1rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--linie);
}

/* ===== TABELLEN ===== */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table.data-table { width: 100%; border-collapse: collapse; background: var(--oberflaeche); }
table.data-table th {
  background: var(--oberflaeche); color: var(--grau); padding: 0.6rem 0.8rem; text-align: left;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--linie); white-space: nowrap;
}
table.data-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--linie); font-size: 0.87rem; vertical-align: top; }
table.data-table tbody tr:hover td { background: var(--hover-tint); }
table.data-table tr:last-child td { border-bottom: none; }

/* ===== FILTER ===== */
.filter-bar {
  background: var(--oberflaeche); border: 1px solid var(--linie); border-radius: 14px;
  padding: 0.9rem 1rem; margin-bottom: 1.1rem;
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end;
  box-shadow: var(--schatten-sm);
}

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 5px; font-size: 0.72rem; font-weight: 650; white-space: nowrap; }
.badge-rot { background: var(--rot-tint); color: var(--rot-dunkel); }
.badge-gruen { background: var(--gruen-tint); color: var(--gruen); }
.badge-grau { background: var(--flaeche); color: var(--grau); }
.badge-gelb { background: var(--gelb-tint); color: var(--gelb); }

/* ===== ALERTS ===== */
.alert { padding: 0.8rem 1.05rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.875rem; border: 1px solid; }
.alert-success { background: var(--gruen-tint); color: var(--gruen); border-color: #BBDFC4; }
.alert-error { background: var(--rot-tint); color: var(--rot-dunkel); border-color: #F4B9B9; }
.alert-info { background: #EEF4FB; color: #1A5089; border-color: #C4D9EE; }

/* ===== SONSTIGES ===== */
.but-tag {
  display: inline-block; background: var(--gelb-tint); color: var(--gelb);
  border-radius: 5px; font-size: 0.7rem; font-weight: 700; padding: 0.14rem 0.45rem;
}
.notiz-item { background: #FDFAF0; border-left: 3px solid #E0B83E; padding: 0.75rem 0.9rem; border-radius: 0 7px 7px 0; margin-bottom: 0.5rem; }
.notiz-meta { font-size: 0.72rem; color: var(--grau); margin-top: 0.35rem; }
code { background: var(--flaeche); border-radius: 4px; padding: 0.1rem 0.35rem; font-size: 0.82em; }

/* ===== MOBIL ===== */
@media (max-width: 1024px) {
  .seite { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 50;
    border-right: none; border-bottom: 1px solid var(--linie);
    flex-direction: row; align-items: center; overflow: visible;
  }
  .marke { border-bottom: none; padding: 0.5rem 0.9rem; flex-direction: row; align-items: center; }
  .marke-logo { max-width: 120px; }
  .marke-produkt { display: none; }
  .nav { display: flex; padding: 0.45rem 0.5rem; overflow-x: auto; flex: 1; -webkit-overflow-scrolling: touch; }
  .nav-gruppe { display: flex; margin: 0; }
  .nav-label { display: none; }
  .nav-link { white-space: nowrap; padding: 0.38rem 0.6rem; }
  .nav-ico { display: none; }
  /* Untermenü-Gruppen auf Mobil wie vorher flach in der scrollbaren Leiste zeigen */
  details.nav-gruppe-klapp { display: contents; }
  details.nav-gruppe-klapp summary { display: none; }
  details.nav-gruppe-klapp .nav-unter { display: contents; }
  .sidebar-fuss { border-top: none; padding: 0.5rem 0.9rem; }
  .sidebar-fuss .wer, .sidebar-fuss .rolle, .sidebar-fuss .auto-logout { display: none; }
  .container { padding: 0.9rem 0.75rem 2.5rem; }
  .page-header { margin-bottom: 1rem; }
  .page-header h1 { font-size: 1.35rem; }
  .card { padding: 0.9rem 0.9rem; border-radius: 12px; }
  .filter-bar { padding: 0.7rem 0.75rem; gap: 0.5rem; }
  .filter-bar .form-group { flex: 1 1 140px; min-width: 0; }
  table.data-table td { padding: 0.5rem 0.6rem; }
  .nav-link { padding: 0.38rem 0.55rem; font-size: 0.86rem; }
}
/* ===== TABS (für Detailseiten) ===== */
.tabs {
  display: flex; gap: 0.25rem; border-bottom: 2px solid var(--linie);
  margin-bottom: 1.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-btn {
  background: none; border: none; border-bottom: 3px solid transparent;
  padding: 0.7rem 1.05rem; font-size: 0.92rem; font-weight: 600; color: var(--grau);
  cursor: pointer; white-space: nowrap; margin-bottom: -2px; display: flex;
  align-items: center; gap: 0.4rem; transition: color 0.12s, border-color 0.12s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--tinte); }
.tab-btn.active { color: var(--rot); border-bottom-color: var(--rot); }
.tab-btn .tab-badge {
  background: var(--rot); color: white; border-radius: 10px;
  padding: 0.02rem 0.4rem; font-size: 0.68rem; font-weight: 700;
}
.tab-btn .tab-badge.grau { background: var(--grau-hell); }
.tab-inhalt { display: none; }
.tab-inhalt.active { display: block; animation: tab-ein 0.15s ease; }
@keyframes tab-ein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ===== TOUCH-OPTIMIERUNG (Tablet/Kiosk) ===== */
@media (pointer: coarse) {
  .btn { min-height: 44px; padding: 0.7rem 1.2rem; }
  .btn-sm { min-height: 36px; }
  .form-control { min-height: 44px; font-size: 16px; }
  .tab-btn { min-height: 48px; padding: 0.7rem 1.2rem; }
  .nav-link { min-height: 42px; }
  input[type="checkbox"] { min-width: 20px; min-height: 20px; }
}

/* =====================================================================
   FUHRPARK-BAUSTEINE (gleiche Tokens wie Nestwerk)
   ===================================================================== */
.badge-blau { background: #EEF4FB; color: #1A5089; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-header .btn-group { margin-bottom: 0.15rem; }
.muted { color: var(--grau); }
.klein { font-size: 0.8rem; }
.kz { font-weight: 700; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.zahl { font-variant-numeric: tabular-nums; }
.raster-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.raster-2 > .card { margin-bottom: 0; }
.abstand { height: 1.1rem; }

/* Stat-Karten als Links + Warnstufe */
a.stat-card { display: block; color: inherit; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease); }
a.stat-card:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--schatten); }
.stat-card.warn .stat-num { color: var(--rot); }

/* Listen-Zeilen in Karten */
.zeile { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: none; padding-bottom: 0; }
.zeile:first-child { padding-top: 0; }
.zeile .zeile-haupt { flex: 1; min-width: 0; }
.zeile .zeile-titel { font-weight: 600; }
.zeile .zeile-sub { font-size: 0.8rem; color: var(--grau); margin-top: 0.1rem; }
.leer { color: var(--grau); font-size: 0.87rem; padding: 0.4rem 0; }

/* Fahrzeug-Kacheln */
.fz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.85rem; }
.fz-kachel {
  position: relative; display: flex; align-items: center; gap: 0.85rem;
  background: var(--oberflaeche); border: 1px solid var(--linie); border-radius: 14px;
  padding: 0.85rem 1rem; box-shadow: var(--schatten-sm); color: inherit; cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
a.fz-kachel:hover { text-decoration: none; box-shadow: var(--schatten); transform: translateY(-1px); }
.fz-bild {
  width: 48px; height: 48px; border-radius: 11px; flex-shrink: 0;
  background: var(--flaeche) center/cover no-repeat; display: flex; align-items: center; justify-content: center;
}
.fz-bild svg { width: 26px; height: 26px; color: var(--grau-hell); }
.fz-text { flex: 1; min-width: 0; }
.fz-text .kz { font-size: 0.98rem; }
.fz-text .fz-name { font-size: 0.8rem; color: var(--grau); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-text .badge { margin-top: 0.35rem; }
label.fz-kachel input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
label.fz-kachel:has(input:checked) { border-color: var(--rot); box-shadow: 0 0 0 3px var(--rot-tint); }
label.fz-kachel:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.fz-haken { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--linie); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
label.fz-kachel:has(input:checked) .fz-haken { background: var(--rot); border-color: var(--rot); }
label.fz-kachel:has(input:checked) .fz-haken::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }

/* Segment-Auswahl (Tank, Ja/Nein, Schnellzeiten) */
.segmente { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; background: var(--flaeche); border-radius: 11px; padding: 4px; }
.segmente label { position: relative; text-align: center; padding: 0.55rem 0.3rem; border-radius: 8px; font-size: 0.86rem; font-weight: 590; color: var(--tinte); cursor: pointer; transition: background 0.15s var(--ease); margin: 0; letter-spacing: 0; }
.segmente label input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmente label:has(input:checked) { background: var(--oberflaeche); box-shadow: var(--schatten-sm); color: var(--rot); }
.chips { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip { flex-shrink: 0; border: 1px solid var(--linie); background: var(--oberflaeche); border-radius: 980px; padding: 0.38rem 0.85rem; font: inherit; font-size: 0.82rem; font-weight: 590; cursor: pointer; color: var(--tinte); transition: all 0.15s var(--ease); }
.chip:hover { background: var(--hover-tint); }
.chip.an { background: var(--rot); border-color: var(--rot); color: #fff; }

/* Checkbox-Zeile */
.check { display: flex; align-items: center; gap: 0.55rem; font-size: 0.875rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--rot); flex-shrink: 0; }
.hilfe { font-size: 0.76rem; color: var(--grau); }
.verf { font-size: 0.82rem; font-weight: 600; min-height: 1.2em; }
.verf.ok { color: var(--gruen); } .verf.nein { color: var(--rot); }
.form-group.voll { grid-column: 1 / -1; }

/* Schritt-Nummern in Formular-Sektionen */
.form-section-title { display: flex; align-items: center; gap: 0.55rem; }
.schritt { width: 20px; height: 20px; border-radius: 50%; background: var(--rot); color: #fff; font-size: 0.7rem; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0; }

/* Großer Fahrzeugkopf (QR-Seite / Fahrt) */
.fz-kopf { display: flex; align-items: center; gap: 1rem; }
.fz-kopf .fz-bild { width: 64px; height: 64px; border-radius: 14px; }
.fz-kopf .fz-bild svg { width: 34px; height: 34px; }
.fz-kopf .kz-gross { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.fz-foto { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 1rem; display: block; }
.btn-block { width: 100%; justify-content: center; padding: 0.7rem 1.1rem; font-size: 0.95rem; }
.btn-dunkel { background: var(--tinte); color: #fff; }
.btn-dunkel:hover { background: #000; color: #fff; }
.btn-umriss { background: var(--oberflaeche); color: var(--rot); border-color: var(--rot); }
.btn-umriss:hover { background: var(--rot-tint); }

/* Wochenkalender */
.woche { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.6rem; }
.tag-spalte { background: var(--oberflaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 0.75rem; box-shadow: var(--schatten-sm); min-height: 160px; display: flex; flex-direction: column; gap: 0.4rem; }
.tag-spalte.heute { border-color: var(--rot); box-shadow: 0 0 0 3px var(--rot-tint); }
.tag-kopf { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.78rem; }
.tag-kopf b { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--grau); }
.tag-kopf .datum { font-size: 1.15rem; font-weight: 700; color: var(--tinte); }
.tag-spalte.heute .tag-kopf .datum { color: var(--rot); }
.termin { border-radius: 8px; padding: 0.38rem 0.5rem; font-size: 0.76rem; line-height: 1.35; background: var(--gruen-tint); border-left: 3px solid var(--gruen); }
.termin.ausstehend { background: var(--gelb-tint); border-left-color: var(--gelb); }
.termin b { font-variant-numeric: tabular-nums; }
.tag-plus { margin-top: auto; font-size: 0.76rem; color: var(--grau); }
.tag-plus:hover { color: var(--rot); }
.legende { display: flex; gap: 1rem; font-size: 0.76rem; color: var(--grau); margin-top: 0.8rem; }
.legende span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; background: var(--gruen-tint); border-left: 3px solid var(--gruen); }
.legende span.gelb::before { background: var(--gelb-tint); border-left-color: var(--gelb); }
@media (max-width: 1024px) {
  .woche { grid-template-columns: 1fr; }
  .tag-spalte { min-height: 0; }
  .tag-spalte.leer-tag { padding: 0.55rem 0.75rem; flex-direction: row; align-items: center; justify-content: space-between; }
}

/* Fahrtenbuch */
tr.zeile-luecke td { background: var(--rot-tint) !important; }
tr.zeile-alt td { color: var(--grau-hell); text-decoration: line-through; }
.luecke-hinweis { font-size: 0.78rem; color: var(--rot-dunkel); font-weight: 600; }

/* Aufklappbereiche im Nestwerk-Kartenstil */
details.card { padding: 0; }
details.card > summary { list-style: none; cursor: pointer; padding: 1.05rem 1.4rem; font-weight: 650; font-size: 0.95rem; display: flex; align-items: center; justify-content: space-between; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▸"; color: var(--grau-hell); transition: transform 0.2s var(--ease); }
details.card[open] > summary::after { transform: rotate(90deg); }
details.card > .card-body { padding: 0 1.4rem 1.3rem; }

/* Login (wie Nestwerk) */
.login-seite { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: #F4F4F5; }
.login-box { background: #fff; border: 1px solid #E4E5E8; border-radius: 12px; padding: 2.4rem 2.2rem; width: 380px; max-width: 100%; }
.login-box .logo-wrap { display: flex; justify-content: center; margin-bottom: 0.4rem; }
.login-box .logo-wrap img { width: 100%; max-width: 280px; height: auto; }
.login-box .produkt { text-align: center; font-size: 0.82rem; color: #62656B; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; margin-bottom: 1.6rem; padding-top: 0.7rem; border-top: 1px solid #EDEDED; }
.login-box .form-group { margin-bottom: 0.9rem; }
.login-box .btn { width: 100%; justify-content: center; padding: 0.65rem; font-size: 0.95rem; border-radius: 8px; }

/* Logo-Ersatz, falls drk-logo.jpg fehlt */
.logo-ersatz { display: flex; align-items: center; gap: 0.6rem; }
.logo-ersatz .kreuz svg { width: 24px; height: 24px; }

/* QR-Druck */
.qr-blatt { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.qr-karte { border: 1px solid var(--linie); border-top: 4px solid var(--rot); border-radius: 14px; padding: 1.1rem; text-align: center; background: #fff; page-break-inside: avoid; }
.qr-karte img.qr { width: 170px; height: 170px; display: block; margin: 0.6rem auto; }
@media print {
  .sidebar, .nicht-drucken { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  .qr-blatt { grid-template-columns: 1fr 1fr; }
}

/* Feinschliff */
.page-header .btn-secondary, .wochennav .btn-secondary { background: var(--oberflaeche); border-color: var(--linie); box-shadow: var(--schatten-sm); }
.page-header .btn-secondary:hover { background: var(--hover-tint); }
.fz-kopf { flex-wrap: wrap; }
.fz-kopf .kz-gross { white-space: nowrap; }
.termin { overflow-wrap: anywhere; }
.zeile-titel, .zeile-sub { overflow-wrap: anywhere; }
@media (max-width: 1024px) {
  .page-header .btn-group { width: 100%; }
}
