/*
 * Korbkontrolle – Designsystem "Modern Field Journal".
 *
 * Farbwelt wie bisher (Papier-Beige, Moosgrün, Amanita-Rot, Speisewert-Farben),
 * dazu ein ruhigeres, karten-basiertes Layout: abgerundete Karten mit sanftem
 * Schatten, großzügige Eingabefelder und die Schriften Fraunces (Überschriften)
 * und Work Sans (Fließtext).
 */

:root {
    /* Grundfarben */
    --paper: #F6F3EC;
    --paper-dim: #EAE6DC;
    --paper-soft: #F1EFE8;
    --ink: #272A22;
    --white: #FFFFFF;

    /* Akzente */
    --moss: #4B5D3A;
    --moss-dark: #3A4A2D;
    --amanita: #A83C25;
    --orange: #C4842A;
    --brown: #8A6A46;
    --petrol: #2F6A6C;

    /* Grautöne: Labels, Zweitzeilen, inaktive Elemente */
    --grey: #6B6B5F;
    --grey-soft: #8A8677;
    --grey-mute: #B7B2A2;

    /* Linien und Flächen */
    --border: #DDD8CB;
    --border-soft: #EAE6DC;
    --line-art: #DFD9C8;

    /* Radien und Schatten */
    --radius-card: 16px;
    --radius-field: 14px;
    --radius-pill: 999px;
    --shadow-card: 0 2px 10px rgba(39, 42, 34, 0.06);
    --shadow-field: 0 1px 2px rgba(39, 42, 34, 0.04);
    --shadow-moss: 0 10px 22px rgba(75, 93, 58, 0.30);
    --shadow-moss-soft: 0 8px 20px rgba(75, 93, 58, 0.28);

    --font-heading: "Fraunces", "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
    --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.2px;
    margin: 0 0 0.4em;
}

button {
    font-family: inherit;
}

a { color: var(--moss); }

/* ---------- Login ---------- */

.login-page {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 56px 24px calc(32px + env(safe-area-inset-bottom, 0px));
    position: relative;
    overflow-x: hidden;
}

/* Dezente Konturzeichnung (Baum und Pilz) am unteren Seitenrand. */
.login-artwork {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 390px;
    max-width: 100%;
    height: auto;
    pointer-events: none;
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 1;
    max-width: 360px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.login-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.login-badge {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: var(--moss);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-moss-soft);
    flex-shrink: 0;
}

.login-card h1 {
    font-size: 1.9rem;
    color: var(--ink);
    letter-spacing: -0.3px;
    margin: 0;
}

.login-card .subtitle {
    color: var(--grey);
    font-size: 0.86rem;
    letter-spacing: 0.2px;
    margin: 6px 0 0;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    width: 100%;
}

.login-card label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--grey);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 4px;
}

.login-card input {
    height: 50px;
    border-radius: var(--radius-field);
    border: 1px solid var(--border);
    background: var(--white);
    padding: 0 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    box-shadow: var(--shadow-field);
}

.login-card input:focus {
    outline: none;
    border-color: var(--moss);
    box-shadow: 0 0 0 3px rgba(75, 93, 58, 0.12);
}

.login-card .btn-primary {
    height: 52px;
    justify-content: center;
    margin-top: 4px;
}

.error-message {
    color: var(--amanita);
    font-size: 0.9rem;
    margin: 0;
}

.success-message {
    color: var(--moss-dark);
    font-size: 0.9rem;
    margin: 0;
}

.login-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-copyright {
    margin: 0;
    color: var(--grey-soft);
    font-size: 0.72rem;
}

.login-version {
    margin: 0;
    color: var(--grey-mute);
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}

/* ---------- App-Rahmen ---------- */

#app {
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    background: var(--paper);
    padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 5;
}

.topbar h1 {
    font-size: 1.6rem;
    color: var(--ink);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Kompakte Aktion in der Kopfzeile, z. B. "+ Neu". */
.btn-pill {
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--moss);
    color: var(--paper);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(75, 93, 58, 0.22);
}

.btn-pill:hover { background: var(--moss-dark); }

.btn-pill svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.view {
    padding: 4px 20px 24px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--white);
    border-top: 1px solid var(--border-soft);
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 10;
}

.bottom-nav button {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 4px 14px;
    font-size: 0.65rem;
    color: var(--grey-mute);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.bottom-nav button .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.bottom-nav button .icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.bottom-nav button.active {
    color: var(--moss);
    font-weight: 600;
}

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

.btn-primary, .btn-secondary, .btn-danger {
    border: none;
    border-radius: var(--radius-field);
    padding: 13px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--moss);
    color: var(--paper);
    font-weight: 600;
    box-shadow: var(--shadow-moss);
}

.btn-primary:hover { background: var(--moss-dark); }

.btn-secondary {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-field);
}

.btn-secondary:hover { border-color: var(--moss); }

.btn-danger {
    background: var(--white);
    color: var(--amanita);
    border: 1px solid var(--amanita);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--grey-soft);
    padding: 6px 8px;
    border-radius: 10px;
}

.btn-icon:hover { background: var(--paper-soft); }

.kontakt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 2px;
}

/* ---------- Karten / Listen ---------- */

.card-list { display: flex; flex-direction: column; gap: 12px; }

.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.15s, transform 0.15s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(39, 42, 34, 0.10);
    transform: translateY(-1px);
}

/* Karten ohne Detailansicht (Kontakte, Referenzliste) */
.card-static { cursor: default; }
.card-static:hover { box-shadow: var(--shadow-card); transform: none; }

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-auftragsnummer {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--ink);
}

.card-name {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink);
}

/* Zweitzeile: Kontakt, Datum, Ort … */
.card-sub {
    font-size: 0.8rem;
    color: var(--grey-soft);
    margin-top: 2px;
}

.card-pilzarten {
    font-size: 0.8rem;
    color: var(--grey-soft);
    font-style: italic;
}

/* Pill-Badge oben rechts auf der Karte (z. B. Sichtung). */
.card-badge {
    font-size: 0.64rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
    background: var(--paper-soft);
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-badge.live {
    background: var(--paper-dim);
    color: var(--moss);
}

/* Badge mit eigenem Text (z. B. Latenzzeit) – ohne Versalien */
.card-badge.plain {
    text-transform: none;
    letter-spacing: 0.2px;
    font-size: 0.68rem;
}

/* Farbige Punkte: Speisewert-Verteilung der Funde einer Beratung. */
.dot-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.fund-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-label {
    font-size: 0.72rem;
    color: var(--grey-soft);
    margin-left: 4px;
}

.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--white);
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    color: var(--grey-soft);
    padding: 40px 20px;
}

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

.form-section {
    background: var(--white);
    border: none;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 18px;
    margin-bottom: 14px;
}

.form-section h2 {
    font-size: 1.1rem;
    color: var(--ink);
}

.form-section p {
    line-height: 1.5;
    color: var(--ink);
}

.form-section ul {
    margin: 8px 0 0;
    padding-left: 20px;
    line-height: 1.5;
}

.form-section ul ul {
    margin-top: 4px;
    margin-bottom: 6px;
}

.form-section li {
    margin-bottom: 6px;
}

.form-section strong {
    color: var(--moss-dark);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--grey);
    padding-left: 4px;
}

.field input,
.field select,
.field textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    padding: 13px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-field);
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--moss);
    box-shadow: 0 0 0 3px rgba(75, 93, 58, 0.12);
}

.field input:read-only {
    background: var(--paper-soft);
    color: var(--grey);
    box-shadow: none;
}

.field input[type="file"] {
    padding: 10px 12px;
    font-size: 0.85rem;
    background: var(--paper-soft);
    box-shadow: none;
}

.field-row {
    display: flex;
    gap: 10px;
}

.radio-group {
    display: flex;
    gap: 10px;
}

.radio-option {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 0.92rem;
    color: var(--ink) !important;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    padding: 12px 14px !important;
    box-shadow: var(--shadow-field);
    cursor: pointer;
}

.radio-option:has(input:checked) {
    border-color: var(--moss);
    background: var(--paper-soft);
}

.radio-option input { accent-color: var(--moss); }

.field-row .field { flex: 1; }

.pilzfund-item {
    background: var(--paper-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
}

.pilzfund-item .remove-fund {
    position: absolute;
    top: 8px;
    right: 8px;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.image-gallery .thumb {
    position: relative;
    width: 64px;
    height: 64px;
}

.image-gallery .thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
}

.image-gallery .thumb-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--amanita);
    color: var(--white);
    border: none;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
}

.uploading-hint {
    font-size: 0.8rem;
    color: var(--grey);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary,
.form-actions .btn-danger { flex: 1; justify-content: center; }

.latenzzeit-hint {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--moss-dark);
    background: var(--paper-soft);
    border-radius: var(--radius-field);
    border-left: 4px solid transparent;
    padding: 10px 14px;
    margin-bottom: 14px;
}

/* ---------- Bericht ---------- */

.report-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--paper-dim);
    border-radius: var(--radius-field);
    padding: 4px;
}

.report-toggle button {
    flex: 1;
    padding: 10px;
    border-radius: 11px;
    border: none;
    background: none;
    color: var(--grey);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.report-toggle button.active {
    background: var(--white);
    color: var(--moss-dark);
    font-weight: 600;
    box-shadow: var(--shadow-field);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.stat-tile {
    background: var(--white);
    border: none;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
    text-align: center;
}

.stat-tile .value {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.7rem;
    color: var(--moss-dark);
    display: block;
}

.stat-tile .label {
    font-size: 0.74rem;
    color: var(--grey-soft);
}

.art-list {
    background: var(--white);
    border: none;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
    margin-bottom: 12px;
}

.art-list strong {
    font-family: var(--font-heading);
    font-size: 1rem;
}

.art-list ul { margin: 8px 0 0; padding-left: 20px; }

.speisewert-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.9rem;
}

.speisewert-table td {
    padding: 7px 0;
    border-bottom: 1px solid var(--paper-soft);
}

.speisewert-table tr:last-child td { border-bottom: none; }

.speisewert-table .speisewert-count {
    text-align: right;
    font-weight: 600;
    color: var(--moss-dark);
}

.speisewert-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.monthly-chart {
    width: 100%;
    height: auto;
    margin-top: 8px;
    overflow: visible;
}

.monthly-chart .chart-bar { fill: var(--moss); }
.monthly-chart .chart-baseline { stroke: var(--border-soft); stroke-width: 1; }
.monthly-chart .chart-value { font-size: 8px; fill: var(--ink); }
.monthly-chart .chart-label { font-size: 8px; fill: var(--grey-soft); }

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--paper);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.86rem;
    box-shadow: 0 6px 18px rgba(39, 42, 34, 0.22);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    max-width: calc(100% - 40px);
    text-align: center;
}

.toast.show { opacity: 1; }

.toast.error { background: var(--amanita); }

/* ---------- Kontakt-Picker / Autovervollständigung ---------- */

.kontakt-picker {
    display: flex;
    gap: 8px;
}

.kontakt-picker input {
    flex: 1;
}

.kontakt-picker .btn-secondary {
    flex-shrink: 0;
    padding: 12px 18px;
    font-size: 1.1rem;
    line-height: 1;
}

.kontakt-suggestions {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    box-shadow: var(--shadow-card);
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
}

.suggestion-item {
    padding: 11px 14px;
    cursor: pointer;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--paper-soft);
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover { background: var(--paper-soft); }

.suggestion-sub {
    color: var(--grey-soft);
    font-size: 0.8rem;
}

/* ---------- Modal ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(39, 42, 34, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.modal-card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(39, 42, 34, 0.24);
}

.modal-card h2 {
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 16px;
}

.mail-format-actions { margin-bottom: 8px; }
.mail-status { color: var(--grey); font-style: italic; }

/* ---------- Akkordeon ---------- */

.accordion {
    margin-top: 4px;
}

.accordion-item {
    border-bottom: 1px solid var(--paper-soft);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: none;
    border: none;
    text-align: left;
    padding: 13px 0;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1rem;
    color: var(--ink);
}

.accordion-header:hover {
    color: var(--moss-dark);
}

.accordion-chevron {
    color: var(--grey-soft);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.accordion-header.open .accordion-chevron {
    transform: rotate(180deg);
    color: var(--moss);
}

.accordion-body {
    padding: 0 0 14px;
    font-size: 0.92rem;
    color: var(--ink);
}

.accordion-body p {
    line-height: 1.5;
    margin: 0 0 8px;
}

.accordion-body p:last-child {
    margin-bottom: 0;
}

.accordion-body strong {
    color: var(--moss-dark);
}

.quelle-hinweis {
    font-size: 0.76rem;
    color: var(--grey-soft);
    font-style: italic;
    line-height: 1.5;
    padding: 4px 2px 20px;
}

/* ---------- Offline / Synchronisation ---------- */

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-family: var(--font-body);
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-pill.offline {
    background: var(--paper-dim);
    color: var(--grey);
    border-color: var(--border);
}

.status-pill.pending {
    background: var(--orange);
    color: var(--ink);
    cursor: pointer;
}

.status-pill.sync-error {
    background: var(--amanita);
    color: var(--white);
    cursor: pointer;
}

.offline-notice {
    background: var(--paper-dim);
    border-left: 4px solid var(--brown);
    border-radius: var(--radius-field);
    padding: 11px 14px;
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: var(--moss-dark);
}

.sync-error-notice {
    background: #F7E9E5;
    border-left: 4px solid var(--amanita);
    border-radius: var(--radius-field);
    padding: 11px 14px;
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: var(--amanita);
}

.hint-text {
    color: var(--grey-soft);
    font-size: 0.82rem;
}

.chip-sync {
    background: var(--orange);
    color: var(--ink);
}

.chip-sync-error {
    background: var(--amanita);
}

/* Lokal zwischengespeicherte, noch nicht hochgeladene Fotos */
.image-gallery .thumb.thumb-local img {
    outline: 2px dashed var(--orange);
    outline-offset: -2px;
}

button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- Anmeldung, Registrierung, Zwei-Faktor ---------- */

.login-card a {
    color: var(--moss);
}

.login-card .btn-primary {
    text-decoration: none;
}

.login-hinweis {
    font-size: 0.8rem;
    color: var(--grey);
    line-height: 1.5;
    margin: 0;
}

.login-hinweis code {
    font-size: 0.78rem;
    background: var(--paper-dim);
    border-radius: 6px;
    padding: 1px 5px;
}

.login-abbrechen {
    margin-top: -8px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--grey);
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px;
}

.btn-link:hover { color: var(--moss-dark); }

.btn-link:disabled {
    cursor: default;
    text-decoration: none;
    opacity: 0.7;
}

.register-bestaetigung {
    text-align: left;
    font-size: 0.92rem;
    line-height: 1.6;
}

.register-bestaetigung p { margin: 0 0 10px; }

/* ---------- Admin: Benutzerverwaltung ---------- */

.admin-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
    color: var(--grey-soft);
}

.admin-datum {
    margin: 4px 0 0;
}

.admin-datum label {
    font-size: 0.72rem;
}

.admin-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-aktionen button {
    flex: 1;
    min-width: 140px;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.85rem;
}

/* ---------- Anmeldung: „Diesem Gerät vertrauen“, Registrierungsschritte ---------- */

.login-card label.login-checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--ink);
    cursor: pointer;
}

.login-card .login-checkbox input {
    height: 20px;
    width: 20px;
    flex: 0 0 20px;
    margin: 1px 0 0;
    padding: 0;
    box-shadow: none;
    accent-color: var(--moss);
}

.login-checkbox small {
    display: block;
    margin-top: 2px;
    font-size: 0.76rem;
    color: var(--grey);
    line-height: 1.4;
}

.register-schritte {
    margin: 4px 0 12px;
    padding-left: 22px;
    font-size: 0.86rem;
    color: var(--grey);
}

.register-schritte li { margin-bottom: 2px; }
.register-schritte li.erledigt { text-decoration: line-through; }
.register-schritte li.aktuell { color: var(--ink); font-weight: 600; }

/* ---------- Einstellungen: vertrauenswürdige Geräte ---------- */

.geraete-liste {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.geraete-liste li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    background: var(--white);
}

.geraet-name { font-weight: 600; }

.geraet-meta {
    font-size: 0.78rem;
    color: var(--grey);
}

.form-section h3 {
    font-size: 0.95rem;
    color: var(--ink);
    margin: 18px 0 6px;
}

.form-section h2 + h3 { margin-top: 8px; }

/* ---------- Fußzeile der App (Impressum, Datenschutz, AVV) ---------- */

.app-footer {
    padding: 18px 16px 4px;
    text-align: center;
    border-top: 1px solid var(--border-soft);
    margin-top: 24px;
}

.app-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin: 0 0 4px;
}

.app-footer-links a {
    color: var(--grey);
    font-size: 0.78rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.app-footer-links a:hover { color: var(--moss-dark); }

.app-footer-version {
    margin: 0;
    color: var(--grey-mute);
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}

/* Rechtstext-Links in der Fußzeile der Anmelde- und Registrierungsseite */
.login-rechtstexte {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0 0 2px;
    font-size: 0.72rem;
}

.login-rechtstexte a {
    color: var(--grey);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

/* ---------- Öffentliche Rechtstext-Seiten ---------- */

.legal-page {
    display: flex;
    justify-content: center;
    padding: 24px 16px calc(32px + env(safe-area-inset-bottom, 0px));
}

.legal-card {
    width: 100%;
    max-width: 720px;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px 22px;
}

.legal-zurueck {
    margin: 0 0 12px;
    font-size: 0.82rem;
}

.legal-zurueck a { text-decoration: none; }

.legal-card h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 0 0 14px;
}

.legal-platzhalter {
    background: var(--paper-dim);
    border-left: 4px solid var(--orange);
    border-radius: var(--radius-field);
    padding: 11px 14px;
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: var(--moss-dark);
}

.legal-inhalt {
    font-size: 0.92rem;
    line-height: 1.65;
}

.legal-inhalt h2 {
    font-size: 1.05rem;
    margin: 22px 0 6px;
}

.legal-inhalt h3 {
    font-size: 0.95rem;
    margin: 16px 0 4px;
}

.legal-inhalt ul,
.legal-inhalt ol { padding-left: 20px; }

.legal-inhalt li { margin-bottom: 4px; }

.legal-inhalt table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.86rem;
}

.legal-inhalt th,
.legal-inhalt td {
    border: 1px solid var(--border);
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}

.legal-footer {
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 0 4px;
    font-size: 0.8rem;
}

.legal-meta {
    margin: 0;
    color: var(--grey-mute);
    font-size: 0.72rem;
}

/* ---------- Einstellungen: Meine Daten, Konto löschen ---------- */

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.link-row .btn-secondary {
    text-decoration: none;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.export-csv-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.export-csv-row select {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    background: var(--white);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.form-section-danger {
    border-color: #E6CFC8;
}

.form-section-danger h2 { color: var(--amanita); }

.einwilligungen-liste {
    margin: 0 0 10px;
    padding-left: 20px;
    font-size: 0.82rem;
    color: var(--grey);
}

/* ---------- Admin: Unternavigation und Sicherheitsprotokoll ---------- */

.admin-nav { margin-bottom: 14px; }

.audit-eintrag .card-name { font-size: 0.95rem; }

.audit-zeit {
    color: var(--grey-soft);
    font-size: 0.75rem;
    white-space: nowrap;
}

.audit-blaettern {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.audit-blaettern button {
    flex: 1;
    justify-content: center;
}
