/* =========================================================
   GreenMedi — Atelier Verde (theme layer)
   Calm forest workspace · no neon · no glow clutter
   ========================================================= */

:root {
    --font: "Figtree", "Segoe UI", sans-serif;
    --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
    --space-1: 0.35rem;
    --space-2: 0.65rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2.25rem;
    --sidebar-w: 252px;
    --topbar-h: 64px;
    --paper: #e8ece8;
    --paper-deep: #dce3dd;
    --surface: #fbfcfb;
    --surface-2: #f2f5f2;
    --shadow: 0 1px 2px rgba(19, 37, 28, 0.05);
    --shadow-md: 0 8px 24px rgba(19, 37, 28, 0.08);
    --radius: 10px;
    --radius-sm: 7px;
}

html { font-size: 15.5px; }

body.saas-body {
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(31, 107, 69, 0.07), transparent 55%),
        radial-gradient(ellipse 50% 35% at 0% 100%, rgba(19, 37, 28, 0.04), transparent 50%),
        linear-gradient(180deg, #eef2ef 0%, var(--paper) 45%, #e3e9e4 100%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--font);
}

h1, h2, h3,
.topbar-titel,
.seitenkopf h1,
.auth-hero h1,
.auth-card__body h2 {
    font-family: var(--display);
    font-optical-sizing: auto;
    letter-spacing: -0.03em;
}

/* ── Shell ── */
.app-shell { min-height: 100dvh; }

.sidebar {
    width: var(--sidebar-w);
    background:
        linear-gradient(165deg, rgba(42, 133, 88, 0.2), transparent 40%),
        linear-gradient(180deg, #16382a 0%, #10281e 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.app-main { background: transparent; }

.sidebar-brand {
    margin: 0.85rem 0.75rem 0.35rem;
    padding: 0.9rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    transition: background 0.15s ease;
}
.sidebar-brand:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    text-decoration: none;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: linear-gradient(145deg, #2a8558, #165536);
    color: #fff;
    font-family: var(--font);
    font-weight: 800;
    font-size: 0.75rem;
    box-shadow: none;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.brand-mark::after { display: none; }
.brand-mark--logo {
    background: #fff;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px;
}
.brand-mark--logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.brand-text strong {
    font-family: var(--display);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
}
.brand-text span {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    color: #a3b8ab;
}

.nav-gruppe {
    padding: 1.1rem 0.75rem 0.35rem;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    color: #7f9688;
}

.nav-link {
    margin: 0 0.1rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: none;
    color: #fff;
}
.nav-link.aktiv {
    background: rgba(42, 133, 88, 0.24);
    border-color: rgba(126, 184, 150, 0.25);
    color: #fff;
}
.nav-link.aktiv::before {
    background: #7eb896;
    box-shadow: none;
}
.nav-link.aktiv .nav-icon { color: #b8e0c8; opacity: 1; }

.sprache-switch {
    background: rgba(0, 0, 0, 0.22);
    border: none;
    border-radius: var(--radius-sm);
}
.sprache-switch a.aktiv {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: none;
}

.topbar {
    min-height: var(--topbar-h);
    padding: 0.75rem 1.5rem;
    background: rgba(251, 252, 251, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: none;
}
.topbar-links { min-width: 0; }
.topbar-kicker {
    margin: 0 0 0.1rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--moss);
}
.topbar-titel {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}
.topbar-cta { white-space: nowrap; }
.benutzer-name {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.benutzer-chip {
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
}
.benutzer-avatar {
    background: linear-gradient(145deg, #2a8558, #165536);
    color: #fff;
    border-radius: 7px;
}

.hauptinhalt {
    padding: 1.5rem 1.5rem 3rem;
    max-width: 1180px;
    animation: gm-fade-in 0.35s ease both;
}
@keyframes gm-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hauptinhalt { animation: none; }
}

/* ── Page headers ── */
.seitenkopf {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.seitenkopf h1 {
    margin: 0;
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    font-weight: 700;
    color: var(--ink);
}
.untertitel {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 48ch;
}
.kopf-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

/* ── Buttons ── */
.btn {
    min-height: 42px;
    padding: 0.65rem 1.15rem;
    border-radius: var(--radius-sm);
    background: var(--moss);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: none;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn::after { display: none !important; }
.btn:hover {
    background: var(--moss-deep);
    color: #fff;
    transform: none;
    filter: none;
    box-shadow: none;
}
.btn:active { transform: none; }
.btn:focus-visible {
    outline: 2px solid var(--moss);
    outline-offset: 2px;
}
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-sekundaer {
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--line-strong);
    box-shadow: none;
}
.btn-sekundaer::after { display: none; }
.btn-sekundaer:hover {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--moss);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}
.btn-ghost::after { display: none; }
.btn-ghost:hover {
    background: var(--moss-soft);
    color: var(--moss-deep);
}

.btn-gefahr {
    background: var(--danger);
    color: #fff;
}
.btn-gefahr:hover { color: #fff; filter: none; background: #a83232; }

.btn-klein {
    min-height: 34px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-navy {
    background: var(--ink);
    color: #fff;
}
.btn-navy:hover { color: #fff; background: #243830; filter: none; }

.formular-aktionen-sticky {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, rgba(251, 252, 251, 0.92));
}
.aktionen-nav {
    display: flex;
    gap: 0.5rem;
    margin-right: auto;
}

/* ── Surfaces ── */
.formular,
.dash-panel,
.tabelle-wrap,
.filterleiste,
.formular-logo,
.formular-themen {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
}

.formular { padding: 1.35rem 1.4rem; }
.tabelle-wrap { overflow: hidden; }
.panel-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
}
.panel-kopf h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

/* ── Dashboard ── */
.stat-gitter {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.stat-link {
    display: block;
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.15s, background 0.15s;
}
.stat-link:hover {
    border-color: var(--moss);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transform: none;
}
.stat-karte.hero {
    background:
        linear-gradient(145deg, #1f6b45 0%, #165536 100%);
    border-color: transparent;
    color: #fff;
}
.stat-karte.hero:hover {
    border-color: transparent;
    background: linear-gradient(145deg, #247a4f 0%, #165536 100%);
}
.stat-karte.hero .stat-label { color: rgba(255, 255, 255, 0.78); }
.stat-karte.hero .stat-hint { color: rgba(255, 255, 255, 0.68); }
.stat-karte.hero .stat-wert {
    color: #fff;
    font-family: var(--display);
    font-size: 1.85rem;
}
.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.stat-wert {
    margin-top: 0.45rem;
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.stat-hint {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: var(--faint);
}
.stat-karte.stat-warn {
    border-color: #e8b4b4;
    background: #fbf4f4;
}
.stat-karte.stat-warn .stat-wert { color: var(--danger); }

.pipeline-leiste {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}
.pipeline-chip {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    box-shadow: none;
    transition: border-color 0.15s;
}
.pipeline-chip:hover {
    border-color: var(--moss);
    text-decoration: none;
    color: inherit;
    transform: none;
}
.pipeline-chip strong {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 700;
}
.pipeline-offen strong { color: var(--copper); }
.pipeline-bezahlt strong { color: var(--moss); }
.pipeline-entwurf strong { color: var(--muted); }
.pipeline-storniert strong { color: var(--danger); }

.dash-zwei {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.dash-panel { padding: 1.15rem 1.2rem; }

.schnell-gitter {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.schnell-karte {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    box-shadow: none;
    transition: border-color 0.15s, background 0.15s;
}
.schnell-karte:hover {
    border-color: var(--moss);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transform: none;
}
.schnell-karte strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
}
.schnell-karte span { color: var(--muted); font-size: 0.78rem; }
.schnell-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--moss-soft);
    color: var(--moss-deep);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.aufmerksam-liste { display: grid; gap: 0.45rem; padding: 0.15rem 0 0.25rem; }
.aufmerksam-karte {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e8b4b4;
    background: #fbf6f6;
    text-decoration: none;
    color: inherit;
}
.aufmerksam-karte:hover {
    border-color: var(--danger);
    text-decoration: none;
    color: inherit;
}

/* ── Tables / filters / badges ── */
.filterleiste {
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    box-shadow: none;
}
.datentabelle { width: 100%; border-collapse: collapse; }
.datentabelle th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.datentabelle td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.datentabelle tbody tr { transition: background 0.12s; }
.datentabelle tbody tr:hover { background: var(--moss-soft); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.badge::before { display: none; }
.badge-offen { background: var(--copper-soft); color: var(--copper); }
.badge-bezahlt { background: var(--success-soft); color: var(--moss-deep); }
.badge-entwurf { background: #eef1ef; color: #516058; }
.badge-storniert { background: var(--danger-soft); color: var(--danger); }
.badge-ueberfaellig { background: #f9ecec; color: #a83232; }
.badge-heute { background: #f8ebe3; color: #9a4a1f; }
.badge-bald { background: #e8f0f2; color: #2f5f6e; }

.status-chip {
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.status-chip.aktiv {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.status-chip.aktiv em {
    background: rgba(255, 255, 255, 0.14);
    color: #b8e0c8;
}
.status-chip:hover { border-color: var(--moss); }

/* ── Forms ── */
.formular-gruppe label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-soft);
}
.formular-gruppe input[type="text"],
.formular-gruppe input[type="email"],
.formular-gruppe input[type="tel"],
.formular-gruppe input[type="password"],
.formular-gruppe input[type="date"],
.formular-gruppe input[type="number"],
.formular-gruppe input[type="file"],
.formular-gruppe select,
.formular-gruppe textarea {
    border-radius: var(--radius-sm);
    border-color: var(--line-strong);
    background: #fff;
    min-height: 42px;
}
.formular-gruppe input:focus,
.formular-gruppe select:focus,
.formular-gruppe textarea:focus {
    border-color: var(--moss);
    box-shadow: 0 0 0 3px var(--moss-ring);
    background: #fff;
}

/* ── Breadcrumbs / tabs ── */
.brotkrumen {
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
}
.brotkrumen ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--muted);
}
.brotkrumen li:not(:last-child)::after {
    content: "/";
    margin-left: 0.35rem;
    color: var(--faint);
}
.brotkrumen a { color: var(--moss-deep); font-weight: 600; }
.brotkrumen a:hover { color: var(--ink); }

.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.1rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.tab-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    min-height: 40px;
}
.tab-btn:hover { color: var(--ink); background: rgba(19, 37, 28, 0.04); }
.tab-btn.aktiv,
.tab-btn[aria-selected="true"] {
    background: var(--moss);
    color: #fff;
    border-color: transparent;
}

.tabs-nav-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    padding: 0.55rem;
    margin-bottom: 1.15rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.tabs-nav-steps .tab-btn {
    text-align: left;
    background: var(--surface-2);
}
.tabs-nav-steps .tab-btn.aktiv,
.tabs-nav-steps .tab-btn[aria-selected="true"] {
    background: var(--moss);
    color: #fff;
}

/* ── Settings side rail ── */
@media (min-width: 960px) {
    .einstellungen-tabs {
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 1.25rem;
        align-items: start;
    }
    .einstellungen-tabs > .tabs-nav {
        flex-direction: column;
        position: sticky;
        top: calc(var(--topbar-h) + 1rem);
    }
    .einstellungen-tabs > .tabs-nav .tab-btn { width: 100%; text-align: left; }
}

.danger-zone {
    border: 1px solid #e8b4b4;
    background: #fbf6f6;
    border-radius: var(--radius);
    padding: 1.15rem;
}

/* ── Alerts ── */
.meldung {
    border-radius: var(--radius-sm);
    box-shadow: none;
    border-left-width: 3px;
}
.meldung-erfolg { background: var(--success-soft); border-color: #9bc9b0; color: #165536; }
.meldung-fehler { background: var(--danger-soft); border-color: #e0a8a8; color: #8f2e2e; }
.meldung-hinweis { background: var(--warning-soft); border-color: #e0c98a; color: #7a5414; }

/* ── Auth / Login ── */
.auth-page-grid {
    background: #10281e;
}
.auth-hero {
    background: #10281e;
    color: #fff;
}
.auth-hero__scrim {
    background:
        linear-gradient(180deg, rgba(16, 40, 30, 0.72) 0%, rgba(16, 40, 30, 0.5) 45%, rgba(16, 40, 30, 0.82) 100%),
        linear-gradient(90deg, rgba(16, 40, 30, 0.35), transparent 55%);
}
.auth-hero::before {
    background-image: none;
    opacity: 0;
}
.auth-hero__eyebrow {
    color: #9fd0b2;
    letter-spacing: 0.16em;
}
.auth-hero h1 {
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    max-width: 16ch;
    line-height: 1.12;
}
.auth-hero h1 em {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    color: #b8e0c8;
    font-style: italic;
    font-weight: 650;
}
.auth-hero__lead {
    color: rgba(243, 247, 244, 0.78);
    max-width: 36ch;
    font-size: 1rem;
}
.auth-features { gap: 0.55rem; }
.auth-feature {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    backdrop-filter: none;
}
.auth-feature__icon { color: #9fd0b2; }
.auth-hero__stats {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1rem;
}
.auth-hero__stat strong {
    font-family: var(--display);
    color: #fff;
}
.auth-hero__footer { color: rgba(243, 247, 244, 0.55); }

.auth-panel {
    display: grid;
    place-items: center;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(31, 107, 69, 0.08), transparent 55%),
        #e8ece8;
}
.auth-panel__glow { display: none; }
.auth-panel__frame { width: min(100%, 420px); }
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.auth-card__accent {
    height: 4px;
    background: linear-gradient(90deg, #165536, #2a8558 55%, #7eb896);
}
.auth-card__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1.25rem 0.35rem;
}
.auth-card__brand strong {
    display: block;
    font-family: var(--display);
    font-size: 1.15rem;
    color: var(--ink);
}
.auth-card__brand span {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.auth-card__badge {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--moss-deep);
    background: var(--moss-soft);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
}
.auth-card__body { padding: 0.5rem 1.25rem 1.35rem; }
.auth-card__gruss {
    margin: 0 0 0.25rem;
    color: var(--moss);
    font-size: 0.85rem;
    font-weight: 700;
}
.auth-card__body h2 {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
}
.auth-card__body .subtitle {
    margin: 0 0 1.1rem;
    color: var(--muted);
    font-size: 0.92rem;
}
.auth-field {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 0 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field:focus-within {
    border-color: var(--moss);
    box-shadow: 0 0 0 3px var(--moss-ring);
}
.auth-field__icon { color: var(--muted); display: grid; place-items: center; }
.auth-field input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 46px;
    padding-left: 0 !important;
}
.auth-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 0.35rem;
    font-size: 0.95rem;
}
.auth-trust {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    margin: 1.1rem 0 0.65rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}
.auth-trust__item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.auth-secure {
    text-align: center;
    font-size: 0.75rem;
    color: var(--faint);
    margin-bottom: 0.85rem;
}
.auth-lang {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}
.auth-lang a {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
}
.auth-lang a:hover { color: var(--ink); text-decoration: none; }
.auth-lang a.aktiv {
    background: var(--moss);
    color: #fff;
}
.auth-panel__note {
    margin: 0.9rem 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
}

@media (max-width: 900px) {
    .auth-page-grid {
        grid-template-columns: 1fr;
    }
    .auth-hero {
        min-height: 38vh;
    }
    .auth-hero__inner {
        min-height: 38vh;
        padding: 1.25rem;
        gap: 1rem;
    }
    .auth-features,
    .auth-hero__stats { display: none; }
}

/* ── Mobile shell: drawer + touch ── */
.sidebar-kopf-mobil { display: none; }
.nav-toggle { display: none; }
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(16, 40, 30, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.nav-overlay[hidden] { display: none !important; }
.topbar-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.topbar-titel-wrap { min-width: 0; }

button,
.btn,
.nav-link,
.tab-btn,
.nav-toggle,
.nav-close {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

@media (max-width: 1100px) {
    .stat-gitter { grid-template-columns: 1fr 1fr; }
    .stat-karte.hero { grid-column: 1 / -1; }
    .dash-zwei { grid-template-columns: 1fr; }
    .schnell-gitter { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
        min-height: 100dvh;
    }

    .nav-toggle {
        display: inline-grid;
        place-items: center;
        gap: 4px;
        width: 44px;
        height: 44px;
        padding: 0;
        flex-shrink: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: #fff;
        box-shadow: none;
        cursor: pointer;
        color: var(--ink);
    }
    .nav-toggle-balken {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.18s ease, opacity 0.18s ease;
    }
    body.nav-offen .nav-toggle-balken:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    body.nav-offen .nav-toggle-balken:nth-child(2) { opacity: 0; }
    body.nav-offen .nav-toggle-balken:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .nav-overlay {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.nav-offen .nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 300px);
        height: 100dvh;
        max-height: 100dvh;
        z-index: 100;
        display: flex;
        flex-direction: column;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: none;
        box-shadow: 12px 0 40px rgba(16, 40, 30, 0.28);
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        overflow: hidden;
        background:
            linear-gradient(165deg, rgba(42, 133, 88, 0.2), transparent 40%),
            linear-gradient(180deg, #16382a 0%, #10281e 100%);
    }
    body.nav-offen .sidebar { transform: translateX(0); }

    .sidebar-brand-desktop { display: none !important; }
    .sidebar-kopf-mobil {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.65rem 0.65rem 0.25rem;
        flex-shrink: 0;
    }
    .sidebar-kopf-mobil .sidebar-brand {
        flex: 1;
        margin: 0;
        min-width: 0;
    }
    .nav-close {
        width: 44px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        display: grid;
        place-items: center;
        cursor: pointer;
        flex-shrink: 0;
    }

    .sidebar-nav {
        flex: 1;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0.5rem 0.75rem 1rem;
        -webkit-overflow-scrolling: touch;
        gap: 0.2rem;
    }
    .nav-gruppe {
        display: block;
        padding: 0.95rem 0.55rem 0.35rem;
    }
    .nav-link {
        min-height: 48px;
        padding: 0.75rem 0.9rem;
        font-size: 0.95rem;
        white-space: normal;
    }
    .nav-link .nav-icon {
        display: block;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .sidebar-fuss {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0.85rem 0.75rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        margin-left: 0;
    }
    .sidebar-fuss .nav-abmelden span { display: inline; }
    .sprache-switch {
        margin-bottom: 0;
        width: 100%;
        justify-content: stretch;
    }
    .sprache-switch a {
        flex: 1;
        text-align: center;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .app-main { width: 100%; min-width: 0; }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        padding: 0.65rem 0.85rem;
        padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
        min-height: 60px;
        gap: 0.65rem;
    }
    .topbar-kicker { display: none; }
    .topbar-titel {
        font-size: 1.05rem;
        line-height: 1.2;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 52vw;
    }
    .topbar-cta { display: none; }
    .benutzer-name { display: none; }
    .benutzer-chip {
        padding: 0.2rem;
        min-height: 40px;
        min-width: 40px;
        justify-content: center;
    }

    .hauptinhalt {
        padding: 1rem 0.9rem calc(6.5rem + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }
    .seitenkopf {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        margin-bottom: 1rem;
        padding-bottom: 0.85rem;
    }
    .seitenkopf h1 { font-size: clamp(1.35rem, 6vw, 1.7rem); }
    .kopf-aktionen {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
        width: 100%;
    }
    .kopf-aktionen .btn {
        width: 100%;
        justify-content: center;
    }
    .kopf-aktionen .btn-gefahr { grid-column: 1 / -1; }

    .brotkrumen {
        margin-bottom: 0.65rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .brotkrumen ol { flex-wrap: nowrap; }

    .schnell-gitter { grid-template-columns: 1fr; }
    .pipeline-leiste {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }
    .pipeline-chip { flex: 0 0 auto; }

    .filterleiste {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .filterleiste .formular-gruppe { min-width: 0; width: 100%; }
    .filterleiste .btn { width: 100%; min-height: 48px; }

    .tabs-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 0.95rem;
    }
    .tabs-nav::-webkit-scrollbar { display: none; }
    .tab-btn {
        min-height: 44px;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .tabs-nav-steps {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.45rem;
        padding: 0.55rem;
    }
    .tabs-nav-steps::before,
    .tabs-nav-steps .tab-progress { display: none; }
    .tabs-nav-steps .tab-btn {
        min-width: min(78vw, 260px);
        flex: 0 0 auto;
    }

    .formular,
    .formular-rechnung {
        padding: 1rem 0.95rem 1.05rem;
        border-radius: var(--radius);
    }

    .formular-aktionen,
    .formular-aktionen-sticky {
        flex-direction: column;
        align-items: stretch;
    }
    .aktionen-nav {
        width: 100%;
        margin-right: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .aktionen-nav .btn { width: 100%; min-height: 48px; }
    .formular-aktionen > .btn,
    .formular-aktionen > a.btn,
    .formular-aktionen-sticky > .btn,
    .formular-aktionen-sticky > a.btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }
    .formular-aktionen-sticky {
        position: sticky;
        bottom: 0;
        z-index: 30;
        margin: 0.85rem -0.95rem -1.05rem;
        border-radius: 12px 12px 0 0;
        padding: 0.85rem 0.95rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -8px 24px rgba(19, 37, 28, 0.08);
        background: #fff;
        border-top: 1px solid var(--line);
    }

    .datentabelle th,
    .datentabelle td {
        padding: 0.8rem 0.75rem;
        font-size: 0.88rem;
    }
    .tabelle-wrap {
        margin-left: -0.15rem;
        margin-right: -0.15rem;
        border-radius: var(--radius);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pdf-modal {
        padding: 0;
        align-items: stretch;
    }
    .pdf-modal-dialog {
        width: 100%;
        max-height: 100dvh;
        height: 100dvh;
        margin: 0;
        border-radius: 0;
    }
    .pdf-modal-kopf {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 0.85rem;
        padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
        gap: 0.65rem;
    }
    .pdf-modal-aktionen {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .pdf-modal-aktionen .btn {
        min-height: 46px;
        width: 100%;
    }
    .pdf-modal-body iframe {
        height: calc(100dvh - 9.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 640px) {
    .stat-gitter { grid-template-columns: 1fr; }
    .kopf-aktionen { grid-template-columns: 1fr; }
    .status-chips,
    .status-chip-leiste,
    .chip-leiste {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.2rem;
    }
    .status-chip,
    .chip { flex: 0 0 auto; }
}

@media (min-width: 961px) {
    .sidebar-kopf-mobil { display: none !important; }
    .nav-toggle { display: none !important; }
    .nav-overlay { display: none !important; }
    .sidebar-brand-desktop { display: flex; }
}
