/* =====================================================================
   Traktorschutz – Brand-Design abgeleitet vom Logo (Schild + TS)
   ---------------------------------------------------------------------
   Anthrazit-Schwarz #1A1D21 · Signal-Orange #F26522 · Weiß
   Italic-Bold Wortmarke · kantige Buttons · Schild als visuelles Motiv
   ===================================================================== */

:root {
    /* Grundpalette */
    --bg:           #FFFFFF;
    --bg-alt:       #FFFFFF;
    --bg-soft:      #F4F5F7;
    --bg-sunk:      #EBEDF1;

    /* Marke */
    --ink:          #1A1D21;   /* Anthrazit aus dem Logo */
    --ink-soft:     #2A2E33;
    --ink-line:     #3B4047;

    --primary:      #1A1D21;
    --primary-dark: #0F1114;

    --accent:       #F26522;   /* Signal-Orange aus dem Logo */
    --accent-dark:  #D54E0E;
    --accent-tint:  #FDE4D2;
    --accent-glow:  rgba(242,101,34,0.20);

    /* Text & Linien */
    --text:         #1A1D21;
    --text-muted:   #6E7480;
    --text-soft:    #A6ABB3;
    --text-inv:     #FFFFFF;
    --text-inv-muted: rgba(255,255,255,0.72);

    --border:       #E1E3E8;
    --border-strong:#C7CBD1;

    /* Status (dezent unter dem Markendach) */
    --ok:           #1F7A3A;
    --ok-bg:        #E6F3EB;
    --err:          #B5341F;
    --err-bg:       #FBEAE5;
    --warn:         #A56A12;
    --warn-bg:      #FBF1DB;

    /* Form */
    --radius:       4px;
    --radius-lg:    8px;
    --radius-pill:  999px;
    --shadow-sm:    0 1px 2px rgba(26,29,33,0.06);
    --shadow:       0 2px 8px rgba(26,29,33,0.08);
    --shadow-lg:    0 8px 24px rgba(26,29,33,0.14);

    --font:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-brand:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --max:          1160px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s; }
a:hover { color: var(--accent); border-bottom-color: var(--accent); }

h1, h2, h3 { font-weight: 800; color: var(--ink); margin: 0 0 0.6em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin-top: 1.4em; }
h3 { font-size: 17px; margin-top: 1em; }

p { margin: 0 0 0.8em; }
small, .small { font-size: 13px; }
.muted { color: var(--text-muted); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
       font-size: 13px; padding: 2px 5px; background: var(--bg-soft); border-radius: 4px; }

/* ========================================================
   Brand-Mark: Original-Logo als <img>
   ======================================================== */
.brand-mark {
    display: inline-flex;
    align-items: center;
    border: none;
    text-decoration: none;
    color: var(--ink);
    transition: opacity 0.15s;
    line-height: 0;
}
.brand-mark:hover { opacity: 0.85; border: none; color: var(--ink); }

/* Header-Variante: Querformat-Logo, höhenbegrenzt */
.brand-mark img.logo-quer {
    display: block;
    height: 40px;
    width: auto;
    max-width: 280px;
}
/* Hochformat-Logo für Auth/Login-Karte */
.brand-mark img.logo-hoch {
    display: block;
    height: 96px;
    width: auto;
    max-width: 200px;
    margin: 0 auto;
}

/* Optional: noch verwendete Inline-SVG-Klasse — bleibt für Abwärtskompatibilität */
.brand-mark .shield { width: 32px; height: 32px; flex-shrink: 0; display: block; }
.brand-mark .brand-text {
    font-family: var(--font-brand);
    font-style: italic;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 19px;
    line-height: 1;
    white-space: nowrap;
    margin-left: 10px;
}
.brand-mark .brand-text .lead-word { color: var(--ink); }
.brand-mark .brand-text .accent-word { color: var(--accent); }
.brand-mark .brand-text .tld { color: var(--text-muted); font-weight: 600; font-style: normal; font-size: 0.75em; margin-left: 1px; }

@media (max-width: 760px) {
    .brand-mark img.logo-quer { height: 34px; max-width: 220px; }
    .brand-mark img.logo-hoch { height: 80px; }
}

/* Legacy-Klasse .brand bleibt funktional (wird in alten Views verwendet) */
.brand {
    font-family: var(--font-brand);
    font-style: italic;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
    font-size: 19px;
    border: none;
    text-decoration: none;
}
.brand .mark { color: var(--accent); }

/* ========================================================
   Layout-Hüllen
   ======================================================== */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.site-header {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: relative;
    z-index: 10;
}
.site-header.dark {
    background: var(--ink);
    border-bottom: 3px solid var(--accent);
    color: var(--text-inv);
}
.site-header.dark .nav a { color: var(--text-inv-muted); }
.site-header.dark .nav a:hover,
.site-header.dark .nav a.active { color: var(--text-inv); border-bottom-color: var(--accent); }
.site-header.dark .muted { color: var(--text-inv-muted); }

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Händler-Logo oben rechts im Header */
.haendler-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    height: 44px;
    max-width: 160px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    padding: 4px 8px;
    text-decoration: none;
    border-bottom: none;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.15s;
}
.haendler-logo:hover { border-color: var(--accent); }
.haendler-logo img {
    max-height: 36px;
    max-width: 140px;
    width: auto; height: auto;
    object-fit: contain;
    display: block;
}
.haendler-logo.placeholder {
    width: 44px;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 18px;
    background: var(--bg-soft);
    border-style: dashed;
}
.haendler-logo.placeholder:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 760px) {
    .haendler-logo { margin-left: auto; height: 38px; max-width: 130px; padding: 3px 6px; }
    .haendler-logo img { max-height: 30px; max-width: 110px; }
    .haendler-logo.placeholder { width: 38px; font-size: 15px; }
}

.nav { margin-left: auto; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.nav a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}
.nav a.active, .nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.site-main { padding: 36px 0 64px; }
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 24px 0;
    margin-top: 60px;
    font-size: 13px;
    color: var(--text-muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--text-muted); border-bottom-color: transparent; }
.site-footer a:hover { color: var(--accent); }

/* ========================================================
   Sidebar-Layout (Admin / Händler)
   ======================================================== */
.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 20px 64px;
}
.sidebar {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 0 18px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: var(--shadow-sm);
}
.sidebar .section-title {
    padding: 10px 18px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-soft);
    margin-top: 4px;
}
.sidebar a {
    display: block;
    padding: 9px 18px;
    color: var(--text);
    border-left: 3px solid transparent;
    border-bottom: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sidebar a:hover { background: var(--bg-soft); color: var(--ink); }
.sidebar a.active {
    border-left-color: var(--accent);
    background: var(--bg-soft);
    color: var(--ink);
    font-weight: 700;
}
.app-main { min-width: 0; }

@media (min-width: 761px) and (max-width: 1024px) {
    .app-layout { grid-template-columns: 200px 1fr; gap: 20px; padding: 22px 16px 48px; }
    .sidebar a { padding: 8px 14px; font-size: 13px; }
    .sidebar .section-title { padding: 8px 14px 4px; font-size: 10px; }
}

.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* ========================================================
   Dashboard
   ======================================================== */
.dash-head { margin-bottom: 18px; }

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 26px;
}
.kpi {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    border-bottom: none;
    transition: border-color 0.15s, transform 0.05s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}
.kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s;
}
.kpi:hover { border-color: var(--ink-line); box-shadow: var(--shadow); }
.kpi:hover::before { transform: scaleX(1); }
.kpi:active { transform: scale(0.98); }
.kpi .n {
    display: block;
    font-size: 30px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.kpi .lbl {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-top: 6px;
}
.kpi.alert .n { color: var(--err); }
.kpi.alert::before { background: var(--err); transform: scaleX(1); }

.dash-section { margin-bottom: 26px; }
.dash-cols { display: block; }
@media (min-width: 1080px) {
    .dash-cols {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 22px;
    }
    .dash-cols .dash-section { margin-bottom: 0; }
}
.dash-h {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.dash-h h2 { margin: 0; font-size: 18px; }

/* Tile-List */
.tile-list {
    list-style: none; padding: 0; margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-alt);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.tile-list li + li { border-top: 1px solid var(--border); }
.tile-list .tile {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    border-bottom: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0.04);
    transition: background 0.12s;
}
.tile-list .tile:hover,
.tile-list .tile:active { background: var(--bg-soft); }
.tile-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px; line-height: 1.3;
}
.tile-row + .tile-row { margin-top: 2px; }
.tile-num { font-weight: 700; font-size: 15px; color: var(--ink); }
.tile-sub { font-size: 13px; }
.tile-kunde { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.tile-list .tile .badge { flex-shrink: 0; }

.empty { text-align: center; padding: 28px 16px; color: var(--text-muted); }
.empty .btn { margin-top: 12px; }

/* FAB-Menü */
.fab-menu { display: none; }

.show-mobile { display: none; }
@media (max-width: 760px) {
    .show-mobile { display: block; }
    .show-desktop { display: none !important; }
}

/* Status-Pille */
.status-pillrow {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin: -4px 0 6px 0;
}

.btn-row.btn-row-split { justify-content: space-between; align-items: center; }
.btn-row.btn-row-split > * { flex: 0 0 auto; }

.btn-row.btn-row-tri {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.btn-row.btn-row-tri > * { flex: 0 1 auto; }
@media (max-width: 480px) {
    .btn-row.btn-row-tri { flex-wrap: wrap; }
    .btn-row.btn-row-tri .btn { flex: 1 1 auto; text-align: center; }
}

/* ========================================================
   Varianten-Karten (Angebots-Konfigurator)
   ======================================================== */
.var-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) {
    .var-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
.var-card {
    position: relative;
    display: block;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 14px 14px 44px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.var-card:hover { border-color: var(--ink-line); }
.var-card input[type="radio"] {
    position: absolute;
    top: 16px; left: 14px;
    width: 20px; height: 20px;
    margin: 0;
    accent-color: var(--accent);
}
.var-card.is-active,
.var-card:has(input[type="radio"]:checked) {
    border-color: var(--accent);
    background: #FFF8F2;
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.var-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}
.var-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.var-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 700;
}
.var-val { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.var-val.accent { color: var(--accent); font-size: 17px; }
.var-val.muted  { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.var-badge { position: absolute; top: 10px; right: 10px; }

/* ========================================================
   Responsive Tabellen → Karten
   ======================================================== */
@media (max-width: 760px) {
    .card { padding: 14px 14px; }
    table.data.responsive { display: block; width: 100%; }
    table.data.responsive thead { display: none; }
    table.data.responsive tbody { display: block; }
    table.data.responsive tr {
        display: block;
        background: var(--bg-alt);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 10px 12px 12px;
        margin-bottom: 10px;
    }
    table.data.responsive tr:last-child { margin-bottom: 0; }
    table.data.responsive td {
        display: block;
        padding: 4px 0;
        text-align: left !important;
        border: none;
        line-height: 1.4;
        white-space: normal !important;
    }
    table.data.responsive td::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--text-muted);
        font-weight: 700;
        margin-bottom: 1px;
    }
    table.data.responsive td:not([data-label])::before { content: ''; display: none; }
    table.data.responsive td.card-head,
    table.data.responsive td:first-child {
        font-size: 16px; font-weight: 700; color: var(--ink);
        padding-top: 0;
        margin-bottom: 4px;
    }
    table.data.responsive .btn-row { margin-top: 4px; }
    table.data:not(.responsive):not(:has(thead)) tbody tr {
        display: block;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }
    table.data:not(.responsive):not(:has(thead)) tbody tr:last-child { border-bottom: none; }
    table.data:not(.responsive):not(:has(thead)) tbody th {
        display: block;
        width: 100% !important;
        padding: 0 0 2px 0;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--text-muted);
        font-weight: 700;
    }
    table.data:not(.responsive):not(:has(thead)) tbody td {
        display: block;
        padding: 0 0 2px 0;
        text-align: left !important;
        white-space: normal !important;
    }
}

@media (max-width: 760px) {
    .app-layout {
        grid-template-columns: 1fr;
        padding: 20px 16px 48px;
    }

    .menu-toggle { display: none !important; }
    .site-header .nav { display: none; }
    .site-header { padding: 10px 0; }
    .site-header .brand,
    .site-header .brand-mark .brand-text { font-size: 17px; }
    .site-header .brand-mark .shield { width: 28px; height: 28px; }
    .site-header .brand-mark img.logo-quer { height: 32px; max-width: 200px; }

    /* FAB */
    .fab-menu {
        display: flex;
        align-items: center; justify-content: center;
        position: fixed;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 60px; height: 60px;
        background: var(--accent);
        color: #fff;
        border: none; border-radius: 50%;
        box-shadow: 0 6px 18px rgba(0,0,0,0.22), 0 2px 4px rgba(0,0,0,0.12);
        font-size: 26px; line-height: 1;
        z-index: 1002;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.18s ease, background 0.18s ease;
    }
    .fab-menu:active { transform: scale(0.94); }
    body.menu-open .fab-menu { background: var(--ink); }
    body.menu-open .fab-menu .fab-bars { display: none; }
    .fab-menu .fab-x { display: none; }
    body.menu-open .fab-menu .fab-x { display: inline; }

    .kpi-strip { gap: 8px; margin-bottom: 18px; }
    .kpi { padding: 10px 6px; }
    .kpi .n { font-size: 22px; }
    .kpi .lbl { font-size: 10px; }

    .dash-head h1 { font-size: 22px; }
    .dash-head { margin-bottom: 12px; }
    .dash-section { margin-bottom: 18px; }
    .dash-h h2 { font-size: 16px; }

    .tile-list .tile { padding: 10px 12px; }
    .tile-num { font-size: 14px; }
    .tile-sub { font-size: 12px; }
    .tile-meta { font-size: 11px; }

    .app-main { padding-bottom: 100px; }

    .sidebar {
        position: fixed;
        top: auto;
        right: 0;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
        height: auto;
        max-height: calc(100vh - env(safe-area-inset-bottom, 0px) - 96px);
        width: min(52vw, 230px);
        max-width: 240px;
        margin: 0;
        border: none;
        border-left:   1px solid var(--border);
        border-top:    1px solid var(--border);
        border-bottom: 1px solid var(--border);
        border-radius: 14px 0 0 14px;
        padding: 6px 0 8px 0;
        overflow-y: auto;
        z-index: 1001;
        transform: translateX(100%);
        transition: transform 0.22s ease;
        box-shadow: -8px 0 24px rgba(0,0,0,0.18);
        background: var(--bg-alt);
        display: flex;
        flex-direction: column;
    }
    body.menu-open .sidebar { transform: translateX(0); }

    .sidebar .section-title {
        padding: 6px 12px 0 12px;
        font-size: 9px;
        letter-spacing: 1px;
        margin: 0;
        opacity: 0.5;
        line-height: 1.2;
    }

    .sidebar a {
        min-height: 40px;
        display: flex;
        align-items: center;
        padding: 0 12px;
        font-size: 14px;
        border-left: 3px solid transparent;
        line-height: 1.25;
    }
    .sidebar a.active {
        border-left-width: 3px;
        background: var(--accent-tint);
        font-weight: 700;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    body.menu-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.menu-open { overflow: hidden; }

    .sidebar .menu-close { display: none; }
}
@media (min-width: 761px) {
    .sidebar .menu-close { display: none; }
}

/* ========================================================
   Cards / Panels
   ======================================================== */
.card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

@media (min-width: 761px) {
    .card > table.data thead th,
    .card > table.data tbody td { white-space: nowrap; }
    .card > table.data tbody td.wrap,
    .card > table.data tbody th { white-space: normal; }
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.stat .value { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.1; margin-top: 4px; letter-spacing: -0.02em; }
.stat .sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ========================================================
   Forms
   ======================================================== */
.form { display: grid; gap: 14px; max-width: 560px; }
.form.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: none; }
.form.grid-2 .span-2 { grid-column: span 2; }
.form > *, .form.grid-2 > * { min-width: 0; }
@media (max-width: 640px) {
    .form.grid-2 { grid-template-columns: minmax(0, 1fr); }
    .form.grid-2 .span-2 { grid-column: auto; }
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Globale Mobile-Härtung gegen Overflow */
@media (max-width: 760px) {
    html, body { overflow-x: hidden; }
    input, select, textarea { max-width: 100%; min-width: 0; }
    .card, .wrap { max-width: 100%; }
}

label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin-top: 5px; }
label.check input { margin-top: 3px; accent-color: var(--accent); }
label.check span { flex: 1; }

label { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
label .hint { display: block; font-weight: 400; color: var(--text-muted); font-size: 12px; margin-top: 2px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="date"],
select, textarea {
    width: 100%;
    font: inherit;
    padding: 10px 12px;
    margin-top: 5px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-alt);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { min-height: 90px; resize: vertical; font-family: var(--font); }

input[type="file"] {
    font-size: 14px;
    margin-top: 5px;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.check-line { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0; }
.check-line input { margin-top: 3px; }
.check-line label { font-weight: 400; }

/* ========================================================
   Buttons — kantig, brand-stark
   ======================================================== */
.btn {
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border-strong);
    background: var(--bg-alt);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:hover { background: var(--bg-soft); border-color: var(--ink); color: var(--ink); }
.btn:active { transform: translateY(1px); }

.btn.primary {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; box-shadow: var(--shadow); }

.btn.accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn.accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }

.btn.ghost {
    background: transparent;
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}
.btn.ghost:hover { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; }

.btn.danger { color: var(--err); border-color: var(--err); background: var(--bg-alt); }
.btn.danger:hover { background: var(--err-bg); color: var(--err); }

.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========================================================
   Flash
   ======================================================== */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid;
    border-left-width: 4px;
    font-weight: 500;
}
.flash.ok   { background: var(--ok-bg);   border-color: var(--ok);   color: var(--ok); }
.flash.err  { background: var(--err-bg);  border-color: var(--err);  color: var(--err); }
.flash.info { background: var(--bg-soft); border-color: var(--ink-line); color: var(--ink); }
.flash.warn { background: var(--warn-bg); border-color: var(--warn);  color: var(--warn); }

/* ========================================================
   Tabellen
   ======================================================== */
table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
table.data th, table.data td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}
table.data th {
    background: var(--bg-soft);
    font-weight: 700;
    color: var(--ink);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #FAFBFC; }

/* ========================================================
   Status-Badges
   ======================================================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid;
}
.badge.info { background: var(--bg-soft); color: var(--ink); border-color: var(--border-strong); }
.badge.ok   { background: var(--ok-bg);  color: var(--ok);      border-color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn);   border-color: var(--warn); }
.badge.err  { background: var(--err-bg); color: var(--err);     border-color: var(--err); }
.badge.accent { background: var(--accent-tint); color: var(--accent-dark); border-color: var(--accent); }

/* ========================================================
   Hero (Startseite) — dunkle Marken-Bühne mit Schild-Wasserzeichen
   ======================================================== */
.hero {
    background: var(--ink);
    color: var(--text-inv);
    padding: 72px 0 64px;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--accent);
}
.hero::before {
    /* Schild als Wasserzeichen rechts oben */
    content: '';
    position: absolute;
    right: -80px;
    top: -40px;
    width: 480px;
    height: 480px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 110'><path d='M50 5 L92 18 L92 60 Q92 88 50 105 Q8 88 8 60 L8 18 Z' fill='none' stroke='%23F26522' stroke-width='2' opacity='0.18'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}
.hero::after {
    /* Subtiler radialer Highlight links unten */
    content: '';
    position: absolute;
    left: -120px; bottom: -160px;
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(242,101,34,0.18) 0%, rgba(242,101,34,0) 60%);
    pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 {
    color: var(--text-inv);
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
    max-width: 760px;
    line-height: 1.1;
    margin-bottom: 18px;
}
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero .lead {
    font-size: 18px;
    color: var(--text-inv-muted);
    max-width: 660px;
    margin-bottom: 30px;
    line-height: 1.5;
}
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .slogan {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--accent);
    margin-bottom: 20px;
}
.hero .slogan::before,
.hero .slogan::after {
    content: '';
    width: 28px;
    height: 2px;
    background: var(--accent);
}

@media (max-width: 760px) {
    .hero { padding: 48px 0 44px; }
    .hero h1 { font-size: 32px; }
    .hero .lead { font-size: 16px; }
    .hero::before { width: 320px; height: 320px; right: -100px; top: -20px; }
}

/* ========================================================
   Feature-Grid
   ======================================================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 44px 0;
}
.feature {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.feature:hover { border-color: var(--ink-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.feature h3 { margin-top: 0; color: var(--ink); font-size: 17px; }
.feature .tag {
    display: inline-block;
    width: 36px; height: 4px;
    background: var(--accent);
    margin-bottom: 14px;
    border-radius: 2px;
}
.feature p { color: var(--text-muted); margin-bottom: 0; }

/* ========================================================
   Auth / Install
   ======================================================== */
.auth-wrap, .install {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-soft);
    position: relative;
    overflow: hidden;
}
.auth-wrap::before, .install::before {
    content: '';
    position: absolute;
    top: -150px; right: -150px;
    width: 500px; height: 500px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 110'><path d='M50 5 L92 18 L92 60 Q92 88 50 105 Q8 88 8 60 L8 18 Z' fill='none' stroke='%231A1D21' stroke-width='1.5' opacity='0.06'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}
.auth-card, .install-card {
    max-width: 460px;
    width: 100%;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
}
.auth-card h1, .install-card h1 { font-size: 22px; margin-bottom: 4px; color: var(--ink); }
.auth-card header, .install-card header { margin-bottom: 24px; text-align: center; }
.auth-card header .brand-mark,
.install-card header .brand-mark { justify-content: center; margin-bottom: 8px; }

/* ========================================================
   Utility
   ======================================================== */
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.right { margin-left: auto; }
.space-y > * + * { margin-top: 16px; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.kbd {
    padding: 1px 6px; border: 1px solid var(--border-strong);
    border-bottom-width: 2px; border-radius: 4px;
    font-family: ui-monospace, monospace; font-size: 12px;
}

/* Inline-Akzent (z. B. für Hervorhebungen im Fließtext) */
.text-accent { color: var(--accent); font-weight: 700; }
.text-ink    { color: var(--ink); font-weight: 700; }
