/* =========================================================================
   TARIFO UI – zentrales Design-System
   Wird von ALLEN Seiten geladen (Partner, Admin, öffentlich): /CSS/tarifo-ui.css
   Farben aus dem Logo: Blau-Verlauf (#1E9BE0 → #1A3FD0) + Orange (#FFB000 → #FF7A00)

   Inhalt
   1. Tokens            7. Tabellen          13. Modal & Toast
   2. Basis             8. Formulare         14. Leere Zustände, Alerts, Loader
   3. App-Rahmen        9. Buttons           15. Wizard / Stepper
   4. Seitenleiste     10. Badges & Status   16. Hilfsklassen
   5. Seitenkopf       11. Tabs & Chips      17. Mobile
   6. Karten & KPIs    12. Listen & Avatare
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================== 1. TOKENS ============================== */
:root {
    /* Marke */
    --tf-blue-50: #EEF4FF;
    --tf-blue-100: #DCE8FF;
    --tf-blue-200: #B7CFFF;
    --tf-blue-400: #4C8DF6;
    --tf-blue-500: #1F6FEB;
    --tf-blue-600: #1557C8;
    --tf-blue-700: #1446A0;
    --tf-orange-50: #FFF4E5;
    --tf-orange-100: #FFE4BF;
    --tf-orange-400: #FFA41B;
    --tf-orange-500: #FF8A00;
    --tf-orange-600: #E57300;
    --tf-gradient: linear-gradient(135deg, #1E9BE0 0%, #1A3FD0 100%);
    --tf-gradient-orange: linear-gradient(135deg, #FFB000 0%, #FF7A00 100%);

    /* Navy (Seitenleiste) */
    --tf-navy-950: #060C1D;
    --tf-navy-900: #0A1430;
    --tf-navy-800: #111F45;
    --tf-navy-700: #1A2B5C;
    --tf-navy-text: #A9B5D3;
    --tf-navy-muted: #66739A;

    /* Neutral */
    --tf-bg: #F3F5FA;
    --tf-surface: #FFFFFF;
    --tf-surface-2: #F8FAFD;
    --tf-surface-3: #EEF1F7;
    --tf-border: #E3E8F1;
    --tf-border-strong: #CBD3E2;
    --tf-text: #0D1630;
    --tf-text-2: #4A5672;
    --tf-text-3: #8590A8;

    /* Status */
    --tf-green: #12A150;
    --tf-green-50: #E8F7EE;
    --tf-green-700: #0B7A3B;
    --tf-red: #E5484D;
    --tf-red-50: #FDECEC;
    --tf-red-700: #B42328;
    --tf-amber: #F59E0B;
    --tf-amber-50: #FEF5E2;
    --tf-amber-700: #A15C00;
    --tf-violet: #7C5CFC;
    --tf-violet-50: #F1EDFF;

    /* Form */
    --tf-radius-xs: 6px;
    --tf-radius-sm: 8px;
    --tf-radius: 12px;
    --tf-radius-lg: 16px;
    --tf-radius-xl: 22px;
    --tf-shadow-xs: 0 1px 2px rgba(13, 22, 48, .05);
    --tf-shadow-sm: 0 1px 3px rgba(13, 22, 48, .06), 0 1px 2px rgba(13, 22, 48, .04);
    --tf-shadow: 0 6px 20px -6px rgba(13, 22, 48, .12), 0 2px 6px rgba(13, 22, 48, .05);
    --tf-shadow-lg: 0 24px 48px -12px rgba(13, 22, 48, .22);
    --tf-ring: 0 0 0 4px rgba(31, 111, 235, .16);
    --tf-font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --tf-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --tf-sidebar-w: 264px;
    --tf-ease: cubic-bezier(.2, .7, .2, 1);

    /* Alte Variablennamen (werden in Seiten-CSS & Inline-Styles noch benutzt) */
    --accent: var(--tf-blue-500);
    --accent-hover: var(--tf-blue-600);
    --accent-glow: rgba(31, 111, 235, .18);
    --accent-orange: var(--tf-orange-500);
    --tf-orange: var(--tf-orange-500);
    --bg-primary: var(--tf-bg);
    --bg-secondary: var(--tf-surface);
    --bg-tertiary: var(--tf-surface-2);
    --bg-elevated: var(--tf-surface);
    --text-primary: var(--tf-text);
    --text-secondary: var(--tf-text-2);
    --text-muted: var(--tf-text-3);
    --border: var(--tf-border);
    --border-light: var(--tf-border-strong);
    --success: var(--tf-green);
    --success-bg: var(--tf-green-50);
    --warning: var(--tf-amber);
    --danger: var(--tf-red);
    --danger-hover: var(--tf-red-700);
    --radius-sm: var(--tf-radius-sm);
    --radius-md: var(--tf-radius-sm);
    --radius-lg: var(--tf-radius);
    --radius-xl: var(--tf-radius-lg);
    --shadow-sm: var(--tf-shadow-sm);
    --shadow-md: var(--tf-shadow);
    --shadow-lg: var(--tf-shadow-lg);
    --transition: all .18s var(--tf-ease);
}

/* ============================== 2. BASIS ============================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--tf-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--tf-text);
    background: var(--tf-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 { color: var(--tf-text); line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--tf-blue-500); text-decoration: none; }
a:hover { color: var(--tf-blue-600); }
img, svg { vertical-align: middle; }
button, input, select, textarea { font-family: inherit; }
::selection { background: var(--tf-blue-100); }
:focus-visible { outline: 2px solid var(--tf-blue-500); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--tf-border); margin: 24px 0; }
code, .mono { font-family: var(--tf-mono); font-size: .9em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CDD4E2; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #AEB8CC; border: 3px solid transparent; background-clip: content-box; }

/* ============================== 3. APP-RAHMEN ============================== */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--tf-bg);
}
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--tf-sidebar-w);
    padding: 32px 40px 64px;
    max-width: calc(1440px + var(--tf-sidebar-w));
}
.main-content > * { max-width: 1360px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================== 4. SEITENLEISTE ============================== */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--tf-sidebar-w);
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(31, 111, 235, .22) 0%, transparent 60%),
        radial-gradient(80% 40% at 100% 100%, rgba(255, 138, 0, .10) 0%, transparent 60%),
        var(--tf-navy-900);
    color: var(--tf-navy-text);
    z-index: 200;
    border-right: 1px solid rgba(255, 255, 255, .04);
}

/* Logo */
.logo-container { padding: 22px 22px 14px; }
.tf-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.tf-brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--tf-gradient);
    box-shadow: 0 6px 16px -4px rgba(31, 111, 235, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.tf-brand-mark svg { width: 18px; height: 18px; fill: #FFC24A; stroke: none; }
.tf-brand-name { font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; color: #fff; line-height: 1; }
.tf-brand-name b { font-weight: 800; background: var(--tf-gradient-orange); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tf-brand-tag {
    margin-left: 2px; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: #FFC24A; background: rgba(255, 138, 0, .14); border: 1px solid rgba(255, 138, 0, .3);
    padding: 2px 7px; border-radius: 99px;
}

/* Navigation */
.nav-menu {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-menu::-webkit-scrollbar { width: 6px; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border: 0; }
.nav-label {
    margin: 16px 10px 6px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tf-navy-muted) !important;
}
.nav-label:first-child { margin-top: 4px; }
.nav-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--tf-navy-text);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.nav-button svg { width: 19px; height: 19px; flex-shrink: 0; stroke: currentColor; opacity: .8; transition: .15s; }
.nav-button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-button:hover svg { opacity: 1; }
.nav-button.active {
    background: linear-gradient(90deg, rgba(31, 111, 235, .28), rgba(31, 111, 235, .10));
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(76, 141, 246, .25);
}
.nav-button.active svg { opacity: 1; stroke: #FFB547; }
.nav-button.active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--tf-gradient-orange);
}
.nav-button .mail-badge, .nav-badge {
    margin-left: auto;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 99px;
    background: var(--tf-orange-500) !important;
    color: #fff !important;
    font-size: .7rem !important; font-weight: 700 !important;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
}
.nav-divider { height: 1px; background: rgba(255, 255, 255, .07); margin: 10px 8px; }
.nav-button.nav-switch { color: #8FB6FF; }
.nav-button.logout-nav-btn { color: #FF9B9E; margin-top: 8px; }
.nav-button.logout-nav-btn:hover { background: rgba(229, 72, 77, .12); color: #FFC1C3; }
.nav-button.logout-nav-btn svg { stroke: currentColor !important; }
.nav-button.logout-nav-btn span { color: inherit !important; font-weight: 600; }

/* Profil unten */
.user-profile {
    margin: 8px 12px 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .06);
}
.avatar {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--tf-gradient-orange);
    color: #fff; font-weight: 800; font-size: .82rem; letter-spacing: .02em;
}
.user-profile .user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-profile .user-name { color: #fff; font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-profile .user-email { color: var(--tf-navy-muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "Zurück zum Admin" (von Name.js eingefügt) */
.admin-return-btn {
    position: fixed; right: 24px; bottom: 24px; z-index: 300;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px; border-radius: 99px;
    background: var(--tf-navy-900); color: #FFC24A !important;
    font-weight: 700; font-size: .88rem; text-decoration: none;
    box-shadow: var(--tf-shadow-lg); border: 1px solid rgba(255, 255, 255, .08);
    transition: transform .15s;
}
.admin-return-btn:hover { transform: translateY(-2px); }
.admin-return-btn svg { width: 18px; height: 18px; }

/* ============================== 5. SEITENKOPF ============================== */
.content-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin: 0 0 28px;
    padding: 0;
    background: none;
    border: 0;
    position: static;
    backdrop-filter: none;
}
.content-header .header-title { min-width: 0; }
.content-header h1, .content-header .header-title h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--tf-text);
    text-align: left;
    background: none;
    -webkit-text-fill-color: currentColor;
}
.content-header h2 { margin: 0; font-size: 1.2rem; }
.content-header p { margin: 6px 0 0; color: var(--tf-text-2); font-size: .95rem; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tf-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--tf-blue-500); margin-bottom: 8px;
}
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 14px; }
.section-title h2, .section-title h3 { margin: 0; font-size: 1.1rem; }
.section-title p { margin: 2px 0 0; color: var(--tf-text-2); font-size: .88rem; }

/* ============================== 6. KARTEN & KPIs ============================== */
.card, .tf-card, .structure-card, .chart-container {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    box-shadow: var(--tf-shadow-xs);
    padding: 24px;
}
.card-header, .tf-card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: -4px 0 18px;
}
.card-header h2, .card-header h3, .tf-card-header h2, .tf-card-header h3 { margin: 0; font-size: 1.05rem; }
.card-header p, .tf-card-header p { margin: 2px 0 0; color: var(--tf-text-2); font-size: .86rem; }
.card-flush { padding: 0; overflow: hidden; }
.card + .card, .tf-card + .tf-card { margin-top: 20px; }

.stats-grid, .tf-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card, .tf-kpi {
    position: relative;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: 20px;
    box-shadow: var(--tf-shadow-xs);
    transition: transform .18s var(--tf-ease), box-shadow .18s var(--tf-ease);
    overflow: hidden;
}
.stat-card:hover, .tf-kpi:hover { transform: translateY(-2px); box-shadow: var(--tf-shadow); }
.stat-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    color: var(--tf-text-2); font-size: .82rem; font-weight: 600;
    margin-bottom: 14px;
}
.stat-card h2, .tf-kpi-value {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--tf-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.stat-sub, .tf-kpi-sub { margin: 6px 0 0; font-size: .8rem; color: var(--tf-text-3); }
.tf-kpi-icon, .stat-header svg, .stat-header .currency-icon {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 11px;
    display: inline-grid; place-items: center;
    background: var(--tf-blue-50); color: var(--tf-blue-500);
    padding: 9px;
    font-size: 1rem; font-weight: 800;
}
.tf-kpi-icon svg { width: 20px; height: 20px; }
.tf-kpi.is-orange .tf-kpi-icon, .stat-card.is-orange .stat-header svg, .stat-card.is-orange .currency-icon { background: var(--tf-orange-50); color: var(--tf-orange-600); }
.tf-kpi.is-green .tf-kpi-icon, .stat-card.is-green .stat-header svg, .stat-card.is-green .currency-icon { background: var(--tf-green-50); color: var(--tf-green); }
.tf-kpi.is-violet .tf-kpi-icon, .stat-card.is-violet .stat-header svg, .stat-card.is-violet .currency-icon { background: var(--tf-violet-50); color: var(--tf-violet); }
.tf-kpi.is-hero, .stat-card.is-hero {
    background: var(--tf-gradient); border: 0; color: #fff;
    box-shadow: 0 14px 30px -12px rgba(26, 63, 208, .6);
}
.tf-kpi.is-hero::after, .stat-card.is-hero::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 176, 0, .35), transparent 70%);
}
.stat-card.is-hero .stat-header, .stat-card.is-hero .stat-sub, .tf-kpi.is-hero .tf-kpi-sub { color: rgba(255, 255, 255, .78); }
.stat-card.is-hero h2, .tf-kpi.is-hero .tf-kpi-value { color: #fff; }
.stat-card.is-hero .stat-header svg, .stat-card.is-hero .currency-icon, .tf-kpi.is-hero .tf-kpi-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.tf-trend { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.tf-trend.up { background: var(--tf-green-50); color: var(--tf-green-700); }
.tf-trend.down { background: var(--tf-red-50); color: var(--tf-red-700); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

/* Quick-Actions */
.tf-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tf-action {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; border-radius: var(--tf-radius);
    background: var(--tf-surface); border: 1px solid var(--tf-border);
    color: var(--tf-text); font-weight: 600; font-size: .9rem; text-decoration: none;
    transition: .15s;
}
.tf-action:hover { border-color: var(--tf-blue-200); box-shadow: var(--tf-shadow); transform: translateY(-1px); color: var(--tf-text); }
.tf-action > span:last-child { min-width: 0; }
.tf-action small { display: block; color: var(--tf-text-3); font-weight: 500; font-size: .78rem; }
.tf-action-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--tf-blue-50); color: var(--tf-blue-500); }
.tf-action-icon svg { width: 20px; height: 20px; }
.tf-action-icon.orange { background: var(--tf-orange-50); color: var(--tf-orange-600); }
.tf-action-icon.green { background: var(--tf-green-50); color: var(--tf-green); }
.tf-action-icon.violet { background: var(--tf-violet-50); color: var(--tf-violet); }

/* ============================== 7. TABELLEN ============================== */
.table-container, .table-responsive, .leads-table-wrapper, .tf-table-wrap {
    width: 100%;
    overflow: auto;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    box-shadow: var(--tf-shadow-xs);
}
.structure-card .table-responsive, .card .table-container, .card .tf-table-wrap, .tf-card .tf-table-wrap { border: 0; box-shadow: none; border-radius: 0; }
.leads-table-wrapper { max-height: calc(100vh - 300px); min-height: 320px; }
table { border-collapse: collapse; }
.tf-table, .leads-table, .structure-table, .table-container > table, .table-responsive > table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .88rem;
}
.tf-table th, .leads-table th, .structure-table th, .table-container > table th, .table-responsive > table th {
    position: sticky; top: 0; z-index: 2;
    background: var(--tf-surface-2) !important;
    color: var(--tf-text-3) !important;
    font-size: .7rem !important;
    font-weight: 700 !important;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-align: left;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--tf-border) !important;
    white-space: nowrap;
}
.tf-table td, .leads-table td, .structure-table td, .table-container > table td, .table-responsive > table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--tf-border);
    vertical-align: middle;
    color: var(--tf-text);
}
.tf-table tbody tr, .leads-table tbody tr, .structure-table tbody tr, .table-container > table tbody tr { transition: background .12s; }
.tf-table tbody tr:hover, .leads-table tbody tr:hover, .structure-table tbody tr:hover, .table-container > table tbody tr:hover { background: #F7F9FF; }
.tf-table tbody tr:last-child td, .leads-table tbody tr:last-child td, .structure-table tbody tr:last-child td, .table-container > table tbody tr:last-child td { border-bottom: 0; }
.leads-table a, .tf-table a { color: var(--tf-blue-500); font-weight: 600; }
.leads-table small, .tf-table small { color: var(--tf-text-3); font-size: .78rem; }
.leads-table select, .tf-table select { min-width: 140px; height: 36px; padding: 0 30px 0 10px; font-size: .84rem; }
.tf-table .cell-strong, .cell-strong { font-weight: 600; color: var(--tf-text); }
.tf-table .cell-muted, .cell-muted { color: var(--tf-text-3); font-size: .82rem; }
.tf-table td.num, .tf-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-toolbar, .tf-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 14px 16px; border-bottom: 1px solid var(--tf-border); background: var(--tf-surface);
}

/* ============================== 8. FORMULARE ============================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full-width, .form-grid .span-all { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group label, .tf-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--tf-text-2);
    text-transform: none;
    letter-spacing: 0;
}
.form-hint, .tf-hint { font-size: .78rem; color: var(--tf-text-3); }

input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="password"], input[type="search"], input[type="url"],
input:not([type]), select, textarea, .form-control {
    width: 100%;
    min-height: 42px;
    padding: 9px 13px;
    font-size: .92rem;
    font-family: inherit;
    color: var(--tf-text);
    background: var(--tf-surface);
    border: 1px solid var(--tf-border-strong);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: var(--tf-shadow-xs);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #B5C0D4; }
input:focus, select:focus, textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--tf-blue-500);
    box-shadow: var(--tf-ring);
    background-color: #fff;
}
input::placeholder, textarea::placeholder { color: #A3ACC0; }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--tf-surface-3); color: var(--tf-text-2); cursor: not-allowed; box-shadow: none; }
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234A5672' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
    cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--tf-blue-500); width: 16px; height: 16px; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--tf-text-3); pointer-events: none; }
.input-icon > input { padding-left: 38px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Filterleiste */
.leads-filter, .filter-section, .tf-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    padding: 18px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    box-shadow: var(--tf-shadow-xs);
    margin-bottom: 20px;
}
.leads-filter .form-group, .filter-section .form-group, .tf-filterbar .form-group { flex: 1 1 160px; }
.filter-button-wrapper { margin-left: auto; }

/* Switch */
.tf-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; font-weight: 500; }
.tf-switch input { position: absolute; opacity: 0; pointer-events: none; }
.tf-switch-ui { width: 40px; height: 22px; border-radius: 99px; background: var(--tf-border-strong); position: relative; transition: .2s; flex-shrink: 0; }
.tf-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--tf-shadow-sm); transition: .2s; }
.tf-switch input:checked + .tf-switch-ui { background: var(--tf-blue-500); }
.tf-switch input:checked + .tf-switch-ui::after { transform: translateX(18px); }

/* ============================== 9. BUTTONS ============================== */
.btn, .button, .tf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid var(--tf-border-strong);
    background: var(--tf-surface);
    color: var(--tf-text);
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--tf-shadow-xs);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .15s, color .15s;
}
.btn:hover, .button:hover, .tf-btn:hover { background: var(--tf-surface-2); border-color: #B5C0D4; color: var(--tf-text); }
.btn:active, .button:active { transform: translateY(1px); }
.btn:disabled, .button:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg, .button svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-primary, .button-primary, .save-btn {
    background: var(--tf-blue-500);
    border-color: var(--tf-blue-500);
    color: #fff !important;
    box-shadow: 0 6px 14px -6px rgba(31, 111, 235, .7), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-primary:hover, .button-primary:hover, .save-btn:hover { background: var(--tf-blue-600); border-color: var(--tf-blue-600); color: #fff; }
.btn-accent {
    background: var(--tf-gradient-orange); border: 0; color: #fff !important;
    box-shadow: 0 8px 18px -8px rgba(255, 122, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-accent:hover { filter: brightness(1.04); color: #fff; }
.btn-success { background: var(--tf-green); border-color: var(--tf-green); color: #fff !important; }
.btn-success:hover { background: var(--tf-green-700); border-color: var(--tf-green-700); }
.btn-danger { background: var(--tf-surface); border-color: #F5C2C4; color: var(--tf-red-700) !important; }
.btn-danger:hover { background: var(--tf-red-50); border-color: var(--tf-red); }
.btn-ghost, .button-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--tf-text-2); }
.btn-ghost:hover, .button-ghost:hover { background: var(--tf-surface-3); border-color: transparent; color: var(--tf-text); }
.btn-soft { background: var(--tf-blue-50); border-color: transparent; color: var(--tf-blue-600) !important; box-shadow: none; }
.btn-soft:hover { background: var(--tf-blue-100); border-color: transparent; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .82rem; border-radius: 8px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.save-btn { animation: tf-pulse 2s infinite; }
@keyframes tf-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31, 111, 235, .35); } 50% { box-shadow: 0 0 0 8px rgba(31, 111, 235, 0); } }
.buttons-container { display: flex; gap: 10px; flex-wrap: wrap; }
.return-button { display: inline-flex; align-items: center; gap: 6px; color: var(--tf-text-2); font-weight: 600; font-size: .88rem; }
.btn-drilldown, .set-date-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 12px; border-radius: 8px;
    background: var(--tf-blue-50); color: var(--tf-blue-600);
    border: 0; font-weight: 600; font-size: .8rem; cursor: pointer; transition: .15s;
}
.btn-drilldown:hover, .set-date-btn:hover { background: var(--tf-blue-100); }

/* ============================== 10. BADGES & STATUS ============================== */
.badge, .tf-badge, .badge-stufe {
    display: inline-flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 10px;
    border-radius: 99px;
    font-size: .74rem; font-weight: 700; letter-spacing: .01em;
    white-space: nowrap;
    background: var(--tf-surface-3); color: var(--tf-text-2);
}
.badge::before, .tf-badge.dot::before { content: none; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-blue, .badge-stufe { background: var(--tf-blue-50); color: var(--tf-blue-600); }
.badge-orange { background: var(--tf-orange-50); color: var(--tf-orange-600); }
.badge-green, .status-erreicht { background: var(--tf-green-50); color: var(--tf-green-700); }
.badge-red, .status-negativ { background: var(--tf-red-50); color: var(--tf-red-700); }
.badge-amber, .status-offen { background: var(--tf-amber-50); color: var(--tf-amber-700); }
.badge-violet { background: var(--tf-violet-50); color: var(--tf-violet); }
.badge-gray { background: var(--tf-surface-3); color: var(--tf-text-2); }
.badge-navy { background: var(--tf-navy-900); color: #fff; }

/* ============================== 11. TABS, CHIPS, SEGMENTE ============================== */
.time-filters, .tf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip, .tf-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 14px;
    border-radius: 99px;
    border: 1px solid var(--tf-border-strong);
    background: var(--tf-surface);
    color: var(--tf-text-2);
    font-size: .84rem; font-weight: 600;
    cursor: pointer; transition: .15s;
}
.filter-chip:hover, .tf-chip:hover { border-color: var(--tf-blue-400); color: var(--tf-blue-600); }
.filter-chip.active, .tf-chip.active { background: var(--tf-navy-900); border-color: var(--tf-navy-900); color: #fff; }

.tf-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--tf-surface-3); }
.tf-tab { height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--tf-text-2); font-weight: 600; font-size: .86rem; cursor: pointer; transition: .15s; }
.tf-tab:hover { color: var(--tf-text); }
.tf-tab.active { background: #fff; color: var(--tf-blue-600); box-shadow: var(--tf-shadow-sm); }

/* Radio-Segmente (alte .type-toggle) */
.type-toggle {
    display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
    border-radius: 12px; background: var(--tf-surface-3);
}
.type-toggle input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.type-toggle label {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 0 16px; border-radius: 9px;
    font-weight: 600; font-size: .88rem; color: var(--tf-text-2);
    cursor: pointer; transition: .15s; text-transform: none; letter-spacing: 0;
}
.type-toggle label:hover { color: var(--tf-text); }
.type-toggle input[type="radio"]:checked + label { background: #fff; color: var(--tf-blue-600); box-shadow: var(--tf-shadow-sm); }

/* Breadcrumbs */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; font-size: .86rem; }
.breadcrumb-item { color: var(--tf-text-2); cursor: pointer; font-weight: 600; padding: 4px 10px; border-radius: 8px; transition: .15s; }
.breadcrumb-item:hover { background: var(--tf-blue-50); color: var(--tf-blue-600); }
.breadcrumb-item.active { color: var(--tf-text); background: var(--tf-surface-3); cursor: default; }
.breadcrumb-separator { color: var(--tf-text-3); }

/* ============================== 12. LISTEN & AVATARE ============================== */
.tf-list { list-style: none; margin: 0; padding: 0; }
.tf-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--tf-border); }
.tf-list-item:last-child { border-bottom: 0; }
.tf-list-item .grow { flex: 1; min-width: 0; }
.tf-avatar {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--tf-blue-50); color: var(--tf-blue-600);
    font-weight: 800; font-size: .78rem;
}
.tf-avatar.orange { background: var(--tf-orange-50); color: var(--tf-orange-600); }
.tf-avatar.green { background: var(--tf-green-50); color: var(--tf-green-700); }
.tf-avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 1rem; }
.tf-rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--tf-surface-3); color: var(--tf-text-2); flex-shrink: 0; }
.tf-rank.r1 { background: linear-gradient(135deg, #FFD65C, #FFA41B); color: #5A3500; }
.tf-rank.r2 { background: linear-gradient(135deg, #E9EDF5, #C3CCDC); color: #2E3A55; }
.tf-rank.r3 { background: linear-gradient(135deg, #F6C9A1, #D9925A); color: #4E2808; }
.tf-progress { height: 8px; border-radius: 99px; background: var(--tf-surface-3); overflow: hidden; }
.tf-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--tf-gradient); }

/* ============================== 13. MODAL & TOAST ============================== */
.tf-modal-overlay, .modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(6, 12, 29, .55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.tf-modal-overlay[hidden], .modal-overlay[hidden] { display: none; }
.tf-modal, .modal-content {
    width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
    background: #fff; border-radius: var(--tf-radius-xl);
    box-shadow: var(--tf-shadow-lg);
    padding: 26px;
    animation: tf-pop .18s var(--tf-ease);
}
.tf-modal.lg { max-width: 760px; }
.tf-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tf-modal-head h3 { margin: 0; font-size: 1.15rem; }
.tf-modal-head p { margin: 4px 0 0; color: var(--tf-text-2); font-size: .9rem; }
.tf-modal-close { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--tf-surface-3); color: var(--tf-text-2); font-size: 1.3rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.tf-modal-close:hover { background: var(--tf-border); color: var(--tf-text); }
.tf-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes tf-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

#datePickerToast, .tf-toast {
    position: fixed; z-index: 1100;
    left: 50%; bottom: 28px; transform: translateX(-50%);
    background: #fff; border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg); box-shadow: var(--tf-shadow-lg);
    padding: 18px; min-width: 300px;
}
#datePickerToast h4 { margin: 0 0 12px; font-size: .95rem; }
#datePickerToast input { margin-bottom: 10px; }
#datePickerToast button { height: 38px; padding: 0 14px; border-radius: 9px; font-weight: 600; cursor: pointer; border: 1px solid var(--tf-border-strong); background: #fff; }
#toastSaveBtn { background: var(--tf-blue-500) !important; border-color: var(--tf-blue-500) !important; color: #fff; }
#toastCancelBtn:hover { background: var(--tf-surface-3); }

/* ============================== 14. LEER, ALERTS, LOADER ============================== */
.empty-state, .empty-chart-state, .tf-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    gap: 6px;
    padding: 44px 20px;
    color: var(--tf-text-2);
}
.tf-empty-icon {
    width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 8px;
    background: var(--tf-blue-50); color: var(--tf-blue-500);
}
.tf-empty-icon svg { width: 26px; height: 26px; }
.tf-empty h4, .empty-state h4 { margin: 0; font-size: 1rem; color: var(--tf-text); }
.tf-empty p, .empty-state p { margin: 0; font-size: .88rem; color: var(--tf-text-3); max-width: 380px; }
td.tf-empty-cell { padding: 0 !important; }

.alert, .tf-alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 16px; border-radius: var(--tf-radius);
    font-size: .9rem; line-height: 1.5;
    background: var(--tf-blue-50); color: #13336E; border: 1px solid var(--tf-blue-100);
}
.alert svg, .tf-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--tf-green-50); color: #0B5A2C; border-color: #C3EBD2; }
.alert-warning { background: var(--tf-amber-50); color: #7A4500; border-color: #F7DFAE; }
.alert-danger { background: var(--tf-red-50); color: #8C1C20; border-color: #F7C9CB; }

.tf-spinner, .spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--tf-border); border-top-color: var(--tf-blue-500);
    animation: tf-spin .8s linear infinite; display: inline-block;
}
@keyframes tf-spin { to { transform: rotate(360deg); } }
.tf-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 36px; color: var(--tf-text-2); font-size: .9rem; }
.tf-skeleton { background: linear-gradient(90deg, #EEF1F7 25%, #F7F9FC 50%, #EEF1F7 75%); background-size: 200% 100%; animation: tf-shimmer 1.2s infinite; border-radius: 8px; }
@keyframes tf-shimmer { to { background-position: -200% 0; } }

/* ============================== 15. WIZARD / STEPPER ============================== */
.tf-stepper { list-style: none; display: flex; gap: 6px; margin: 0 0 18px; padding: 0; }
.tf-stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--tf-text-3); text-align: center; }
.tf-stepper li span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--tf-border); font-size: .82rem; }
.tf-stepper li.done span { background: var(--tf-blue-500); border-color: var(--tf-blue-500); color: #fff; }
.tf-stepper li.active { color: var(--tf-blue-600); }
.tf-stepper li.active span { border-color: var(--tf-blue-500); color: var(--tf-blue-600); box-shadow: var(--tf-ring); }

/* ============================== 16. HILFSKLASSEN ============================== */
.text-muted { color: var(--tf-text-3) !important; }
.text-secondary { color: var(--tf-text-2) !important; }
.text-success { color: var(--tf-green) !important; }
.text-danger { color: var(--tf-red) !important; }
.text-accent { color: var(--tf-blue-500) !important; }
.text-orange { color: var(--tf-orange-600) !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.small { font-size: .84rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tf-green); box-shadow: 0 0 0 3px var(--tf-green-50); }

/* ============================== 17. MOBILE ============================== */
.burger-menu {
    display: none;
    position: fixed; top: 12px; left: 12px; z-index: 260;
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--tf-navy-900); box-shadow: var(--tf-shadow);
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    cursor: pointer;
}
.burger-bar { width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: .25s; }
.burger-menu.open .burger-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger-menu.open .burger-bar:nth-child(2) { opacity: 0; }
.burger-menu.open .burger-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.burger-menu .mail-badge { position: absolute; top: -5px; right: -5px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(6, 12, 29, .5); z-index: 190; opacity: 0; transition: opacity .3s; }
.sidebar-overlay.open { opacity: 1; }

@media (max-width: 1200px) {
    .main-content { padding: 28px 28px 56px; }
    .grid-main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    body { font-size: 14.5px; }
    .burger-menu { display: flex; }
    .sidebar { transform: translateX(-100%); transition: transform .3s var(--tf-ease); box-shadow: var(--tf-shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 72px 16px 48px; }
    .content-header { margin-bottom: 20px; align-items: flex-start; }
    .content-header h1, .content-header .header-title h1 { font-size: 1.4rem; }
    .header-actions { width: 100%; }
    .header-actions .btn { flex: 1; }
    .grid-2, .grid-3, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .stats-grid, .tf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat-card, .tf-kpi { padding: 16px; }
    .stat-card h2, .tf-kpi-value { font-size: 1.4rem; }
    .card, .tf-card, .structure-card { padding: 18px; }
    .leads-filter .form-group, .filter-section .form-group, .tf-filterbar .form-group { flex-basis: 100%; }
    .tf-table th, .leads-table th, .structure-table th { padding: 10px 12px !important; }
    .tf-table td, .leads-table td, .structure-table td { padding: 11px 12px; }
    .admin-return-btn { right: 12px; bottom: 12px; padding: 10px 14px; font-size: .8rem; }
    .tf-modal, .modal-content { padding: 20px; border-radius: 18px; }
}
@media (max-width: 420px) {
    .stats-grid, .tf-kpis { grid-template-columns: 1fr; }
}

/* Icon-Button (z.B. Abmelden im Admin-Profil) */
.tf-icon-btn {
    margin-left: auto; width: 32px; height: 32px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 9px; border: 0; cursor: pointer;
    background: transparent; color: var(--tf-navy-muted); transition: .15s;
}
.tf-icon-btn svg { width: 17px; height: 17px; }
.tf-icon-btn:hover { background: rgba(229, 72, 77, .14); color: #FF9B9E; }

/* Mobile Kopfleiste (wird von mobile_burger.js eingefügt) */
.tf-mobilebar { display: none; }
@media (max-width: 768px) {
    .tf-mobilebar {
        display: flex; align-items: center; justify-content: center;
        position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 180;
        background: var(--tf-navy-900);
        box-shadow: 0 4px 14px -6px rgba(6, 12, 29, .5);
    }
    .tf-mobilebar .tf-brand-mark { width: 30px; height: 30px; border-radius: 9px; }
    .tf-mobilebar .tf-brand-name { font-size: 1.25rem; }
    .burger-menu { top: 8px; left: 10px; width: 44px; height: 44px; background: rgba(255, 255, 255, .08); box-shadow: none; }
    .main-content { padding-top: 84px; }
}

/* Hervorgehobene Tabellenzeile (z.B. "Gesamt") */
tr.row-highlight td { background: #FBFCFF; }
tr.row-highlight td:first-child { box-shadow: inset 3px 0 0 var(--tf-orange-500); }
.stat-sub b { color: var(--tf-text); font-weight: 700; }
.stat-card.is-hero .stat-sub b { color: #fff; }

/* ===== Korrekturen nach Seiten-Umbau ===== */
/* Orange Hauptaktion behält beim Hover ihren Verlauf */
.btn-accent:hover, .btn.btn-accent:hover { background: var(--tf-gradient-orange); border-color: transparent; color: #fff; }
/* Selects mit .form-control behalten den Pfeil */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234A5672' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
/* Tabellen in Karten: kein doppelter Rahmen */
.card .table-responsive, .tf-card .table-responsive, .card .leads-table-wrapper { border: 0; box-shadow: none; border-radius: 0; }
/* Randlose Karte bleibt auch mobil randlos */
@media (max-width: 768px) { .card.card-flush, .tf-card.card-flush { padding: 0; } }
/* Kleine Ergänzungen */
.badge svg { width: 13px; height: 13px; }
.tf-avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: .7rem; }
.tf-empty-icon.is-danger { background: var(--tf-red-50); color: var(--tf-red); }
.tf-empty-icon.is-success { background: var(--tf-green-50); color: var(--tf-green); }
.btn .tf-spinner { width: 15px; height: 15px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.btn:not(.btn-primary):not(.btn-accent):not(.btn-success) .tf-spinner { border-color: var(--tf-border); border-top-color: var(--tf-blue-500); }


/* ===== Logo (SVG-Wortmarke, /Bilder/logo/) ===== */
.tf-brand { line-height: 0; }
.tf-brand-logo { display: block; height: 30px; width: auto; }
.logo-container .tf-brand-logo { height: 31px; }
.tf-brand .tf-brand-tag { line-height: 1.4; align-self: center; }
@media (max-width: 768px) {
    .tf-mobilebar .tf-brand-logo { height: 26px; }
}

/* ===== Seitenleiste auf niedrigen Bildschirmen (fix-partner, UI-P P-05) =====
   Seit dem Abschnitt "Versicherungsanfragen" ist die Partner-Navigation ~720 px hoch: bei 1366×768,
   1280×720 oder im Handy-Menü lagen "Webmail" und "Abmelden" unter dem Rand, ohne dass man es sah.
   1) Ab 820 px Höhe abwärts engere Abstände (gleiche Optik), ab 720 px noch etwas enger.
   2) Scrollt die Navigation trotzdem, blendet sie unten weich aus, solange noch Einträge folgen
      (scroll-getriebene Animation; Browser ohne Unterstützung zeigen nur die Scrollleiste).
   3) Scrollleiste der Navigation etwas deutlicher (auch Firefox). */
@media (max-height: 820px) {
    .logo-container { padding: 16px 22px 10px; }
    .nav-menu { padding-top: 4px; gap: 1px; }
    .nav-label { margin: 10px 10px 3px; }
    .nav-label:first-child { margin-top: 2px; }
    .nav-button { padding: 7px 12px; }
    .nav-button.logout-nav-btn { margin-top: 4px; }
    .user-profile { margin: 6px 12px 10px; padding: 8px 10px; }
}
@media (max-height: 720px) {
    .nav-label { margin: 8px 10px 2px; }
    .nav-button { padding: 6px 12px; }
}
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 99px; }
@supports not selector(::-webkit-scrollbar) {
    .nav-menu { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
}
@property --tf-nav-fade { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes tf-nav-fade { 0%, 85% { --tf-nav-fade: 40px; } 100% { --tf-nav-fade: 0px; } }
@supports (animation-timeline: scroll()) {
    .nav-menu {
        -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--tf-nav-fade)), transparent);
        mask-image: linear-gradient(to bottom, #000 calc(100% - var(--tf-nav-fade)), transparent);
        animation: tf-nav-fade linear both;
        animation-timeline: scroll(self);
    }
}
