/* ==========================================================================
   Abschleppdienst Efe - Backoffice
   Ein einziges Stylesheet, bewusst ohne Framework: weniger Code, der gepflegt
   werden muss, und keine externen Quellen (strenge Content-Security-Policy).
   Grosszuegige Bedienflaechen, damit die Oberflaeche auch auf dem Tablet
   im Einsatzfahrzeug zuverlaessig bedienbar ist.
   ========================================================================== */

:root {
    /* --- Markenfarben: identisch zur Website abschleppdienst-efe.de --- */
    --gelb: #ffd200;          /* Signalgelb, die Hausfarbe */
    --gelb-rand: #f0c400;
    --gelb-dunkel: #806400;   /* Textvariante: reines Gelb ist auf Weiss unlesbar (nur 3,5:1) */
    --gelb-hell: #fff8d6;

    --tinte: #101418;
    --tinte-weich: #1f252c;
    --text: #1a1f24;
    --gedaempft: #5a616a;
    --linie: #e2e4ea;
    --flaeche: #ffffff;
    --grund: #f3f4f7;
    --grund-tief: #eaecf2;

    /* --- Signalfarben: bewusst NICHT die Markenfarbe ---
       Waere Rot die Hausfarbe, wuerde "unbezahlt" oder "Notfall" in der
       Oberflaeche untergehen. Deshalb bleibt Rot allein der Warnung vorbehalten. */
    --gruen: #0f7b4f;
    --gruen-hell: #e6f4ee;
    --warn: #b45309;
    --warn-hell: #fef3e2;
    --alarm: #c8102e;
    --alarm-dunkel: #9d0c24;
    --alarm-hell: #fdeaed;
    --blau: #1d4ed8;
    --blau-hell: #e8eefc;

    --radius: 10px;
    --radius-sm: 6px;
    --schatten: 0 1px 2px rgba(16, 20, 24, .05), 0 6px 20px rgba(16, 20, 24, .07);
    --schatten-stark: 0 16px 44px rgba(16, 20, 24, .18);

    --kopfhoehe: 60px;
    --seitenbreite: 232px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--grund);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--tinte); line-height: 1.25; margin: 0 0 .6rem; font-weight: 650; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
a { color: var(--gelb-dunkel); }
a:hover { color: var(--tinte); }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--tinte); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* --- Kopfzeile ---------------------------------------------------------- */

.topbar {
    position: fixed; inset: 0 0 auto 0; height: var(--kopfhoehe); z-index: 40;
    display: flex; align-items: center; gap: 14px;
    padding: 0 18px;
    background: var(--tinte);
    color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-mark {
    background: var(--gelb); color: var(--tinte); font-weight: 800; letter-spacing: .06em;
    padding: 5px 9px; border-radius: 6px; font-size: .82rem;
}
.brand-text { font-weight: 600; font-size: .95rem; opacity: .92; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-link { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; color: #fff; }
.user-name { font-size: .86rem; font-weight: 600; }
.user-role { font-size: .72rem; opacity: .65; }
.logout-form { margin: 0; }

.nav-toggle { display: none; }
.burger { display: none; flex-direction: column; gap: 4px; cursor: pointer; padding: 8px; }
.burger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

/* --- Grundraster -------------------------------------------------------- */

.shell { display: flex; padding-top: var(--kopfhoehe); min-height: 100vh; }

.sidebar {
    position: fixed; top: var(--kopfhoehe); bottom: 0; left: 0; width: var(--seitenbreite);
    background: var(--flaeche); border-right: 1px solid var(--linie);
    padding: 16px 12px; overflow-y: auto; z-index: 30;
}
.nav-list { list-style: none; margin: 0 0 4px; padding: 0; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 500;
}
.nav-item:hover { background: var(--grund-tief); color: var(--tinte); }
.nav-item.is-active { background: var(--gelb-hell); color: var(--tinte); font-weight: 640;
    box-shadow: inset 3px 0 0 var(--gelb); }
.nav-heading {
    margin: 18px 12px 6px; font-size: .7rem; text-transform: uppercase;
    letter-spacing: .09em; color: var(--gedaempft); font-weight: 700;
}
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; opacity: .75; background: currentColor;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain; }
.nav-item.is-active .nav-icon { opacity: 1; }

.nav-warning {
    margin-top: 20px; padding: 13px; border-radius: var(--radius);
    background: var(--warn-hell); border: 1px solid #f5d9a8;
}
.nav-warning strong { display: block; color: var(--warn); font-size: .85rem; }
.nav-warning p { font-size: .78rem; margin: 4px 0 9px; color: #7c4a06; }

.content {
    flex: 1; min-width: 0;
    margin-left: var(--seitenbreite);
    padding: 22px 26px 60px;
}

/* --- Seitenkopf --------------------------------------------------------- */

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head .sub { color: var(--gedaempft); font-size: .88rem; margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Karten / Panels ---------------------------------------------------- */

.card {
    background: var(--flaeche); border: 1px solid var(--linie);
    border-radius: var(--radius); box-shadow: var(--schatten);
    margin-bottom: 18px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--linie); flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --- Kennzahlen --------------------------------------------------------- */

.stat {
    background: var(--flaeche); border: 1px solid var(--linie);
    border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--schatten);
}
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gedaempft); font-weight: 650; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--tinte); line-height: 1.15; margin-top: 4px;
    font-variant-numeric: tabular-nums; }
.stat-hint { font-size: .78rem; color: var(--gedaempft); margin-top: 2px; }
.stat.accent-red .stat-value { color: var(--alarm); }
.stat.accent-green .stat-value { color: var(--gruen); }
.stat.accent-amber .stat-value { color: var(--warn); }

/* --- Tabellen ----------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; vertical-align: middle; }
table.data thead th {
    background: var(--grund-tief); color: var(--gedaempft);
    font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
    border-bottom: 1px solid var(--linie); white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--linie); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: #fafbfc; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.actions { text-align: right; white-space: nowrap; }
.row-link { color: var(--tinte); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--gelb-dunkel); text-decoration: underline; }
.cell-sub { display: block; font-size: .78rem; color: var(--gedaempft); }

.empty { padding: 44px 20px; text-align: center; color: var(--gedaempft); }
.empty strong { display: block; color: var(--tinte); margin-bottom: 4px; font-size: 1rem; }

/* --- Abzeichen ---------------------------------------------------------- */

.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .74rem; font-weight: 650; white-space: nowrap; line-height: 1.5;
}
.st-new       { background: var(--blau-hell); color: var(--blau); }
.st-assigned  { background: #ede9fe; color: #5b21b6; }
.st-enroute   { background: var(--warn-hell); color: var(--warn); }
.st-onsite    { background: #fff1cc; color: #92400e; }
.st-towing    { background: var(--alarm-hell); color: var(--alarm-dunkel); }
.st-done      { background: var(--gruen-hell); color: var(--gruen); }
.st-cancelled { background: var(--grund-tief); color: var(--gedaempft); }

.pay-paid      { background: var(--gruen-hell); color: var(--gruen); }
.pay-pending   { background: var(--warn-hell); color: var(--warn); }
.pay-unpaid    { background: var(--alarm-hell); color: var(--alarm-dunkel); }
.pay-refunded  { background: var(--blau-hell); color: var(--blau); }
.pay-cancelled { background: var(--grund-tief); color: var(--gedaempft); }

.prio-emergency { background: var(--alarm); color: #fff; }
.prio-high { background: var(--warn-hell); color: var(--warn); }
.prio-normal { background: var(--grund-tief); color: var(--gedaempft); }

/* --- Schaltflaechen ----------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 17px; min-height: 42px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font: inherit; font-size: .9rem; font-weight: 600;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .12s ease, border-color .12s ease;
}
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--gelb); color: var(--tinte); border-color: var(--gelb-rand); }
.btn-primary:hover:not(:disabled) { background: var(--gelb-rand); color: var(--tinte); }
.btn-secondary { background: var(--flaeche); color: var(--text); border-color: var(--linie); }
.btn-secondary:hover:not(:disabled) { background: var(--grund-tief); color: var(--tinte); }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.28); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.12); color: #fff; }
.btn-danger { background: #fff; color: var(--alarm); border-color: #f2c2ca; }
.btn-danger:hover:not(:disabled) { background: var(--alarm-hell); }
.btn-success { background: var(--gruen); color: #fff; }
.btn-success:hover:not(:disabled) { background: #0c6741; color: #fff; }
.btn-warning { background: var(--warn); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #92400e; color: #fff; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .82rem; }
.btn-lg { padding: 14px 26px; min-height: 52px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Formulare ---------------------------------------------------------- */

.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 640; color: var(--tinte); }
.field .hint { font-size: .76rem; color: var(--gedaempft); }
.req::after { content: " *"; color: var(--alarm); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="search"],
select, textarea {
    width: 100%; padding: 10px 12px; min-height: 42px;
    border: 1px solid #cbd2d9; border-radius: var(--radius-sm);
    font: inherit; font-size: .92rem; color: var(--text); background: #fff;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--gelb-dunkel); box-shadow: 0 0 0 3px rgba(255, 210, 0, .45);
}
input[readonly] { background: var(--grund-tief); color: var(--gedaempft); }
input::placeholder, textarea::placeholder { color: #a3adb8; }

.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; }
.check input[type="checkbox"], .check input[type="radio"] { width: 19px; height: 19px; accent-color: var(--tinte); margin: 0; }

.form-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--linie);
}

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset legend {
    padding: 0; margin-bottom: 12px; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; color: var(--gedaempft);
}

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

.filterbar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
    padding: 14px 18px; background: var(--flaeche);
    border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 16px;
}
.filterbar .field { flex: 1 1 180px; }
.filterbar .field.narrow { flex: 0 1 150px; }

/* --- Auswahlfeld mit Suche (Kunde/Fahrzeug) ----------------------------- */

.picker { position: relative; }
.picker-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
    background: #fff; border: 1px solid var(--linie); border-radius: var(--radius-sm);
    box-shadow: var(--schatten-stark); max-height: 260px; overflow-y: auto;
}
.picker-results[hidden] { display: none; }
.picker-item {
    display: block; width: 100%; text-align: left; padding: 10px 13px;
    border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 1px solid var(--linie);
}
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover, .picker-item.is-highlighted { background: var(--gelb-hell); }
.picker-item .meta { display: block; font-size: .78rem; color: var(--gedaempft); }
.picker-empty { padding: 12px 13px; color: var(--gedaempft); font-size: .85rem; }

.chosen {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 13px; background: var(--grund-tief);
    border: 1px solid var(--linie); border-radius: var(--radius-sm);
}
.chosen strong { font-size: .9rem; }
.chosen .meta { font-size: .78rem; color: var(--gedaempft); }

/* --- Meldungen ---------------------------------------------------------- */

.flash-area { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius); font-size: .9rem; font-weight: 500;
    border: 1px solid;
}
.flash-success { background: var(--gruen-hell); border-color: #b7e0cc; color: #0b5c3b; }
.flash-error   { background: var(--alarm-hell); border-color: #f2c2ca; color: var(--alarm-dunkel); }
.flash-warning { background: var(--warn-hell); border-color: #f5d9a8; color: #7c4a06; }
.flash-info    { background: var(--blau-hell); border-color: #c3d2f7; color: #1e40af; }
.flash-close { border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 4px; }
.flash-close:hover { opacity: 1; }

.toast-area {
    position: fixed; right: 18px; bottom: 18px; z-index: 200;
    display: flex; flex-direction: column; gap: 9px; max-width: min(380px, calc(100vw - 36px));
}
.toast {
    padding: 13px 17px; border-radius: var(--radius); background: var(--tinte); color: #fff;
    box-shadow: var(--schatten-stark); font-size: .9rem; font-weight: 500;
}
.toast.is-error { background: var(--alarm-dunkel); }
.toast.is-success { background: var(--gruen); }

.notice {
    padding: 13px 16px; border-radius: var(--radius); font-size: .87rem;
    border: 1px solid; margin-bottom: 16px;
}
.notice-info { background: var(--blau-hell); border-color: #c3d2f7; color: #1e40af; }
.notice-warn { background: var(--warn-hell); border-color: #f5d9a8; color: #7c4a06; }

/* --- Definitionslisten (Detailansichten) -------------------------------- */

.deflist { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 20px; margin: 0; }
.deflist > div { min-width: 0; }
.deflist dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gedaempft); font-weight: 700; }
.deflist dd { margin: 2px 0 0; font-size: .93rem; color: var(--tinte); overflow-wrap: anywhere; }

/* --- Zeitstrahl (Statusverlauf) ----------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--linie); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -6px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%; background: var(--gelb); border: 2px solid var(--tinte);
}
.timeline .tl-time { font-size: .76rem; color: var(--gedaempft); }
.timeline .tl-text { font-size: .89rem; }

/* --- Karte -------------------------------------------------------------- */

.map-canvas { width: 100%; height: 560px; border-radius: var(--radius); background: var(--grund-tief); }
.map-canvas.tall { height: calc(100vh - var(--kopfhoehe) - 190px); min-height: 420px; }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--gedaempft); padding: 12px 18px; }
.legend-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-order { background: var(--alarm); }
.dot-truck { background: var(--blau); }
.dot-target { background: var(--gruen); }

/* --- Unterschrift ------------------------------------------------------- */

.sign-stage { background: var(--flaeche); border-radius: var(--radius); padding: 18px; border: 1px solid var(--linie); }
.sign-pad {
    width: 100%; height: 300px; touch-action: none;
    border: 2px dashed #c3ccd6; border-radius: var(--radius); background: #fff;
    cursor: crosshair; display: block;
}
.sign-pad.has-ink { border-style: solid; border-color: var(--gruen); }
.sign-baseline { display: flex; justify-content: space-between; font-size: .78rem; color: var(--gedaempft); margin-top: 8px; }
.consent-box {
    background: var(--grund-tief); border-radius: var(--radius-sm);
    padding: 14px; font-size: .86rem; margin: 16px 0; line-height: 1.55;
}

/* --- Diagramm ----------------------------------------------------------- */

.chart { width: 100%; height: 260px; display: block; }
.chart-legend { display: flex; gap: 18px; font-size: .82rem; color: var(--gedaempft); margin-top: 10px; }
.legend-box { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.box-income { background: var(--gruen); }
.box-expense { background: var(--alarm); }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; font-size: .85rem; }
.bar-label { flex: 0 0 150px; color: var(--text); }
.bar-track { flex: 1; height: 9px; background: var(--grund-tief); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; width: 0; }
.bar-fill.income { background: var(--gruen); }
.bar-fill.expense { background: var(--alarm); }
.bar-value { flex: 0 0 110px; text-align: right; font-variant-numeric: tabular-nums; }

/* --- Blaetterfunktion --------------------------------------------------- */

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; flex-wrap: wrap; }
.pager .info { font-size: .84rem; color: var(--gedaempft); }
.pager .links { display: flex; gap: 6px; }
.pager a, .pager span.current {
    padding: 7px 12px; border-radius: var(--radius-sm); font-size: .85rem;
    border: 1px solid var(--linie); text-decoration: none; color: var(--text); background: #fff;
}
.pager span.current { background: var(--gelb); border-color: var(--gelb-rand); color: var(--tinte); font-weight: 650; }

/* --- Dialog ------------------------------------------------------------- */

.modal {
    position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
    background: rgba(31, 41, 51, .55); padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
    background: #fff; border-radius: var(--radius); max-width: 480px; width: 100%;
    box-shadow: var(--schatten-stark); max-height: 90vh; overflow-y: auto;
}
.modal-head { padding: 18px 20px 0; }
.modal-body { padding: 14px 20px; }
.modal-foot { padding: 0 20px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; }

/* --- Anmeldung / oeffentliche Seiten ------------------------------------ */

.body-minimal { background: linear-gradient(160deg, #101418 0%, #1f252c 55%, #2e2a12 100%); min-height: 100vh; }
.minimal-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }

.auth-card {
    width: 100%; max-width: 420px; background: #fff;
    border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); padding: 32px 30px;
}
.auth-card.wide { max-width: 560px; }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .brand-mark { display: inline-block; font-size: 1.05rem; padding: 8px 13px; }
.auth-logo p { margin: 10px 0 0; color: var(--gedaempft); font-size: .86rem; }
.auth-card h1 { font-size: 1.25rem; text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--gedaempft); font-size: .87rem; margin-bottom: 22px; }
.auth-card .field { margin-bottom: 15px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: .8rem; color: var(--gedaempft); }

.code-input {
    font-size: 1.7rem; text-align: center; letter-spacing: .5em;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    padding-left: .5em; min-height: 58px;
}

.qr-wrap { text-align: center; margin: 18px 0; }
.qr-wrap img { width: 220px; height: 220px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; }
.secret-code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: var(--grund-tief); padding: 11px 14px; border-radius: var(--radius-sm);
    text-align: center; font-size: .95rem; letter-spacing: .08em; word-break: break-all;
}
.recovery-list { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.recovery-list li {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: var(--grund-tief); padding: 10px; border-radius: var(--radius-sm);
    text-align: center; font-size: .92rem; letter-spacing: .05em;
}

/* Oeffentliche Kundenseiten */
.public-card {
    width: 100%; max-width: 480px; background: #fff;
    border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); padding: 30px 26px; text-align: center;
}
.public-card.wide { max-width: 760px; text-align: left; }
.public-card h1 { font-size: 1.3rem; }
.public-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 12px; }
.public-map { width: 100%; height: 400px; border-radius: var(--radius); margin: 16px 0; background: var(--grund-tief); }
.track-status {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--grund-tief); border-radius: var(--radius); margin-bottom: 14px;
}
.pulse { width: 11px; height: 11px; border-radius: 50%; background: var(--gruen); flex: 0 0 11px;
    animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* --- Hilfsklassen ------------------------------------------------------- */

.muted { color: var(--gedaempft); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spread { margin-left: auto; }
[hidden] { display: none !important; }

/* --- Symbole (als Maske, damit sie die Textfarbe uebernehmen) ----------- */

.i-grid  { -webkit-mask-image: url("/assets/img/i-grid.svg");  mask-image: url("/assets/img/i-grid.svg"); }
.i-clip  { -webkit-mask-image: url("/assets/img/i-clip.svg");  mask-image: url("/assets/img/i-clip.svg"); }
.i-user  { -webkit-mask-image: url("/assets/img/i-user.svg");  mask-image: url("/assets/img/i-user.svg"); }
.i-car   { -webkit-mask-image: url("/assets/img/i-car.svg");   mask-image: url("/assets/img/i-car.svg"); }
.i-map   { -webkit-mask-image: url("/assets/img/i-map.svg");   mask-image: url("/assets/img/i-map.svg"); }
.i-card  { -webkit-mask-image: url("/assets/img/i-card.svg");  mask-image: url("/assets/img/i-card.svg"); }
.i-chart { -webkit-mask-image: url("/assets/img/i-chart.svg"); mask-image: url("/assets/img/i-chart.svg"); }
.i-file  { -webkit-mask-image: url("/assets/img/i-file.svg");  mask-image: url("/assets/img/i-file.svg"); }
.i-truck { -webkit-mask-image: url("/assets/img/i-truck.svg"); mask-image: url("/assets/img/i-truck.svg"); }
.i-team  { -webkit-mask-image: url("/assets/img/i-team.svg");  mask-image: url("/assets/img/i-team.svg"); }
.i-gear  { -webkit-mask-image: url("/assets/img/i-gear.svg");  mask-image: url("/assets/img/i-gear.svg"); }
.i-shield{ -webkit-mask-image: url("/assets/img/i-shield.svg");mask-image: url("/assets/img/i-shield.svg"); }

/* --- Tablet und Telefon ------------------------------------------------- */

@media (max-width: 980px) {
    .burger { display: flex; }
    .hide-sm { display: none; }
    .sidebar {
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: var(--schatten-stark);
    }
    .nav-toggle:checked ~ .shell .sidebar { transform: translateX(0); }
    .content { margin-left: 0; padding: 18px 16px 60px; }
    .brand-text { display: none; }
}

@media (max-width: 620px) {
    body { font-size: 15px; }
    .content { padding: 14px 12px 50px; }
    .card-body { padding: 14px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions .btn { flex: 1; }
    table.data th, table.data td { padding: 10px 10px; }
    .recovery-list { grid-template-columns: 1fr; }
    .bar-label { flex-basis: 100px; }
    .bar-value { flex-basis: 84px; }
}

/* Auf Geraeten mit Stift/Finger alles etwas grosszuegiger */
@media (pointer: coarse) {
    .btn { min-height: 46px; }
    input, select, textarea { min-height: 46px; font-size: 16px; } /* 16px verhindert Zoom in iOS */
    .nav-item { padding: 13px 12px; }
}

@media print {
    .topbar, .sidebar, .page-actions, .form-actions, .toast-area, .flash-close { display: none !important; }
    .content { margin: 0; padding: 0; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    body { background: #fff; }
}

/* --- Kartenmarkierungen (feste Farbklassen statt Inline-Styles) --------- */

.pin {
    display: block; width: 100%; height: 100%;
    border-radius: 50%; border: 2.5px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.pin-emergency  { background: #c8102e; }
.pin-high       { background: #b45309; }
.pin-normal     { background: #1d4ed8; }
.pin-target     { background: #0f7b4f; }
.pin-truck      { background: #111827; }
.pin-truck-stale{ background: #94a3b8; }
.pin-me         { background: #7c3aed; }

/* Sprechblasen auf der Karte */
.pop { font-size: .85rem; min-width: 170px; }
.pop strong { display: block; font-size: .95rem; color: #1f2933; margin-bottom: 3px; }
.pop-badge { font-size: .72rem; color: #7b8794; text-transform: capitalize; margin-bottom: 7px; }
.pop-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-top: 1px solid #eef1f4; }
.pop-row span { color: #7b8794; }
.pop-link { display: inline-block; margin-top: 8px; font-weight: 600; }

/* Hilfselement zum Kopieren (bleibt für Screenreader unsichtbar) */
.offscreen-helper { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* --- Firmenlogo ---------------------------------------------------------
   Das Logo ist überwiegend schwarz. Auf der dunklen Kopfzeile bekommt es
   deshalb ein helles Feld, sonst verschwinden die schwarzen Anteile. */

.brand-logo {
    height: 40px; width: auto; display: block;
    background: #fff; border-radius: 8px; padding: 3px 7px;
}
.auth-logo .logo-mark { width: 94px; height: auto; display: inline-block; }
.public-logo { width: 78px; height: auto; display: block; margin: 0 auto 14px; }
.public-logo.left { margin: 0 0 14px; }

@media (max-width: 620px) {
    .brand-logo { height: 34px; }
    .auth-logo .logo-mark { width: 78px; }
}
