/* easy4drive – App-Design (mobile first) */

:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --dark: #0f172a;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --fuel: #ea580c;
    --fuel-soft: #fff7ed;
    --charge: #16a34a;
    --charge-soft: #f0fdf4;
    --cost: #7c3aed;
    --cost-soft: #f5f3ff;
    --odo: #0891b2;
    --odo-soft: #ecfeff;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warn: #b45309;
    --warn-soft: #fffbeb;
    --ok: #15803d;
    --ok-soft: #f0fdf4;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
    --tabbar-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}

body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); }

a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.icon { flex: none; vertical-align: middle; }

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--dark);
    color: #fff;
    padding-top: var(--safe-top);
}

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    flex: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary);
    font-size: 12px;
    letter-spacing: -.3px;
}

.topbar-back {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: -8px;
    border-radius: 999px;
    color: #fff;
}

.topbar-back:active { background: rgba(255, 255, 255, .12); }

.topbar-title {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topnav { display: none; align-items: center; gap: 4px; margin-left: auto; }
.topnav a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 999px;
}
.topnav a:hover, .topnav a.active { color: #fff; background: rgba(255, 255, 255, .1); }
.topnav .btn { margin-left: 8px; }
.topnav-public { display: flex; }

/* Handy: auf Unterseiten Zurück-Pfeil + Titel statt Logo */
@media (max-width: 899px) {
    .brand.has-back { display: none; }
}

/* Desktop: Logo und Navigation stehen immer an derselben Stelle */
@media (min-width: 900px) {
    .topnav { display: flex; }
    .topbar-back { margin-left: 8px; width: 34px; height: 34px; }
    .topbar-title { flex: 0 1 auto; font-weight: 600; color: #cbd5e1; }
}

/* ---------- Grundlayout ---------- */

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px;
}

body.narrow .container { max-width: 640px; }

@media (min-width: 900px) {
    .container { padding: 28px 24px; }
}

.stack > * + * { margin-top: 16px; }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}

@media (min-width: 700px) {
    .card { padding: 24px; }
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-head h2 { margin: 0; }

.section-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin: 24px 4px 8px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 16px;
}

.page-head h1 { margin: 0; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--dark);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, transform .05s;
}

.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: inherit; border-color: var(--line-strong); }
.topbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-light { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--danger); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #fecaca; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn-row .btn { flex: 1 1 auto; }

@media (min-width: 700px) {
    .btn-row .btn { flex: 0 0 auto; }
}

/* Speichern-Leiste bleibt am Handy immer sichtbar */
.form-actions {
    position: sticky;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom));
    z-index: 5;
    display: flex;
    gap: 10px;
    margin: 20px -18px -18px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
}

.form-actions .btn { flex: 1; }
.form-actions .btn-primary { flex: 2; }

@media (min-width: 700px) {
    .form-actions { margin: 24px -24px -24px; padding: 14px 24px; justify-content: flex-end; }
    .form-actions .btn, .form-actions .btn-primary { flex: 0 0 auto; }
}

@media (min-width: 900px) {
    .form-actions { bottom: 0; }
}

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

.field { margin-top: 14px; }
.field:first-child { margin-top: 0; }

label, .label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 6px;
}

.req { color: var(--danger); }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
input[type=search], input[type=tel], select, textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 16px; /* verhindert Zoom am iPhone */
    appearance: none;
    -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

input[type=date] { min-width: 0; }
textarea { min-height: 96px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

input.is-computed { background: var(--primary-soft); border-color: #bfdbfe; }
input.is-suggested { background: #fffbeb; border-color: #f59e0b; border-style: dashed; }
.price-suggestion { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fcd34d; }
.price-suggestion p { margin: 0 0 6px; font-size: .92rem; }
.price-suggestion .hint { margin: 6px 0 0; }
.price-suggestion label.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.price-suggestion label.check input { width: 20px; height: 20px; }
.kpi-note { color: var(--muted); font-size: .75rem; margin-top: 2px; font-style: italic; }

.hint { color: var(--muted); font-size: .84rem; margin-top: 5px; }

.input-unit { position: relative; }
.input-unit input { padding-right: 56px; }
.input-unit .unit {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-weight: 600;
    pointer-events: none;
}

.grid-2, .grid-3 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Datumsfelder dürfen die Spalte nicht über den Rand drücken */
    gap: 12px;
}

.grid-2 > *, .grid-3 > * { min-width: 0; }

.grid-2 > .field, .grid-3 > .field { margin-top: 0; }
.grid-3 > .full-mobile { grid-column: 1 / -1; }
@media (min-width: 700px) { .grid-3 > .full-mobile { grid-column: auto; } }
.grid-2 + .grid-2, .grid-2 + .field, .field + .grid-2, .grid-3 + .field, .grid-3 + .grid-2, .grid-2 + .grid-3 { margin-top: 14px; }
.span-2 { grid-column: 1 / -1; }

@media (min-width: 700px) {
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    margin: 12px 0 0;
    cursor: pointer;
}

.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.check small { display: block; color: var(--muted); font-weight: 400; }

/* Segmentierte Auswahl (Radio-Buttons als Schalter) */
.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented label {
    margin: 0;
    flex: 1 1 auto;
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.segmented input:checked + span {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.segmented input:focus-visible + span { box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.segmented label { flex: 0 0 auto; }
.chips.segmented span { min-height: 40px; border-radius: 999px; padding: 6px 14px; }

/* Aufklappbereiche */
details.more {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
}

details.more > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

details.more > summary { flex-wrap: wrap; row-gap: 2px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "+"; order: 2; font-size: 1.3rem; line-height: 1; color: var(--muted); }
details.more[open] > summary::after { content: "−"; }
details.more > summary small { order: 3; flex-basis: 100%; font-weight: 400; font-size: .84rem; color: var(--muted); }
details.more .more-body { padding: 0 16px 16px; }

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

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-success { background: var(--ok-soft); color: #166534; border-color: #bbf7d0; }
.alert-info { background: var(--primary-soft); color: #1e40af; border-color: #bfdbfe; }
.alert-warn { background: var(--warn-soft); color: #92400e; border-color: #fde68a; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Fahrzeugliste ---------- */

.vehicle-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 760px) {
    .vehicle-grid { grid-template-columns: repeat(2, 1fr); }
}

.vehicle-card {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}

.vehicle-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }

.vehicle-photo {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #94a3b8;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.vehicle-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vehicle-photo .icon { width: 56px; height: 56px; stroke-width: 1.2; }

.plate {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--text);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-weight: 800;
    letter-spacing: .06em;
    padding: 1px 8px;
    font-size: .9rem;
    white-space: nowrap;
}

.vehicle-photo .plate { position: absolute; left: 12px; bottom: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }

.vehicle-body { padding: 14px 16px 16px; }
.vehicle-body h2 { margin: 0; font-size: 1.2rem; }
.vehicle-body .muted { font-size: .9rem; }

.kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}

@media (min-width: 560px) {
    .kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); }
    .kpis.kpis-3 { grid-template-columns: repeat(3, 1fr); }
}

.kpi {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    min-width: 0;
}

.kpi-label { color: var(--muted); font-size: .78rem; font-weight: 600; }
.kpi-value { font-size: 1.15rem; font-weight: 800; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-hint { color: var(--muted); font-size: .75rem; margin-top: 2px; }
.kpi-big .kpi-value { font-size: clamp(1.15rem, 5.2vw, 1.5rem); }

.empty {
    text-align: center;
    padding: 36px 16px;
}

.empty .icon { width: 48px; height: 48px; color: var(--muted); stroke-width: 1.4; }

/* ---------- Fahrzeug-Detail ---------- */

.hero {
    display: flex;
    gap: 16px;
    align-items: center;
}

.hero-photo {
    position: relative;
    flex: none;
    width: 112px;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: grid;
    place-items: center;
    color: #94a3b8;
    text-decoration: none;
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo .photo-edit {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .75);
    color: #fff;
    display: grid;
    place-items: center;
}
.hero-photo .photo-edit .icon { width: 16px; height: 16px; }

@media (min-width: 700px) {
    .hero-photo { width: 200px; }
}

.hero h1 { margin: 0 0 4px; font-size: 1.35rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: .85rem;
    text-align: center;
    min-width: 0;
}

.quick-action .qa-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.ic-fuel { background: var(--fuel-soft); color: var(--fuel); }
.ic-charge { background: var(--charge-soft); color: var(--charge); }
.ic-cost { background: var(--cost-soft); color: var(--cost); }
.ic-odo { background: var(--odo-soft); color: var(--odo); }
.ic-neutral { background: #f1f5f9; color: var(--muted); }

/* Erinnerungen */
.reminders { display: grid; gap: 8px; }

.reminder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.reminder .icon { width: 22px; height: 22px; }
.reminder strong { display: block; font-size: .95rem; }
.reminder span { color: var(--muted); font-size: .85rem; }
.reminder.danger { background: var(--danger-soft); border-color: #fecaca; }
.reminder.danger .icon { color: var(--danger); }
.reminder.warn { background: var(--warn-soft); border-color: #fde68a; }
.reminder.warn .icon { color: var(--warn); }
.reminder.info .icon { color: var(--primary); }

/* Zeitleiste */
.filter-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tabs a {
    flex: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: .88rem;
}

.filter-tabs a.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.filter-tabs a small { color: inherit; opacity: .7; margin-left: 4px; }

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li + li { border-top: 1px solid var(--line); }

.entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 2px;
    color: inherit;
    text-decoration: none;
}

.entry:active { background: var(--surface-2); }

.entry-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.entry-main { flex: 1; min-width: 0; }
.entry-title { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-sub { display: block; color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-side { text-align: right; flex: none; max-width: 42%; }
.entry-extra { display: inline-block; white-space: nowrap; }
.entry-amount { font-weight: 800; }
.entry-extra { font-size: .8rem; color: var(--muted); }
.entry-extra.good { color: var(--ok); font-weight: 700; }

.tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--muted);
    vertical-align: 1px;
    margin-left: 4px;
}

.tag-warn { background: var(--warn-soft); color: var(--warn); }

/* Datenliste (Stammdaten) */
.data-list {
    display: grid;
    grid-template-columns: 1fr;
    margin: 0;
}

@media (min-width: 700px) {
    .data-list { grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

.data-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Diagramme ---------- */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--primary); }
.chart .bar-fuel { fill: var(--fuel); }
.chart .bar-charge { fill: var(--charge); }
.chart .bar-cost { fill: var(--cost); }
.chart .line { fill: none; stroke: var(--fuel); stroke-width: 2.5; }
.chart .dot { fill: var(--fuel); }
.chart .avg-line { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1.5; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .84rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.bar-track { display: block; height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--primary); }

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

.table-wrap { overflow-x: auto; margin: 0 -4px; }

table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table td.num, .table th.num { text-align: right; }

/* ---------- Menülisten (Profil) ---------- */

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list a, .menu-list button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 2px;
    background: none;
    border: 0;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}
.menu-list .chev { margin-left: auto; color: var(--muted); }
.menu-list .danger { color: var(--danger); }

/* ---------- Untere Navigation + Erfassen-Sheet ---------- */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
}

.tabbar a, .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    text-decoration: none;
    font: inherit;
    font-size: .72rem;
    font-weight: 600;
    background: none;
    border: 0;
    cursor: pointer;
}

.tabbar .icon { width: 24px; height: 24px; }
.tabbar a.active { color: var(--primary); }

.tabbar .tab-add .icon {
    width: 44px;
    height: 44px;
    padding: 10px;
    margin-top: -18px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .4);
}

.tabbar .tab-add { color: var(--primary); }

@media (min-width: 900px) {
    .tabbar { display: none; }
    body.has-tabbar { padding-bottom: 0; }
}

dialog.sheet {
    border: 0;
    padding: 8px 16px calc(16px + var(--safe-bottom));
    margin: auto auto 0;
    width: 100%;
    max-width: 560px;
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 -10px 40px rgba(15, 23, 42, .25);
}

dialog.sheet::backdrop { background: rgba(15, 23, 42, .45); }

dialog.sheet[open] { animation: sheet-up .2s ease-out; }

@keyframes sheet-up {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (min-width: 900px) {
    dialog.sheet { margin: auto; border-radius: 20px; }
}

.sheet-handle { width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet-title { font-size: 1.1rem; text-align: center; }
.sheet-title small { display: block; font-weight: 500; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.sheet-actions { display: grid; gap: 8px; margin: 14px 0; }

.sheet-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}

.sheet-action:active { background: var(--surface-2); }
.sheet-action strong { display: block; }
.sheet-action small { color: var(--muted); }

.sheet-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

/* ---------- Fußzeile ---------- */

.app-footer {
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    padding: 8px 16px 24px;
}

.app-footer a { color: var(--muted); }

/* ---------- Anmeldung ---------- */

.auth-card { max-width: 440px; margin: 16px auto; }
.auth-card h1 { font-size: 1.4rem; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: .92rem; }

/* Honeypot gegen Bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Rechtstexte */
.prose h2 { margin-top: 1.4em; }
.prose p, .prose li { color: #334155; }

/* Installationshinweis */
.install-hint { display: none; }
.install-hint.show { display: block; }

/* ---------- Premium ---------- */

.premium-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .03em;
    vertical-align: 1px;
}

.premium-teaser {
    border: 1px solid #fde68a;
    background: linear-gradient(180deg, #fffbeb, #ffffff 60%);
}

.premium-teaser h2 { margin-top: 10px; }

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list .icon { color: var(--ok); margin-top: 2px; }

.plan-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .plan-grid { grid-template-columns: 1fr 1fr; } }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.plan.highlight { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }
.plan-price { font-size: 1.8rem; font-weight: 800; margin: 6px 0 14px; }
.plan-price small { font-size: .9rem; font-weight: 600; color: var(--muted); }

/* Schmale Handys: Formularabschnitte etwas enger, damit Datumsfelder in zwei Spalten ganz lesbar bleiben */
@media (max-width: 440px) {
    input[type=date] { padding-left: 10px; padding-right: 4px; }
    details.more .more-body { padding-left: 12px; padding-right: 12px; }
}
