/* =============================================
   RWD Analysetool – Modern Design System
   (Layout-Struktur: BAV-Style, Farben: RWD-CI)
   ============================================= */

:root {
    --sidebar-width: 260px;
    --header-height: 60px;

    /* RWD CI */
    --rwd-blue-900: #14375E;
    --rwd-blue-800: #1B4470;
    --rwd-blue-700: #1F4E7A;
    --rwd-blue-600: #2C5A8E;
    --rwd-teal-700: #1F8F75;
    --rwd-teal-600: #2BA587;
    --rwd-teal-500: #3DBFA0;

    --primary: var(--rwd-blue-700);
    --primary-dark: var(--rwd-blue-900);
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #e0f2fe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --card-radius: 10px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

    --sidebar-bg: #14375E;
}

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

html, body {
    margin: 0; padding: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    height: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ── App Layout ── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    background: var(--sidebar-bg) !important;
    background-image: none !important;
}

.sidebar-header {
    padding: 20px 16px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-logo {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: white;
    border-radius: 6px;
    padding: 6px 8px;
}

.sidebar-brand {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.1); }

.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role { color: rgba(255,255,255,0.55); font-size: 11px; }

.btn-logout {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85);
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); color: white; }

/* ── NavMenu ── */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    color: rgba(255,255,255,0.78) !important;
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.12); color: white !important; }
.nav-link.active { background: rgba(255,255,255,0.22); color: white !important; font-weight: 600; }
.nav-icon { width: 18px; display: inline-flex; justify-content: center; flex-shrink: 0; }
.nav-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 8px 4px; }

/* ── Main Wrapper ── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.header-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-username { font-size: 13px; color: var(--text-secondary); }

.main-content { flex: 1; padding: 24px; background: var(--bg); }

/* ── Headings ── */
h1, .page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}
h2 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 0 0 14px 0; }
h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 12px 0; }
h4, h5, h6 { font-weight: 600; color: var(--text-primary); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ── Grids ── */
.info-grid { display: grid; gap: 16px; margin-bottom: 24px; }
.info-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.info-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1199px) {
    .info-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .info-grid-4, .info-grid-3, .info-grid-2 { grid-template-columns: 1fr; }
}

.form-grid { display: grid; gap: 14px 16px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 767px) {
    .form-grid-2, .form-grid-3, .form-grid-auto { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
}
.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.card-text { font-size: 13.5px; color: var(--text-secondary); }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-primary);
    vertical-align: middle;
}
.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover > * { background: rgba(31, 78, 122, 0.05); }
.table-sm th { padding: 8px 12px; }
.table-sm td { padding: 8px 12px; }
.table .align-middle td { vertical-align: middle; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.bg-primary { background: var(--primary) !important; color: white !important; }
.bg-success { background: var(--success) !important; color: white !important; }
.bg-warning { background: var(--warning) !important; color: white !important; }
.bg-danger  { background: var(--danger) !important; color: white !important; }
.bg-secondary { background: #6c757d !important; color: white !important; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #15803d; border-color: #15803d; color: white; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: white; }
.btn-secondary { background: white; color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-outline-primary { background: white; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-outline-secondary { background: white; color: var(--text-secondary); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--text-primary); }
.btn-outline-danger { background: white; color: var(--danger); border-color: #fca5a5; }
.btn-outline-danger:hover { background: var(--danger-light); }
.btn-link { background: transparent; color: var(--primary); border: none; padding: 4px 8px; }
.btn-link:hover { text-decoration: underline; color: var(--primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Form Controls ── */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.form-control, .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    color: var(--text-primary);
    background: white;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 122, 0.12);
}
.form-control:disabled, .form-select:disabled { background: #f9fafb; color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-text { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.form-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 0 !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
}
.form-check-input {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    margin: 0 !important;
    float: none !important;
    flex-shrink: 0;
}
.form-check-label { font-size: 13.5px; cursor: pointer; margin: 0 !important; }
.form-switch .form-check-input { width: 32px; height: 16px; accent-color: var(--primary); }

/* ── Tabs ── */
.nav-tabs { border-bottom: 2px solid #d1d5db; display: flex; gap: 2px; flex-wrap: wrap; }
.nav-tabs .nav-link {
    color: #4b5563 !important;
    font-size: 13.5px;
    background: #f9fafb;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    padding: 9px 16px;
    cursor: pointer;
}
.nav-tabs .nav-link:hover { background: #eff6ff; color: var(--primary) !important; }
.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: white;
    border-color: #d1d5db;
    border-bottom-color: white;
    font-weight: 600;
}

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-top: 12px; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #86efac; }
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fcd34d; }
.alert-info    { background: var(--info-light);    color: var(--info);    border: 1px solid #7dd3fc; }
.alert.py-2 { padding-top: 8px; padding-bottom: 8px; }

/* ── Grid (Bootstrap-Kompat) ── */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col { flex: 1; padding: 0 8px; }
.col-auto { flex: 0 0 auto; padding: 0 8px; }
.col-md-1  { flex: 0 0 8.333%;  max-width: 8.333%;  padding: 0 8px; }
.col-md-2  { flex: 0 0 16.667%; max-width: 16.667%; padding: 0 8px; }
.col-md-3  { flex: 0 0 25%;     max-width: 25%;     padding: 0 8px; }
.col-md-4  { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 8px; }
.col-md-5  { flex: 0 0 41.667%; max-width: 41.667%; padding: 0 8px; }
.col-md-6  { flex: 0 0 50%;     max-width: 50%;     padding: 0 8px; }
.col-md-7  { flex: 0 0 58.333%; max-width: 58.333%; padding: 0 8px; }
.col-md-8  { flex: 0 0 66.667%; max-width: 66.667%; padding: 0 8px; }
.col-md-9  { flex: 0 0 75%;     max-width: 75%;     padding: 0 8px; }
.col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; padding: 0 8px; }
.col-md-12, .col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 8px; }
.g-1 { gap: 4px; } .g-2 { gap: 8px; } .g-3 { gap: 16px; }

/* ── Spacing ── */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mt-auto { margin-top: auto; }
.ms-1 { margin-left: 4px; } .ms-2 { margin-left: 8px; } .ms-3 { margin-left: 16px; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; } .me-3 { margin-right: 16px; }
.p-0 { padding: 0; } .p-2 { padding: 8px; } .p-3 { padding: 16px; } .p-4 { padding: 24px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }

/* ── Flex ── */
.d-flex { display: flex; } .d-block { display: block; }
.d-inline-block { display: inline-block; } .d-none { display: none; }
.flex-column { flex-direction: column; } .flex-grow-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; } .flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-start { justify-content: flex-start; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 16px; }
.w-100 { width: 100%; } .text-nowrap { white-space: nowrap; }

/* ── Text ── */
.text-end { text-align: right; }
.text-center { text-align: center; }
.text-start { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary) !important; }
.text-white { color: white; } .text-dark { color: var(--text-primary); }
.fw-bold { font-weight: 700; } .fw-semibold { font-weight: 600; } .fw-normal { font-weight: 400; }
.small { font-size: 12px; } .fst-italic { font-style: italic; }

code {
    background: #f3f4f6;
    color: #be185d;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.shadow-sm { box-shadow: var(--card-shadow); }
.rounded { border-radius: var(--card-radius); }
.border-top { border-top: 1px solid var(--border); }
.sticky-top { position: sticky; top: 0; z-index: 10; background: white; }

.blazor-error-boundary {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px;
    color: var(--danger);
    margin: 16px;
}
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten. Bitte die Seite neu laden."; }

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #14375E;
    padding: 16px;
}
.login-card {
    background: white;
    border-radius: 14px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border-top: 4px solid var(--rwd-teal-600);
}
.login-logo {
    display: block;
    max-width: 200px;
    width: 100%;
    height: auto;
    margin: 0 auto 1.5rem;
}

.loading-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    gap: 12px;
}
.loading-wrapper span { animation: pulse-soft 1.5s ease infinite; }

/* ── Hamburger ── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.25s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 190;
    animation: fadeIn 0.2s ease;
}
.sidebar-overlay.visible { display: block; }

/* ── Responsive ── */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 200;
        box-shadow: none;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.18); }
    .main-wrapper { margin-left: 0; }
    .hamburger-btn { display: flex; }
    .top-header { padding: 0 14px; }
}

@media (max-width: 767px) {
    html, body { font-size: 14px; }
    .sidebar { width: 280px; }
    .main-wrapper { margin-left: 0; }
    .main-content { padding: 14px 12px; }
    .top-header { padding: 0 12px; height: 52px; gap: 8px; }
    .col-md-1, .col-md-2, .col-md-3, .col-md-4,
    .col-md-5, .col-md-6, .col-md-7, .col-md-8,
    .col-md-9, .col-md-10 { flex: 0 0 100%; max-width: 100%; }
    .col { flex: 0 0 100%; max-width: 100%; }
    .row { gap: 10px 0; }
    .g-2, .g-3 { gap: 10px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table th, .table td { padding: 9px 10px; white-space: nowrap; }
    .btn { padding: 9px 14px; font-size: 13px; }
    .form-control, .form-select { font-size: 16px; padding: 10px 12px; }
    .login-card { padding: 28px 20px; border-radius: 10px; }
}

/* =============================================
   Page-übergreifende Komponenten (vorher in Home.razor.css scoped)
   — Dashboard, Auswertungen u. a. teilen sich diese Styles.
   ============================================= */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.filter-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.quick-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(31, 78, 122, 0.25);
}

/* ── KPI-Hero-Kacheln ────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 8px;
}

@media (max-width: 1199px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
    position: relative;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 24px 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 0 0 0 rgba(0,0,0,0);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--accent, var(--primary));
    border-radius: 16px 16px 0 0;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(20, 55, 94, 0.10), 0 1px 2px rgba(0,0,0,0.03);
}

.kpi-card__icon {
    position: absolute;
    top: 18px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    background: color-mix(in srgb, var(--accent, var(--primary)) 12%, white);
    color: var(--accent, var(--primary));
}

.kpi-card__label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.kpi-card__value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 6px;
    word-break: break-word;
}

.kpi-card__sub {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.kpi-card--primary { --accent: #1F4E7A; }
.kpi-card--teal    { --accent: #2BA587; }
.kpi-card--purple  { --accent: #7c3aed; }
.kpi-card--orange  { --accent: #f97316; }

/* ── Top-Kunden-Karten ───────────────────────────────────────────────── */
.topkunde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.topkunde-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 18px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
}

.topkunde-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(20, 55, 94, 0.12);
}

.topkunde-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    min-height: 44px;
}

.topkunde-card__logo {
    max-height: 36px;
    max-width: 70px;
    object-fit: contain;
    flex-shrink: 0;
}

.topkunde-card__logo-placeholder {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #14375E 0%, #2BA587 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.topkunde-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.topkunde-card__umsatz {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.topkunde-card__sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.topkunde-card__bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-top: auto;
}

.topkunde-card__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1F4E7A 0%, #2BA587 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* ── Drill-Down-Tabelle ──────────────────────────────────────────────── */
.btn-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.btn-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tabelle-logo {
    max-height: 22px;
    max-width: 44px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 10px;
}

.zeile-top { background: #f8fafc; }
.zeile-top:hover { background: #eef4f9 !important; }
.zeile-debitor { background: white; }
.zeile-objekt { background: #fafafa; font-size: 13px; }
.zeile-gesamt {
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border-top: 2px solid var(--border);
}
.zeile-gesamt td { font-size: 14.5px; }
