/**
 * SysEnviCorp - Global Theme Styles
 * Tema: Azul Corporativo Claro (Soft Professional)
 * Tipografia: Plus Jakarta Sans
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Cores de Fundo e Superfície */
    --sys-bg: #f0f4fa;
    --sys-surface: #ffffff;
    --sys-surface-alt: #f8fafc;
    --sys-border: #e2e8f0;

    /* Identidade Visual */
    --sys-navy: #1d4ed8;
    --sys-blue: #1d4ed8;
    --sys-blue-soft: #dbeafe;
    --sys-accent-glow: rgba(37, 99, 235, 0.05);

    /* Cores Semânticas (Status) */
    --sys-green: #10b981;
    --sys-green-soft: #d1fae5;
    --sys-red: #ef4444;
    --sys-red-soft: #fee2e2;
    --sys-orange: #f59e0b;
    --sys-orange-soft: #fef3c7;
    --sys-purple: #8b5cf6;
    --sys-purple-soft: #ede9fe;
    --sys-gray: #64748b;
    --sys-gray-soft: #f1f5f9;

    /* Tipografia e Texto */
    --sys-text-main: #1e293b;
    --sys-text-muted: #475569;
    --sys-text-light: #94a3b8;

    /* Aliases para compatibilidade com Dashboard (--db-*) */
    --db-bg: var(--sys-bg);
    --db-surface: var(--sys-surface);
    --db-surface2: var(--sys-surface-alt);
    --db-border: var(--sys-border);
    --db-text: var(--sys-text-main);
    --db-text2: var(--sys-text-muted);
    --db-text3: var(--sys-text-light);
    --db-accent: var(--sys-blue);
    --db-accent2: #38bdf8;
    --db-accent-glow: var(--sys-accent-glow);
    --db-green: var(--sys-green);
    --db-red: var(--sys-red);
    --db-orange: var(--sys-orange);
    --db-purple: var(--sys-purple);

    /* Paleta Semântica de Módulos (Jewel Tones - v3 Executivo) */
    --mod-sky: #C9A961;
    --mod-sky-rgb: 201, 169, 97;
    --mod-sky-dark: #a88a3e;
    --mod-purple: #9B8AC4;
    --mod-purple-rgb: 155, 138, 196;
    --mod-purple-dark: #7d6aa8;
    --mod-blue: #6C93B8;
    --mod-blue-rgb: 108, 147, 184;
    --mod-blue-dark: #4e759a;
    --mod-violet: #A594C4;
    --mod-violet-rgb: 165, 148, 196;
    --mod-violet-dark: #8774a8;
    --mod-emerald: #4F9E82;
    --mod-emerald-rgb: 79, 158, 130;
    --mod-emerald-dark: #347a62;
    --mod-amber: #C08B4A;
    --mod-amber-rgb: 192, 139, 74;
    --mod-amber-dark: #a06e30;
    --mod-rose: #B4728A;
    --mod-rose-rgb: 180, 114, 138;
    --mod-rose-dark: #965470;
    --mod-cyan: #5FA8A3;
    --mod-cyan-rgb: 95, 168, 163;
    --mod-cyan-dark: #3d8a85;
    --mod-teal: #3D8577;
    --mod-teal-rgb: 61, 133, 119;
    --mod-teal-dark: #236757;
    --mod-slate: #9C958A;
    --mod-slate-rgb: 156, 149, 138;
    --mod-slate-dark: #7e776c;
    --mod-orange: #C17D4B;
    --mod-orange-rgb: 193, 125, 75;
    --mod-orange-dark: #a36030;
}

/* Tema Escuro - variáveis sobrescritas via data-theme no html */
html[data-theme="dark"] {
    /* Cores de Fundo e Superfície */
    --sys-bg: #0d1117;
    --sys-surface: #161b22;
    --sys-surface-alt: #1c2330;
    --sys-border: #30363d;

    /* Identidade Visual */
    --sys-blue-soft: #1e3a5f;
    --sys-accent-glow: rgba(56, 189, 248, 0.1);

    /* Cores Semânticas (Status) - ajustadas para dark */
    --sys-green-soft: #064e3b;
    --sys-red-soft: #7f1d1d;
    --sys-orange-soft: #78350f;
    --sys-purple-soft: #3b0764;
    --sys-gray-soft: #1e293b;

    /* Tipografia e Texto */
    --sys-text-main: #e6edf3;
    --sys-text-muted: #8b949e;
    --sys-text-light: #6e7681;

    /* Aliases para compatibilidade com Dashboard (--db-*) */
    --db-bg: var(--sys-bg);
    --db-surface: var(--sys-surface);
    --db-surface2: var(--sys-surface-alt);
    --db-border: var(--sys-border);
    --db-text: var(--sys-text-main);
    --db-text2: var(--sys-text-muted);
    --db-text3: var(--sys-text-light);
    --db-accent: var(--sys-blue);
    --db-accent2: #38bdf8;
    --db-accent-glow: var(--sys-accent-glow);
    --db-green: var(--sys-green);
    --db-red: var(--sys-red);
    --db-orange: var(--sys-orange);
    --db-purple: var(--sys-purple);
}

/* Configurações Base */
* {
    box-sizing: border-box;
}

body,
html {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--sys-bg);
    color: var(--sys-text-main);
    margin: 0;
    height: 100%;
    -webkit-font-smoothing: antialiased;
}

/* Layout Sidebar */
.sys-layout {
    display: flex;
    min-height: 100vh;
}

.sys-sidebar {
    width: 260px;
    background-color: var(--sys-navy);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sys-sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin: 2px 8px;
    border-radius: 8px;
    color: rgba(255,255,255,0.78) !important;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 12px;
    position: relative;
    border-left: 3px solid transparent;
}

/* Atribuição de variáveis por módulo */
.item-sky {
    --mod-color: var(--mod-sky);
    --mod-color-dark: var(--mod-sky-dark);
    --mod-rgb: var(--mod-sky-rgb);
}

.item-blue {
    --mod-color: var(--mod-blue);
    --mod-color-dark: var(--mod-blue-dark);
    --mod-rgb: var(--mod-blue-rgb);
}

.item-violet {
    --mod-color: var(--mod-violet);
    --mod-color-dark: var(--mod-violet-dark);
    --mod-rgb: var(--mod-violet-rgb);
}

.item-emerald {
    --mod-color: var(--mod-emerald);
    --mod-color-dark: var(--mod-emerald-dark);
    --mod-rgb: var(--mod-emerald-rgb);
}

.item-amber {
    --mod-color: var(--mod-amber);
    --mod-color-dark: var(--mod-amber-dark);
    --mod-rgb: var(--mod-amber-rgb);
}

.item-rose {
    --mod-color: var(--mod-rose);
    --mod-color-dark: var(--mod-rose-dark);
    --mod-rgb: var(--mod-rose-rgb);
}

.item-cyan {
    --mod-color: var(--mod-cyan);
    --mod-color-dark: var(--mod-cyan-dark);
    --mod-rgb: var(--mod-cyan-rgb);
}

.item-teal {
    --mod-color: var(--mod-teal);
    --mod-color-dark: var(--mod-teal-dark);
    --mod-rgb: var(--mod-teal-rgb);
}

.item-slate {
    --mod-color: var(--mod-slate);
    --mod-color-dark: var(--mod-slate-dark);
    --mod-rgb: var(--mod-slate-rgb);
}

.item-purple {
    --mod-color: var(--mod-purple);
    --mod-color-dark: var(--mod-purple-dark);
    --mod-rgb: var(--mod-purple-rgb);
}

.item-orange {
    --mod-color: var(--mod-orange);
    --mod-color-dark: var(--mod-orange-dark);
    --mod-rgb: var(--mod-orange-rgb);
}

.sys-sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
}

.sys-sidebar-item.active {
    background: linear-gradient(90deg, rgba(var(--mod-rgb), 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--mod-color);
    color: white !important;
    box-shadow: inset 6px 0 15px -4px rgba(var(--mod-rgb), 0.5);
}

.sidebar-section-label {
    font-family: 'Sora', sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    padding: 24px 16px 8px;
    display: block;
}

.sidebar-text {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 600;
}

/* Container de Ícone 3D Dinâmico */
.icon-box-3d {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(145deg, var(--mod-color), var(--mod-color-dark));
    transform-style: preserve-3d;
    perspective: 800px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.3),
        0 8px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.icon-box-3d::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

.icon-box-3d i,
.icon-box-3d svg {
    color: white;
    font-size: 19px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s ease;
}

.sys-sidebar-item:hover .icon-box-3d {
    transform: perspective(800px) translateY(-6px) rotateX(12deg);
    box-shadow:
        0 10px 0 rgba(0, 0, 0, 0.2),
        0 15px 25px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(var(--mod-rgb), 0.6);
}

.sys-sidebar-item:hover .icon-box-3d i {
    transform: translateZ(15px) scale(1.1);
}

/* Submenus */
.has-submenu ul .sys-sidebar-item {
    padding-left: 52px;
    border-left: none;
}

/* Page Header Padrão (mesma cor do sidebar) */
.page-header {
    background-color: #0A1526;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.page-header .page-title,
.page-header .header-title {
    color: white;
    font-weight: 700;
}
.page-header .breadcrumb,
.page-header .header-sub {
    color: rgba(255,255,255,0.7);
}
.page-header .breadcrumb a {
    color: rgba(255,255,255,0.85);
}
.page-header .breadcrumb a:hover {
    color: white;
}

/* Utilitários */
.sys-card {
    background: var(--sys-surface);
    border: 1px solid var(--sys-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.sys-badge {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.sys-btn-primary {
    background-color: var(--sys-blue);
    color: white;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.sys-btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   DARK MODE OVERRIDES (via html[data-theme="dark"])
   ============================================ */
html[data-theme="dark"] .card,
html[data-theme="dark"] .db-card,
html[data-theme="dark"] .db-stat-card,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] main,
html[data-theme="dark"] .page-wrapper,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] .bg-slate-100,
html[data-theme="dark"] .bg-slate-200,
html[data-theme="dark"] .bg-gray-200,
html[data-theme="dark"] footer,
html[data-theme="dark"] thead,
html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] tr,
html[data-theme="dark"] tbody,
html[data-theme="dark"] .table { 
    background-color: var(--sys-surface) !important; 
    color: var(--sys-text-main) !important; 
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .bg-gray-200,
html[data-theme="dark"] .bg-slate-100,
html[data-theme="dark"] .db-modal-desc-content {
    background-color: var(--sys-surface-alt) !important;
    border-color: var(--sys-border) !important;
    color: var(--sys-text-main) !important;
}

html[data-theme="dark"] .text-slate-900, 
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-black,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] h1, 
html[data-theme="dark"] h2, 
html[data-theme="dark"] h3, 
html[data-theme="dark"] h4, 
html[data-theme="dark"] h5, 
html[data-theme="dark"] h6 { color: var(--sys-text-main) !important; }

html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .text-muted { color: var(--sys-text-muted) !important; }

html[data-theme="dark"] .border, 
html[data-theme="dark"] .border-t, 
html[data-theme="dark"] .border-b, 
html[data-theme="dark"] .border-l, 
html[data-theme="dark"] .border-r, 
html[data-theme="dark"] hr { 
    border-color: var(--sys-border) !important; 
}

html[data-theme="dark"] ::placeholder { color: var(--sys-text-light) !important; opacity: 1; }

html[data-theme="dark"] .hover\:bg-gray-100:hover,
html[data-theme="dark"] .hover\:bg-gray-50:hover { 
    background-color: var(--sys-surface-alt) !important; 
}

/* Sidebar no dark mode (já é escuro por padrão, mas garante consistência) */
html[data-theme="dark"] #sidebar {
    background-color: var(--sys-navy);
}

/* Footer no dark mode */
html[data-theme="dark"] footer {
    background-color: var(--sys-surface) !important;
    border-top-color: var(--sys-border) !important;
    color: var(--sys-text-muted) !important;
}

/* ============================================
   DARK MODE — BADGES PASTÉIS (bg-*-50/100 sem dark:)
   Mapeia cores claras para versões translúcidas escuras
   ============================================ */

html[data-theme="dark"] .bg-red-50     { background-color: rgba(239, 68, 68, 0.12) !important; }
html[data-theme="dark"] .bg-red-100    { background-color: rgba(239, 68, 68, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-red-50:hover,
html[data-theme="dark"] .hover\:bg-red-100:hover,
html[data-theme="dark"] .hover\:bg-red-200:hover { background-color: rgba(239, 68, 68, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-red-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-red-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-red-200 { background-color: rgba(239, 68, 68, 0.18) !important; }
html[data-theme="dark"] .border-red-100,
html[data-theme="dark"] .border-red-200 { border-color: rgba(239, 68, 68, 0.35) !important; }
html[data-theme="dark"] .text-red-600,
html[data-theme="dark"] .text-red-700 { color: #f87171 !important; }
html[data-theme="dark"] .text-red-800,
html[data-theme="dark"] .text-red-900 { color: #fca5a5 !important; }

html[data-theme="dark"] .bg-orange-50     { background-color: rgba(249, 115, 22, 0.12) !important; }
html[data-theme="dark"] .bg-orange-100    { background-color: rgba(249, 115, 22, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-orange-50:hover,
html[data-theme="dark"] .hover\:bg-orange-100:hover,
html[data-theme="dark"] .hover\:bg-orange-200:hover { background-color: rgba(249, 115, 22, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-orange-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-orange-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-orange-200 { background-color: rgba(249, 115, 22, 0.18) !important; }
html[data-theme="dark"] .border-orange-100,
html[data-theme="dark"] .border-orange-200 { border-color: rgba(249, 115, 22, 0.35) !important; }
html[data-theme="dark"] .text-orange-600,
html[data-theme="dark"] .text-orange-700 { color: #fb923c !important; }
html[data-theme="dark"] .text-orange-800,
html[data-theme="dark"] .text-orange-900 { color: #fdba74 !important; }

html[data-theme="dark"] .bg-amber-50     { background-color: rgba(245, 158, 11, 0.12) !important; }
html[data-theme="dark"] .bg-amber-100    { background-color: rgba(245, 158, 11, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-amber-50:hover,
html[data-theme="dark"] .hover\:bg-amber-100:hover,
html[data-theme="dark"] .hover\:bg-amber-200:hover { background-color: rgba(245, 158, 11, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-amber-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-amber-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-amber-200 { background-color: rgba(245, 158, 11, 0.18) !important; }
html[data-theme="dark"] .border-amber-100,
html[data-theme="dark"] .border-amber-200 { border-color: rgba(245, 158, 11, 0.35) !important; }
html[data-theme="dark"] .text-amber-600,
html[data-theme="dark"] .text-amber-700 { color: #fbbf24 !important; }
html[data-theme="dark"] .text-amber-800,
html[data-theme="dark"] .text-amber-900 { color: #fcd34d !important; }

html[data-theme="dark"] .bg-yellow-50     { background-color: rgba(234, 179, 8, 0.12) !important; }
html[data-theme="dark"] .bg-yellow-100    { background-color: rgba(234, 179, 8, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-yellow-50:hover,
html[data-theme="dark"] .hover\:bg-yellow-100:hover,
html[data-theme="dark"] .hover\:bg-yellow-200:hover { background-color: rgba(234, 179, 8, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-yellow-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-yellow-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-yellow-200 { background-color: rgba(234, 179, 8, 0.18) !important; }
html[data-theme="dark"] .border-yellow-100,
html[data-theme="dark"] .border-yellow-200 { border-color: rgba(234, 179, 8, 0.35) !important; }
html[data-theme="dark"] .text-yellow-600,
html[data-theme="dark"] .text-yellow-700 { color: #facc15 !important; }
html[data-theme="dark"] .text-yellow-800,
html[data-theme="dark"] .text-yellow-900 { color: #fde047 !important; }

html[data-theme="dark"] .bg-lime-50     { background-color: rgba(132, 204, 22, 0.12) !important; }
html[data-theme="dark"] .bg-lime-100    { background-color: rgba(132, 204, 22, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-lime-50:hover,
html[data-theme="dark"] .hover\:bg-lime-100:hover,
html[data-theme="dark"] .hover\:bg-lime-200:hover { background-color: rgba(132, 204, 22, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-lime-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-lime-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-lime-200 { background-color: rgba(132, 204, 22, 0.18) !important; }
html[data-theme="dark"] .border-lime-100,
html[data-theme="dark"] .border-lime-200 { border-color: rgba(132, 204, 22, 0.35) !important; }
html[data-theme="dark"] .text-lime-600,
html[data-theme="dark"] .text-lime-700 { color: #a3e635 !important; }
html[data-theme="dark"] .text-lime-800,
html[data-theme="dark"] .text-lime-900 { color: #bef264 !important; }

html[data-theme="dark"] .bg-green-50     { background-color: rgba(34, 197, 94, 0.12) !important; }
html[data-theme="dark"] .bg-green-100    { background-color: rgba(34, 197, 94, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-green-50:hover,
html[data-theme="dark"] .hover\:bg-green-100:hover,
html[data-theme="dark"] .hover\:bg-green-200:hover { background-color: rgba(34, 197, 94, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-green-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-green-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-green-200 { background-color: rgba(34, 197, 94, 0.18) !important; }
html[data-theme="dark"] .border-green-100,
html[data-theme="dark"] .border-green-200 { border-color: rgba(34, 197, 94, 0.35) !important; }
html[data-theme="dark"] .text-green-600,
html[data-theme="dark"] .text-green-700 { color: #4ade80 !important; }
html[data-theme="dark"] .text-green-800,
html[data-theme="dark"] .text-green-900 { color: #86efac !important; }

html[data-theme="dark"] .bg-emerald-50     { background-color: rgba(16, 185, 129, 0.12) !important; }
html[data-theme="dark"] .bg-emerald-100    { background-color: rgba(16, 185, 129, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-emerald-50:hover,
html[data-theme="dark"] .hover\:bg-emerald-100:hover,
html[data-theme="dark"] .hover\:bg-emerald-200:hover { background-color: rgba(16, 185, 129, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-emerald-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-emerald-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-emerald-200 { background-color: rgba(16, 185, 129, 0.18) !important; }
html[data-theme="dark"] .border-emerald-100,
html[data-theme="dark"] .border-emerald-200 { border-color: rgba(16, 185, 129, 0.35) !important; }
html[data-theme="dark"] .text-emerald-600,
html[data-theme="dark"] .text-emerald-700 { color: #34d399 !important; }
html[data-theme="dark"] .text-emerald-800,
html[data-theme="dark"] .text-emerald-900 { color: #6ee7b7 !important; }

html[data-theme="dark"] .bg-teal-50     { background-color: rgba(20, 184, 166, 0.12) !important; }
html[data-theme="dark"] .bg-teal-100    { background-color: rgba(20, 184, 166, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-teal-50:hover,
html[data-theme="dark"] .hover\:bg-teal-100:hover,
html[data-theme="dark"] .hover\:bg-teal-200:hover { background-color: rgba(20, 184, 166, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-teal-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-teal-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-teal-200 { background-color: rgba(20, 184, 166, 0.18) !important; }
html[data-theme="dark"] .border-teal-100,
html[data-theme="dark"] .border-teal-200 { border-color: rgba(20, 184, 166, 0.35) !important; }
html[data-theme="dark"] .text-teal-600,
html[data-theme="dark"] .text-teal-700 { color: #2dd4bf !important; }
html[data-theme="dark"] .text-teal-800,
html[data-theme="dark"] .text-teal-900 { color: #5eead4 !important; }

html[data-theme="dark"] .bg-cyan-50     { background-color: rgba(6, 182, 212, 0.12) !important; }
html[data-theme="dark"] .bg-cyan-100    { background-color: rgba(6, 182, 212, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-cyan-50:hover,
html[data-theme="dark"] .hover\:bg-cyan-100:hover,
html[data-theme="dark"] .hover\:bg-cyan-200:hover { background-color: rgba(6, 182, 212, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-cyan-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-cyan-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-cyan-200 { background-color: rgba(6, 182, 212, 0.18) !important; }
html[data-theme="dark"] .border-cyan-100,
html[data-theme="dark"] .border-cyan-200 { border-color: rgba(6, 182, 212, 0.35) !important; }
html[data-theme="dark"] .text-cyan-600,
html[data-theme="dark"] .text-cyan-700 { color: #22d3ee !important; }
html[data-theme="dark"] .text-cyan-800,
html[data-theme="dark"] .text-cyan-900 { color: #67e8f9 !important; }

html[data-theme="dark"] .bg-sky-50     { background-color: rgba(14, 165, 233, 0.12) !important; }
html[data-theme="dark"] .bg-sky-100    { background-color: rgba(14, 165, 233, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-sky-50:hover,
html[data-theme="dark"] .hover\:bg-sky-100:hover,
html[data-theme="dark"] .hover\:bg-sky-200:hover { background-color: rgba(14, 165, 233, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-sky-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-sky-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-sky-200 { background-color: rgba(14, 165, 233, 0.18) !important; }
html[data-theme="dark"] .border-sky-100,
html[data-theme="dark"] .border-sky-200 { border-color: rgba(14, 165, 233, 0.35) !important; }
html[data-theme="dark"] .text-sky-600,
html[data-theme="dark"] .text-sky-700 { color: #38bdf8 !important; }
html[data-theme="dark"] .text-sky-800,
html[data-theme="dark"] .text-sky-900 { color: #7dd3fc !important; }

html[data-theme="dark"] .bg-blue-50     { background-color: rgba(59, 130, 246, 0.12) !important; }
html[data-theme="dark"] .bg-blue-100    { background-color: rgba(59, 130, 246, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-blue-50:hover,
html[data-theme="dark"] .hover\:bg-blue-100:hover,
html[data-theme="dark"] .hover\:bg-blue-200:hover { background-color: rgba(59, 130, 246, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-blue-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-blue-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-blue-200 { background-color: rgba(59, 130, 246, 0.18) !important; }
html[data-theme="dark"] .border-blue-100,
html[data-theme="dark"] .border-blue-200 { border-color: rgba(59, 130, 246, 0.35) !important; }
html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-blue-700 { color: #60a5fa !important; }
html[data-theme="dark"] .text-blue-800,
html[data-theme="dark"] .text-blue-900 { color: #93c5fd !important; }

html[data-theme="dark"] .bg-indigo-50     { background-color: rgba(99, 102, 241, 0.12) !important; }
html[data-theme="dark"] .bg-indigo-100    { background-color: rgba(99, 102, 241, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-indigo-50:hover,
html[data-theme="dark"] .hover\:bg-indigo-100:hover,
html[data-theme="dark"] .hover\:bg-indigo-200:hover { background-color: rgba(99, 102, 241, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-indigo-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-indigo-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-indigo-200 { background-color: rgba(99, 102, 241, 0.18) !important; }
html[data-theme="dark"] .border-indigo-100,
html[data-theme="dark"] .border-indigo-200 { border-color: rgba(99, 102, 241, 0.35) !important; }
html[data-theme="dark"] .text-indigo-600,
html[data-theme="dark"] .text-indigo-700 { color: #818cf8 !important; }
html[data-theme="dark"] .text-indigo-800,
html[data-theme="dark"] .text-indigo-900 { color: #a5b4fc !important; }

html[data-theme="dark"] .bg-violet-50     { background-color: rgba(139, 92, 246, 0.12) !important; }
html[data-theme="dark"] .bg-violet-100    { background-color: rgba(139, 92, 246, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-violet-50:hover,
html[data-theme="dark"] .hover\:bg-violet-100:hover,
html[data-theme="dark"] .hover\:bg-violet-200:hover { background-color: rgba(139, 92, 246, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-violet-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-violet-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-violet-200 { background-color: rgba(139, 92, 246, 0.18) !important; }
html[data-theme="dark"] .border-violet-100,
html[data-theme="dark"] .border-violet-200 { border-color: rgba(139, 92, 246, 0.35) !important; }
html[data-theme="dark"] .text-violet-600,
html[data-theme="dark"] .text-violet-700 { color: #a78bfa !important; }
html[data-theme="dark"] .text-violet-800,
html[data-theme="dark"] .text-violet-900 { color: #c4b5fd !important; }

html[data-theme="dark"] .bg-purple-50     { background-color: rgba(168, 85, 247, 0.12) !important; }
html[data-theme="dark"] .bg-purple-100    { background-color: rgba(168, 85, 247, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-purple-50:hover,
html[data-theme="dark"] .hover\:bg-purple-100:hover,
html[data-theme="dark"] .hover\:bg-purple-200:hover { background-color: rgba(168, 85, 247, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-purple-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-purple-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-purple-200 { background-color: rgba(168, 85, 247, 0.18) !important; }
html[data-theme="dark"] .border-purple-100,
html[data-theme="dark"] .border-purple-200 { border-color: rgba(168, 85, 247, 0.35) !important; }
html[data-theme="dark"] .text-purple-600,
html[data-theme="dark"] .text-purple-700 { color: #c084fc !important; }
html[data-theme="dark"] .text-purple-800,
html[data-theme="dark"] .text-purple-900 { color: #d8b4fe !important; }

html[data-theme="dark"] .bg-fuchsia-50     { background-color: rgba(217, 70, 239, 0.12) !important; }
html[data-theme="dark"] .bg-fuchsia-100    { background-color: rgba(217, 70, 239, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-fuchsia-50:hover,
html[data-theme="dark"] .hover\:bg-fuchsia-100:hover,
html[data-theme="dark"] .hover\:bg-fuchsia-200:hover { background-color: rgba(217, 70, 239, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-fuchsia-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-fuchsia-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-fuchsia-200 { background-color: rgba(217, 70, 239, 0.18) !important; }
html[data-theme="dark"] .border-fuchsia-100,
html[data-theme="dark"] .border-fuchsia-200 { border-color: rgba(217, 70, 239, 0.35) !important; }
html[data-theme="dark"] .text-fuchsia-600,
html[data-theme="dark"] .text-fuchsia-700 { color: #e879f9 !important; }
html[data-theme="dark"] .text-fuchsia-800,
html[data-theme="dark"] .text-fuchsia-900 { color: #f0abfc !important; }

html[data-theme="dark"] .bg-pink-50     { background-color: rgba(236, 72, 153, 0.12) !important; }
html[data-theme="dark"] .bg-pink-100    { background-color: rgba(236, 72, 153, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-pink-50:hover,
html[data-theme="dark"] .hover\:bg-pink-100:hover,
html[data-theme="dark"] .hover\:bg-pink-200:hover { background-color: rgba(236, 72, 153, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-pink-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-pink-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-pink-200 { background-color: rgba(236, 72, 153, 0.18) !important; }
html[data-theme="dark"] .border-pink-100,
html[data-theme="dark"] .border-pink-200 { border-color: rgba(236, 72, 153, 0.35) !important; }
html[data-theme="dark"] .text-pink-600,
html[data-theme="dark"] .text-pink-700 { color: #f472b6 !important; }
html[data-theme="dark"] .text-pink-800,
html[data-theme="dark"] .text-pink-900 { color: #f9a8d4 !important; }

html[data-theme="dark"] .bg-rose-50     { background-color: rgba(244, 63, 94, 0.12) !important; }
html[data-theme="dark"] .bg-rose-100    { background-color: rgba(244, 63, 94, 0.20) !important; }
html[data-theme="dark"] .hover\:bg-rose-50:hover,
html[data-theme="dark"] .hover\:bg-rose-100:hover,
html[data-theme="dark"] .hover\:bg-rose-200:hover { background-color: rgba(244, 63, 94, 0.18) !important; }
html[data-theme="dark"] .group:hover .group-hover\:bg-rose-50,
html[data-theme="dark"] .group:hover .group-hover\:bg-rose-100,
html[data-theme="dark"] .group:hover .group-hover\:bg-rose-200 { background-color: rgba(244, 63, 94, 0.18) !important; }
html[data-theme="dark"] .border-rose-100,
html[data-theme="dark"] .border-rose-200 { border-color: rgba(244, 63, 94, 0.35) !important; }
html[data-theme="dark"] .text-rose-600,
html[data-theme="dark"] .text-rose-700 { color: #fb7185 !important; }
html[data-theme="dark"] .text-rose-800,
html[data-theme="dark"] .text-rose-900 { color: #fda4af !important; }

/* File input pastéis (input file usa ::file-selector-button) */
html[data-theme="dark"] ::file-selector-button {
    background-color: var(--sys-surface-alt) !important;
    color: var(--sys-text-muted) !important;
    border-color: var(--sys-border) !important;
}

/* SweetAlert2 popup em dark mode */
html[data-theme="dark"] .swal2-popup {
    background-color: var(--sys-surface) !important;
    color: var(--sys-text-main) !important;
    border-color: var(--sys-border) !important;
}
html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container { color: var(--sys-text-main) !important; }

/* ============================================
   FALLBACK: Inline styles hardcoded comuns
   (atributo style= com cores fixas)
   ============================================ */
/* Fundos claros comuns */
html[data-theme="dark"] [style*="background:#F9FAFB"],
html[data-theme="dark"] [style*="background:#f9fafb"],
html[data-theme="dark"] [style*="background:#F3F4F6"],
html[data-theme="dark"] [style*="background:#f3f4f6"],
html[data-theme="dark"] [style*="background:#F0F9FF"],
html[data-theme="dark"] [style*="background:#f0f9ff"],
html[data-theme="dark"] [style*="background:#ECFDF5"],
html[data-theme="dark"] [style*="background:#ecfdf5"],
html[data-theme="dark"] [style*="background:#FEF2F2"],
html[data-theme="dark"] [style*="background:#fef2f2"],
html[data-theme="dark"] [style*="background:#FFF"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background:#FFFFFF"],
html[data-theme="dark"] [style*="background:#dbeafe"],
html[data-theme="dark"] [style*="background:#DBEAFE"],
html[data-theme="dark"] [style*="background:#DCFCE7"],
html[data-theme="dark"] [style*="background:#dcfce7"],
html[data-theme="dark"] [style*="background:#FEE2E2"],
html[data-theme="dark"] [style*="background:#fee2e2"],
html[data-theme="dark"] [style*="background:#FEF3C7"],
html[data-theme="dark"] [style*="background:#fef3c7"],
html[data-theme="dark"] [style*="background:#E0F2FE"],
html[data-theme="dark"] [style*="background:#e0f2fe"],
html[data-theme="dark"] [style*="background:#EDE9FE"],
html[data-theme="dark"] [style*="background:#ede9fe"],
html[data-theme="dark"] [style*="background:#FAEEDA"],
html[data-theme="dark"] [style*="background:#faeeda"],
html[data-theme="dark"] [style*="background:#EAF3DE"],
html[data-theme="dark"] [style*="background:#eaf3de"],
html[data-theme="dark"] [style*="background:#F1EFE8"],
html[data-theme="dark"] [style*="background:#f1efe8"] {
    background-color: var(--sys-surface-alt) !important;
}

/* Fundos brancos puros */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background:#ffffff"] {
    background-color: var(--sys-surface) !important;
}

/* Cores de texto comuns (cinzas) */
html[data-theme="dark"] [style*="color:#6B7280"],
html[data-theme="dark"] [style*="color:#6b7280"],
html[data-theme="dark"] [style*="color:#9CA3AF"],
html[data-theme="dark"] [style*="color:#9ca3af"],
html[data-theme="dark"] [style*="color:#D1D5DB"],
html[data-theme="dark"] [style*="color:#d1d5db"] {
    color: var(--sys-text-muted) !important;
}
html[data-theme="dark"] [style*="color:#374151"],
html[data-theme="dark"] [style*="color:#111827"],
html[data-theme="dark"] [style*="color:#1E293B"],
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color:#0F172A"],
html[data-theme="dark"] [style*="color:#0f172a"] {
    color: var(--sys-text-main) !important;
}
html[data-theme="dark"] [style*="color:#4B5563"],
html[data-theme="dark"] [style*="color:#4b5563"] {
    color: var(--sys-text-main) !important;
}

/* Cores de marca */
html[data-theme="dark"] [style*="color:#1d4ed8"],
html[data-theme="dark"] [style*="color:#2563eb"],
html[data-theme="dark"] [style*="color:#0ea5e9"],
html[data-theme="dark"] [style*="color:#3b82f6"] {
    color: var(--sys-blue) !important;
}
html[data-theme="dark"] [style*="color:#16a34a"],
html[data-theme="dark"] [style*="color:#10b981"],
html[data-theme="dark"] [style*="color:#22c55e"] {
    color: var(--sys-green) !important;
}
html[data-theme="dark"] [style*="color:#ef4444"],
html[data-theme="dark"] [style*="color:#dc2626"],
html[data-theme="dark"] [style*="color:#f43f5e"] {
    color: var(--sys-red) !important;
}
html[data-theme="dark"] [style*="color:#f59e0b"],
html[data-theme="dark"] [style*="color:#eab308"] {
    color: var(--sys-orange) !important;
}
html[data-theme="dark"] [style*="color:#8b5cf6"],
html[data-theme="dark"] [style*="color:#a855f7"] {
    color: var(--sys-purple) !important;
}

/* Bordas brancas hardcoded (ex: JS orcamento/formulario) */
html[data-theme="dark"] [style*="border-bottom:0.5px solid #fff"],
html[data-theme="dark"] [style*="border-bottom:0.5px solid #ffffff"],
html[data-theme="dark"] [style*="border-color:#fff"],
html[data-theme="dark"] [style*="border-color:#ffffff"] {
    border-color: var(--sys-border) !important;
}

/* Badges de status inline (orcamento/lista) */
html[data-theme="dark"] [style*="background:rgba(217,119,6,0.12)"],
html[data-theme="dark"] [style*="color:#b45309"] {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] [style*="background:rgba(5,150,105,0.1)"],
html[data-theme="dark"] [style*="color:#059669"] {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}
html[data-theme="dark"] [style*="color:#e11d48"],
html[data-theme="dark"] [style*="color:#dc2626"] {
    color: #f87171 !important;
}
html[data-theme="dark"] [style*="color:#b5842b"] {
    color: #fbbf24 !important;
}
html[data-theme="dark"] [style*="color:#1f6b46"] {
    color: #34d399 !important;
}

/* Leaflet popups (dashboard.php) - texto escuro sobre fundo escuro */
html[data-theme="dark"] [style*="color:#111"],
html[data-theme="dark"] [style*="color:#111111"],
html[data-theme="dark"] [style*="color:#555"],
html[data-theme="dark"] [style*="color:#888"] {
    color: var(--sys-text-main) !important;
}
html[data-theme="dark"] [style*="background:#f3e8ff"],
html[data-theme="dark"] [style*="color:#9333ea"] {
    background-color: rgba(139, 92, 246, 0.15) !important;
    color: #c4b5fd !important;
}

/* Juridico residuals */
html[data-theme="dark"] [style*="color:#C83232"],
html[data-theme="dark"] [style*="color:#B91C1C"],
html[data-theme="dark"] [style*="color:#B8860B"],
html[data-theme="dark"] [style*="color:#166534"] {
    color: var(--sys-text-main) !important;
}
html[data-theme="dark"] [style*="background:rgba(10,21,38,0.08)"] {
    background-color: rgba(59, 130, 246, 0.08) !important;
}
html[data-theme="dark"] [style*="border-color:#E4DDC9"] {
    border-color: var(--sys-border) !important;
}

/* Fornecedores/form inline */
html[data-theme="dark"] [style*="background:#F7F8FA"],
html[data-theme="dark"] [style*="background:#f7f8fa"] {
    background-color: var(--sys-surface-alt) !important;
}

/* Financeiro index JS cores */
html[data-theme="dark"] [style*="color:#1d4ed8"],
html[data-theme="dark"] [style*="color:#9ca3af"],
html[data-theme="dark"] [style*="background:#16a34a"],
html[data-theme="dark"] [style*="background:#dc2626"] {
    /* cobertos pelas regras acima */
}