/*
 * VitaSuite Komponenten-Library — Opt-in Klassen für konsistente UI-Elemente.
 * Setzt voraus, dass --vs-* Variablen via theme-*.css geladen sind.
 *
 * Einbinden: <link rel="stylesheet" href="/assets/themes/vs-components.css">
 * (Reihenfolge: NACH theme-{app}.css, damit Varianten aus Theme greifen.)
 */

/* ---- Buttons -------------------------------------------------------- */
.vs-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.2;
    border-radius: 6px;
    border: 1px solid var(--vs-border-strong, #cbd5e1);
    background: var(--vs-surface, #ffffff);
    color: var(--vs-text, #1a1f2e);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.vs-btn:hover {
    background: var(--vs-surface-alt, #f1f5f9);
    border-color: var(--vs-primary, #6366f1);
}
.vs-btn:active { transform: translateY(1px); }
.vs-btn:disabled,
.vs-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
.vs-btn-primary {
    background: var(--vs-primary, #6366f1);
    color: var(--vs-on-primary, #ffffff);
    border-color: transparent;
}
.vs-btn-primary:hover {
    background: var(--vs-primary-hover, #4f46e5);
}
.vs-btn-danger {
    background: var(--vs-danger, #ef4444);
    color: #ffffff;
    border-color: transparent;
}
.vs-btn-danger:hover { filter: brightness(1.1); }
.vs-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--vs-text-muted, #94a3b8);
}
.vs-btn-ghost:hover {
    background: var(--vs-surface-alt, rgba(0,0,0,0.05));
    color: var(--vs-text, #1a1f2e);
}
.vs-btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}
.vs-btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

/* ---- Pills ---------------------------------------------------------- */
.vs-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    background: color-mix(in srgb, var(--vs-text-muted, #94a3b8) 18%, transparent);
    color: var(--vs-text-muted, #64748b);
}
.vs-pill-success {
    background: color-mix(in srgb, var(--vs-success, #22c55e) 18%, transparent);
    color: var(--vs-success, #16a34a);
}
.vs-pill-warning {
    background: color-mix(in srgb, var(--vs-warning, #f59e0b) 22%, transparent);
    color: var(--vs-warning, #d97706);
}
.vs-pill-danger {
    background: color-mix(in srgb, var(--vs-danger, #ef4444) 18%, transparent);
    color: var(--vs-danger, #dc2626);
}
.vs-pill-info {
    background: color-mix(in srgb, var(--vs-info, #3b82f6) 18%, transparent);
    color: var(--vs-info, #2563eb);
}
.vs-pill-primary {
    background: color-mix(in srgb, var(--vs-primary, #6366f1) 18%, transparent);
    color: var(--vs-primary, #4f46e5);
}

/* ---- Cards ---------------------------------------------------------- */
.vs-card {
    background: var(--vs-surface, #ffffff);
    border: 1px solid var(--vs-border, rgba(0,0,0,0.08));
    border-radius: 10px;
    padding: 1.25rem;
}
.vs-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -0.25rem 0 1rem;
}
.vs-card-head h2,
.vs-card-head h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vs-text, #1a1f2e);
}
.vs-card-muted {
    background: var(--vs-surface-alt, #f1f5f9);
}

/* ---- Text-Utilities ------------------------------------------------- */
.vs-muted { color: var(--vs-text-muted, #64748b); }
.vs-hidden { display: none !important; }

/* ============================================================
   Sercon-Clean Shared Components — von helpdesk Sprint 3a übernommen,
   damit alle Module dieselbe Komponenten-Optik teilen.
   Klassen ohne vs-Prefix, weil die Helpdesk-Views die Namen so kennen.
============================================================ */

/* ---- Panel-Card (Toolbar + Body) ----------------------------------- */
.panel-card {
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-lg, 12px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.panel-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--vs-border);
    background: var(--vs-surface-alt);
}
.panel-card-head .toolbar-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.75rem; }
.panel-card-head .toolbar-right { display: flex; align-items: center; gap: 0.5rem; }
.panel-card-body { padding: 1.25rem; }

/* ---- Stat-Cards (Dashboard-Metriken) ------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}
.stat-card {
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-lg, 12px);
    padding: 1.125rem 1.25rem;
    transition: var(--vs-transition, all 0.15s ease);
}
.stat-card:hover {
    border-color: color-mix(in srgb, var(--vs-primary), transparent 60%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.stat-card-icon {
    color: var(--vs-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.stat-card-label {
    font-size: 0.75rem;
    color: var(--vs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--vs-text);
    line-height: 1.1;
}
.stat-card-sub {
    font-size: 0.8rem;
    color: var(--vs-text-muted);
    margin-top: 0.375rem;
}

/* ---- Modern-Table (Hover, Sortable-ready) -------------------------- */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--vs-text);
}
.modern-table thead th {
    background: var(--vs-surface-alt);
    color: var(--vs-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--vs-border);
}
.modern-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--vs-border);
    vertical-align: middle;
}
.modern-table tbody tr:hover td {
    background: color-mix(in srgb, var(--vs-primary), transparent 95%);
}
.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Filter-Pills (Segmented Control) ------------------------------ */
.filter-pills {
    display: inline-flex;
    background: var(--vs-surface-alt);
    border: 1px solid var(--vs-border);
    border-radius: 999px;
    padding: 0.25rem;
    gap: 0.125rem;
}
.filter-pill {
    padding: 0.4rem 0.9rem;
    border: none;
    background: transparent;
    color: var(--vs-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--vs-transition, all 0.15s ease);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.filter-pill:hover {
    color: var(--vs-text);
    text-decoration: none;
}
.filter-pill.is-active,
.filter-pill[aria-pressed="true"] {
    background: var(--vs-primary);
    color: var(--vs-on-primary);
}

/* ---- Primary Action Button (canonical CTA) ------------------------- */
.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: var(--vs-primary);
    color: var(--vs-on-primary);
    border: 1px solid var(--vs-primary);
    border-radius: var(--vs-radius-sm, 8px);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vs-transition, all 0.15s ease);
    text-decoration: none;
}
.btn-primary-action:hover {
    background: var(--vs-primary-hover);
    border-color: var(--vs-primary-hover);
    text-decoration: none;
}
.btn-primary-action i,
.btn-primary-action svg { width: 1em; height: 1em; }

/* ---- Page-Header (Title + Actions Row) ----------------------------- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--vs-border);
}
.page-header h1, .page-header h2 {
    margin: 0;
    color: var(--vs-text);
    font-size: 1.5rem;
    font-weight: 600;
    border: none;
    padding: 0;
}
.page-header p {
    margin: 0.35rem 0 0;
    color: var(--vs-text-muted);
    font-size: 0.95rem;
}
.page-header .page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Lead-Subtitle (außerhalb von .page-header, z.B. sercon-Style direkt
   nach <h2>): muted, etwas weniger margin-bottom als ein <p>-Default. */
.lead {
    color: var(--vs-text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* ---- Sub-Nav (horizontale Tab-Leiste, ≤768px vertikaler Stack) ------
   Suite-weit verwendbar fuer Sub-Navigationen innerhalb einer Seite
   (z. B. Lumina-Profil-Bereiche). Auf Desktop horizontale Tabs mit
   Bottom-Border-Indicator, auf Mobile gestapelte Listenzeilen mit
   Left-Border-Akzent fuer den aktiven Eintrag. */
.vs-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--vs-border);
    margin: 0 0 1.5rem;
}
.vs-subnav a {
    padding: 0.65rem 1.1rem;
    color: var(--vs-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.vs-subnav a:hover { color: var(--vs-text); text-decoration: none; }
.vs-subnav a.is-active {
    color: var(--vs-primary);
    border-bottom-color: var(--vs-primary);
    font-weight: 600;
}
.vs-subnav a.is-danger.is-active {
    color: var(--vs-danger);
    border-bottom-color: var(--vs-danger);
}

@media (max-width: 768px) {
    .vs-subnav {
        flex-direction: column;
        flex-wrap: nowrap;
        background: var(--vs-surface);
        border: 1px solid var(--vs-border);
        border-radius: 10px;
        overflow: hidden;
    }
    .vs-subnav a {
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--vs-border);
        border-left: 3px solid transparent;
        margin: 0;
        font-size: 0.95rem;
    }
    .vs-subnav a:last-child { border-bottom: none; }
    .vs-subnav a:hover {
        background: var(--vs-surface-alt);
        color: var(--vs-text);
    }
    .vs-subnav a.is-active {
        background: color-mix(in srgb, var(--vs-primary) 12%, transparent);
        border-left-color: var(--vs-primary);
        border-bottom-color: var(--vs-border);
    }
    .vs-subnav a.is-danger.is-active {
        background: color-mix(in srgb, var(--vs-danger) 12%, transparent);
        border-left-color: var(--vs-danger);
        border-bottom-color: var(--vs-border);
    }
}

/* ---- Form-Card (Sercon-Profil-Layout, suite-weit) ------------------ */
.form-card {
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: 12px;
    padding: 1.75rem;
    max-width: 500px;
    margin-top: 1rem;
}
.form-card h3 { margin-bottom: 1rem; }
.form-card form { display: flex; flex-direction: column; gap: 0.85rem; }
.form-card label {
    font-size: 0.85rem;
    color: var(--vs-text-muted);
    margin-bottom: -0.4rem;
}
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="text"],
.form-card select {
    background: var(--vs-bg);
    border: 1px solid var(--vs-border-strong);
    color: var(--vs-text);
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.form-card input:focus, .form-card select:focus {
    outline: none;
    border-color: var(--vs-primary);
}
.form-card button {
    background: var(--vs-primary);
    color: var(--vs-on-primary);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: background 0.15s;
    box-sizing: border-box;
}
.form-card button:hover { background: var(--vs-primary-hover); }
.form-card button.btn-danger {
    background: var(--vs-danger);
}
.form-card button.btn-danger:hover {
    background: color-mix(in srgb, var(--vs-danger) 85%, black);
}
.form-card .small { color: var(--vs-text-muted); font-size: 0.8rem; margin-top: -0.4rem; }
.form-card code {
    background: var(--vs-bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.error-box {
    background: color-mix(in srgb, var(--vs-danger) 18%, transparent);
    color: var(--vs-danger);
    border: 1px solid color-mix(in srgb, var(--vs-danger) 50%, transparent);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.success-box {
    background: color-mix(in srgb, var(--vs-success) 18%, transparent);
    color: var(--vs-success);
    border: 1px solid color-mix(in srgb, var(--vs-success) 50%, transparent);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ---- Dashboard-Split (2fr|1fr Hauptbereich + Sidebar) -------------- */
.dash-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ============================================================
   Modul-TopBar — horizontale Navigation pro Modul (Sercon-Clean)
   Sticky unter dem Suite-Chrome (40px), 48px hoch, max-width 1400px.
   Eingeführt mit helpdesk Sprint 3.1i (2026-04-25), in Sprint 3.1j
   (todo) zu vs-Komponente verallgemeinert.
============================================================ */

.vs-modtopbar {
    position: sticky;
    top: 40px; /* Suite-Chrome height */
    z-index: 50;
    background: var(--vs-surface);
    border-bottom: 1px solid var(--vs-border);
    margin: 0 0 2rem; /* 32 px Luft bis zur Bereichsüberschrift, identisch sercon-Spec */
}

.vs-modtopbar-inner {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 48px;
}

.vs-modtopbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--vs-primary);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.vs-modtopbar-brand i { width: 18px; height: 18px; }

.vs-modtopbar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 0.125rem;
    flex: 1;
}

.vs-modtopbar-item { position: relative; display: flex; align-items: stretch; }

.vs-modtopbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.85rem;
    color: var(--vs-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.vs-modtopbar-link:hover {
    color: var(--vs-text);
    background: color-mix(in srgb, var(--vs-primary), transparent 92%);
    text-decoration: none;
}

.vs-modtopbar-item.is-active > .vs-modtopbar-link {
    color: var(--vs-primary);
    border-bottom-color: var(--vs-primary);
    font-weight: 600;
}

.vs-modtopbar-link i { width: 16px; height: 16px; flex-shrink: 0; }

.vs-modtopbar-chevron { width: 12px !important; height: 12px !important; opacity: 0.6; transition: transform 0.15s; }
.vs-modtopbar-item.is-open .vs-modtopbar-chevron { transform: rotate(180deg); }

.vs-modtopbar-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    display: none;
    z-index: 60;
}

.vs-modtopbar-item.is-open .vs-modtopbar-submenu { display: block; }

/* Detached submenu: per JS aus der Topbar-Nav herausgeloest und an <body>
   angehaengt (siehe vs-components.js -> detachSubmenus). Positioniert
   relativ zum Viewport unter Suite-Chrome (40 px) + Modtopbar (48 px),
   sodass keine mask-image- oder overflow-Vorfahren das Rendering brechen. */
.vs-modtopbar-submenu-detached {
    position: fixed;
    /* top und left werden per JS aus dem Parent-Button-Rect gesetzt;
       diese Defaults dienen nur als Fallback, wenn JS spaeter laeuft. */
    top: calc(40px + 48px + 6px);
    left: 0.5rem;
    right: auto;
    min-width: 200px;
    max-width: calc(100vw - 1rem);
    width: auto;
    z-index: 9000;
    display: none;
}
.vs-modtopbar-submenu-detached.is-open { display: block; }

.vs-modtopbar-submenu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--vs-text);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    line-height: 1.2;
}

.vs-modtopbar-submenu a i { width: 16px; height: 16px; opacity: 0.8; flex-shrink: 0; }

.vs-modtopbar-submenu a:hover {
    background: var(--vs-surface-alt);
    color: var(--vs-text);
    text-decoration: none;
}

.vs-modtopbar-submenu a.is-active {
    background: color-mix(in srgb, var(--vs-primary), transparent 85%);
    color: var(--vs-primary);
    font-weight: 600;
}

.vs-modtopbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--vs-danger);
    color: var(--vs-on-primary, #fff);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.4rem;
}

.vs-modtopbar-profile {
    position: relative;
    display: flex;
    align-items: center;
}

.vs-modtopbar-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--vs-text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.vs-modtopbar-profile-btn:hover {
    background: var(--vs-surface-alt);
    color: var(--vs-text);
    border-color: var(--vs-border);
}

.vs-modtopbar-profile-btn i { width: 18px; height: 18px; }

.vs-modtopbar-profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 240px;
    padding: 0.5rem;
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    display: none;
    z-index: 60;
}

.vs-modtopbar-profile-menu.is-open { display: block; }

.vs-modtopbar-profile-head {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--vs-border);
    margin-bottom: 0.4rem;
}

.vs-modtopbar-profile-name { font-weight: 600; color: var(--vs-text); font-size: 0.875rem; }
.vs-modtopbar-profile-mail { font-size: 0.8rem; color: var(--vs-text-muted); margin-top: 0.15rem; }

.vs-modtopbar-profile-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--vs-text);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
}

.vs-modtopbar-profile-menu a:hover {
    background: var(--vs-surface-alt);
    text-decoration: none;
}

.vs-modtopbar-profile-menu a i { width: 16px; height: 16px; opacity: 0.8; }

.vs-modtopbar-profile-version {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    color: var(--vs-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid var(--vs-border);
    margin-top: 0.4rem;
    padding-top: 0.65rem;
}

/* ============================================================
   Mobile (≤768px) — globale Regeln, gelten Suite-weit
============================================================ */
@media (max-width: 768px) {
    /* Modul-TopBar: scrollende Nav, Brand-Text aus, kompakte Links */
    .vs-modtopbar { margin: 0 0 1.5rem; } /* Mobile etwas kompakter */
    .vs-modtopbar-inner { gap: 0.5rem; padding: 0 0.5rem; }
    .vs-modtopbar-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox: Scrollbar weg, damit kein 3-px-Streifen */
        /* Edge-Fades als visueller "mehr da"-Hinweis ohne Scrollbar */
        mask-image: linear-gradient(to right,
            transparent 0,
            black 0.75rem,
            black calc(100% - 0.75rem),
            transparent 100%);
        -webkit-mask-image: linear-gradient(to right,
            transparent 0,
            black 0.75rem,
            black calc(100% - 0.75rem),
            transparent 100%);
    }
    .vs-modtopbar-nav::-webkit-scrollbar { display: none; }
    .vs-modtopbar-link { padding: 0 0.6rem; font-size: 0.8rem; }
    .vs-modtopbar-brand span { display: none; }
    /* Submenüs: nicht breiter als Viewport-1rem (gilt fuer den
       Desktop-Pfad und den noch-nicht-detached-Fall). */
    .vs-modtopbar-submenu {
        min-width: 180px;
        max-width: calc(100vw - 1rem);
    }
    /* Profil-Dropdown: schmaler, mit Sicherheits-Inset */
    .vs-modtopbar-profile-menu {
        min-width: 200px;
        max-width: calc(100vw - 1rem);
        right: 0.5rem;
    }

    /* Sercon-Clean Komponenten — Mobile-Anpassungen */
    .panel-card-head {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .panel-card-body { padding: 1rem; }

    /* Stats-Grid: 1 Spalte unter 480px, 2 Spalten 480-768px */
    .stats-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .stat-card { padding: 1rem; }
    .stat-card-value { font-size: 1.5rem; }

    /* Tabellen: horizontal scrollend statt überlaufend.
       Deckt explizit die häufigen Klassen-Namen ab + alle Tabellen in
       Cards/Panel-Cards (für ad-hoc <table> ohne eigene Klasse). */
    .modern-table,
    .activity-list,
    .recent-table,
    .data-table,
    .panel-card-body table,
    .card-body table,
    .panel-card > table,
    .card > table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        font-size: 0.8rem;
    }
    .modern-table thead th,
    .modern-table tbody td,
    .activity-list td,
    .recent-table th,
    .recent-table td,
    .panel-card-body table th,
    .panel-card-body table td,
    .card-body table th,
    .card-body table td { padding: 0.5rem 0.75rem; }

    /* Dashboard-Split: 2 Spalten → 1 Spalte */
    .dash-split { grid-template-columns: 1fr; }

    /* Filter-Pills: umbrechen statt überlaufen */
    .filter-pills { flex-wrap: wrap; }

    /* Page-Header: stack vertikal */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.95rem;
    }
    .page-header h1, .page-header h2 { font-size: 1.25rem; }
    .page-header .page-actions { width: 100%; flex-wrap: wrap; }

    /* CTA-Button: full-width auf Mobile */
    .btn-primary-action { width: 100%; justify-content: center; }
}

@media (min-width: 480px) and (max-width: 768px) {
    /* Stats-Grid: 2 Spalten ab 480px */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
