:root {
            --primary-color: #6366f1;
            --primary-light: #818cf8;
            --primary-dark: #4f46e5;
            --secondary-color: #8b5cf6;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color: #ef4444;
            --info-color: #3b82f6;
            --dark-color: #1f2937;
            --text-muted-custom: #6b7280;
            --light-bg: #f9fafb;
            --body-gradient-end: #e0e7ff;
            --card-bg: #ffffff;
            --border-subtle: #e5e7eb;
            --border-radius: 20px;
            --border-radius-sm: 14px;
            --border-radius-lg: 24px;
            --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.06);
            --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        html {
            color-scheme: light;
        }

        html[data-theme="dark"] {
            color-scheme: dark;
        }

        * {
            transition: var(--transition);
        }

        body {
            background: linear-gradient(135deg, var(--light-bg) 0%, var(--body-gradient-end) 100%);
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            min-height: 100vh;
            color: var(--dark-color);
        }

        /* Botão flutuante de tema na tela de login */
        .login-theme-toggle {
            border: 2px solid rgba(255, 255, 255, 0.85) !important;
            background: rgba(255, 255, 255, 0.2) !important;
            backdrop-filter: blur(10px);
            color: #fff !important;
        }
        .login-theme-toggle:hover {
            background: rgba(255, 255, 255, 0.32) !important;
            border-color: #fff !important;
        }

        .navbar {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            box-shadow: var(--shadow-md);
            backdrop-filter: blur(10px);
            border: none;
            padding: 1rem 0;
            position: relative;
            z-index: 1030;
        }

        .navbar-brand {
            font-weight: 700;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .navbar-brand i {
            font-size: 2rem;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
        }

        .btn {
            border-radius: var(--border-radius-sm);
            font-weight: 600;
            padding: 0.625rem 1.5rem;
            border: none;
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        }

        .btn-success {
            background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
        }

        .btn-warning {
            background: linear-gradient(135deg, var(--warning-color) 0%, #fbbf24 100%);
        }

        .btn-danger {
            background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
        }

        .btn-info {
            background: linear-gradient(135deg, var(--info-color) 0%, #60a5fa 100%);
        }

        .bg-orange {
            background-color: #f97316 !important;
        }

        .btn-outline-light {
            border: 2px solid rgba(255, 255, 255, 0.8);
            background: transparent;
        }

        .btn-outline-light:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: white;
        }

        .sidebar {
            background: var(--card-bg);
            min-height: calc(100vh - 76px);
            border-radius: 0 var(--border-radius) var(--border-radius) 0;
            padding: 1.5rem 1rem;
            box-shadow: var(--shadow-md);
            position: sticky;
            top: 76px;
            height: calc(100vh - 76px);
            overflow-y: auto;
        }

        @media (max-width: 991px) {
            .sidebar {
                position: fixed;
                left: -320px;
                top: 76px;
                bottom: 0;
                z-index: 1020;
                width: 280px;
                max-width: 85vw;
                min-height: auto;
                height: calc(100vh - 76px);
                overflow-y: auto;
                transition: left 0.3s ease;
                border-radius: 0;
                box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
            }
            body.sidebar-open .sidebar {
                left: 0;
            }
            .sidebar-overlay {
                display: none;
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, 0.4);
                z-index: 1019;
                top: 76px;
            }
            body.sidebar-open .sidebar-overlay {
                display: block;
            }
        }

        .sidebar .nav-link {
            color: var(--dark-color);
            padding: 0.875rem 1.25rem;
            border-radius: var(--border-radius-sm);
            margin: 0.375rem 0;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            transition: var(--transition);
        }

        .sidebar .nav-link i {
            font-size: 1.25rem;
            width: 24px;
            text-align: center;
        }

        .sidebar .nav-link:hover {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
            color: var(--primary-color);
            transform: translateX(4px);
        }

        .sidebar .nav-link.active {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .card {
            border: none;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-md);
            overflow: hidden;
            background: var(--card-bg);
        }

        .card-header {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
            border-bottom: 2px solid rgba(99, 102, 241, 0.1);
            padding: 1.25rem 1.5rem;
            font-weight: 600;
        }

        .stat-card {
            border: none;
            border-radius: var(--border-radius);
            transition: var(--transition);
            overflow: hidden;
            position: relative;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: linear-gradient(180deg, var(--accent-color) 0%, transparent 100%);
        }

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

        .stat-card.primary {
            --accent-color: var(--primary-color);
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
        }

        .stat-card.success {
            --accent-color: var(--success-color);
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
        }

        .stat-card.warning {
            --accent-color: var(--warning-color);
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
        }

        .stat-card.danger {
            --accent-color: var(--danger-color);
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
        }

        .stat-card.info {
            --accent-color: var(--info-color);
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
        }

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

        .stat-card h6 {
            color: var(--text-muted-custom);
            font-size: 0.875rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.5rem;
        }

        .stat-card h2, .stat-card h3 {
            color: var(--dark-color);
            font-weight: 700;
            margin-bottom: 0.25rem;
        }

        .stat-card small {
            color: #9ca3af;
            font-size: 0.875rem;
        }

        .badge {
            border-radius: var(--border-radius-sm);
            padding: 0.5rem 1rem;
            font-weight: 600;
            font-size: 0.875rem;
        }

        .badge-priority {
            padding: 0.375rem 0.875rem;
            font-size: 0.75rem;
        }

        .table {
            border-radius: var(--border-radius);
            overflow: hidden;
        }

        .table thead {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
        }

        .table thead th {
            border: none;
            color: var(--dark-color);
            font-weight: 700;
            padding: 1rem 1.5rem;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.05em;
        }

        .table tbody tr {
            transition: var(--transition);
        }

        .table tbody tr:hover {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
            transform: scale(1.01);
        }

        .table tbody td {
            padding: 1rem 1.5rem;
            vertical-align: middle;
            border-bottom: 1px solid var(--border-subtle);
        }

        .form-control, .form-select {
            border-radius: var(--border-radius-sm);
            border: 2px solid var(--border-subtle);
            padding: 0.75rem 1rem;
            transition: var(--transition);
        }

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

        .form-label {
            font-weight: 600;
            color: var(--dark-color);
            margin-bottom: 0.5rem;
        }

        .modal-content {
            border: none;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-lg);
        }

        .modal-header {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
            border-bottom: 2px solid rgba(99, 102, 241, 0.1);
            border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
            padding: 1.5rem;
        }

        .modal-title {
            font-weight: 700;
            color: var(--dark-color);
        }

        .modal-footer {
            border-top: 2px solid rgba(0, 0, 0, 0.05);
            padding: 1.25rem 1.5rem;
        }

        .alert {
            border: none;
            border-radius: var(--border-radius);
            padding: 1rem 1.25rem;
            box-shadow: var(--shadow-sm);
        }

        .alert-info {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
            color: var(--info-color);
            border-left: 4px solid var(--info-color);
        }

        .alert-danger {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
            color: var(--danger-color);
            border-left: 4px solid var(--danger-color);
        }

        .nav-tabs {
            border: none;
            gap: 0.5rem;
        }

        .nav-tabs .nav-link {
            border: none;
            border-radius: var(--border-radius-sm);
            color: #6b7280;
            font-weight: 600;
            padding: 0.75rem 1.5rem;
        }

        .nav-tabs .nav-link:hover {
            background: rgba(99, 102, 241, 0.1);
            color: var(--primary-color);
        }

        .nav-tabs .nav-link.active {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .list-group-item {
            border: none;
            border-radius: var(--border-radius-sm);
            margin-bottom: 0.5rem;
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
        }

        .list-group-item:hover {
            transform: translateX(4px);
            box-shadow: var(--shadow-md);
        }

        .input-group-text {
            border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
            border: 2px solid #e5e7eb;
            border-right: none;
            background: #f9fafb;
        }

        .input-group .form-control {
            border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
            border-left: none;
        }

        .item-card {
            transition: var(--transition);
        }

        .item-card:hover {
            box-shadow: var(--shadow-lg);
        }

        h2, h5, h6 {
            color: var(--dark-color);
            font-weight: 700;
        }

        small.text-muted {
            color: #9ca3af !important;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .card, .stat-card {
            animation: fadeInUp 0.5s ease-out;
        }

        .bg-primary {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
        }

        .bg-success {
            background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%) !important;
        }

        .bg-warning {
            background: linear-gradient(135deg, var(--warning-color) 0%, #fbbf24 100%) !important;
        }

        .bg-info {
            background: linear-gradient(135deg, var(--info-color) 0%, #60a5fa 100%) !important;
        }

        .bg-danger {
            background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%) !important;
        }

        .text-white {
            color: white !important;
        }

        .form-check-input:checked {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }

        .form-control-color {
            border-radius: var(--border-radius-sm);
            height: 45px;
            border: 2px solid #e5e7eb;
        }

        #user-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(255, 255, 255, 0.15);
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius-sm);
            backdrop-filter: blur(10px);
        }

        .table-responsive {
            border-radius: var(--border-radius);
            overflow-x: auto;
            overflow-y: visible;
            -webkit-overflow-scrolling: touch;
        }

        .notification-dropdown {
            width: 350px;
            max-height: 450px;
            overflow-y: auto;
            position: absolute;
            top: 100% !important;
            right: 0 !important;
            left: auto !important;
            margin-top: 0.5rem;
            z-index: 9999;
            box-shadow: var(--shadow-lg);
            border-radius: var(--border-radius);
        }

        .notification-item {
            padding: 12px;
            border-bottom: 1px solid #dee2e6;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .notification-item:hover {
            background-color: #f8f9fa;
        }

        .notification-item.unread {
            background-color: #e7f3ff;
        }

        .notification-item.unread:hover {
            background-color: #d0e7ff;
        }

        .notification-item p {
            font-size: 0.9rem;
            color: #495057;
        }

        .dropdown-header {
            position: sticky;
            top: 0;
            background: white;
            z-index: 1;
            border-bottom: 1px solid #dee2e6;
        }

        #notifications-list {
            max-height: 350px;
            overflow-y: auto;
        }

        .timeline {
            position: relative;
            padding: 20px 0;
        }

        .timeline::before {
            content: '';
            position: absolute;
            left: 20px;
            top: 0;
            bottom: 0;
            width: 2px;
            background: #dee2e6;
        }

        .timeline-item {
            position: relative;
            padding-left: 50px;
            margin-bottom: 20px;
        }

        .timeline-marker {
            position: absolute;
            left: 0;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .timeline-content {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 12px;
        }

        /* Toasts Modernos */
        .custom-toast {
            min-width: 320px;
            max-width: 420px;
            background: white;
            border-radius: 16px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
            border: none;
            overflow: hidden;
            animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOutRight {
            from {
                transform: translateX(0);
                opacity: 1;
            }
            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        .custom-toast.hiding {
            animation: slideOutRight 0.3s ease-in forwards;
        }

        .custom-toast .toast-header {
            background: transparent;
            border-bottom: none;
            padding: 1rem 1rem 0.5rem 1rem;
        }

        .custom-toast .toast-body {
            padding: 0.5rem 1rem 1rem 1rem;
            font-size: 0.95rem;
            color: #374151;
        }

        .custom-toast .toast-icon {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            margin-right: 12px;
        }

        .custom-toast.toast-success .toast-icon {
            background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
            color: white;
        }

        .custom-toast.toast-error .toast-icon {
            background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
            color: white;
        }

        .custom-toast.toast-warning .toast-icon {
            background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
            color: white;
        }

        .custom-toast.toast-info .toast-icon {
            background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
            color: white;
        }

        .custom-toast .toast-title {
            font-weight: 700;
            font-size: 1rem;
            color: #1f2937;
            margin: 0;
        }

        .custom-toast .btn-close {
            opacity: 0.5;
            transition: opacity 0.2s ease;
        }

        .custom-toast .btn-close:hover {
            opacity: 1;
        }

        .custom-toast .toast-progress {
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            border-radius: 0 0 16px 16px;
            animation: progressShrink 5s linear forwards;
        }

        @keyframes progressShrink {
            from { width: 100%; }
            to { width: 0%; }
        }

        /* Marca d'água */
        .watermark {
            position: fixed;
            bottom: 20px;
            right: 20px;
            font-size: 0.75rem;
            color: #6b7280;
            opacity: 0.75;
            z-index: 999;
            pointer-events: none;
            user-select: none;
            font-weight: 500;
            text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
            background: rgba(255, 255, 255, 0.5);
            padding: 0.375rem 0.75rem;
            border-radius: 6px;
            backdrop-filter: blur(4px);
            transition: opacity 0.3s ease;
        }

        .watermark.hidden {
            opacity: 0;
            visibility: hidden;
        }

        @media (max-width: 768px) {
            .watermark {
                font-size: 0.65rem;
                bottom: 10px;
                right: 10px;
                padding: 0.25rem 0.5rem;
            }
        }

        @media print {
            .watermark {
                display: none;
            }
        }

        /* Responsividade adicional */
        @media (max-width: 576px) {
            .btn-group-vertical.btn-group-sm .btn {
                font-size: 0.75rem;
                padding: 0.25rem 0.5rem;
            }

            .card-body {
                padding: 1rem !important;
            }

            .table-sm td, .table-sm th {
                padding: 0.5rem;
                font-size: 0.875rem;
            }

            .badge {
                font-size: 0.7rem;
                padding: 0.25rem 0.5rem;
            }

            h2 {
                font-size: 1.5rem;
            }

            .stat-card h3 {
                font-size: 1.5rem;
            }
        }

        @media (max-width: 768px) {
            .navbar-brand {
                font-size: 1.1rem;
            }

            #user-info {
                font-size: 0.8rem;
                padding: 0.35rem 0.5rem;
            }

            #dashboard-content,
            [id$="-content"] {
                padding: 0.75rem !important;
                overflow-x: hidden;
            }
        }

        @media (max-width: 576px) {
            .navbar .dropdown-menu {
                min-width: 280px;
                max-width: calc(100vw - 2rem);
            }
        }

        .bg-gradient-primary {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        }

        .bg-gradient-success {
            background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
        }

        .bg-gradient-info {
            background: linear-gradient(135deg, var(--info-color) 0%, #60a5fa 100%);
        }

        .supplier-card {
            border-left: 4px solid var(--success-color);
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .supplier-card:hover {
            transform: translateX(4px);
            box-shadow: var(--shadow-md);
            background: rgba(16, 185, 129, 0.05);
        }

        .supplier-card.selected {
            background: rgba(16, 185, 129, 0.1);
            border-left-color: var(--primary-color);
        }

        /* ========== Modo escuro (complementa data-bs-theme="dark" do Bootstrap) ========== */
        html[data-theme="dark"] {
            --dark-color: #f1f5f9;
            --text-muted-custom: #94a3b8;
            --light-bg: #0f172a;
            --body-gradient-end: #1e1b4b;
            --card-bg: #1e293b;
            --border-subtle: rgba(148, 163, 184, 0.22);
            --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
            --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
            --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
        }

        html[data-theme="dark"] body {
            color: var(--dark-color);
        }

        html[data-theme="dark"] .navbar {
            box-shadow: var(--shadow-md);
        }

        html[data-theme="dark"] .sidebar {
            background: var(--card-bg);
            border: 1px solid var(--border-subtle);
        }

        html[data-theme="dark"] .sidebar .nav-link {
            color: #cbd5e1;
        }

        html[data-theme="dark"] .sidebar .nav-link:hover {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
            color: #e0e7ff;
        }

        html[data-theme="dark"] .card {
            background: var(--card-bg);
            border: 1px solid var(--border-subtle);
        }

        html[data-theme="dark"] .card-header {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
            border-bottom-color: var(--border-subtle);
            color: var(--dark-color);
        }

        html[data-theme="dark"] .stat-card.primary {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0.08) 100%);
        }
        html[data-theme="dark"] .stat-card.success {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.06) 100%);
        }
        html[data-theme="dark"] .stat-card.warning {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.06) 100%);
        }
        html[data-theme="dark"] .stat-card.danger {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.06) 100%);
        }
        html[data-theme="dark"] .stat-card.info {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.06) 100%);
        }

        html[data-theme="dark"] .stat-card h2,
        html[data-theme="dark"] .stat-card h3 {
            color: var(--dark-color);
        }

        html[data-theme="dark"] .stat-card small {
            color: var(--text-muted-custom);
        }

        html[data-theme="dark"] .table {
            --bs-table-bg: transparent;
            color: var(--dark-color);
        }

        html[data-theme="dark"] .table thead {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
        }

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

        /* thead.bg-light (abas Configurações): no dark, Bootstrap pode aplicar fundo + texto escuros — cabeçalhos somem */
        html[data-theme="dark"] .table thead.bg-light {
            --bs-table-bg: transparent;
            --bs-table-color: #e2e8f0;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.12) 100%) !important;
            color: #e2e8f0;
        }

        html[data-theme="dark"] .table thead.bg-light th {
            color: #e2e8f0 !important;
            background-color: transparent !important;
            border-color: var(--border-subtle);
        }

        html[data-theme="dark"] .table tbody tr:hover {
            background: rgba(99, 102, 241, 0.08);
        }

        html[data-theme="dark"] .modal-content {
            background-color: var(--card-bg);
            color: var(--dark-color);
            border: 1px solid var(--border-subtle);
        }

        html[data-theme="dark"] .modal-header {
            border-bottom-color: var(--border-subtle);
        }

        html[data-theme="dark"] .modal-title {
            color: var(--dark-color);
        }

        html[data-theme="dark"] .modal-footer {
            border-top-color: var(--border-subtle);
        }

        /* Modal de detalhes: parágrafos com bg-light herdam texto claro do .modal-content; no fundo
           quase branco do Bootstrap (.bg-light) o conteúdo some. Forçar texto escuro nas caixas claras. */
        html[data-theme="dark"] #solicitationDetailModal .bg-light {
            color: #1f2937 !important;
        }

        /* Modal detalhes: inputs com superfície clara e texto escuro (evita texto invisível no tema escuro) */
        html[data-theme="dark"] #solicitationDetailModal .form-control,
        html[data-theme="dark"] #solicitationDetailModal .form-select {
            background-color: #ffffff !important;
            color: #0f172a !important;
            border-color: #94a3b8 !important;
        }

        html[data-theme="dark"] #solicitationDetailModal .form-control:focus,
        html[data-theme="dark"] #solicitationDetailModal .form-select:focus {
            background-color: #ffffff !important;
            color: #0f172a !important;
            border-color: var(--primary-color) !important;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
        }

        html[data-theme="dark"] #solicitationDetailModal .form-control::placeholder {
            color: #64748b !important;
        }

        html[data-theme="dark"] #solicitationDetailModal #detail-comments-section .card.bg-light {
            background-color: #f1f5f9 !important;
            border: 1px solid #cbd5e1 !important;
            color: #0f172a !important;
        }

        html[data-theme="dark"] #solicitationDetailModal #detail-comments-section .card.bg-light .text-muted {
            color: #475569 !important;
        }

        /* Modal criar orçamento / atendimento por estoque — contraste no tema escuro */
        html[data-theme="dark"] #createBudgetModal .modal-content,
        html[data-theme="dark"] #budget-stock-fulfillment-modal .modal-content {
            background-color: var(--card-bg);
            color: var(--dark-color);
            border: 1px solid var(--border-subtle);
        }

        html[data-theme="dark"] #createBudgetModal .form-control,
        html[data-theme="dark"] #createBudgetModal .form-select,
        html[data-theme="dark"] #budget-stock-fulfillment-modal .form-control,
        html[data-theme="dark"] #budget-stock-fulfillment-modal .form-select {
            background-color: #ffffff !important;
            color: #0f172a !important;
            border-color: #94a3b8 !important;
        }

        html[data-theme="dark"] #createBudgetModal .form-control::placeholder,
        html[data-theme="dark"] #budget-stock-fulfillment-modal .form-control::placeholder {
            color: #64748b !important;
        }

        html[data-theme="dark"] #createBudgetModal .card.bg-light,
        html[data-theme="dark"] #createBudgetModal .border.rounded.p-4 {
            background-color: #f1f5f9 !important;
            color: #0f172a !important;
        }

        html[data-theme="dark"] #createBudgetModal .card-header.bg-primary,
        html[data-theme="dark"] #createBudgetModal .alert-success {
            color: inherit;
        }

        html[data-theme="dark"] #createBudgetModal .alert-info {
            background: rgba(59, 130, 246, 0.2) !important;
            border-color: rgba(59, 130, 246, 0.45) !important;
            color: #e0f2fe !important;
        }

        html[data-theme="dark"] #createBudgetModal small.text-muted {
            color: #94a3b8 !important;
        }

        /* Modal atendimento estoque: ficar acima de qualquer backdrop residual */
        #budget-stock-fulfillment-modal.modal.show {
            z-index: 1065;
        }

        body.modal-open:has(#budget-stock-fulfillment-modal.show) .modal-backdrop:last-of-type {
            z-index: 1060;
        }

        #solicitationDetailModal #detail-description,
        #solicitationDetailModal #detail-justification,
        #solicitationDetailModal #detail-observations {
            white-space: pre-wrap;
            word-break: break-word;
        }

        /* Formulário de comprovante: card claro no tema escuro — fundo claro nos campos (evita texto escuro sobre fundo escuro do .form-control global) */
        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form.card {
            background-color: #f1f5f9 !important;
            border: 1px solid #cbd5e1 !important;
        }

        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form .form-label,
        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form h6 {
            color: #0f172a !important;
        }

        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form .form-control,
        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form .form-select {
            background-color: #ffffff !important;
            color: #0f172a !important;
            border-color: #94a3b8 !important;
        }

        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form .form-control:focus,
        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form .form-select:focus {
            border-color: var(--primary-color) !important;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
        }

        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form .form-control::placeholder {
            color: #64748b !important;
        }

        html[data-theme="dark"] #solicitationDetailModal #payment-receipt-form input[type="file"].form-control::file-selector-button {
            background: #e2e8f0;
            color: #0f172a;
            border: 0;
            padding: 0.4rem 0.85rem;
            margin-right: 0.65rem;
            border-radius: 0.35rem;
            font-weight: 600;
        }

        html[data-theme="dark"] .notification-dropdown {
            background: var(--card-bg);
            border: 1px solid var(--border-subtle);
        }

        html[data-theme="dark"] .notification-item {
            border-bottom-color: var(--border-subtle);
        }

        html[data-theme="dark"] .notification-item:hover {
            background-color: rgba(99, 102, 241, 0.1);
        }

        html[data-theme="dark"] .notification-item.unread {
            background-color: rgba(59, 130, 246, 0.15);
        }

        html[data-theme="dark"] .dropdown-header {
            background: var(--card-bg);
            border-bottom-color: var(--border-subtle);
            color: var(--dark-color);
        }

        html[data-theme="dark"] .timeline-content {
            background: #0f172a;
            color: var(--dark-color);
        }

        html[data-theme="dark"] .timeline::before {
            background: var(--border-subtle);
        }

        html[data-theme="dark"] .custom-toast {
            background: var(--card-bg);
            border: 1px solid var(--border-subtle);
        }

        html[data-theme="dark"] .custom-toast .toast-body {
            color: #cbd5e1;
        }

        html[data-theme="dark"] .custom-toast .toast-title {
            color: var(--dark-color);
        }

        html[data-theme="dark"] .watermark {
            color: #94a3b8;
            text-shadow: none;
            background: rgba(15, 23, 42, 0.65);
        }

        html[data-theme="dark"] .nav-tabs .nav-link {
            color: #94a3b8;
        }

        html[data-theme="dark"] .nav-tabs .nav-link:hover {
            color: #c7d2fe;
        }

        html[data-theme="dark"] .input-group-text {
            background: #0f172a;
            border-color: var(--border-subtle);
            color: #94a3b8;
        }

        html[data-theme="dark"] .form-control,
        html[data-theme="dark"] .form-select {
            background-color: #0f172a;
            color: var(--dark-color);
            border-color: var(--border-subtle);
        }

        html[data-theme="dark"] #user-info {
            background: rgba(15, 23, 42, 0.45);
            color: #f8fafc;
        }

        html[data-theme="dark"] small.text-muted {
            color: var(--text-muted-custom) !important;
        }

        html[data-theme="dark"] h2,
        html[data-theme="dark"] h5,
        html[data-theme="dark"] h6 {
            color: var(--dark-color);
        }

        html[data-theme="dark"] .list-group-item {
            background: var(--card-bg);
            color: var(--dark-color);
            border: 1px solid var(--border-subtle);
        }