/* Modern Module Design System */
:root {
    --module-primary: #6366f1;
    --module-primary-dark: #4f46e5;
    --module-success: #10b981;
    --module-danger: #ef4444;
    --module-warning: #f59e0b;
    --module-info: #3b82f6;
    --module-bg: #f8fafc;
    --module-card-bg: #ffffff;
    --module-border: #e2e8f0;
    --module-text: #1e293b;
    --module-text-muted: #64748b;
    --module-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --module-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --module-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --module-radius: 0.75rem;
    --module-radius-lg: 1rem;
}

/* Module Container */
.module-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Modern Header */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--module-border);
}

.module-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--module-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.module-header h2 i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--module-primary) 0%, var(--module-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.module-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Modern Cards */
.module-card {
    background: var(--module-card-bg);
    border-radius: var(--module-radius-lg);
    box-shadow: var(--module-shadow);
    border: 1px solid var(--module-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.module-card:hover {
    box-shadow: var(--module-shadow-lg);
    transform: translateY(-2px);
}

.module-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--module-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--module-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.module-card-body {
    padding: 1.5rem;
}

.module-card-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--module-border);
}

/* Stat Cards */
.module-stat-card {
    background: var(--module-card-bg);
    border-radius: var(--module-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--module-shadow);
    border: 1px solid var(--module-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.module-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--module-primary) 0%, var(--module-primary-dark) 100%);
}

.module-stat-card:hover {
    box-shadow: var(--module-shadow-lg);
    transform: translateY(-4px);
}

.module-stat-card.primary::before { background: linear-gradient(90deg, var(--module-primary) 0%, var(--module-primary-dark) 100%); }
.module-stat-card.success::before { background: linear-gradient(90deg, var(--module-success) 0%, #059669 100%); }
.module-stat-card.danger::before { background: linear-gradient(90deg, var(--module-danger) 0%, #dc2626 100%); }
.module-stat-card.warning::before { background: linear-gradient(90deg, var(--module-warning) 0%, #d97706 100%); }
.module-stat-card.info::before { background: linear-gradient(90deg, var(--module-info) 0%, #2563eb 100%); }

.module-stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--module-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.module-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--module-text);
    margin: 0;
    line-height: 1.2;
}

.module-stat-subtitle {
    font-size: 0.875rem;
    color: var(--module-text-muted);
    margin-top: 0.5rem;
}

/* Modern Buttons */
.module-btn {
    padding: 0.625rem 1.25rem;
    border-radius: var(--module-radius);
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.module-btn-primary {
    background: linear-gradient(135deg, var(--module-primary) 0%, var(--module-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.module-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    color: white;
}

.module-btn-outline {
    background: transparent;
    border: 2px solid var(--module-border);
    color: var(--module-text);
}

.module-btn-outline:hover {
    background: var(--module-bg);
    border-color: var(--module-primary);
    color: var(--module-primary);
}

.module-btn-outline.active {
    background: linear-gradient(135deg, var(--module-primary) 0%, var(--module-primary-dark) 100%);
    border-color: var(--module-primary);
    color: white;
    font-weight: 600;
}

.module-btn-outline.active:hover {
    background: linear-gradient(135deg, var(--module-primary-dark) 0%, var(--module-primary) 100%);
    color: white;
}

/* Modern Tables */
.module-table-wrapper {
    border-radius: var(--module-radius-lg);
    overflow: hidden;
    border: 1px solid var(--module-border);
}

.module-table {
    width: 100%;
    margin: 0;
    background: var(--module-card-bg);
}

.module-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.module-table thead th {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--module-text);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--module-border);
}

.module-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--module-border);
}

.module-table tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.01);
}

.module-table tbody td {
    padding: 1rem 1.5rem;
    color: var(--module-text);
}

/* Modern Forms */
.module-form-group {
    margin-bottom: 1.5rem;
}

.module-form-label {
    display: block;
    font-weight: 500;
    color: var(--module-text);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.module-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--module-border);
    border-radius: var(--module-radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--module-card-bg);
    color: var(--module-text);
}

.module-form-control:focus {
    outline: none;
    border-color: var(--module-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Modern Alerts */
.module-alert {
    padding: 1rem 1.5rem;
    border-radius: var(--module-radius);
    border-left: 4px solid;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.module-alert-danger {
    background: #fef2f2;
    border-color: var(--module-danger);
    color: #991b1b;
}

.module-alert-success {
    background: #f0fdf4;
    border-color: var(--module-success);
    color: #166534;
}

.module-alert-warning {
    background: #fffbeb;
    border-color: var(--module-warning);
    color: #92400e;
}

.module-alert-info {
    background: #eff6ff;
    border-color: var(--module-info);
    color: #1e40af;
}

/* Modern Badges */
.module-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modern Tabs */
.module-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--module-border);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.module-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--module-text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.module-tab:hover {
    color: var(--module-primary);
    background: rgba(99, 102, 241, 0.05);
}

.module-tab.active {
    color: var(--module-primary);
    border-bottom-color: var(--module-primary);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .module-tab.active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.2);
    border-bottom-color: #6366f1;
}

/* Modern Empty State */
.module-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--module-text-muted);
}

.module-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.module-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--module-text);
    margin-bottom: 0.5rem;
}

.module-empty-text {
    font-size: 0.875rem;
    color: var(--module-text-muted);
}

/* Responsive - Mobile Optimierungen */

/* Nested dropdown submenu CSS (moved from app/Views/navigation.php) */
@media (min-width:992px){
    .dropdown{position:relative}
    .nav-item.dropdown:hover>.dropdown-menu,.nav-item.dropdown.show>.dropdown-menu{display:block!important;opacity:1;visibility:visible}
    .dropdown-submenu{position:relative}
    .dropdown-submenu-content{position:absolute;top:0;left:100%;min-width:200px;max-width:300px;display:none;z-index:1040;background:rgba(255,255,255,0.98);backdrop-filter:blur(12px);border-radius:.75rem;padding:.5rem;white-space:nowrap;box-shadow:0 6px 18px rgba(0,0,0,0.08)}
    .dropdown-submenu:hover>.dropdown-submenu-content,.dropdown-submenu.show>.dropdown-submenu-content{display:block!important}
    .navbar .container-fluid{position:relative;overflow:visible}
    .navbar .dropdown-menu{overflow:visible}
}
/* Mobile: display nested submenu blocks as normal blocks when JS toggles them */
@media (max-width:991px){
    .dropdown-submenu-content{position:relative;left:auto;display:none;padding-left:0.5rem;background:transparent;box-shadow:none}
    .dropdown-toggle-submenu{display:flex;justify-content:space-between;align-items:center}
    .dropdown-submenu-content .dropdown-item{padding-left:1rem}
}

/* Navigation-specific utility classes */
.nav-frosted {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 3px solid #6366f1;
}
.brand-large {
    font-size: 1.5rem;
    color: #6366f1 !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-icon {
    font-size: 1.75rem;
    color: #6366f1;
}
.brand-gradient-text {
    background: linear-gradient(135deg,#6366f1 0%,#4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.user-area {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.user-balance-box, .user-points-box {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.user-balance-box {
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.12);
    color: #6366f1;
}
.user-points-box {
    background: rgba(255,193,7,0.08);
    border: 1px solid rgba(255,193,7,0.12);
    color: #ffc107;
}

/* Fixes for nested submenu interactivity and stacking */
/* Z-index hierarchy is centralized in modal-defaults.css */
/* Ensure navbar and its dropdowns sit above page content but BELOW modals */
.navbar {
    position: relative;
    z-index: 1030; /* Below modal backdrop (1050) and modals (1055) */
}
.navbar .dropdown-menu,
.dropdown-submenu-content {
    pointer-events: auto;
}
/* If any ancestor introduces a new stacking context, make submenu render on its own layer */
.dropdown-submenu-content {
    transform: translateZ(0);
}

/* Smooth transitions and delayed visibility for dropdowns */
.navbar .dropdown-menu,
.dropdown-submenu-content {
    transition: opacity 150ms ease, transform 150ms ease;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}
.navbar .dropdown-menu.show,
.dropdown-submenu-content.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Visually hidden, but becomes visible on focus (skip links) */
.visually-hidden-focusable {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.visually-hidden-focusable:focus,
.visually-hidden-focusable:active {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    background: #111827;
    color: #fff;
    border-radius: 0.375rem;
    z-index: 1080; /* tooltips and focus elements above modals */
    text-decoration: none;
}

/* Icon color from classes instead of inline styles */
.user-balance-box i { color: #6366f1; }
.user-points-box i { color: #ffc107; }

/* small aria-live region styling (hidden) */
#nav-aria-live { position: absolute; left: -9999px; top: auto; }
@media (max-width: 768px) {
    .module-container {
        padding: 1rem 0.5rem;
    }
    
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .module-header h2 {
        font-size: 1.5rem;
    }
    
    .module-header h2 i {
        font-size: 1.75rem;
    }
    
    .module-header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .module-card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .module-card-header h3 {
        font-size: 1.125rem;
    }
    
    .module-card-body {
        padding: 1rem;
    }
    
    /* Touch-optimierte Buttons */
    .module-btn {
        min-height: 44px; /* Mindesthöhe für Touch-Bedienung */
        min-width: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
        touch-action: manipulation;
    }
    
    .module-btn i {
        font-size: 1.125rem;
    }
    
    /* Größere Klickflächen für Mobile */
    .module-btn-outline {
        padding: 0.75rem 1.25rem;
    }
    
    /* Tabs auf Mobile optimiert */
    .module-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--module-border) transparent;
        padding-bottom: 0.5rem;
    }
    
    .module-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .module-tabs::-webkit-scrollbar-thumb {
        background: var(--module-border);
        border-radius: 2px;
    }
    
    .module-tab {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
        white-space: nowrap;
    }
    
    /* Tabellen auf Mobile optimiert */
    .module-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .module-table {
        min-width: 600px;
    }
    
    .module-table thead th {
        padding: 0.75rem 1rem;
        font-size: 0.6875rem;
    }
    
    .module-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Formulare auf Mobile optimiert */
    .module-form-control {
        padding: 0.875rem 1rem;
        font-size: 1rem; /* Verhindert Zoom auf iOS */
        min-height: 44px;
    }
    
    /* Stat Cards auf Mobile */
    .module-stat-card {
        padding: 1.25rem;
    }
    
    .module-stat-value {
        font-size: 1.75rem;
    }
    
    /* Modals auf Mobile optimiert */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: var(--module-radius-lg);
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .modal-footer {
        padding: 1rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .modal-footer .module-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
    }
}

/* Tablet-Optimierungen */
@media (min-width: 769px) and (max-width: 991.98px) {
    .module-container {
        padding: 1.5rem 1rem;
    }
    
    .module-header h2 {
        font-size: 1.75rem;
    }
    
    .module-btn {
        min-height: 42px;
        padding: 0.625rem 1.125rem;
    }
    
    .module-card-header {
        padding: 1.25rem;
    }
    
    .module-card-body {
        padding: 1.25rem;
    }
}

/* Touch-Device-Detection (für JavaScript) */
@media (hover: none) and (pointer: coarse) {
    /* Touch-Devices */
    .module-btn {
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
        touch-action: manipulation;
    }
    
    .module-card:hover {
        transform: none; /* Kein Hover-Effekt auf Touch-Devices */
    }
    
    .module-table tbody tr:hover {
        transform: none; /* Kein Hover-Effekt auf Touch-Devices */
    }
    
    /* Größere Klickflächen für Links */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Große Mobile-Geräte (landscape) */
@media (max-width: 991.98px) and (orientation: landscape) {
    .module-header {
        flex-direction: row;
        align-items: center;
    }
    
    .module-header-actions {
        width: auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-card {
    animation: fadeIn 0.3s ease-out;
}

/* Dark Mode Support */
[data-theme="dark"] {
    --module-bg: #0f172a;
    --module-card-bg: #1e293b;
    --module-border: #334155;
    --module-text: #f1f5f9;
    --module-text-muted: #94a3b8;
    --module-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --module-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --module-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .module-card-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] .module-card-footer {
    background: #1e293b;
}

[data-theme="dark"] .module-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] .module-table tbody tr:hover {
    background: #334155;
}

[data-theme="dark"] .module-alert-danger {
    background: #7f1d1d;
    color: #fecaca;
}

[data-theme="dark"] .module-alert-success {
    background: #14532d;
    color: #bbf7d0;
}

[data-theme="dark"] .module-alert-warning {
    background: #78350f;
    color: #fde68a;
}

[data-theme="dark"] .module-alert-info {
    background: #1e3a8a;
    color: #bfdbfe;
}

/* Nav grouping styles */
.nav-groups { display:flex; gap:0.25rem; flex-direction:column; }
.nav-group { list-style:none; margin:0; padding:0; }
.nav-group-header { padding:0.25rem 0.5rem; }
.nav-group-header .nav-link { display:flex; align-items:center; gap:0.5rem; color:var(--module-text); }
.nav-group-panel { display:block; }

/* Mobile: hide panels by default and toggle via .expanded */
@media (max-width: 991.98px) {
    .nav-group-panel { display:none; padding-left:0.5rem; }
    .nav-group-panel.expanded { display:block; }
    .btn-toggle-group { background:transparent; border:none; color:var(--module-text); padding:0.25rem 0; }
    .btn-toggle-group:focus { outline:2px solid rgba(99,102,241,0.2); border-radius:0.25rem; }
    .nav-group-panel .dropdown-item, .nav-group-panel .nav-item, .nav-group-panel a { display:block; padding:0.5rem 0.5rem; }
}

@media (min-width: 992px) {
    /* On desktop, keep group headers inline and panels visible as normal menu blocks */
    .nav-groups { flex-direction:row; align-items:center; }
    .nav-group { margin-right:0.5rem; }
     /* Desktop: prefer desktop dropdowns — hide any leftover mobile panels that may remain in the DOM
         This prevents duplicated/streamed mobile panels from appearing in the page content. */
     .nav-group-panel { display: none !important; }
    .nav-group-header .nav-link.d-none.d-lg-flex { display: flex !important; }
    .nav-group-panel .dropdown-item { display:block; }

    /* Navbar spacing and dropdown sizing tweaks for a more compact, consistent look */
    .navbar-nav .nav-link { padding: 0.5rem 0.75rem; }
    .navbar .dropdown-menu { min-width: 220px; max-width: 360px; }
    .navbar .dropdown-menu .dropdown-header { font-size: 0.85rem; color: var(--module-text-muted); }
    .user-area .user-balance-box, .user-area .user-points-box { padding: 0.2rem 0.5rem; gap: 0.4rem; }
    .navbar .badge { position: relative; transform: none; top: auto; right: auto; }
}

/* Highlighted navigation item (e.g. Glücksrad / wheel) */
.nav-highlight {
    background: linear-gradient(90deg, rgba(255,223,93,0.12), rgba(255,193,7,0.06));
    border-radius: 0.375rem;
    padding: 0.15rem 0.35rem;
    font-weight: 600;
    color: var(--module-text) !important;
    box-shadow: 0 4px 10px rgba(249, 168, 37, 0.08);
}
.nav-highlight i { color: #b45309; }

/* Ensure highlighted link is visible in dark mode */
[data-theme="dark"] .nav-highlight {
    background: linear-gradient(90deg, rgba(245,158,11,0.12), rgba(245,158,11,0.06));
    color: #f59e0b !important;
    box-shadow: 0 6px 14px rgba(245,158,11,0.08);
}

/* Slightly larger hit target on mobile for highlighted items */
@media (max-width: 991.98px) {
    .nav-group-panel .nav-highlight { display: inline-block; padding: 0.6rem 0.5rem; border-radius: 0.375rem; }
}

/* Dark Mode für Module Buttons */
[data-theme="dark"] .module-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .module-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.5);
}

[data-theme="dark"] .module-btn-outline {
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .module-btn-outline:hover {
    background: #334155;
    border-color: #6366f1;
    color: #a5b4fc;
}

[data-theme="dark"] .module-btn-outline.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #6366f1;
    color: white;
}

[data-theme="dark"] .module-btn-outline.active:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
}

/* Dark Mode für Module Tabs - Bessere Lesbarkeit */
[data-theme="dark"] .module-tab {
    color: #94a3b8;
}

[data-theme="dark"] .module-tab:hover {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .module-table thead th {
    color: #f1f5f9;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] .module-table tbody td {
    color: #f1f5f9;
}

[data-theme="dark"] .module-table tbody tr:hover {
    background: #334155;
}

[data-theme="dark"] .module-form-label {
    color: #f1f5f9;
}

[data-theme="dark"] .module-form-control {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .module-form-control:focus {
    background: #1e293b;
    border-color: #6366f1;
    color: #f1f5f9;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .module-stat-label {
    color: #94a3b8;
}

[data-theme="dark"] .module-stat-value {
    color: #f1f5f9;
}

[data-theme="dark"] .module-stat-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .module-header h2 {
    color: #f1f5f9;
}

[data-theme="dark"] .module-card-header h3 {
    color: #f1f5f9;
}

/* Dark Mode für Navigation */
[data-theme="dark"] .navbar-light {
    background: #1e293b !important;
    border-bottom-color: #6366f1 !important;
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link:hover {
    color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link.active {
    color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .navbar-light .navbar-brand {
    color: #6366f1 !important;
}

[data-theme="dark"] .navbar-light .navbar-brand span {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-item {
    color: #f1f5f9;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #334155;
    color: #6366f1;
}

[data-theme="dark"] .dropdown-header {
    color: #94a3b8 !important;
}

[data-theme="dark"] .navbar-collapse {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* High-specificity overrides for active navigation items in dark theme
   Added to ensure the active link is always high-contrast and readable
   regardless of other rules or cascade order. */
html[data-theme="dark"] .nav-frosted .navbar-nav .nav-link.active,
html[data-theme="dark"] .nav-frosted .navbar-nav .nav-link.active.dropdown-toggle,
html[data-theme="dark"] .navbar-light .navbar-nav .nav-link.active,
html[data-theme="dark"] .navbar-light .navbar-nav .nav-link.active.dropdown-toggle {
    background: linear-gradient(135deg,#4338ca 0%,#4f46e5 100%) !important;
    color: #ffffff !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 6px 18px -4px rgba(79,70,229,0.45) !important;
}

html[data-theme="dark"] .nav-frosted .navbar-nav .nav-link.active i,
html[data-theme="dark"] .nav-frosted .navbar-nav .nav-link.active.dropdown-toggle i {
    color: #ffffff !important;
}


[data-theme="dark"] body {
    background: #0f172a;
    color: #f1f5f9;
}

[data-theme="dark"] .bg-light {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

