/* =========================================================
   GreenMedi — Bilsisan Destek teması (destek.bilsisan.com)
   Navy #030018 · Mint #12E193 · Light SaaS shell
   ========================================================= */

:root {
    --ink: #030018;
    --ink-soft: #0f172a;
    --muted: #667085;
    --faint: #98a2b3;
    --line: #eaecf0;
    --line-strong: #d0d5dd;
    --paper: #f3f4f6;
    --paper-deep: #e5e7eb;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --moss: #12E193;
    --moss-deep: #0db876;
    --moss-soft: rgba(18, 225, 147, 0.1);
    --moss-ring: rgba(18, 225, 147, 0.28);
    --sky: #0d9488;
    --sky-soft: #ecfdf5;
    --copper: #ea580c;
    --copper-soft: #fff7ed;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --success: #0db876;
    --success-soft: #ecfdf5;
    --sidebar: #f8fafc;
    --sidebar-2: #f1f5f9;
    --sidebar-text: #64748b;
    --sidebar-text-active: #0f172a;
    --sidebar-border: #e2e8f0;
    --auth-dark: #030018;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(3, 0, 24, 0.04), 0 4px 12px rgba(3, 0, 24, 0.04);
    --shadow-md: 0 4px 6px rgba(3, 0, 24, 0.04), 0 12px 28px rgba(3, 0, 24, 0.08);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

a { color: var(--moss-deep); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }

/* ── Shell ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    color: var(--sidebar-text-active);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 40;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0.9rem;
    margin: 0.65rem 0.65rem 0;
    border: 1px solid var(--sidebar-border);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow);
}

.sidebar-brand:hover { text-decoration: none; color: var(--ink); }

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(145deg, #5eead4, #12E193);
    box-shadow: none;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: #030018;
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.brand-text span { font-size: 0.68rem; color: var(--sidebar-text); margin-top: 0.12rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.nav-gruppe {
    padding: 0.95rem 0.55rem 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
}

.sidebar-nav {
    padding: 0.35rem 0.55rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.62rem 0.75rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    border: 1px solid transparent;
    position: relative;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--sidebar-text-active);
    text-decoration: none;
}

.nav-link.aktiv {
    background: #ecfdf5;
    color: var(--sidebar-text-active);
    border-color: #bbf7d0;
    box-shadow: none;
}

.nav-link.aktiv::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #12E193;
    box-shadow: 0 0 12px rgba(18, 225, 147, 0.45);
}

.nav-icon { width: 18px; height: 18px; opacity: 0.9; flex-shrink: 0; }
.nav-link.aktiv .nav-icon { color: #0d9488; }

.sidebar-fuss {
    padding: 0.75rem 0.65rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    background: transparent;
}

.sprache-switch {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    padding: 0.2rem;
    background: #fff;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
}

.sprache-switch a {
    flex: 1;
    text-align: center;
    padding: 0.4rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--sidebar-text);
    text-decoration: none;
}

.sprache-switch a:hover { color: var(--ink); text-decoration: none; }
.sprache-switch a.aktiv {
    background: #12E193;
    color: #030018;
    box-shadow: none;
}

.nav-abmelden { color: #b91c1c !important; }
.nav-abmelden:hover { background: #fef2f2 !important; color: #991b1b !important; }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 0.95rem 1.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-titel {
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

.topbar-rechts { display: flex; align-items: center; gap: 0.75rem; }

.benutzer-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.benutzer-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(145deg, #99f6e4, #12E193);
    color: #134e4a;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.hauptinhalt {
    padding: 1.75rem 1.85rem 3.5rem;
    max-width: 1320px;
    width: 100%;
}

/* Login / Auth shell */
body.login-body,
body.auth-page {
    background: #030018;
}
body.login-body .hauptinhalt,
body.auth-page .hauptinhalt {
    max-width: none;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
}
body.login-body .fusszeile,
body.auth-page .fusszeile { display: none; }

/* Surfaces */
.seitenkopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.seitenkopf h1 { margin: 0; font-size: 1.85rem; }
.seitenkopf .untertitel {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    font-family: var(--font);
    font-weight: 400;
}

/* Dashboard */
.stat-gitter {
    display: grid;
    grid-template-columns: 1.55fr 1fr 1fr 1fr;
    gap: 1.1rem;
    margin-bottom: 1.75rem;
}

.stat-karte {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.35rem 1.4rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-karte:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-karte.hero {
    background: #030018;
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.stat-karte.hero::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(18, 225, 147, 0.12);
    pointer-events: none;
}

.stat-karte.hero .stat-label { color: rgba(255,255,255,0.78); }
.stat-karte.hero .stat-wert { color: #fff; font-family: var(--display); }
.stat-karte.hero .stat-hint { color: rgba(255,255,255,0.65); }

.stat-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 0.55rem;
}

.stat-wert {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-family: var(--display);
}

.stat-karte.hero .stat-wert {
    font-size: 42px;
    font-size: clamp(30px, 4.2vw, 42px);
}

.stat-hint { margin-top: 0.5rem; font-size: 0.82rem; color: var(--faint); }

.panel-kopf {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.25rem 0 0.85rem;
}
.panel-kopf h2 {
    margin: 0;
    font-size: 1.2rem;
}

/* Tables */
.tabelle-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.datentabelle { width: 100%; border-collapse: collapse; }

.datentabelle th,
.datentabelle td {
    padding: 0.9rem 1.05rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 0.93rem;
}

.datentabelle th {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: linear-gradient(180deg, #fafafa, var(--surface-2));
}

.datentabelle tr:last-child td { border-bottom: none; }
.datentabelle tbody tr { transition: background 0.12s; }
.datentabelle tbody tr:hover { background: var(--moss-soft); }

.datentabelle .betrag {
    text-align: right;
    font-weight: 700;
    font-family: var(--display);
    white-space: nowrap;
    font-size: 1rem;
}

.datentabelle tr.status-offen,
.datentabelle tr.status-bezahlt,
.datentabelle tr.status-entwurf,
.datentabelle tr.status-storniert {
    border-left: 3px solid transparent;
}
.datentabelle tr.status-offen    { border-left-color: var(--copper); }
.datentabelle tr.status-bezahlt  { border-left-color: var(--success); }
.datentabelle tr.status-entwurf  { border-left-color: #94a3b8; }
.datentabelle tr.status-storniert { border-left-color: var(--danger); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}
.badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-offen     { background: var(--copper-soft); color: var(--copper); }
.badge-bezahlt   { background: var(--success-soft); color: var(--success); }
.badge-entwurf   { background: #f1f5f9; color: #475569; }
.badge-storniert { background: var(--danger-soft); color: var(--danger); }
.badge-ueberfaellig { background: #fef2f2; color: #b91c1c; }
.badge-heute { background: #fff7ed; color: #c2410c; }
.badge-bald { background: #eff6ff; color: #1d4ed8; }
.status-punkt { display: none; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.text-faint { color: var(--faint); }
.kopf-aktionen { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.stat-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.stat-link:hover { text-decoration: none; color: inherit; }
.stat-karte.stat-warn {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff, #fef2f2);
}
.stat-karte.stat-warn .stat-wert { color: #b91c1c; }

.pipeline-leiste {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}
.pipeline-chip {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, transform 0.12s;
}
.pipeline-chip:hover {
    border-color: #12E193;
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}
.pipeline-chip strong { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.pipeline-chip span { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.pipeline-offen strong { color: var(--copper); }
.pipeline-bezahlt strong { color: var(--success); }
.pipeline-entwurf strong { color: #64748b; }
.pipeline-storniert strong { color: var(--danger); }

.dash-zwei {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1.15rem;
    margin-bottom: 0.5rem;
}
.dash-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.15rem 1.2rem;
}
.dash-panel .panel-kopf { margin: 0 0 0.85rem; }
.dash-panel .panel-kopf h2 { font-size: 1rem; }
.dash-panel .panel-kopf a { font-size: 0.82rem; font-weight: 700; }

.leer-zustand-kompakt {
    padding: 1.25rem 0.5rem;
    text-align: center;
    border: none;
    box-shadow: none;
    background: transparent;
}
.leer-zustand-kompakt p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.aufmerksam-liste { display: grid; gap: 0.55rem; }
.aufmerksam-karte {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #fecaca;
    background: #fffafa;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}
.aufmerksam-karte:hover { border-color: #f87171; text-decoration: none; color: inherit; }
.aufmerksam-karte strong { display: block; font-size: 0.9rem; }
.aufmerksam-karte span { font-size: 0.78rem; color: var(--muted); }
.aufmerksam-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}
.aufmerksam-meta strong { font-size: 0.95rem; color: #b91c1c; }

.schnell-gitter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.schnell-karte {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    text-decoration: none;
    color: inherit;
    min-height: 96px;
}
.schnell-karte:hover {
    border-color: #12E193;
    background: #ecfdf5;
    text-decoration: none;
    color: inherit;
}
.schnell-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: #12E193;
    color: #030018;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.schnell-icon-dot::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #030018;
}
.schnell-karte strong { font-size: 0.85rem; }
.schnell-karte span { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }

.status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow);
}
.status-chip em {
    font-style: normal;
    background: var(--surface-2);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    color: var(--muted);
}
.status-chip:hover { border-color: #12E193; text-decoration: none; color: inherit; }
.status-chip.aktiv {
    background: #030018;
    border-color: #030018;
    color: #fff;
}
.status-chip.aktiv em { background: rgba(255,255,255,0.14); color: #12E193; }

.filterleiste-erweitert { align-items: flex-end; }
.ergebnis-leiste {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.zellen-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}
.zellen-unter {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--faint);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-form select.status-aendern,
.rechnung-karte-status select.status-aendern {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    color: var(--ink);
}

.zeile-ueberfaellig td:first-child,
.rechnung-karte.zeile-ueberfaellig {
    box-shadow: inset 3px 0 0 #ef4444;
}

.rechnung-karten-mobil { display: none; gap: 0.75rem; }
.rechnung-karte {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.rechnung-karte header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.rechnung-karte-kunde { margin: 0 0 0.55rem; color: var(--muted); font-size: 0.9rem; }
.rechnung-karte-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    font-size: 0.78rem;
    color: var(--faint);
    margin-bottom: 0.75rem;
}
.rechnung-karte-fuss {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.rechnung-karte-status select { width: 100%; }

@media (max-width: 960px) {
    .dash-zwei { grid-template-columns: 1fr; }
    .pipeline-leiste { grid-template-columns: 1fr 1fr; }
    .rechnung-karten-mobil { display: grid; }
    .rechnung-tabelle-desktop { display: none; }
}

@media (max-width: 560px) {
    .pipeline-leiste { grid-template-columns: 1fr 1fr; }
    .schnell-gitter { grid-template-columns: 1fr; }
}

/* Forms */
.formular {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.45rem;
}

.formular-gruppe { margin-bottom: 1.05rem; }

.formular-gruppe label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}

.formular-gruppe small {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.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 {
    width: 100%;
    padding: 0.68rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font: inherit;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.formular-gruppe input:hover,
.formular-gruppe select:hover,
.formular-gruppe textarea:hover {
    border-color: var(--line-strong);
}

.formular-gruppe input:focus,
.formular-gruppe select:focus,
.formular-gruppe textarea:focus {
    outline: none;
    border-color: var(--moss);
    background: #fff;
    box-shadow: 0 0 0 3px var(--moss-ring);
}

.formular-gruppe textarea { min-height: 92px; resize: vertical; }

.formular-reihe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.formular-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
}

.formular h2 {
    margin: 0 0 1.1rem;
    font-size: 1.15rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
}

/* Buttons — Bilsisan mint */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.62rem 1.1rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    background: #12E193;
    color: #030018;
    line-height: 1.3;
    box-shadow: none;
    transition: background 0.12s, transform 0.1s;
}

.btn:hover {
    background: #0db876;
    text-decoration: none;
    color: #030018;
    filter: none;
    box-shadow: none;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: wait; filter: none; }

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

.btn-gefahr {
    background: #ef4444;
    color: #fff;
    box-shadow: none;
}
.btn-gefahr:hover { background: #dc2626; color: #fff; filter: none; }

.btn-klein { padding: 0.38rem 0.7rem; font-size: 0.8rem; }
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
    box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); filter: none; }

/* Filter */
.filterleiste {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
    align-items: flex-end;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: var(--shadow);
}
.filterleiste .formular-gruppe { margin-bottom: 0; flex: 1; min-width: 150px; }

/* Alerts */
.meldung {
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.93rem;
    box-shadow: var(--shadow);
}
.meldung-erfolg { background: var(--success-soft); border-color: #abefc6; color: #085d3a; }
.meldung-fehler { background: var(--danger-soft); border-color: #fecdca; color: #912018; }
.meldung-hinweis { background: var(--warning-soft); border-color: #fedf89; color: #93370d; }

/* ── Auth (Bilsisan Destek split layout) ── */
.auth-page-grid {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #030018;
}

.auth-hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    color: #fff;
    background:
        radial-gradient(ellipse 70% 50% at 20% 15%, rgba(18, 225, 147, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 45% at 90% 80%, rgba(13, 148, 136, 0.2), transparent 50%),
        #030018;
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 40% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

.auth-hero__inner {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(28px, 5vw, 52px) clamp(22px, 4vw, 40px);
}

.auth-hero__eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #12E193;
    margin-bottom: 0.75rem;
}

.auth-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    max-width: 28ch;
}

.auth-hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #12E193, #5eead4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-hero__lead {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(0.8125rem, 1.2vw, 0.9375rem);
    line-height: 1.55;
    max-width: 440px;
}

.auth-features {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-feature__icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #12E193;
}
.auth-feature__icon svg { width: 16px; height: 16px; }

.auth-feature__text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
}

.auth-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.auth-hero__stat {
    padding: 12px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}
.auth-hero__stat strong {
    display: block;
    font-size: 1rem;
    color: #12E193;
    font-weight: 800;
}
.auth-hero__stat span {
    display: block;
    margin-top: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.auth-hero__footer {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.75rem;
    margin: 0;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 32px);
    background: #f4f5f7;
}

.auth-card {
    position: relative;
    width: min(100%, 400px);
    background: #fff;
    border: 1px solid #e6e8ef;
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
}

.auth-card__accent {
    height: 3px;
    background: #12E193;
}

.auth-card__head {
    padding: 22px 22px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-card__head .brand-mark {
    width: 42px;
    height: 42px;
}

.auth-card__head strong {
    display: block;
    font-size: 0.95rem;
    color: #030018;
}
.auth-card__head span {
    display: block;
    font-size: 0.72rem;
    color: #98A2B3;
    font-weight: 600;
}

.auth-card__body { padding: 18px 22px 22px; }

.auth-card__badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d9488;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    margin-bottom: 10px;
}

.auth-card h2 {
    margin: 0 0 6px;
    color: #030018;
    font-size: 1.25rem;
    font-weight: 700;
}

.auth-card .subtitle {
    color: #98A2B3;
    margin: 0 0 16px;
    line-height: 1.5;
    font-size: 0.8125rem;
}

.auth-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    color: #98A2B3;
    font-size: 0.75rem;
    font-weight: 500;
}

.auth-lang {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 14px;
}
.auth-lang a {
    font-size: 0.75rem;
    font-weight: 700;
    color: #98A2B3;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    text-decoration: none;
}
.auth-lang a.aktiv {
    background: #ecfdf5;
    color: #0d9488;
}

@media (max-width: 900px) {
    .auth-page-grid { grid-template-columns: 1fr; }
    .auth-hero { min-height: auto; }
    .auth-hero__inner {
        min-height: auto;
        padding: 28px 20px 24px;
        gap: 24px;
    }
    .auth-hero__stats { grid-template-columns: repeat(3, 1fr); }
    .auth-panel { padding: 20px 16px 32px; }
}

/* Rechnung editor */
.rechnung-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 1.75rem;
    align-items: start;
}

.formular-rechnung {
    padding: 1.65rem 1.75rem 1.35rem;
}

.formular-abschnitt {
    margin-bottom: 1.5rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid var(--line);
}
.formular-abschnitt:last-of-type { border-bottom: none; margin-bottom: 0.5rem; }

.formular-abschnitt-titel {
    margin: 0 0 1rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: inherit;
}

.formular-reihe-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.formular-reihe-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.vorschau-panel {
    position: sticky;
    top: 4.75rem;
    background: #6b7f74;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 280px;
    box-shadow: var(--shadow-md);
}

.vorschau-toggle {
    display: none;
    width: 100%;
    appearance: none;
    border: none;
    background: linear-gradient(180deg, #122018, #1a2c22);
    color: #fff;
    padding: 0.95rem 1.1rem;
    text-align: left;
    cursor: pointer;
    font: inherit;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.vorschau-toggle-text {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.vorschau-toggle-hint {
    font-size: 0.75rem;
    color: #9fb0a6;
    font-weight: 600;
}
.vorschau-toggle::after {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid #c5d4cb;
    border-bottom: 2px solid #c5d4cb;
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.vorschau-panel.zugeklappt .vorschau-toggle::after {
    transform: rotate(-135deg);
    margin-top: 0.35rem;
}

.vorschau-status {
    background: linear-gradient(180deg, #122018, #1a2c22);
    color: #9fb0a6;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.55rem 0.95rem;
    font-weight: 700;
    transition: opacity 0.2s;
}

.vorschau-panel iframe {
    width: 100%;
    height: min(78vh, 920px);
    border: none;
    display: block;
    background: #5a6d62;
}

.positionen-editor { margin-top: 0; }
.positionen-editor #position-hinzufuegen { margin-top: 0.85rem; }

.positionen-kopf {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 88px 100px 96px 40px;
    gap: 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 0.55rem 0.15rem;
    border-bottom: 1px solid var(--line);
}

.position-zeile {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 88px 100px 96px 40px;
    gap: 0.55rem;
    align-items: center;
    padding: 0.65rem 0.15rem;
    border-bottom: 1px solid var(--line);
}
.position-zeile.dragging { opacity: 0.45; }

.griff {
    cursor: grab;
    color: var(--faint);
    text-align: center;
    user-select: none;
    font-size: 0.95rem;
    padding: 0.35rem 0;
}

.position-zeile input {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    font: inherit;
    font-variant-numeric: tabular-nums;
}
.position-zeile .pos-feld { min-width: 0; }
.position-zeile input:focus {
    outline: none;
    border-color: var(--moss);
    box-shadow: 0 0 0 2px var(--moss-ring);
    background: #fff;
}

.zeilen-summe {
    text-align: right;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--display);
    padding-right: 0.15rem;
}

.gesamt-anzeige {
    text-align: right;
    margin-top: 1.15rem;
    padding: 1rem 0.25rem 0;
    border-top: 2px solid var(--ink);
}
.gesamt-anzeige .label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.gesamt-anzeige .betrag {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-family: var(--display);
    color: var(--moss-deep);
}

.formular-aktionen-sticky {
    margin-top: 0.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.formular-aktionen-sticky .btn {
    min-height: 44px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.neuer-kunde-felder {
    display: none;
    margin: 0 0 1.5rem;
    padding: 1.15rem 1.2rem;
    background: var(--moss-soft);
    border: 1px dashed #8fbf9f;
    border-radius: var(--radius-sm);
}
.neuer-kunde-felder.sichtbar { display: block; }

.einstellungen-gitter { display: grid; gap: 1.25rem; }

/* Theme gallery */
.thema-layout {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 1.25rem;
    align-items: start;
}

.thema-galerie {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    max-height: 72vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.thema-karte {
    appearance: none;
    text-align: left;
    cursor: pointer;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
    font: inherit;
    color: inherit;
    position: relative;
}

.thema-karte:hover {
    border-color: var(--moss);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.thema-karte.aktiv {
    border-color: var(--moss);
    box-shadow: 0 0 0 3px var(--moss-ring), var(--shadow);
    background: #fff;
}

.thema-swatch {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
}
.thema-swatch span { display: block; height: 100%; }

.thema-mini {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    height: 78px;
}
.thema-mini-band { height: 14px; }
.thema-mini-body { padding: 8px; }
.thema-mini-line {
    height: 4px;
    width: 55%;
    border-radius: 2px;
    margin-bottom: 5px;
}
.thema-mini-line.short { width: 35%; opacity: 0.7; }
.thema-mini-table {
    border: 1px solid;
    margin-top: 6px;
}
.thema-mini-table > div:first-child { height: 8px; }
.thema-mini-table > div:not(:first-child) {
    height: 6px;
    border-top: 1px solid #eee;
}

.thema-karte strong {
    font-size: 0.9rem;
    font-family: var(--font);
    font-weight: 700;
}
.thema-karte span {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.35;
}
.thema-aktiv-badge {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--moss);
    color: #fff;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
}

.thema-preview-panel {
    background: #5a6d62;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 4.75rem;
}

.thema-preview-kopf {
    background: linear-gradient(180deg, #122018, #1a2c22);
    color: #c5d4cb;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}
.thema-preview-kopf strong { color: #fff; font-family: var(--font); }
.thema-preview-kopf span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.thema-preview-panel iframe {
    width: 100%;
    height: 62vh;
    min-height: 480px;
    border: none;
    display: block;
    background: #6b7f74;
}

.thema-preview-panel .formular-aktionen {
    background: var(--surface);
}

@media (max-width: 1100px) {
    .thema-layout { grid-template-columns: 1fr; }
    .thema-preview-panel { position: static; order: -1; }
    .thema-preview-panel iframe { height: 45vh; min-height: 360px; }
    .thema-galerie { max-height: none; }
}


.leer-zustand {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--muted);
}
.leer-zustand p { margin: 0 0 1.1rem; }

.fusszeile {
    text-align: center;
    padding: 1.4rem;
    font-size: 0.75rem;
    color: var(--faint);
}

.install-karte {
    max-width: 560px;
    margin: 2rem auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}
.install-karte h1 { margin-top: 0; }
.schritt-liste { margin: 1rem 0; padding-left: 1.25rem; }

.pdf-hinweis {
    background: var(--warning-soft);
    border: 1px solid #fedf89;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
}

@media print {
    .pdf-hinweis, .kein-druck { display: none !important; }
}

:focus-visible {
    outline: 2px solid var(--moss);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .stat-karte:hover { transform: none; }
}

@media (max-width: 1100px) {
    .rechnung-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .vorschau-panel {
        position: static;
        order: 2;
    }
    .formular-rechnung { order: 1; }
    .vorschau-toggle { display: flex; }
    .vorschau-panel .vorschau-status { display: none; }
    .vorschau-panel.zugeklappt .vorschau-koerper { display: none; }
    .vorschau-panel iframe {
        height: min(70vh, 640px);
    }
    .formular-reihe-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .formular-gruppe-breit { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        background: var(--sidebar);
        z-index: 40;
        border-right: none;
        border-bottom: 1px solid var(--sidebar-border);
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem 0.75rem 0.85rem;
        -webkit-overflow-scrolling: touch;
    }
    .nav-gruppe { display: none; }
    .nav-link { white-space: nowrap; padding: 0.55rem 0.8rem; font-size: 0.85rem; }
    .nav-link .nav-icon { display: none; }
    .sidebar-fuss {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.7rem 1rem;
    }
    .sprache-switch { margin-bottom: 0; min-width: 110px; }
    .stat-gitter { grid-template-columns: 1fr 1fr; }
    .hauptinhalt { padding: 1.15rem 1rem 5.5rem; }
    .topbar { padding: 0.8rem 1rem; }
    .seitenkopf {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        margin-bottom: 1.25rem;
    }
    .formular { padding: 1.2rem; }
    .formular-rechnung { padding: 1.2rem 1.15rem 1.1rem; }
    .formular-aktionen-sticky {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 0.5rem -1.15rem -1.1rem;
        padding: 0.85rem 1.15rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        background: rgba(255,255,255,0.96);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(18, 32, 24, 0.08);
    }
    .formular-aktionen-sticky .btn { flex: 1; justify-content: center; }
}

@media (max-width: 720px) {
    .formular-reihe,
    .formular-reihe-2,
    .formular-reihe-3 {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
    .formular-gruppe-breit { grid-column: auto; }
    .formular-gruppe { margin-bottom: 1.15rem; }
    .formular-gruppe input,
    .formular-gruppe select,
    .formular-gruppe textarea {
        min-height: 46px;
        font-size: 16px; /* iOS zoom prevent */
    }

    .positionen-kopf { display: none; }

    #positionen-liste {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
    }

    .position-zeile {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem 0.75rem;
        align-items: stretch;
        padding: 1rem;
        background: var(--surface-2);
        border: 1px solid var(--line);
        border-radius: 12px;
        border-bottom: 1px solid var(--line);
    }

    .position-zeile .griff {
        grid-column: 1;
        justify-self: start;
        align-self: center;
        padding: 0.5rem 0.35rem;
        min-width: 44px;
    }

    .position-zeile .pos-entfernen {
        grid-column: 2;
        justify-self: end;
        align-self: center;
        min-width: 44px;
        min-height: 44px;
    }

    .position-zeile .pos-feld-breit {
        grid-column: 1 / -1;
    }

    .position-zeile .pos-feld[data-label]::before,
    .position-zeile .zeilen-summe[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: 0.3rem;
    }

    .position-zeile .zeilen-summe {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        text-align: right;
        padding: 0.35rem 0.15rem 0;
        font-size: 1.05rem;
    }

    .gesamt-anzeige {
        text-align: left;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.1rem 0.15rem 0;
    }
    .gesamt-anzeige .betrag { font-size: 1.65rem; }
}

@media (max-width: 560px) {
    .stat-gitter { grid-template-columns: 1fr; }
    .datentabelle { display: block; overflow-x: auto; }
    .seitenkopf h1 { font-size: 1.4rem; }
    .benutzer-chip span:last-child { display: none; }
    .thema-galerie { grid-template-columns: 1fr; }
}
