/* Dark Mode Overrides - KAI KSR */
/* Applied when [data-theme="dark"] is set on <html> */

/* =====================================================
   Bootstrap CSS Variable Overrides
   ===================================================== */
[data-theme="dark"] {
    /* Core Bootstrap Variables */
    --bs-body-bg: #0f172a;
    --bs-body-color: #f1f5f9;
    --bs-secondary-bg: #1e293b;
    --bs-tertiary-bg: #334155;

    /* Border and text colors */
    --bs-border-color: #475569;
    --text-light: #cbd5e1;
    --border-color: #475569;

    /* Card colors */
    --bs-card-bg: #1e293b;
    --bs-card-border-color: #475569;

    /* Primary color adjustments for dark mode */
    --bs-primary: #60a5fa;
    --bs-primary-rgb: 96, 165, 250;
}

/* =====================================================
   Body & Base Elements
   ===================================================== */
[data-theme="dark"] body {
    background-color: #0f172a;
    color: #f1f5f9;
}

/* =====================================================
   Typography - IMPROVED TEXT READABILITY
   ===================================================== */

/* Headings should be bright white for maximum readability */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #f8fafc;
}

/* Primary colored headings */
[data-theme="dark"] .text-primary,
[data-theme="dark"] h6.text-primary {
    color: #60a5fa !important;
}

/* Regular paragraphs and text */
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] li {
    color: #e2e8f0;
}

/* Labels and strong text */
[data-theme="dark"] label,
[data-theme="dark"] strong,
[data-theme="dark"] b {
    color: #f1f5f9;
}

/* Small text - slightly brighter than before */
[data-theme="dark"] small,
[data-theme="dark"] .small {
    color: #cbd5e1;
}

/* =====================================================
   Bootstrap Component Overrides
   ===================================================== */

/* Cards */
[data-theme="dark"] .card {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .card-header {
    background-color: #1e293b;
    border-bottom-color: #475569;
    color: #f1f5f9;
}

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

[data-theme="dark"] .card-body {
    color: #e2e8f0;
}

[data-theme="dark"] .card-title {
    color: #f8fafc;
}

/* Buttons */
[data-theme="dark"] .btn-light {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .btn-light:hover {
    background-color: #475569;
    border-color: #64748b;
    color: #ffffff;
}

[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #64748b;
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #475569;
    border-color: #64748b;
    color: #ffffff;
}

[data-theme="dark"] .btn-outline-primary {
    color: #60a5fa;
    border-color: #60a5fa;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #60a5fa;
    border-color: #60a5fa;
    color: #0f172a;
}

/* Form Controls */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #1e293b;
    border-color: #60a5fa;
    color: #f1f5f9;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
}

[data-theme="dark"] .input-group-text {
    background-color: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .form-text {
    color: #cbd5e1;
}

/* Form Labels */
[data-theme="dark"] .form-label {
    color: #f1f5f9;
}

/* Tables */
[data-theme="dark"] .table {
    --bs-table-bg: #1e293b;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: #475569;
    --bs-table-striped-bg: #334155;
    --bs-table-hover-bg: #334155;
}

[data-theme="dark"] .table th {
    color: #f8fafc;
}

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

[data-theme="dark"] .table-active {
    --bs-table-active-bg: #334155;
    --bs-table-active-color: #f8fafc;
}

[data-theme="dark"] .table-info {
    --bs-table-bg: #164e63;
    --bs-table-color: #e2e8f0;
    color: #e2e8f0 !important;
    background-color: #164e63 !important;
}

/* Alerts */
[data-theme="dark"] .alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* Bootstraps „subtle"-Flächen (.bg-*-subtle) tragen !important und hängen an
   Bootstraps eigenem [data-bs-theme], nicht an unserem [data-theme]. Ohne die
   folgenden Regeln bleiben sie im Dark Mode hell, während Überschriften und
   Text hell eingefärbt werden — helle Schrift auf hellem Grund. Betrifft
   Kartenköpfe ebenso wie Badges. */
[data-theme="dark"] .bg-warning-subtle {
    background-color: rgba(234, 179, 8, 0.18) !important;
    color: #fde68a;
}
[data-theme="dark"] .bg-warning-subtle h1,
[data-theme="dark"] .bg-warning-subtle h2,
[data-theme="dark"] .bg-warning-subtle h3,
[data-theme="dark"] .bg-warning-subtle h4,
[data-theme="dark"] .bg-warning-subtle h5,
[data-theme="dark"] .bg-warning-subtle h6 {
    color: #fde68a;
}

[data-theme="dark"] .bg-primary-subtle {
    background-color: rgba(96, 165, 250, 0.18) !important;
    color: #bfdbfe;
}
[data-theme="dark"] .bg-primary-subtle.text-primary {
    color: #93c5fd !important;
}

[data-theme="dark"] .bg-danger-subtle {
    background-color: rgba(248, 113, 113, 0.18) !important;
    color: #fecaca;
}
[data-theme="dark"] .bg-danger-subtle.text-danger {
    color: #fca5a5 !important;
}

[data-theme="dark"] .bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.18) !important;
    color: #86efac;
}
[data-theme="dark"] .bg-success-subtle.text-success {
    color: #86efac !important;
}

/* Badges */
[data-theme="dark"] .badge.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
}

[data-theme="dark"] .badge.bg-primary {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge.bg-danger {
    background-color: #fca5a5 !important;
    color: #991b1b !important;
}

[data-theme="dark"] .live-indicator {
    background: #dc2626 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .status-badge.status-live {
    background: #dc2626 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .info-bar {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

/* Referent: Feedback Share Bar */
[data-theme="dark"] .share-feedback-bar {
    background-color: #1e293b;
    border-top-color: #92400e;
}

[data-theme="dark"] .share-feedback-bar p {
    color: #fbbf24;
}

[data-theme="dark"] .share-status-text {
    color: #6ee7b7;
}

/* Referent: Screen Share Status Indicators */
[data-theme="dark"] .share-inactive {
    background: #422006;
    color: #fbbf24;
}

[data-theme="dark"] .share-active {
    background: #064e3b;
    color: #34d399;
}

/* Zuschauer: Feedback Panel */
[data-theme="dark"] .feedback-panel {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-top-color: #10b981;
}

[data-theme="dark"] .feedback-panel h3 {
    color: #ffffff;
}

[data-theme="dark"] .feedback-panel p {
    color: #6ee7b7;
}

[data-theme="dark"] .feedback-panel .btn-feedback {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .feedback-panel .btn-feedback:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .feedback-qr p {
    color: #94a3b8;
}

[data-theme="dark"] .feedback-code {
    background: #1e293b;
    border-color: #92400e;
}

[data-theme="dark"] .feedback-code .label {
    color: #fbbf24;
}

[data-theme="dark"] .feedback-code .code {
    color: #fcd34d;
}

/* Modals */
[data-theme="dark"] .modal-content {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #475569;
}

[data-theme="dark"] .modal-title {
    color: #f8fafc;
}

/* Offcanvas */
[data-theme="dark"] .offcanvas {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .offcanvas-header {
    border-bottom-color: #475569;
}

[data-theme="dark"] .offcanvas-title {
    color: #f8fafc;
}

/* List Groups */
[data-theme="dark"] .list-group-item {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

/* =====================================================
   Custom Components Overrides (OPs Module etc.)
   ===================================================== */

/* Glass Header - maintain blue but ensure text visibility */
[data-theme="dark"] .glass-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(30, 64, 175, 0.9) 100%);
}

[data-theme="dark"] .glass-header h1,
[data-theme="dark"] .glass-header p {
    color: #ffffff;
}

/* Desktop Sidebar */
[data-theme="dark"] .overview-column {
    background: #1e293b;
    border-right-color: #475569;
}

[data-theme="dark"] .overview-column .fachgebiet-list>li>a {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .overview-column .fachgebiet-list>li>a:hover {
    background: #475569;
    color: #60a5fa;
}

[data-theme="dark"] .overview-column .op-item {
    color: #94a3b8;
}

[data-theme="dark"] .overview-column .op-item:hover {
    color: #60a5fa;
}

[data-theme="dark"] .overview-column .op-item:hover span {
    color: #60a5fa;
}

[data-theme="dark"] .overview-column .op-item span {
    color: #cbd5e1;
}

/* Search Suggestions Dropdown */
[data-theme="dark"] #suggestions {
    background: #1e293b;
    border-color: #475569;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #suggestions .suggestion-item,
[data-theme="dark"] #suggestions .suggestion-item-op {
    border-bottom-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] #suggestions .suggestion-item:hover,
[data-theme="dark"] #suggestions .suggestion-item-op:hover {
    background: #334155;
}

/* OP Sections - IMPROVED */
[data-theme="dark"] .op-section {
    background: #334155 !important;
}

[data-theme="dark"] .op-section h6 {
    color: #60a5fa !important;
}

[data-theme="dark"] .op-content {
    color: #e2e8f0;
}

[data-theme="dark"] .op-content span {
    color: #e2e8f0;
}

[data-theme="dark"] .op-content ul,
[data-theme="dark"] .op-content li {
    color: #e2e8f0;
}

/* Change Suggestion Container */
[data-theme="dark"] .change-suggestion-container {
    background: #334155;
}

[data-theme="dark"] .last-change-text {
    color: #cbd5e1;
}

[data-theme="dark"] .suggestion-input-container textarea {
    background-color: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

/* Footer */
[data-theme="dark"] footer {
    background-color: #1e293b;
    border-top-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] footer a {
    color: #60a5fa;
}

[data-theme="dark"] footer a:hover {
    color: #93c5fd;
}

/* Cookie Banner */
[data-theme="dark"] .cookie-banner {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .cookie-banner p {
    color: #e2e8f0;
}

/* Popup/Modal (legacy) */
[data-theme="dark"] .popup {
    background-color: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .popup input,
[data-theme="dark"] .popup textarea {
    background-color: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

/* Tool Cards (Homepage) */
[data-theme="dark"] .tool-card {
    background-color: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .tool-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .tool-card-highlight {
    border-color: rgba(96, 165, 250, 0.55);
}

[data-theme="dark"] .tool-card-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
}

[data-theme="dark"] .tool-card h5,
[data-theme="dark"] .tool-card .card-title {
    color: #f8fafc;
}

[data-theme="dark"] .tool-card p,
[data-theme="dark"] .tool-card .card-text {
    color: #cbd5e1;
}

/* Changelog */
[data-theme="dark"] .changelog-body {
    color: #e2e8f0;
}

[data-theme="dark"] .changelog-body li {
    color: #cbd5e1;
}

[data-theme="dark"] .changelog-body strong {
    color: #60a5fa;
}

/* Text Colors - IMPROVED CONTRAST */
[data-theme="dark"] .text-muted {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .text-secondary {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .text-body {
    color: #e2e8f0 !important;
}

/* Opacity classes - ensure readable */
[data-theme="dark"] .opacity-75 {
    color: #cbd5e1;
}

/* Background Colors */
[data-theme="dark"] .bg-light {
    background-color: #334155 !important;
    color: #e2e8f0;
}

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

/* Links - brighter for better visibility */
[data-theme="dark"] a:not(.btn):not(.nav-link) {
    color: #60a5fa;
}

[data-theme="dark"] a:not(.btn):not(.nav-link):hover {
    color: #93c5fd;
}

/* Nav Links */
[data-theme="dark"] .nav-link {
    color: #cbd5e1;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: #60a5fa;
}

/* Breadcrumbs */
[data-theme="dark"] .breadcrumb-item {
    color: #cbd5e1;
}

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

[data-theme="dark"] .breadcrumb-item+.breadcrumb-item::before {
    color: #64748b;
}

/* Helpful voting section */
[data-theme="dark"] #helpfulCount {
    color: #cbd5e1;
}

[data-theme="dark"] #helpfulNumber {
    color: #e2e8f0;
}

/* Scrollbar styling for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* =====================================================
   Dark Mode Toggle Button
   ===================================================== */
.dark-mode-toggle {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 1040;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    color: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .dark-mode-toggle {
    background: #334155;
    border-color: #475569;
    color: #fbbf24;
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background: #475569;
}

/* Hide the opposite icon based on theme */
.dark-mode-toggle .bi-sun-fill {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle .bi-moon-fill {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle .bi-sun-fill {
    display: inline;
}

/* =====================================================
   Additional Component Fixes
   ===================================================== */

/* Accordion */
[data-theme="dark"] .accordion-item {
    background-color: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .accordion-button {
    background-color: #1e293b;
    color: #f1f5f9;
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #334155;
    color: #60a5fa;
}

[data-theme="dark"] .accordion-body {
    background-color: #1e293b;
    color: #e2e8f0;
}

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

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

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

/* Close button */
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Progress bars */
[data-theme="dark"] .progress {
    background-color: #334155;
}

/* Pagination */
[data-theme="dark"] .page-link {
    background-color: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .page-link:hover {
    background-color: #334155;
    border-color: #475569;
    color: #60a5fa;
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #1e293b;
    border-color: #475569;
    color: #64748b;
}

/* =====================================================
   OPS MODULE - Form Sections (edit.php, new_op.php)
   ===================================================== */

/* Form sections with white background */
[data-theme="dark"] .form-section {
    background: #1e293b !important;
    border: 1px solid #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .form-section-title {
    color: #60a5fa !important;
    border-bottom-color: #475569 !important;
}

/* Checkbox items in forms */
[data-theme="dark"] .checkbox-item {
    color: #e2e8f0;
}

[data-theme="dark"] .checkbox-item:hover {
    background: #334155 !important;
}

/* Checkbox grid labels */
[data-theme="dark"] .checkbox-grid label {
    color: #e2e8f0;
}

/* =====================================================
   FACHARZTNACHWEIS MODULE
   ===================================================== */

/* Procedure cards */
[data-theme="dark"] .procedure {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .procedure h3 {
    color: #f8fafc !important;
}

[data-theme="dark"] .procedure ul,
[data-theme="dark"] .procedure li {
    color: #cbd5e1 !important;
}

/* Drop area / file upload */
[data-theme="dark"] .drop-area {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0;
}

[data-theme="dark"] .drop-area:hover {
    background-color: #334155 !important;
    border-color: #60a5fa !important;
}

[data-theme="dark"] .drop-area.dragging {
    background-color: #334155 !important;
    border-color: #60a5fa !important;
}

[data-theme="dark"] .drop-area p,
[data-theme="dark"] .drop-area span {
    color: #e2e8f0;
}

/* Text containers */
[data-theme="dark"] .text-container {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .text-container-left {
    color: #cbd5e1 !important;
}

/* Progress bar container */
[data-theme="dark"] .progress-bar-container {
    background-color: #334155;
}

/* Popup content */
[data-theme="dark"] .popup-content {
    background-color: #1e293b !important;
    color: #e2e8f0;
}

[data-theme="dark"] .popup-message {
    color: #e2e8f0 !important;
}

/* =====================================================
   DIENSTPLANTOOL MODULE
   ===================================================== */

/* Calendar days */
[data-theme="dark"] .calendar-day {
    background: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .calendar-day:hover,
[data-theme="dark"] .calendar-day.day-hover-active {
    background: #334155 !important;
}

[data-theme="dark"] .calendar-day.other-month {
    background: #0f172a !important;
}

[data-theme="dark"] .calendar-day.today {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e4976 100%) !important;
    border-color: #60a5fa !important;
}

[data-theme="dark"] .calendar-day-number {
    color: #f1f5f9 !important;
}

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

/* Calendar weekday headers */
[data-theme="dark"] .calendar-weekday-header {
    background: #334155 !important;
    color: #cbd5e1 !important;
}

/* Dienst modal */
[data-theme="dark"] .dienst-details-modal {
    background: #1e293b !important;
    border: 1px solid #475569;
}

[data-theme="dark"] .dienst-modal-header {
    border-bottom-color: #475569 !important;
}

[data-theme="dark"] .dienst-modal-close {
    color: #94a3b8 !important;
}

[data-theme="dark"] .dienst-modal-close:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* Specific text input fix */
[data-theme="dark"] #namesearch {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] #namesearch::placeholder {
    color: #94a3b8;
}

/* Statistics/Summary Container */
[data-theme="dark"] .statistics-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .stat-detail-row {
    border-bottom-color: #334155;
}

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

[data-theme="dark"] .stat-weekday-chart {
    background: #1e293b;
}

[data-theme="dark"] .stat-weekday-count {
    color: #cbd5e1;
}

[data-theme="dark"] .stat-insight {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.5) 0%, rgba(30, 64, 175, 0.5) 100%);
    border-color: #1e40af;
    color: #bfdbfe;
}

[data-theme="dark"] .statistics-details {
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
}

/* Shift Type Pie Chart - Dark Mode */
[data-theme="dark"] .shift-type-chart {
    background: #0f172a !important;
    border: 1px solid #334155;
}

[data-theme="dark"] .shift-type-title {
    color: #94a3b8;
}

[data-theme="dark"] .shift-type-donut {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .shift-type-donut-center {
    background: #0f172a !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .shift-type-total {
    color: #e2e8f0;
}

[data-theme="dark"] .shift-type-total-label {
    color: #94a3b8;
}

[data-theme="dark"] .shift-type-legend-label {
    color: #cbd5e1;
}

[data-theme="dark"] .shift-type-legend-value {
    color: #e2e8f0;
}

/* Dienstart Breakdown - Dark Mode */
[data-theme="dark"] .dienstart-breakdown {
    background: #0f172a !important;
    border: 1px solid #334155;
}

[data-theme="dark"] .dienstart-breakdown-title {
    color: #94a3b8;
}

[data-theme="dark"] .dienstart-breakdown-label {
    color: #cbd5e1;
}

[data-theme="dark"] .dienstart-breakdown-value {
    color: #e2e8f0;
}

[data-theme="dark"] .dienstart-breakdown-item {
    border-bottom-color: #334155;
}

/* Hinweis auf neue Funktionen (Dienstplantool) - Dark Mode */
[data-theme="dark"] .neu-hinweis {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #475569;
    border-left-color: #3b82f6;
}

[data-theme="dark"] .neu-hinweis-title {
    color: #f1f5f9;
}

[data-theme="dark"] .neu-hinweis-text {
    color: #cbd5e1;
}

[data-theme="dark"] .neu-hinweis-hint {
    color: #93c5fd;
}

[data-theme="dark"] .neu-hinweis-close {
    color: #94a3b8;
}

[data-theme="dark"] .neu-hinweis-close:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #f1f5f9;
}

[data-theme="dark"] .neu-hinweis-badge,
[data-theme="dark"] .ws-neu {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
}

/* Wochenstunden (Dienstplantool) - Dark Mode */
[data-theme="dark"] .wochenstunden-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .ws-hero-main,
[data-theme="dark"] .ws-chip,
[data-theme="dark"] .ws-settings,
[data-theme="dark"] .ws-breakdown,
[data-theme="dark"] .ws-weeks,
[data-theme="dark"] .ws-explain {
    background: #0f172a !important;
    border: 1px solid #334155;
}

[data-theme="dark"] .ws-title,
[data-theme="dark"] .ws-hero-value,
[data-theme="dark"] .ws-breakdown-value,
[data-theme="dark"] .ws-breakdown-sum .ws-breakdown-label,
[data-theme="dark"] .ws-breakdown-sum .ws-breakdown-value,
[data-theme="dark"] .ws-week-value {
    color: #f1f5f9;
}

[data-theme="dark"] .ws-subtitle,
[data-theme="dark"] .ws-hero-unit,
[data-theme="dark"] .ws-hero-label,
[data-theme="dark"] .ws-settings-title,
[data-theme="dark"] .ws-block-title,
[data-theme="dark"] .ws-mode-hint,
[data-theme="dark"] .ws-breakdown-note,
[data-theme="dark"] .ws-week-label,
[data-theme="dark"] .ws-weeks-legend,
[data-theme="dark"] .ws-weeks-legend span,
[data-theme="dark"] .ws-weeks-note,
[data-theme="dark"] .ws-explain-limits {
    color: #94a3b8;
}

[data-theme="dark"] .ws-optout {
    border-top-color: #334155;
}

[data-theme="dark"] .ws-optout-hint {
    color: #94a3b8;
}

[data-theme="dark"] .ws-breakdown-label,
[data-theme="dark"] .ws-optout .form-check-label,
[data-theme="dark"] .ws-prozent-row,
[data-theme="dark"] .ws-prozent-row label,
[data-theme="dark"] .ws-prozent-row span,
[data-theme="dark"] .ws-explain summary,
[data-theme="dark"] .ws-explain-body,
[data-theme="dark"] .ws-explain-body p,
[data-theme="dark"] .ws-explain-body li {
    color: #cbd5e1;
}

[data-theme="dark"] .ws-mode-hint strong,
[data-theme="dark"] .ws-explain-body strong {
    color: #e2e8f0;
}

[data-theme="dark"] .ws-breakdown-item,
[data-theme="dark"] .ws-breakdown-note {
    border-bottom-color: #334155;
}

[data-theme="dark"] .ws-breakdown-value.ws-over,
[data-theme="dark"] .ws-breakdown-warn .ws-breakdown-value,
[data-theme="dark"] .ws-breakdown-note.ws-breakdown-warn {
    color: #fbbf24;
}

[data-theme="dark"] .ws-breakdown-value.ws-under {
    color: #93c5fd;
}

[data-theme="dark"] .ws-hero-over {
    background: rgba(180, 83, 9, 0.25);
    color: #fcd34d;
}

[data-theme="dark"] .ws-hero-under {
    background: rgba(30, 64, 175, 0.35);
    color: #bfdbfe;
}

[data-theme="dark"] .ws-hero-even {
    background: rgba(22, 101, 52, 0.35);
    color: #bbf7d0;
}

[data-theme="dark"] .ws-mode,
[data-theme="dark"] .ws-weekday {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .ws-mode:hover,
[data-theme="dark"] .ws-weekday:hover {
    border-color: #60a5fa;
    color: #93c5fd;
}

[data-theme="dark"] .ws-mode.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #f8fafc;
}

[data-theme="dark"] .ws-weekday.active {
    background: #14532d;
    border-color: #22c55e;
    color: #bbf7d0;
}

[data-theme="dark"] .ws-week-badge {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .ws-settings-summary {
    color: #f1f5f9;
}

[data-theme="dark"] .ws-settings-action {
    color: #60a5fa;
}

[data-theme="dark"] .ws-hero-side .ws-hero-value,
[data-theme="dark"] .ws-breakdown-bd .ws-breakdown-label,
[data-theme="dark"] .ws-breakdown-bd .ws-breakdown-value,
[data-theme="dark"] .ws-hero-note,
[data-theme="dark"] .ws-chip-label {
    color: #94a3b8;
}

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

[data-theme="dark"] .ws-chip i {
    color: #60a5fa;
}

[data-theme="dark"] .ws-week-bar-bd,
[data-theme="dark"] .ws-bd-legend {
    background-color: #64748b;
}

[data-theme="dark"] .ws-week-track {
    background: #334155;
}

[data-theme="dark"] .ws-week-bar {
    background: #3b82f6;
}

[data-theme="dark"] .ws-week-bar-over {
    background: #f59e0b;
}

[data-theme="dark"] .ws-soll-line,
[data-theme="dark"] .ws-soll-legend {
    background: #f1f5f9;
    opacity: 0.75;
}

[data-theme="dark"] .ws-soll-line-partial {
    background: none;
    border-left-color: #f1f5f9;
}

[data-theme="dark"] .ws-grenz-line,
[data-theme="dark"] .ws-grenz-legend {
    border-left-color: #f87171;
    opacity: 0.9;
}

[data-theme="dark"] .stat-colleague-comparison {
    background: #1e293b !important;
    /* Use background shorthand to override gradient image */
    border: 1px solid #475569 !important;
}

[data-theme="dark"] .stat-comparison-header {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-bottom: 1px solid #475569 !important;
}

[data-theme="dark"] .stat-comparison-insight {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .stat-comparison-count {
    color: #94a3b8 !important;
}

/* Name Variation Suggestion */
[data-theme="dark"] .name-variation-suggestion {
    background: linear-gradient(135deg, #422006 0%, #451a03 100%) !important;
    border-color: #92400e !important;
}

[data-theme="dark"] .name-variation-suggestion.name-variation-prominent {
    box-shadow: 0 4px 15px rgba(146, 64, 14, 0.4);
}

[data-theme="dark"] .name-variation-suggestion .suggestion-header {
    color: #fef3c7 !important;
}

[data-theme="dark"] .name-variation-suggestion .suggestion-text {
    color: #fcd34d !important;
}

[data-theme="dark"] .name-variation-suggestion .suggestion-hint {
    color: #fbbf24 !important;
}

[data-theme="dark"] .name-variation-suggestion .variation-tag {
    background: #d97706;
    color: #fef3c7;
}

[data-theme="dark"] .name-variation-suggestion .suggestion-add-btn {
    background: #16a34a;
    color: #fef3c7;
}

[data-theme="dark"] .name-variation-suggestion .suggestion-add-btn:hover {
    background: #22c55e;
}

[data-theme="dark"] .name-variation-suggestion .suggestion-skip-btn {
    border-color: #fcd34d;
    color: #fcd34d;
}

[data-theme="dark"] .name-variation-suggestion .suggestion-skip-btn:hover {
    background: rgba(252, 211, 77, 0.1);
}


/* Fortschrittsanzeige + Monatsbilanz (Dienstplantool) - Dark Mode */
[data-theme="dark"] .progress-steps-bar {
    background-color: #0f172a;
    border-bottom-color: #334155;
}

[data-theme="dark"] .progress-step::before,
[data-theme="dark"] .progress-step-dot {
    background-color: #334155;
}

[data-theme="dark"] .progress-step-dot {
    color: #94a3b8;
}

[data-theme="dark"] .progress-step.is-done::before,
[data-theme="dark"] .progress-step.is-active::before {
    background-color: #10b981;
}

[data-theme="dark"] .progress-step.is-active .progress-step-dot,
[data-theme="dark"] .progress-step.is-done .progress-step-dot {
    color: #ffffff;
}

[data-theme="dark"] .achievements-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .achievement-tile {
    background-color: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .achievement-label,
[data-theme="dark"] .achievement-note {
    color: #cbd5e1;
}

[data-theme="dark"] .achievement-tier.tier-bronze,
[data-theme="dark"] .achievement-tier.tier-gold {
    color: #fcd34d;
}

[data-theme="dark"] .achievement-tier.tier-silber {
    color: #cbd5e1;
}


/* Form check / checkboxes in dienstplantool */
[data-theme="dark"] .form-check {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0;
}

[data-theme="dark"] .form-check:hover {
    background-color: #334155 !important;
    border-color: #64748b !important;
}

[data-theme="dark"] .form-check-label {
    color: #e2e8f0 !important;
}

/* Options changed hint */
[data-theme="dark"] .options-changed-hint {
    background: #422006 !important;
    border-color: #92400e !important;
    color: #fcd34d !important;
}

/* Autocomplete dropdowns */
[data-theme="dark"] .autocomplete {
    background: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .autocomplete div,
[data-theme="dark"] .autocomplete li {
    color: #e2e8f0;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .autocomplete div:hover,
[data-theme="dark"] .autocomplete li:hover {
    background-color: #334155 !important;
    color: #60a5fa !important;
}

/* Dienstliste */
[data-theme="dark"] .dienstliste li {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0;
}

[data-theme="dark"] .dienstliste li:hover {
    background-color: #334155 !important;
}

/* Dienstcounter */
[data-theme="dark"] #dienstcounter b u {
    color: #f1f5f9 !important;
    border-bottom-color: #60a5fa !important;
}

[data-theme="dark"] #ul_dienstcounter li {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0;
}

/* Email Popup */
[data-theme="dark"] #emailPopup {
    background: #1e293b !important;
}

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

[data-theme="dark"] #emailPopup input {
    background-color: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] #emailPopup button.cancel {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Selected names (tags) */
[data-theme="dark"] .selected {
    background-color: #1e3a5f !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* Kollege info */
[data-theme="dark"] .kollege-info {
    background-color: #422006 !important;
    border-left-color: #f59e0b !important;
    color: #fcd34d;
}

/* =====================================================
   NAVIGATION & GLOBAL ELEMENTS
   ===================================================== */

/* Navbar */
[data-theme="dark"] .navbar {
    background-color: #1e293b !important;
    border-bottom-color: #475569;
}

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

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

[data-theme="dark"] .navbar-nav .nav-link:hover,
[data-theme="dark"] .navbar-nav .nav-link.active {
    color: #60a5fa !important;
}

[data-theme="dark"] .navbar-toggler {
    border-color: #475569;
}

[data-theme="dark"] .navbar-toggler-icon {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Alert info boxes */
[data-theme="dark"] .alert.alert-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .alert.alert-info strong {
    color: #bfdbfe !important;
}

/* Bg-opacity classes */
[data-theme="dark"] .bg-opacity-75 {
    background-color: #1e293b !important;
}

/* Inline styles override - force text color on elements with background */
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background-color: #f8fafc"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background-color:#f8fafc"] {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background-color:white"] {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

/* =====================================================
   SUGGESTIONS DROPDOWN (new_op.php, edit.php)
   ===================================================== */

[data-theme="dark"] #suggestions,
[data-theme="dark"] #suggestions2 {
    background: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] #suggestions .suggestion-item-op,
[data-theme="dark"] #suggestions2 .suggestion-item {
    color: #e2e8f0;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] #suggestions .suggestion-item-op:hover,
[data-theme="dark"] #suggestions2 .suggestion-item:hover {
    background: #334155 !important;
}

/* =====================================================
   FULLCALENDAR (Assistenten Module)
   ===================================================== */

/* Calendar container */
[data-theme="dark"] .fc {
    --fc-page-bg-color: #1e293b;
    --fc-neutral-bg-color: #334155;
    --fc-border-color: #475569;
    --fc-button-text-color: #f1f5f9;
    --fc-button-bg-color: #3b82f6;
    --fc-button-border-color: #3b82f6;
    --fc-button-hover-bg-color: #2563eb;
    --fc-button-hover-border-color: #2563eb;
    --fc-button-active-bg-color: #1d4ed8;
    --fc-button-active-border-color: #1d4ed8;
    --fc-today-bg-color: rgba(96, 165, 250, 0.15);
    --fc-list-event-hover-bg-color: #334155;
}

/* Calendar day cells */
[data-theme="dark"] .fc-daygrid-day,
[data-theme="dark"] .fc-timegrid-slot {
    background-color: #1e293b;
}

[data-theme="dark"] .fc-day-today {
    background-color: rgba(96, 165, 250, 0.15) !important;
}

[data-theme="dark"] .fc-day-other {
    background-color: #0f172a !important;
}

/* Calendar header */
[data-theme="dark"] .fc-col-header-cell {
    background-color: #334155;
}

[data-theme="dark"] .fc-col-header-cell-cushion {
    color: #e2e8f0;
}

/* Day numbers */
[data-theme="dark"] .fc-daygrid-day-number {
    color: #e2e8f0;
}

/* List view */
[data-theme="dark"] .fc-list {
    background-color: #1e293b;
}

[data-theme="dark"] .fc-list-day-cushion {
    background-color: #334155 !important;
    color: #f1f5f9;
}

[data-theme="dark"] .fc-list-event:hover td {
    background-color: #334155 !important;
}

[data-theme="dark"] .fc-list-event-time,
[data-theme="dark"] .fc-list-event-title {
    color: #e2e8f0;
}

/* Calendar buttons */
[data-theme="dark"] .fc .fc-button {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

[data-theme="dark"] .fc .fc-button:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

[data-theme="dark"] .fc .fc-button-primary:not(:disabled).fc-button-active,
[data-theme="dark"] .fc .fc-button-primary:not(:disabled):active {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Toolbar title */
[data-theme="dark"] .fc-toolbar-title {
    color: #f8fafc;
}

/* =====================================================
   ASSISTENTEN MODULE
   ===================================================== */

/* Topic containers */
[data-theme="dark"] .topic-container {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .topic-container:hover {
    background-color: #334155 !important;
    border-color: #64748b !important;
}

[data-theme="dark"] .topic {
    color: #e2e8f0;
}

/* Custom popups */
[data-theme="dark"] .custom-popup,
[data-theme="dark"] #customPopup,
[data-theme="dark"] #customConfirmPopup,
[data-theme="dark"] .customConfirmPopup,
[data-theme="dark"] #infoPopup,
[data-theme="dark"] #responsePopup {
    background: #1e293b !important;
    border: 1px solid #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .custom-popup h5,
[data-theme="dark"] #customPopup h5,
[data-theme="dark"] #infoPopup h5 {
    color: #f8fafc;
}

/* Alert inside popups */
[data-theme="dark"] .custom-popup .alert-light,
[data-theme="dark"] #customPopup .alert-light,
[data-theme="dark"] #infoPopup .alert-light {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0;
}

/* Legacy popup */
[data-theme="dark"] #popup_kalender.popup,
[data-theme="dark"] #popup.popup {
    background-color: #1e293b !important;
}

[data-theme="dark"] #popup_kalender .popup-content,
[data-theme="dark"] #popup .popup-content {
    background-color: #1e293b !important;
    color: #e2e8f0;
}

[data-theme="dark"] #popup_kalender h2,
[data-theme="dark"] #popup h5 {
    color: #f8fafc;
}

/* Custom overlay */
[data-theme="dark"] #customOverlay {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Close button for popups */
[data-theme="dark"] .close_kalender {
    color: #94a3b8;
}

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

/* Tooltips */
[data-theme="dark"] .tooltip .tooltip-inner {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #1e293b !important;
}

/* Card header bg-light */
[data-theme="dark"] .card-header.bg-light {
    background-color: #334155 !important;
    color: #f1f5f9;
}

[data-theme="dark"] .card-header.bg-light h5 {
    color: #f8fafc;
}

/* Topics list button styling */
[data-theme="dark"] .topics-list .btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* =====================================================
   DIENSTPLANTOOL CALENDAR - ADDITIONAL FIXES
   ===================================================== */

/* Dienst events on calendar */
[data-theme="dark"] .calendar-dienst {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Multi-day events */
[data-theme="dark"] .calendar-dienst.multi-day {
    background: #7c3aed;
}

[data-theme="dark"] .calendar-dienst.multi-day-start::after,
[data-theme="dark"] .calendar-dienst.multi-day-end::before {
    background: #7c3aed;
}

/* Frei nach Dienst events */
[data-theme="dark"] .calendar-dienst.frei-nach-dienst {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Calendar loading */
[data-theme="dark"] .calendar-loading {
    color: #e2e8f0;
}

/* Dienst modal info rows */
[data-theme="dark"] .modal-info-row {
    color: #e2e8f0;
}

[data-theme="dark"] .modal-info-icon {
    color: #60a5fa;
}

/* =====================================================
   LIST GROUP ITEMS (Downloads, etc.)
   ===================================================== */

[data-theme="dark"] .list-group-item {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

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

[data-theme="dark"] .list-group-item .text-muted {
    color: #94a3b8 !important;
}

/* =====================================================
   BORDER-TOP/BOTTOM STYLING
   ===================================================== */

[data-theme="dark"] .border-top {
    border-top-color: #475569 !important;
}

[data-theme="dark"] .border-bottom {
    border-bottom-color: #475569 !important;
}

/* =====================================================
   OFFCANVAS NAVIGATION (visitor_id_check.php)
   ===================================================== */

/* Offcanvas menu background and text */
[data-theme="dark"] .offcanvas {
    background-color: #1e293b !important;
    color: #e2e8f0;
}

[data-theme="dark"] .offcanvas-header {
    background-color: #1e293b !important;
    border-bottom-color: #475569 !important;
}

[data-theme="dark"] .offcanvas-title {
    color: #60a5fa !important;
}

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

/* Navigation links inside offcanvas */
[data-theme="dark"] .offcanvas .nav-link {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .offcanvas .nav-link:hover {
    background-color: #334155 !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .offcanvas .nav-link.btn-light {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .offcanvas .nav-link.btn-light:hover {
    background-color: #475569 !important;
    color: #60a5fa !important;
}

/* Navbar (fixed top) */
[data-theme="dark"] .navbar.bg-white {
    background-color: #1e293b !important;
    border-bottom-color: #475569;
}

[data-theme="dark"] .navbar-brand .text-primary {
    color: #60a5fa !important;
}

/* =====================================================
   ALERT-LIGHT (Accordion content, steps, etc.)
   ===================================================== */

[data-theme="dark"] .alert-light,
[data-theme="dark"] .alert.alert-light {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .alert-light h6,
[data-theme="dark"] .alert-light strong {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .alert-light span {
    color: #e2e8f0 !important;
}

/* =====================================================
   CARD-FOOTER BG-LIGHT
   ===================================================== */

[data-theme="dark"] .card-footer.bg-light {
    background-color: #334155 !important;
    color: #cbd5e1;
}

[data-theme="dark"] .card-footer.bg-light .text-muted {
    color: #94a3b8 !important;
}

/* =====================================================
   HR DIVIDERS
   ===================================================== */

[data-theme="dark"] hr {
    border-color: #475569 !important;
    opacity: 1;
}

/* =====================================================
   Dark Mode Toggle in Navigation Menu
   ===================================================== */

.dark-mode-toggle-menu {
    cursor: pointer;
    width: 100%;
}

/* Light mode: show moon icon and "Dark Mode" text */
.dark-mode-toggle-menu .bi-sun-fill,
.dark-mode-toggle-menu .dark-mode-label-light {
    display: none;
}

.dark-mode-toggle-menu .bi-moon-fill,
.dark-mode-toggle-menu .dark-mode-label-dark {
    display: inline;
}

/* Dark mode: show sun icon and "Light Mode" text */
[data-theme="dark"] .dark-mode-toggle-menu .bi-moon-fill,
[data-theme="dark"] .dark-mode-toggle-menu .dark-mode-label-dark {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle-menu .bi-sun-fill,
[data-theme="dark"] .dark-mode-toggle-menu .dark-mode-label-light {
    display: inline;
}

/* Dark mode styling - golden sun icon */
[data-theme="dark"] .dark-mode-toggle-menu {
    border-color: #fbbf24;
    color: #fbbf24;
}

[data-theme="dark"] .dark-mode-toggle-menu:hover {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fbbf24;
}

/* =====================================================
   FEEDBACK MODULE - Table and Card Headers
   ===================================================== */

/* Card headers with bg-light should be dark */
[data-theme="dark"] .card-header.bg-light {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-bottom-color: #475569 !important;
}

/* Table headers with table-light */
[data-theme="dark"] .table-light,
[data-theme="dark"] thead.table-light,
[data-theme="dark"] .table-light th,
[data-theme="dark"] thead.table-light th {
    background-color: #2d3339 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

/* Sticky table header fix */
[data-theme="dark"] thead.sticky-top th {
    background-color: #2d3339 !important;
}

/* Sortable header hover in dark mode */
[data-theme="dark"] th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Accordion in feedback module */
[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #334155;
    color: #60a5fa;
}

/* =====================================================
   Feedback Popup (index.php) - IMPROVED
   ===================================================== */

/* Feedback Options */
[data-theme="dark"] .feedback-option label.btn-outline-success,
[data-theme="dark"] .feedback-option label.btn-outline-primary,
[data-theme="dark"] .feedback-option label.btn-outline-warning,
[data-theme="dark"] .feedback-option label.btn-outline-danger {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .feedback-option label.btn-outline-success:hover,
[data-theme="dark"] .feedback-option label.btn-outline-primary:hover,
[data-theme="dark"] .feedback-option label.btn-outline-warning:hover,
[data-theme="dark"] .feedback-option label.btn-outline-danger:hover {
    background-color: #334155 !important;
    transform: translateY(-2px);
    border-color: #64748b !important;
}

/* Checked States - Stronger specificity */
[data-theme="dark"] .btn-check:checked+label.btn-outline-success {
    background-color: rgba(34, 197, 94, 0.2) !important;
    border-color: #22c55e !important;
    color: #86efac !important;
}

[data-theme="dark"] .btn-check:checked+label.btn-outline-primary {
    background-color: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .btn-check:checked+label.btn-outline-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    border-color: #f59e0b !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .btn-check:checked+label.btn-outline-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

/* Ensure icons inherit color properly in all states */
[data-theme="dark"] .feedback-option label i {
    color: inherit !important;
}

/* Text Colors in Options */
[data-theme="dark"] .feedback-option .fw-semibold {
    color: #f8fafc;
}

[data-theme="dark"] .feedback-option .opacity-75 {
    color: #cbd5e1 !important;
    opacity: 0.9 !important;
}

/* Input Fields in Modal */
[data-theme="dark"] #feedbackModal .form-control,
[data-theme="dark"] #feedbackModal .input-group-text {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] #feedbackModal .form-control::placeholder {
    color: #94a3b8;
}

/* Modal Specific Overrides */
[data-theme="dark"] #feedbackModal label.text-dark,
[data-theme="dark"] #feedbackModal .fw-bold.text-dark {
    color: #f1f5f9 !important;
}

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

[data-theme="dark"] #feedbackModal .modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%) !important;
}

/* =====================================================
   TAGESSPIEGEL MODULE
   ===================================================== */

/* Document Viewer */
[data-theme="dark"] .doc-viewer-container {
    background-color: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .doc-viewer-container .doc-content {
    color: #e2e8f0;
}

[data-theme="dark"] .doc-viewer-container .doc-content table td,
[data-theme="dark"] .doc-viewer-container .doc-content table th {
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .doc-no-preview {
    color: #e2e8f0;
}

[data-theme="dark"] .doc-no-preview i {
    color: #64748b;
}

/* File Info Badge */
[data-theme="dark"] .file-info-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

/* Calendar */
[data-theme="dark"] .calendar-wrapper {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .calendar-header {
    background: #334155;
    border-bottom-color: #475569;
}

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

[data-theme="dark"] .calendar-nav-btn {
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .calendar-nav-btn:hover {
    background: #475569;
    border-color: #60a5fa;
    color: #60a5fa;
}

[data-theme="dark"] .calendar-day-label {
    color: #64748b;
}

[data-theme="dark"] .calendar-day {
    color: #94a3b8;
}

[data-theme="dark"] .calendar-day.other-month {
    color: #475569;
}

[data-theme="dark"] .calendar-day.has-file {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

[data-theme="dark"] .calendar-day.has-file:hover {
    background: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .calendar-day.active {
    background: #3b82f6;
    color: #fff !important;
}

[data-theme="dark"] .calendar-day.today {
    border-color: #60a5fa;
}

[data-theme="dark"] .calendar-day.has-file::after {
    background: #60a5fa;
}

/* Upload Drop Area (extends existing .drop-area dark rules) */
[data-theme="dark"] .upload-progress-wrapper .progress {
    background-color: #334155;
}

[data-theme="dark"] .upload-icon {
    color: #60a5fa !important;
}

[data-theme="dark"] .file-info-badge[style*="background: #fef3c7"] {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
/* ======= Party Popup - Dark Mode ======= */
[data-theme="dark"] .party-popup {
    background: #1e293b;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .party-popup-date-badge {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.3);
    color: #fb923c;
}

[data-theme="dark"] .party-popup-text {
    color: #94a3b8;
}

[data-theme="dark"] .party-popup-btn-secondary {
    color: #475569;
}

[data-theme="dark"] .party-popup-btn-secondary:hover {
    color: #64748b;
}

/* =====================================================
   VIEW DIENSTPLAN PAGE
   ===================================================== */
[data-theme="dark"] .dp-viewer-card {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .dp-viewer-header .dp-title {
    color: #f8fafc;
}

[data-theme="dark"] .dp-sheet-tab {
    color: #94a3b8;
}

[data-theme="dark"] .dp-sheet-tab:hover {
    background: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .dp-sheet-tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
    background: #2563eb1f;
}

[data-theme="dark"] .dp-table-wrapper {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .dp-table th,
[data-theme="dark"] .dp-table td {
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .dp-table thead th {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    color: #f8fafc;
    border-bottom-color: #64748b;
}

[data-theme="dark"] .dp-table tbody tr:hover td,
[data-theme="dark"] .dp-table tbody tr:hover th {
    background-color: #334155 !important;
}

[data-theme="dark"] .dp-table tbody tr:nth-child(even) td,
[data-theme="dark"] .dp-table tbody tr:nth-child(even) th:not(:first-child) {
    background-color: #1e293b;
}

[data-theme="dark"] .dp-table tbody tr:nth-child(odd) td,
[data-theme="dark"] .dp-table tbody tr:nth-child(odd) th:not(:first-child) {
    background-color: #0f172a;
}

[data-theme="dark"] .dp-table tbody td:first-child,
[data-theme="dark"] .dp-table thead th:first-child {
    background: #1e293b;
    border-right-color: #64748b;
    color: #f1f5f9;
}

[data-theme="dark"] .dp-table .dp-weekend {
    background-color: #78350f !important;
    color: #fef3c7 !important;
}

[data-theme="dark"] .dp-table thead .dp-weekend {
    background: linear-gradient(180deg, #92400e 0%, #78350f 100%) !important;
}

[data-theme="dark"] .dp-search-highlight td {
    background-color: rgba(6, 95, 70, 0.5) !important;
    color: #d1fae5 !important;
}

[data-theme="dark"] .dp-info {
    color: #94a3b8;
}

[data-theme="dark"] .dp-cell-colored {
    color: #0f172a !important;
}

[data-theme="dark"] .wizard-info-box {
    background: #1e293b !important;
    color: #93c5fd !important;
}

/* =====================================================
   TICKETSYSTEM - Modal (visitor_id_check.php)
   ===================================================== */

/* Modal body / header */
[data-theme="dark"] #ticketModal .modal-body.bg-light {
    background-color: #1e293b !important;
}

[data-theme="dark"] #ticketModal .modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%) !important;
}

[data-theme="dark"] #ticketModal label.text-dark,
[data-theme="dark"] #ticketModal .fw-bold.text-dark {
    color: #f1f5f9 !important;
}

/* Inputs */
[data-theme="dark"] #ticketModal .form-control,
[data-theme="dark"] #ticketModal .input-group-text {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] #ticketModal .form-control::placeholder {
    color: #94a3b8;
}

[data-theme="dark"] #ticketModal .input-group-text {
    background-color: #334155 !important;
}

[data-theme="dark"] #ticketModal .input-group-text i {
    color: #94a3b8;
}

/* Typ-Auswahl (Bug / Feature) - unchecked */
[data-theme="dark"] #ticketModal label.btn-outline-danger,
[data-theme="dark"] #ticketModal label.btn-outline-primary {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] #ticketModal label.btn-outline-danger:hover,
[data-theme="dark"] #ticketModal label.btn-outline-primary:hover {
    background-color: #3f4d63 !important;
    border-color: #64748b !important;
}

/* Typ-Auswahl - checked */
[data-theme="dark"] #ticketModal .btn-check:checked + label.btn-outline-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] #ticketModal .btn-check:checked + label.btn-outline-primary {
    background-color: rgba(59, 130, 246, 0.25) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* Icons erben Farbe in jedem Zustand */
[data-theme="dark"] #ticketModal label.btn i {
    color: inherit !important;
}

/* =====================================================
   Globales Live-Vortrag-Banner (include/live_banner.php)
   ===================================================== */
[data-theme="dark"] #globalLiveBanner {
    background: #1e293b;
    color: #f1f5f9;
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #globalLiveBanner .glb-text strong {
    color: #f8fafc;
}

[data-theme="dark"] #globalLiveBanner .glb-text .glb-topic {
    color: #cbd5e1;
    opacity: 1;
}
