/* UVV-Fahrzeugprüfung – EB-Gruppe / EBIC */
@font-face { font-family: 'Work Sans'; font-weight: 400; font-display: swap; src: url(/fonts/WorkSans-400.woff2) format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 500; font-display: swap; src: url(/fonts/WorkSans-500.woff2) format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 600; font-display: swap; src: url(/fonts/WorkSans-600.woff2) format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 700; font-display: swap; src: url(/fonts/WorkSans-700.woff2) format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 800; font-display: swap; src: url(/fonts/WorkSans-800.woff2) format('woff2'); }

:root {
  --blue: #006DAA;
  --blue-dark: #00527F;
  --blue-soft: #E5F1F8;
  --navy: #34394D;
  --navy-2: #2A2E3F;
  --red: #E1222D;
  --red-text: #C21B25;
  --red-soft: #FDECEC;
  --green: #2E9E5B;
  --green-text: #1F7A44;
  --green-soft: #E7F5EC;
  --orange: #EC720F;
  --orange-text: #B4520A;
  --orange-soft: #FDF0E5;
  --grey-soft: #EEF0F3;
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --text: #1F2430;
  --muted: #646B7A;
  --line: #E3E6EC;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 4px 16px rgba(20, 24, 40, .05);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--navy);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-eb { height: 34px; width: auto; }
.brand-ebic { height: 24px; width: auto; }
.brand-sep { width: 1px; height: 26px; background: rgba(255, 255, 255, .35); }
.topbar-title { font-weight: 600; font-size: .9rem; opacity: .85; letter-spacing: .02em; }
.stripe {
  position: sticky; top: calc(54px + var(--safe-t)); z-index: 19;
  height: 4px;
  background: linear-gradient(90deg, var(--red) 0 50%, var(--blue) 50% 100%);
}

/* ---------- Layout ---------- */
.main {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  outline: none;
}
.main.no-tabbar { padding-bottom: 32px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.stack { display: grid; gap: 12px; }
.section { margin-top: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.section-title h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; margin-bottom: 8px; min-height: 36px; white-space: nowrap; }
.back svg, .chev svg, svg.chev { width: 20px; height: 20px; }
svg { flex: none; }

.card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 12px; }
.kpis > .card, .stack > .card { margin-top: 0; }
a.card { color: inherit; }
a.card:active, .row-link:active { transform: scale(.995); background: #FAFBFC; }

/* ---------- Tab-Leiste ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .7rem; font-weight: 600;
  position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--blue); }
.tabbar a.active::before {
  content: ''; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue);
}
.tabbar .dot {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: .65rem; line-height: 18px; text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 0; border-radius: 12px;
  font: inherit; font-weight: 600; font-size: .98rem;
  cursor: pointer; text-align: center;
  background: var(--grey-soft); color: var(--text);
  transition: transform .08s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { background: var(--red-soft); color: var(--red-text); }
.btn.success { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; color: var(--blue); padding: 0 8px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: .88rem; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px); z-index: 25;
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--blue); color: #fff;
  box-shadow: 0 6px 20px rgba(0, 109, 170, .35);
}
.fab svg { width: 28px; height: 28px; }
@media (min-width: 800px) { .fab { right: calc(50% - 380px + 18px); } }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit; color: var(--text);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23646B7A' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px;
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 109, 170, .15); }
.input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .grid-2.collapse { grid-template-columns: 1fr; } }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search .input { padding-left: 44px; border-color: transparent; box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid var(--line); color: var(--text);
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .count { font-weight: 700; opacity: .7; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--grey-soft); border-radius: 12px; }
.segmented button {
  min-height: 44px; border: 0; border-radius: 9px; background: transparent;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.segmented button svg { width: 18px; height: 18px; }
.segmented button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmented button.on.io { background: var(--green); color: #fff; }
.segmented button.on.nio { background: var(--red); color: #fff; }
.segmented button.on.na { background: #8A909C; color: #fff; }

/* ---------- Kennzeichen & Status ---------- */
.plate {
  display: inline-flex; align-items: stretch;
  border: 2px solid #1F2430; border-radius: 6px; overflow: hidden;
  background: #fff; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
  font-size: 1rem; line-height: 1; flex: none;
}
.plate::before {
  content: 'D'; display: flex; align-items: flex-end; justify-content: center;
  width: 16px; padding-bottom: 3px; background: #0F3EA8; color: #fff; font-size: .58rem; letter-spacing: 0;
}
.plate span { padding: 6px 8px; }
.plate.lg { font-size: 1.45rem; border-width: 2.5px; }
.plate.lg::before { width: 22px; font-size: .75rem; }
.plate.lg span { padding: 8px 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.badge svg { width: 15px; height: 15px; }
.badge.ok { background: var(--green-soft); color: var(--green-text); }
.badge.maengel, .badge.ueberfaellig, .badge.offen { background: var(--red-soft); color: var(--red-text); }
.badge.faellig { background: var(--orange-soft); color: var(--orange-text); }
.badge.ungeprueft { background: var(--grey-soft); color: var(--muted); }
.badge.erledigt { background: var(--green-soft); color: var(--green-text); }
.badge.info { background: var(--blue-soft); color: var(--blue-dark); }

/* ---------- Fahrzeugliste ---------- */
.vcard { display: flex; gap: 12px; align-items: center; position: relative; padding-left: 20px; }
.vcard::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 5px; border-radius: 0 4px 4px 0; background: var(--line); }
.vcard.s-ok::before { background: var(--green); }
.vcard.s-maengel::before, .vcard.s-ueberfaellig::before { background: var(--red); }
.vcard.s-faellig::before { background: var(--orange); }
.vcard .body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.vcard .line1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vcard .meta { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard .chev { color: #B5BAC4; width: 20px; height: 20px; flex: none; }
.me-tag { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--blue-dark); background: var(--blue-soft); padding: 1px 7px; border-radius: 6px; margin-left: 4px; vertical-align: 1px; }

/* ---------- Detail ---------- */
.hero { display: grid; gap: 10px; }
.hero .title { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; }
.dl > div { display: contents; }
.dl dt, .dl dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { font-weight: 500; word-break: break-word; }
.dl > div:last-child dt, .dl > div:last-child dd { border-bottom: 0; }

.list { display: grid; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; border-bottom: 1px solid var(--line); }
.row-link:last-child { border-bottom: 0; }
.row-link .grow { flex: 1; min-width: 0; }
.row-link .title { font-weight: 600; }
.row-link .sub { color: var(--muted); font-size: .85rem; }

.driver-box { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue-dark); font-weight: 700;
}
.avatar.none { background: var(--grey-soft); color: var(--muted); }

/* ---------- Mängelübersicht (gruppiert nach Fahrzeug) ---------- */
.dtoolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.dtoolbar .chips { margin: 0; padding: 2px; }
.view-toggle { flex: 0 0 auto; min-width: 230px; }
.view-toggle button { min-height: 38px; font-size: .85rem; }
@media (max-width: 480px) { .view-toggle { flex: 1 1 100%; } }
.dgroup { margin-bottom: 12px; }
.dgroup-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: #F7F8FA; border-bottom: 1px solid var(--line); color: inherit;
}
.dgroup-head .grow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dgroup-head .model { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dgroup-head .count { font-size: .8rem; font-weight: 700; color: var(--red-text); white-space: nowrap; }
.dtable { display: grid; }
.drow {
  display: grid; grid-template-columns: 1fr auto 18px; grid-template-areas: 'item date chev' 'desc desc chev';
  gap: 2px 10px; align-items: center; padding: 10px 16px; color: inherit; border-bottom: 1px solid var(--line);
}
.dtable > :last-child, .dtable > :last-child .drow { border-bottom: 0; }
.drow:active { background: #FAFBFC; }
.drow .d-item { grid-area: item; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--red-text); }
.drow.done .d-item { color: var(--green-text); }
.drow .d-desc { grid-area: desc; font-weight: 500; font-size: .95rem; }
.drow .d-date { grid-area: date; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.drow .chev { grid-area: chev; color: #B5BAC4; }
@media (min-width: 640px) {
  .drow { grid-template-columns: minmax(170px, 30%) 1fr auto 18px; grid-template-areas: 'item desc date chev'; padding: 11px 16px; }
}
.drow-wrap { border-bottom: 1px solid var(--line); }
.drow-wrap .drow { border-bottom: 0; }
.d-photos { padding: 0 16px 12px; }
.d-photos .photos { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }

/* ---------- Mängel ---------- */
.defect { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.defect .label { font-size: .8rem; font-weight: 700; color: var(--red-text); text-transform: uppercase; letter-spacing: .04em; }
.defect.done .label { color: var(--green-text); }
.defect .desc { margin-top: 2px; font-weight: 500; }
.defect .meta { margin-top: 6px; color: var(--muted); font-size: .82rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--grey-soft); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--grey-soft); cursor: zoom-in; border: 0; padding: 0; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph .tag { position: absolute; left: 4px; bottom: 4px; font-size: .62rem; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, .6); color: #fff; }
.photos .ph .del {
  position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.photos .ph .del svg { width: 16px; height: 16px; }
.photos .ph.noimg { cursor: pointer; display: grid; place-items: center; }
.noimg-label { display: grid; justify-items: center; gap: 4px; padding: 6px; font-size: .68rem; font-weight: 600; color: var(--muted); text-align: center; }
.noimg-label svg { width: 22px; height: 22px; }
.photo-add {
  aspect-ratio: 1; border-radius: 10px; border: 2px dashed #C9CED8; background: #FAFBFC;
  display: grid; place-items: center; align-content: center; gap: 2px;
  color: var(--blue); font-size: .75rem; font-weight: 600; cursor: pointer; position: relative;
}
.photo-add svg { width: 26px; height: 26px; }
.photo-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-add.busy { color: var(--muted); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 20, .92);
  display: grid; place-items: center; padding: 16px;
}
.lightbox img { max-height: 88vh; max-width: 100%; border-radius: 8px; }
.lightbox button { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; }

/* ---------- Prüfung ---------- */
.progress-head {
  position: sticky; top: calc(58px + var(--safe-t)); z-index: 15;
  margin: -16px -16px 16px; padding: 12px 16px;
  background: rgba(243, 245, 248, .96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.progress-head .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bar { height: 8px; border-radius: 4px; background: #DDE1E8; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--blue); transition: width .3s; }
.bar.done > i { background: var(--green); }
.item { scroll-margin-top: 130px; }
.item .q { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.item .num {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--grey-soft); color: var(--muted);
}
.item.r-io .num { background: var(--green); color: #fff; }
.item.r-nio .num { background: var(--red); color: #fff; }
.item.r-na .num { background: #8A909C; color: #fff; }
.item .q h3 { font-size: 1rem; font-weight: 600; padding-top: 3px; }
.item.r-nio { box-shadow: 0 0 0 2px var(--red) inset, var(--shadow); }
.item.missing { box-shadow: 0 0 0 2px var(--orange) inset, var(--shadow); animation: pulse 1s ease 2; }
.item .nio-extra { margin-top: 12px; display: grid; gap: 10px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(236, 114, 15, .35) inset, var(--shadow); } }
.yn { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.yn:last-of-type { border-bottom: 0; }
.yn p { font-size: .95rem; font-weight: 500; }
.saved { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.saved svg { width: 14px; height: 14px; }

/* ---------- Dashboard ---------- */
.hello { margin-bottom: 18px; }
.hello h1 { font-size: 1.6rem; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: grid; gap: 2px; padding: 14px 14px 12px; color: inherit; position: relative; min-height: 104px; align-content: start; }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; background: var(--grey-soft); color: var(--muted); }
.kpi .ic svg { width: 20px; height: 20px; }
.kpi .val { font-size: 1.9rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .lbl { font-size: .82rem; color: var(--muted); font-weight: 500; }
.kpi.red .ic { background: var(--red-soft); color: var(--red-text); }
.kpi.orange .ic { background: var(--orange-soft); color: var(--orange-text); }
.kpi.green .ic { background: var(--green-soft); color: var(--green-text); }
.kpi.blue .ic { background: var(--blue-soft); color: var(--blue-dark); }
.kpi.zero .val { color: #9AA0AC; }

.rate { display: flex; align-items: center; gap: 18px; }
.ring { width: 96px; height: 96px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.hbar { display: grid; gap: 4px; margin-bottom: 12px; }
.hbar:last-child { margin-bottom: 0; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.hbar .top b { font-variant-numeric: tabular-nums; }
.hbar .track { height: 10px; background: var(--grey-soft); border-radius: 5px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; }

.mycar { display: flex; align-items: center; gap: 14px; }
.mycar .grow { flex: 1; min-width: 0; display: grid; gap: 6px; }

/* ---------- Login ---------- */
.login-wrap { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 420px; text-align: center; padding: 28px 22px; }
.login-card .logo { width: 160px; margin: 0 auto 18px; }
.login-card h1 { margin-bottom: 6px; }
.login-card .lead { color: var(--muted); margin-bottom: 22px; }
.login-card form { text-align: left; }
.login-card .mailicon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.login-card .mailicon svg { width: 32px; height: 32px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Verwaltung ---------- */
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.user-row:last-child { border-bottom: 0; }
.user-row .grow { flex: 1 1 160px; min-width: 0; }
.user-row .grow .sub { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.user-row .segmented { flex: 0 0 190px; }
.user-row .segmented button { min-height: 36px; font-size: .82rem; }
.domain-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.domain-chips .chip { cursor: default; padding-right: 6px; }
.domain-chips .chip button { width: 28px; height: 28px; border: 0; background: var(--grey-soft); border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.domain-chips .chip button svg { width: 14px; height: 14px; }

/* ---------- Diverses ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 10px; color: #B5BAC4; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #D5DAE2; border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 200; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 480px; padding: 12px 16px; border-radius: 12px;
  background: var(--navy-2); color: #fff; font-weight: 500; font-size: .92rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: toast-in .2s ease;
}
.toast.error { background: var(--red-text); }
.toast.success { background: var(--green-text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
details.more summary { cursor: pointer; list-style: none; padding: 12px 2px; color: var(--blue); font-weight: 600; }
details.more summary::-webkit-details-marker { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 30, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + var(--safe-b));
  animation: up .2s ease;
}
.sheet h2 { margin-bottom: 14px; font-size: 1.15rem; }
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }

/* ---------- Prüfbericht (Druck) ---------- */
.report-tools { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.report { background: #fff; color: #000; padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 12px; line-height: 1.35; }
.report .r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.report .r-head h1 { font-size: 22px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.report .r-head p { font-size: 11px; margin-top: 4px; max-width: 520px; }
.report .r-head img { width: 70px; }
.report .r-stripe { height: 6px; margin: 12px 0; background: linear-gradient(90deg, var(--red) 0 50%, var(--blue) 50% 100%); }
.report .r-data { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 10px; }
.report .r-data div { background: #EEF0F2; padding: 5px 8px; min-height: 34px; }
.report .r-data div.wide { grid-column: span 2; }
.report .r-data small { display: block; font-size: 9px; color: #444; }
.report .r-data b { font-weight: 600; }
.report .legal { font-size: 9.5px; border-top: 4px solid #000; padding-top: 6px; margin-bottom: 8px; }
.report table { width: 100%; border-collapse: collapse; }
.report th, .report td { border-bottom: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; }
.report th { border-top: 4px solid #000; border-bottom: 2px solid #000; font-weight: 600; }
.report td.c, .report th.c { text-align: center; width: 44px; border-left: 1px solid #999; }
.report td.desc { border-left: 1px solid #999; }
.report .x { font-weight: 800; }
.report .r-final { margin-top: 10px; display: grid; gap: 4px; }
.report .r-final .ln { display: flex; gap: 10px; }
.report .r-final .ln span:first-child { width: 90px; flex: none; }
.report .r-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 10px; }
.report .r-sign div { background: #EEF0F2; padding: 5px 8px; min-height: 44px; }
.report .r-sign small { display: block; font-size: 9px; color: #444; }
.report .r-foot { margin-top: 10px; border-top: 4px solid #000; padding-top: 6px; font-size: 9.5px; text-align: center; }
.report .r-photos { margin-top: 18px; break-before: page; }
.report .r-photos h2 { font-size: 15px; margin-bottom: 8px; }
.report .r-photos .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.report .r-photos figure { margin: 0; break-inside: avoid; }
.report .r-photos img { width: 100%; height: 160px; object-fit: cover; border: 1px solid #ccc; }
.report .r-photos figcaption { font-size: 10px; margin-top: 2px; }

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .topbar, .stripe, .tabbar, .toasts, .report-tools, .back, .fab { display: none !important; }
  .main { padding: 0 !important; max-width: none; }
  .report { box-shadow: none; padding: 0; border-radius: 0; }
  .report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
