/* =========================================================================
   carvego mini – Stylesheet
   Farben, Typografie und UI angeglichen an die echte carvego.de-Seite:
     Blau (petrol):      #006F9E
     Dunkelblau (petrol):#00354E
     Akzent-/Linktext:   #005B80
     Hellgrau:  #FBFBFB
     Grau (Badges/Buttons): #D8D8D8 / #C6C6C6
     Schwarz:   #040408
     Schrift:   Montserrat (Regular / Medium / Bold)
   ========================================================================= */

:root {
    --c-blue: #006F9E;
    --c-navy: #00354E;
    --c-teal-text: #005B80;
    --c-grey: #D8D8D8;
    --c-grey-dark: #C6C6C6;
    --c-bg: #FBFBFB;
    --c-black: #040408;
    --c-white: #FFFFFF;
    --c-black-60: rgba(4, 4, 8, 0.60);
    --c-black-40: rgba(4, 4, 8, 0.40);
    --c-black-12: rgba(4, 4, 8, 0.12);
    --c-black-08: rgba(4, 4, 8, 0.08);
    --c-white-85: rgba(255, 255, 255, 0.85);
    --c-white-20: rgba(255, 255, 255, 0.20);
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 2px 10px rgba(4, 4, 8, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--c-bg);
    color: var(--c-black);
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
    font-weight: 700;
    margin: 0 0 0.5em 0;
    line-height: 1.2;
}

p { margin: 0 0 1em 0; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------------------------------------------------------------
   Logo
   --------------------------------------------------------------------- */
.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.logo .logo-part-1 { color: var(--c-black); }
.logo .logo-part-2 { color: var(--c-blue); }
.logo.logo-on-dark .logo-part-1,
.logo.logo-on-dark .logo-part-2 { color: var(--c-white); }
.logo-small { font-size: 1.25rem; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-block;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.7em 1.4em;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: opacity .15s ease, background-color .15s ease;
}
.btn:hover { text-decoration: none; opacity: 0.88; }
.btn:active { opacity: 0.75; }

.btn-navy { background: var(--c-navy); color: var(--c-white); }
.btn-blue { background: var(--c-blue); color: var(--c-white); }
.btn-white { background: var(--c-white); color: var(--c-blue); }
.btn-grey { background: var(--c-grey); color: var(--c-teal-text); }
.btn-black { background: var(--c-black); color: var(--c-white); }
.btn-outline { background: transparent; color: var(--c-navy); border-color: var(--c-black-12); }
.btn-outline:hover { border-color: var(--c-navy); }
.btn-danger { background: var(--c-white); color: #a3121f; border-color: #a3121f33; }
.btn-sm { padding: 0.45em 0.9em; font-size: 0.82rem; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Öffentlicher Header / Navigation
   --------------------------------------------------------------------- */
.site-header {
    background: var(--c-navy);
    color: var(--c-white);
    padding: 18px 0;
}
.site-header .container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}
.site-nav a {
    color: var(--c-white-85);
    font-size: 0.92rem;
    font-weight: 500;
}
.site-nav a:hover { color: var(--c-white); text-decoration: none; }
.site-nav .btn { margin-left: 4px; }
/* Buttons innerhalb der Navigation behalten ihre eigene Button-Farbe
   (sonst gewinnt die spezifischere ".site-nav a"-Regel und der Text
   verschwindet z. B. bei einem weißen Button auf weißem Grund). */
.site-nav a.btn-white { color: var(--c-blue); }
.site-nav a.btn-navy,
.site-nav a.btn-blue,
.site-nav a.btn-black { color: var(--c-white); }

/* ---------------------------------------------------------------------
   Burger-Menü (Navigation auf Tablet & Smartphone)
   Wird sowohl im öffentlichen Header (.site-nav) als auch im
   eingeloggten Bereich (.app-nav-panel) verwendet.
   --------------------------------------------------------------------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.10);
    outline: none;
}
.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--c-white);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
    .nav-toggle { display: flex; }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 1px;
        background: var(--c-navy);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height .25s ease, opacity .2s ease;
        z-index: 200;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    }
    .site-nav.is-open {
        max-height: 85vh;
        opacity: 1;
        overflow-y: auto;
    }
    .site-nav a {
        padding: 16px 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .site-nav .btn {
        margin: 14px 24px;
    }
}

/* ---------------------------------------------------------------------
   Hero (Startseite)
   --------------------------------------------------------------------- */
.hero {
    background: var(--c-navy);
    position: relative;
    overflow: hidden;
    padding: 64px 0 0 0;
}
.hero .container {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 420px;
}
.hero-card {
    background: var(--c-blue);
    color: var(--c-white);
    border-radius: var(--radius);
    padding: 36px 40px;
    max-width: 460px;
    margin-bottom: 64px;
    position: relative;
    z-index: 2;
}
.hero-card h1 {
    font-size: 1.9rem;
    color: var(--c-white);
    margin-bottom: 0.4em;
}
.hero-card p {
    font-size: 0.95rem;
    color: var(--c-white-85);
    margin-bottom: 1.4em;
}
.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge-pill.rating { background: rgba(255, 255, 255, 0.16); color: var(--c-white); }
.badge-pill.rating .stars { color: #ffc84a; }
.badge-pill.season { background: var(--c-grey-dark); color: var(--c-teal-text); }
.hero-car {
    position: absolute;
    right: -30px;
    bottom: 0;
    width: 640px;
    max-width: 52vw;
    z-index: 1;
}
.hero-car img { width: 100%; height: auto; }

.intro-section {
    background: var(--c-bg);
    padding: 48px 0;
}
.intro-section h2 {
    font-size: 1.4rem;
    color: var(--c-black);
}
.intro-section p {
    color: var(--c-black-60);
    max-width: 640px;
    margin-bottom: 0;
}

@media (max-width: 860px) {
    .hero .container { flex-direction: column; align-items: stretch; min-height: 0; }
    .hero-card { max-width: 100%; margin-bottom: 24px; }
    .hero-car { position: static; width: 100%; max-width: 420px; margin: 0 auto; }
}

@media (max-width: 480px) {
    .hero { padding-top: 40px; }
    .hero-card { padding: 24px 20px; }
    .hero-card h1 { font-size: 1.5rem; }
}

/* ---------------------------------------------------------------------
   Rechtstexte (öffentliche Seiten: Impressum, Datenschutz, ...)
   --------------------------------------------------------------------- */
.legal-content {
    max-width: 760px;
    color: var(--c-black);
}
.legal-content h2 {
    font-size: 1.15rem;
    margin-top: 1.6em;
}
.legal-content p,
.legal-content ul,
.legal-content ol {
    color: var(--c-black-60);
    margin-bottom: 1em;
}
.legal-content ul,
.legal-content ol { padding-left: 1.4em; }
.legal-content a { color: var(--c-blue); }

/* ---------------------------------------------------------------------
   Darum Carvego – Feature-Grid
   --------------------------------------------------------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 28px;
}
.feature-card {
    background: var(--c-white);
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px;
}
.feature-card h3 {
    font-size: 0.98rem;
    color: var(--c-navy);
    margin-bottom: 0.4em;
}
.feature-card p {
    font-size: 0.86rem;
    color: var(--c-black-60);
    margin: 0;
}
@media (max-width: 900px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .feature-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   Promo-Block (Wechselsaison-Aktion)
   --------------------------------------------------------------------- */
.promo-section { padding: 0 0 48px 0; }
.promo-block {
    background: var(--c-navy);
    color: var(--c-white);
    border-radius: var(--radius);
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.promo-label {
    display: inline-block;
    background: var(--c-blue);
    color: var(--c-white);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.promo-block h2 { color: var(--c-white); font-size: 1.3rem; margin-bottom: 0.3em; }
.promo-block p { color: var(--c-white-85); max-width: 460px; margin-bottom: 0; }
.promo-keywords {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--c-white-85);
    flex-wrap: wrap;
}
.promo-actions { flex-shrink: 0; }
@media (max-width: 700px) {
    .promo-block { padding: 28px; }
    .promo-block p { max-width: 100%; }
}

/* ---------------------------------------------------------------------
   FAQ
   --------------------------------------------------------------------- */
.faq-section { padding: 0 0 48px 0; }
.faq-section h2 { font-size: 1.4rem; margin-bottom: 0.8em; }
.faq-list { max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--c-black-08); }
.faq-item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--c-black);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--c-black-40);
    flex-shrink: 0;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p {
    color: var(--c-black-60);
    font-size: 0.88rem;
    margin: 0 0 18px 0;
}

/* ---------------------------------------------------------------------
   Abschluss-CTA
   --------------------------------------------------------------------- */
.cta-band {
    background: var(--c-blue);
    color: var(--c-white);
    padding: 48px 0;
    text-align: center;
}
.cta-band h2 { color: var(--c-white); font-size: 1.4rem; margin-bottom: 0.9em; }
.cta-band .btn { background: var(--c-white); color: var(--c-blue); }

/* ---------------------------------------------------------------------
   Öffentlicher Footer
   --------------------------------------------------------------------- */
.site-footer {
    background: var(--c-white);
    border-top: 1px solid var(--c-black-08);
    padding: 32px 0;
    color: var(--c-black-40);
    font-size: 0.82rem;
}
.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--c-black-08);
    margin-bottom: 16px;
}
.footer-brand p { margin: 0 0 4px 0; max-width: 420px; }
.footer-legal {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.footer-legal a { color: var(--c-black-40); }
.footer-legal a:hover { color: var(--c-black); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------------
   App-Layout (nach Login): Sidebar links + Topbar/Profil-Dropdown rechts
   --------------------------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

/* --- Sidebar ------------------------------------------------------- */
.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--c-navy);
    color: var(--c-white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: width .18s ease;
}
.app-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 16px;
    flex-shrink: 0;
}
.app-sidebar-logo { min-width: 0; overflow: hidden; }
.sidebar-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--c-white);
    cursor: pointer;
    padding: 0;
}
.sidebar-collapse-toggle:hover { background: rgba(255, 255, 255, 0.1); }
.sidebar-collapse-toggle .icon { width: 16px; height: 16px; transform: rotate(180deg); transition: transform .18s ease; }

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0 16px 0;
    flex: 1;
}
.app-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 20px;
    color: var(--c-white-85);
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    white-space: nowrap;
}
.app-sidebar-nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--c-white); text-decoration: none; }
.app-sidebar-nav a.active { background: rgba(255, 255, 255, 0.1); color: var(--c-white); border-left-color: var(--c-blue); }
.app-sidebar-nav .icon,
.app-profile-menu .icon { width: 19px; height: 19px; flex-shrink: 0; }

/* Gesperrte (nicht freigeschaltete) Produktbereiche in der Sidebar:
   trotzdem sichtbar, aber gedimmt und mit Schloss-Icon statt Link. */
.app-sidebar-nav .is-locked {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    white-space: nowrap;
    cursor: default;
}
.app-sidebar-nav .is-locked .label { flex: 1; }
.app-sidebar-nav .lock-icon { display: flex; flex-shrink: 0; }
.app-sidebar-nav .lock-icon .icon { width: 14px; height: 14px; }

/* Eingeklappte Sidebar (Desktop): nur Icons, Text ausgeblendet. */
.app-shell.is-collapsed .app-sidebar { width: 72px; }
.app-shell.is-collapsed .app-sidebar-top { justify-content: center; }
.app-shell.is-collapsed .app-sidebar-logo,
.app-shell.is-collapsed .app-sidebar-nav .label { display: none; }
.app-shell.is-collapsed .sidebar-collapse-toggle .icon { transform: rotate(0deg); }
.app-shell.is-collapsed .app-sidebar-nav a,
.app-shell.is-collapsed .app-sidebar-nav .is-locked { justify-content: center; padding: 14px 0; }
.app-shell.is-collapsed .app-sidebar-nav .lock-icon { display: none; }

.app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 8, 0.45);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

/* --- Topbar + Profil-Dropdown --------------------------------------- */
.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.app-topbar {
    background: var(--c-white);
    border-bottom: 1px solid var(--c-black-08);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 90;
}
.app-topbar-spacer { flex: 1; }
.sidebar-open-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--c-black-12);
    border-radius: var(--radius-sm);
    color: var(--c-black);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-open-toggle .icon { width: 20px; height: 20px; }

.app-profile { position: relative; flex-shrink: 0; }
.app-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--c-black-12);
    border-radius: 999px;
    padding: 5px 14px 5px 5px;
    cursor: pointer;
    font-family: inherit;
}
.app-profile-trigger:hover { background: var(--c-bg); }
.app-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-navy);
    color: var(--c-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}
.app-profile-name { font-size: 0.86rem; font-weight: 500; color: var(--c-black); }
.app-profile-caret { display: flex; color: var(--c-black-40); }
.app-profile-caret .icon { width: 15px; height: 15px; }
.app-profile .role-pill { background: var(--c-navy); color: var(--c-white); }

.app-profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 250px;
    background: var(--c-white);
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius);
    box-shadow: 0 16px 36px rgba(4, 4, 8, 0.18);
    padding: 8px;
    display: none;
    z-index: 150;
}
.app-profile-menu.is-open { display: block; }
.app-profile-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--c-black);
    font-size: 0.88rem;
    font-weight: 500;
}
.app-profile-menu a:hover { background: var(--c-bg); text-decoration: none; }
.app-profile-menu a.app-profile-logout { color: #a3121f; }
.app-profile-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-black-40);
    padding: 10px 12px 4px;
}
.app-profile-divider { height: 1px; background: var(--c-black-08); margin: 6px 4px; }

.role-pill {
    display: inline-block;
    background: var(--c-white-20);
    color: var(--c-white);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
}

/* --- Mobil: Sidebar wird Off-Canvas-Panel ---------------------------- */
@media (max-width: 900px) {
    .sidebar-open-toggle { display: flex; }
    .sidebar-collapse-toggle { display: none; }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 272px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: none;
    }
    .app-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.25);
    }
    .app-shell.is-collapsed .app-sidebar { width: 272px; }
    .app-shell.is-collapsed .app-sidebar-logo,
    .app-shell.is-collapsed .app-sidebar-nav .label { display: inline; }
    .app-shell.is-collapsed .app-sidebar-nav a,
    .app-shell.is-collapsed .app-sidebar-nav .is-locked { justify-content: flex-start; padding: 12px 20px; }
    .app-shell.is-collapsed .app-sidebar-nav .lock-icon { display: flex; }
    .app-shell.is-collapsed .app-sidebar-top { justify-content: space-between; }

    .app-sidebar-overlay { display: block; }
    .app-sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }

    .app-profile-name { display: none; }
    .app-profile-trigger { padding: 5px 10px 5px 5px; }
}

@media (max-width: 480px) {
    .app-topbar { padding: 12px 16px; }
    .app-profile-menu { min-width: 220px; right: -8px; }
}

.app-main { padding: 36px 0 64px 0; min-height: 60vh; flex: 1; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.page-head h1 { font-size: 1.5rem; margin-bottom: 0.15em; }
.page-head .subtitle { color: var(--c-black-60); font-size: 0.9rem; }

/* ---------------------------------------------------------------------
   Cards / Panels
   --------------------------------------------------------------------- */
.card {
    background: var(--c-white);
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}
.card h2 { font-size: 1.1rem; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--c-white);
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--c-navy);
}
.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--c-black-60);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------------
   Formulare
   --------------------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--c-black);
}
.form-group .hint {
    display: block;
    font-size: 0.78rem;
    color: var(--c-black-40);
    margin-top: 4px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.92rem;
    padding: 0.65em 0.8em;
    border: 1px solid var(--c-black-12);
    border-radius: var(--radius-sm);
    background: var(--c-white);
    color: var(--c-black);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(0, 111, 158, 0.15);
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
fieldset { border: none; padding: 0; margin: 0 0 20px 0; }
legend { font-weight: 700; padding: 0 0 10px 0; font-size: 1rem; }

/* ---------------------------------------------------------------------
   Tabellen
   --------------------------------------------------------------------- */
.table-wrap {
    background: var(--c-white);
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius);
    overflow: auto;
    box-shadow: var(--shadow);
    container-type: inline-size;
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-black-08);
    white-space: nowrap;
}
th {
    color: var(--c-black-60);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    background: #f5f6fa;
}
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: none; }
td.actions { display: flex; gap: 8px; white-space: nowrap; }
.table-empty { padding: 40px; text-align: center; color: var(--c-black-40); }

/* Auf schmalen Bildschirmen werden Tabellenzeilen zu Karten gestapelt,
   statt sie horizontal scrollen zu lassen (per data-label auf jedem <td>). */
@media (max-width: 700px) {
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr {
        display: block;
        width: 100%;
    }
    .table-wrap thead { position: absolute; left: -9999px; top: -9999px; }
    .table-wrap tbody tr {
        padding: 14px 16px;
        border-bottom: 1px solid var(--c-black-08);
    }
    .table-wrap tbody tr:last-child { border-bottom: none; }
    .table-wrap td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 6px 0;
        border-bottom: none;
        white-space: normal;
        text-align: right;
    }
    .table-wrap td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--c-black-60);
        text-align: left;
    }
    .table-wrap td.actions {
        justify-content: flex-end;
        padding-top: 10px;
    }
    .table-wrap td.actions::before { content: none; }
    .table-wrap td.actions .btn { flex: 1; }
}

/* Dieselben Regeln, aber abhängig von der tatsächlichen Breite des
   Tabellen-Containers statt der Bildschirmbreite. So klappen auch kleine
   Vorschau-Tabellen (z. B. im zweispaltigen Admin-Dashboard auf Tablets)
   automatisch ins Karten-Layout um, sobald ihre Spalte zu schmal wird –
   auch wenn der Bildschirm selbst breiter als 700px ist. Browser ohne
   Container-Query-Unterstützung zeigen stattdessen eine horizontal
   scrollbare Tabelle (kein Darstellungsfehler, nur weniger komfortabel). */
@container (max-width: 520px) {
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr {
        display: block;
        width: 100%;
    }
    .table-wrap thead { position: absolute; left: -9999px; top: -9999px; }
    .table-wrap tbody tr {
        padding: 14px 16px;
        border-bottom: 1px solid var(--c-black-08);
    }
    .table-wrap tbody tr:last-child { border-bottom: none; }
    .table-wrap td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 6px 0;
        border-bottom: none;
        white-space: normal;
        text-align: right;
    }
    .table-wrap td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--c-black-60);
        text-align: left;
    }
    .table-wrap td.actions {
        justify-content: flex-end;
        padding-top: 10px;
    }
    .table-wrap td.actions::before { content: none; }
    .table-wrap td.actions .btn { flex: 1; }
}

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--c-white);
    white-space: nowrap;
}
.badge-new { background: var(--c-navy); }
.badge-progress { background: var(--c-blue); }
.badge-done { background: var(--c-black); }
.badge-active { background: #0a7a3d; }
.badge-inactive { background: var(--c-black-40); }
.badge-admin { background: var(--c-navy); }
.badge-user { background: var(--c-black-40); }
.badge-error { background: #a3121f; }

/* ---------------------------------------------------------------------
   Flash-Meldungen
   --------------------------------------------------------------------- */
.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.flash-success { background: #e7f6ec; color: #0a7a3d; border: 1px solid #b9e6c8; }
.flash-error { background: #fdecec; color: #a3121f; border: 1px solid #f6c6c6; }
.flash-info { background: #e8f1ff; color: var(--c-navy); border: 1px solid #c9deff; }

/* ---------------------------------------------------------------------
   Login
   --------------------------------------------------------------------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-navy);
    padding: 24px;
}
.auth-card {
    background: var(--c-white);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.auth-card .logo { margin-bottom: 6px; }
.auth-card .subtitle {
    color: var(--c-black-60);
    font-size: 0.88rem;
    margin-bottom: 28px;
}
.auth-back {
    display: inline-block;
    margin-top: 18px;
    font-size: 0.85rem;
    color: var(--c-black-40);
}

/* ---------------------------------------------------------------------
   Utilities
   --------------------------------------------------------------------- */
.text-muted { color: var(--c-black-60); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.small { font-size: 0.82rem; }
.divider { height: 1px; background: var(--c-black-08); margin: 24px 0; border: none; }

/* ---------------------------------------------------------------------
   Allgemeine Mobil-Optimierung (Smartphones)
   --------------------------------------------------------------------- */
@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .card { padding: 20px; }
    .auth-card { padding: 28px 22px; }
    .app-main { padding: 24px 0 48px 0; }
    .page-head { align-items: flex-start; }
    .page-head .btn { width: 100%; text-align: center; }
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .form-actions .btn { flex: 1; min-width: 140px; }
    fieldset .form-grid { grid-template-columns: 1fr; }
}

/* Touch-Geräte: etwas großzügigere Klickflächen für Links in Tabellen/Menüs */
@media (hover: none) and (pointer: coarse) {
    .app-nav a, .site-nav a { min-height: 44px; display: flex; align-items: center; }
    .btn { min-height: 40px; }
}

/* ---------------------------------------------------------------------
   Zusätzliche Formularelemente (Händlerportal)
   --------------------------------------------------------------------- */
input[type="number"] {
    width: 100%;
    font-family: inherit;
    font-size: 0.92rem;
    padding: 0.65em 0.8em;
    border: 1px solid var(--c-black-12);
    border-radius: var(--radius-sm);
    background: var(--c-white);
    color: var(--c-black);
}
input[type="number"]:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(0, 111, 158, 0.15);
}
.radio-row {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.4em 0;
}
.radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    font-size: 0.92rem;
    margin: 0;
}
.radio-row input[type="radio"],
.radio-row input[type="checkbox"],
.check-row input[type="checkbox"] {
    width: auto;
    accent-color: var(--c-blue);
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.check-row input[type="checkbox"] { margin-top: 4px; }
.check-row label { font-weight: 400; }
.field-error {
    display: block;
    color: #a3121f;
    font-size: 0.78rem;
    margin-top: 4px;
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #a3121f;
}
.required-mark { color: #a3121f; }

/* ---------------------------------------------------------------------
   Produktübersicht (Händlerportal-Kacheln)
   --------------------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}
@media (max-width: 620px) {
    .product-grid { grid-template-columns: 1fr; }
}
.product-card {
    background: var(--c-white);
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 180px;
}
.product-card h2 { margin-top: 0; margin-bottom: 8px; font-size: 1.05rem; color: var(--c-navy); }
.product-card p { color: var(--c-black-60); font-size: 0.9rem; margin: 0; }
.product-card .btn { align-self: flex-start; }
.product-card.is-locked { background: var(--c-bg); }
.product-card.is-locked h2 { color: var(--c-black-60); }
.btn-disabled {
    background: transparent;
    color: var(--c-black-40);
    border: 1px dashed var(--c-black-12);
    cursor: default;
}
.btn-disabled:hover { border-color: var(--c-black-12); }

/* ---------------------------------------------------------------------
   Mehrstufige Anträge (Fortschrittsanzeige)
   --------------------------------------------------------------------- */
.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    list-style: none;
    padding: 0;
}
.wizard-steps li {
    flex: 1 1 140px;
    background: var(--c-white);
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--c-black-40);
    position: relative;
}
.wizard-steps li .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--c-black-08);
    color: var(--c-black-60);
    font-weight: 700;
    font-size: 0.72rem;
    margin-right: 8px;
}
.wizard-steps li.is-current {
    border-color: var(--c-blue);
    color: var(--c-navy);
    font-weight: 500;
}
.wizard-steps li.is-current .num { background: var(--c-blue); color: var(--c-white); }
.wizard-steps li.is-done .num { background: var(--c-navy); color: var(--c-white); }
.wizard-steps li.is-done { color: var(--c-black); }

/* ---------------------------------------------------------------------
   Wiederholbare Eingabegruppen (Kinder, Verbindlichkeiten, Immobilien …)
   --------------------------------------------------------------------- */
.repeat-item {
    border: 1px solid var(--c-black-08);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 14px;
    background: var(--c-bg);
    position: relative;
}
.repeat-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.repeat-item-head strong { font-size: 0.85rem; color: var(--c-navy); }
.repeat-empty-hint { color: var(--c-black-40); font-size: 0.85rem; margin: 6px 0 14px 0; }

/* ---------------------------------------------------------------------
   Zusammenfassung (letzter Schritt eines Antrags)
   --------------------------------------------------------------------- */
.summary-block {
    border-bottom: 1px solid var(--c-black-08);
    padding: 16px 0;
}
.summary-block:last-child { border-bottom: none; }
.summary-block-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.summary-block-head h3 { margin: 0; font-size: 0.95rem; color: var(--c-navy); }
.summary-block dl { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 4px 12px; margin: 0; }
.summary-block dt { color: var(--c-black-60); font-size: 0.85rem; }
.summary-block dd { margin: 0; font-size: 0.9rem; }

@media (max-width: 600px) {
    .wizard-steps li { flex: 1 1 100%; }
    .summary-block dl { grid-template-columns: 1fr; }
    .summary-block dd { margin-bottom: 6px; }
}

/* ---------------------------------------------------------------------
   NAFI NOVA (eingebettete externe Anwendung per iframe)
   --------------------------------------------------------------------- */
.nafi-frame-wrap {
    border: 1px solid var(--c-black-12);
    border-radius: 8px;
    overflow: hidden;
    background: var(--c-white);
}
.nafi-frame {
    display: block;
    width: 100%;
    height: 80vh;
    min-height: 560px;
    border: 0;
}
@media (max-width: 600px) {
    .nafi-frame { height: 70vh; min-height: 420px; }
}
