/**
 * ARES FINANCIAL CRM - Custom CSS (VERSﾃグ CORRIGIDA)
 * Layout funcional + Cores vivas + Contraste perfeito
 */

/* ==================== CORES E VARIﾃ〃EIS ==================== */
:root {
    /* ==================== PREMIUM DESIGN TOKENS (ZEUS) ==================== */
    --ares-bg-primary: #080A0E;
    --ares-bg-secondary: #0D1117;
    --ares-bg-card: #0F131A;
    --ares-bg-elevated: #161B22;

    /* High-Vibrancy Accents */
    --ares-primary: #00A3FF;
    /* Electric Blue */
    --ares-primary-rgb: 0, 163, 255;
    --ares-success: #00F5A0;
    /* Spring Green */
    --ares-warning: #FFB800;
    /* Super Orange */
    --ares-danger: #FF005C;
    /* Radical Red */
    --ares-info: #B265FF;
    /* Bright Purple */

    /* Typography & Contrast */
    --ares-text-primary: #FFFFFF;
    --ares-text-secondary: #A0AEC0;
    --ares-text-muted: #718096;

    /* Premium Effects */
    --ares-border-premium: rgba(255, 255, 255, 0.05);
    --ares-glow-primary: 0 0 20px rgba(0, 163, 255, 0.2);
    --ares-glow-success: 0 0 20px rgba(0, 245, 160, 0.2);
    --ares-glass-bg: rgba(15, 19, 26, 0.65);
    --ares-glass-border: rgba(255, 255, 255, 0.08);
    --ares-glass-blur: blur(12px);

    /* Animation Tokens */
    --anim-gentle: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --anim-bounce: all 0.6s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    --anim-slide-up: translateY(20px);

    /* Transitions & Radius */
    --transition-premium: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-premium: 16px;
    --radius-pill: 50px;
    --ares-border: rgba(255, 255, 255, 0.1);
}

/* ==================== ADVANCED ANIMATIONS ==================== */
@keyframes aresFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aresGlowPulse {
    0% {
        box-shadow: 0 0 5px rgba(var(--ares-primary-rgb), 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(var(--ares-primary-rgb), 0.5);
    }

    100% {
        box-shadow: 0 0 5px rgba(var(--ares-primary-rgb), 0.2);
    }
}

.animate-ares-up {
    animation: aresFadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.glow-pulse-primary {
    animation: aresGlowPulse 2s infinite ease-in-out;
}

/* ==================== PREMIUM UTILITIES ==================== */
.premium-card {
    background: var(--ares-bg-card) !important;
    border: 1px solid var(--ares-border-premium) !important;
    border-radius: var(--radius-premium) !important;
    transition: var(--transition-premium) !important;
    overflow: hidden;
}

.premium-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--ares-primary-rgb), 0.3) !important;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5), var(--ares-glow-primary) !important;
}

.glass-panel {
    background: var(--ares-glass-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--ares-glass-border) !important;
}

.hover-glow:hover {
    filter: drop-shadow(0 0 8px rgba(var(--ares-primary-rgb), 0.5));
}

.text-gradient-primary {
    background: linear-gradient(135deg, var(--ares-primary) 0%, var(--ares-info) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Fix for Light Backgrounds in Dark Mode (Bootstrap Overrides) */
.list-group-item {
    background-color: transparent !important;
    border-color: var(--ares-border-premium) !important;
    color: var(--ares-text-primary) !important;
}

.table-danger {
    --bs-table-bg: rgba(255, 0, 92, 0.1) !important;
    --bs-table-color: var(--ares-text-primary) !important;
    border-color: rgba(255, 0, 92, 0.2) !important;
}

.table-danger td {
    background-color: transparent !important;
    color: var(--ares-text-primary) !important;
}


/* ==================== TEMA CLARO (OVERRIDE) ==================== */
[data-theme="light"] {
    --ares-bg-primary: #f0f2f5;
    --ares-bg-secondary: #ffffff;
    --ares-bg-card: #ffffff;
    --ares-bg-elevated: #ffffff;

    --ares-text-primary: #1a1a2e;
    --ares-text-secondary: #334155;
    --ares-text-muted: #475569;

    /* Bordas e Sombras Mais Fortes para Contraste */
    --ares-border: #94a3b8;
    --ares-border-light: rgba(0, 0, 0, 0.2);
    --ares-text-muted: #334155;
}

/* ==================== MELHORIAS DE CONTRASTE (LIGHT THEME) ==================== */
/* Garante que textos secundﾃ｡rios sejam legﾃｭveis */
[data-theme="light"] .text-muted {
    color: #475569 !important;
}

[data-theme="light"] .small,
[data-theme="light"] small {
    color: #475569 !important;
    font-weight: 500;
}

/* Inputs com texto escuro e borda visﾃｭvel */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    color: #0f172a !important;
    /* Slate 900 */
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    border-color: var(--ares-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15) !important;
}

/* Placeholders mais escuros */
[data-theme="light"] .form-control::placeholder {
    color: #64748b !important;
    opacity: 1;
}

/* Tﾃｭtulos de Cards e KPIs */
[data-theme="light"] .card-title,
[data-theme="light"] .kpi-card .text-uppercase,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: #1e293b !important;
    /* Slate 800 */
}

/* Tabelas com texto nﾃｭtido */
[data-theme="light"] .table {
    color: #334155 !important;
}

[data-theme="light"] .table th {
    color: #1e293b !important;
    font-weight: 600;
}



[data-theme="light"] .text-white {
    color: var(--ares-text-primary) !important;
}

/* Garantir que ﾃｭcones brancos em botﾃｵes continuem brancos */
[data-theme="light"] .btn .text-white,
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-ares,
[data-theme="light"] .btn-ares-glow,
[data-theme="light"] .badge:not(.bg-primary-light, .bg-success-light, .bg-info-light, .bg-warning-light, .bg-danger-light) {
    color: #ffffff !important;
}

/* Badges e Cores de Status - Contraste Alto */
[data-theme="light"] .text-success {
    color: #047857 !important;
    /* Emerald 700 */
    font-weight: 600;
}

[data-theme="light"] .text-danger {
    color: #b91c1c !important;
    /* Red 700 */
    font-weight: 600;
}

[data-theme="light"] .text-warning {
    color: #b45309 !important;
    /* Amber 700 */
    font-weight: 600;
}

[data-theme="light"] .text-primary {
    color: #1d4ed8 !important;
    /* Blue 700 */
    font-weight: 600;
}

/* Badges específicos - força contraste máximo */
[data-theme="light"] .badge {
    font-weight: 600 !important;
}

/* ==================== BADGE WIDTH FIX (MOBILE FLEX) ==================== */
/* Força badges a não esticarem em containers flex-column */
.d-flex .badge,
.d-flex.flex-column .badge,
.d-flex.flex-column>.badge {
    width: auto !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    max-width: fit-content !important;
}

/* Garante que badges com w-auto realmente funcionem */
.badge.w-auto {
    width: auto !important;
    max-width: fit-content !important;
    flex-shrink: 0 !important;
}

[data-theme="light"] .badge.text-success,
[data-theme="light"] .badge .text-success {
    color: #047857 !important;
}

[data-theme="light"] .badge.text-danger,
[data-theme="light"] .badge .text-danger {
    color: #b91c1c !important;
}

[data-theme="light"] .badge.text-primary,
[data-theme="light"] .badge .text-primary {
    color: #1d4ed8 !important;
}

/* Fundos sutis mais visﾃｭveis */
[data-theme="light"] .bg-success-subtle {
    background-color: #dcfce7 !important;
    /* Emerald 100 */
    border: 1px solid #86efac;
}

[data-theme="light"] .bg-danger-subtle {
    background-color: #fee2e2 !important;
    /* Red 100 */
    border: 1px solid #fca5a5;
}

[data-theme="light"] .bg-warning-subtle {
    background-color: #fef3c7 !important;
    /* Amber 100 */
    border: 1px solid #fcd34d;
}

[data-theme="light"] .bg-primary-subtle {
    background-color: #dbeafe !important;
    /* Blue 100 */
    border: 1px solid #93c5fd;
}

/* ==================== TEMA ESCURO - Backgrounds Sutis ==================== */
/* Garante que no tema escuro os backgrounds sejam escuros, nﾃ｣o brancos */
.bg-success-subtle {
    background-color: rgba(5, 150, 105, 0.15) !important;
    /* Emerald com opacidade */
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.bg-danger-subtle {
    background-color: rgba(220, 38, 38, 0.15) !important;
    /* Red com opacidade */
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.bg-warning-subtle {
    background-color: rgba(217, 119, 6, 0.15) !important;
    /* Amber com opacidade */
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.bg-primary-subtle {
    background-color: rgba(37, 99, 235, 0.15) !important;
    /* Blue com opacidade */
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.bg-info-subtle {
    background-color: rgba(159, 122, 234, 0.15) !important;
    /* Purple com opacidade */
    border: 1px solid rgba(159, 122, 234, 0.3);
}

[data-theme="light"] .bg-dark {
    background-color: #f8fafc !important;
    color: var(--ares-text-primary) !important;
}

[data-theme="light"] .border-secondary {
    border-color: #d1d5db !important;
}

[data-theme="light"] .card {
    border: 2px solid #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .table-premium thead th {
    background: #f8fafc;
    color: var(--ares-text-muted);
    border-bottom: 2px solid #e2e8f0;
}

[data-theme="light"] .table-premium tbody tr:hover {
    background-color: #f1f5f9;
}

/* ==================== LAYOUT BASE ==================== */
body {
    background: var(--ares-bg-primary);
    color: var(--ares-text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
}

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ares-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--ares-bg-elevated);
    border-radius: 10px;
    border: 2px solid var(--ares-bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ares-text-muted);
}

/* ==================== SIDEBAR (LATERAL ESQUERDA) ==================== */
.sidebar {
    width: 280px;
    height: 100vh !important;
    background: var(--ares-bg-secondary);
    border-right: 1px solid var(--ares-border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--ares-border);
    flex-shrink: 0;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sidebar-nav {
    padding: 1rem 0.5rem;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--ares-text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all var(--transition-base);
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: rgba(0, 217, 255, 0.1);
    color: var(--ares-primary);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--ares-primary) 0%, var(--ares-info) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--ares-primary-rgb), 0.4);
    filter: brightness(1.1);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-divider {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ares-text-muted);
    padding: 1rem 1rem 0.5rem;
    letter-spacing: 0.5px;
}

/* ==================== SIDEBAR SUBMENU ==================== */
.nav-content {
    list-style: none;
    padding-left: 1.25rem !important;
    /* Indentaﾃｧﾃ｣o ajustada */
    margin-bottom: 0.5rem;
}

.nav-content li {
    margin-top: 4px;
}

.nav-content li a {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ares-text-muted);
    transition: all 0.25s ease;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    border-left: 2px solid transparent;
}

.nav-content li a i {
    font-size: 6px;
    /* ﾃ皇one bem delicado */
    margin-right: 12px;
    transition: all 0.25s ease;
    opacity: 0.7;
}

.nav-content li a:hover {
    color: var(--ares-text-primary);
    background: rgba(255, 255, 255, 0.03);
    padding-left: 16px;
    /* Efeito de deslize sutil */
}

.nav-content li a.active {
    color: var(--ares-primary);
    background: rgba(0, 217, 255, 0.08);
    font-weight: 600;
}

.nav-content li a:hover i,
.nav-content li a.active i {
    color: var(--ares-primary);
    opacity: 1;
    transform: scale(1.5);
    /* Destaque no ﾃｭcone */
}

/* Light Theme Ajustes */
[data-theme="light"] .nav-content li a {
    color: #64748b;
}

[data-theme="light"] .nav-content li a:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-content li a.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.sidebar-footer {
    border-top: 1px solid var(--ares-border);
    padding: 1rem;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--ares-bg-elevated);
    border-bottom: 1px solid var(--ares-border);
    padding: 1rem 1.5rem;
}

.brand-ares {
    background: linear-gradient(135deg, var(--ares-primary) 0%, var(--ares-info) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--ares-bg-card);
    border: 1px solid var(--ares-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    color: var(--ares-text-primary);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: 1.5rem;
}

/* ==================== BOTﾃ髭S VIBRANTES ==================== */
.btn-primary,
.btn-ares {
    background: linear-gradient(135deg, var(--ares-primary) 0%, var(--ares-info) 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
    transition: all var(--transition-base);
}

.btn-primary:hover,
.btn-ares:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.5);
    filter: brightness(1.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--ares-success) 0%, #00cc6f 100%);
    border: none;
    color: #0d1117;
    font-weight: 600;
}

.btn-danger {
    background: linear-gradient(135deg, var(--ares-danger) 0%, #cc0058 100%);
    border: none;
    color: white;
    font-weight: 600;
}

.btn-outline-primary {
    border: 2px solid var(--ares-primary);
    color: var(--ares-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--ares-primary);
    color: white;
}

/* ==================== INPUTS ==================== */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ares-border);
    color: var(--ares-text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ares-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 217, 255, 0.25);
    color: var(--ares-text-primary);
}

.form-control::placeholder {
    color: var(--ares-text-muted);
}

.form-label {
    color: var(--ares-text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ==================== UNIFORMIZAﾃ�グ ALTURA BOTﾃ髭S/INPUTS ==================== */
/* Garante que btn-sm tenha exatamente a mesma altura que form-control-sm */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: calc(1.5em + 0.75rem + 2px);
    /* min-height para nﾃ｣o cortar texto */
    white-space: nowrap;
    /* Evita quebra de texto */
}

.form-control-sm {
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Quando btn-sm estﾃ｡ em flex container com inputs, alinha verticalmente */
.d-flex .btn-sm,
.d-flex .form-control-sm {
    align-self: center;
}

/* Correﾃｧﾃ｣o especﾃｭfica para botﾃｵes outline que podem ter borda */
.btn-outline-success.btn-sm,
.btn-outline-secondary.btn-sm,
.btn-outline-primary.btn-sm {
    line-height: 1.5;
}

/* ==================== TABELAS PREMIUM ==================== */
.table-premium-container {
    background: var(--ares-bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--ares-border);
    padding: 1.5rem;
    overflow: hidden;
}

.table-premium {
    color: var(--ares-text-primary);
    margin: 0;
    width: 100%;
}

.table-premium thead {
    border-bottom: 2px solid var(--ares-primary);
}

.table-premium thead th {
    color: var(--ares-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem;
    background: rgba(0, 217, 255, 0.05);
}

.table-premium tbody tr {
    border-bottom: 1px solid var(--ares-border);
    transition: all var(--transition-fast);
}

.table-premium tbody tr:hover {
    background: rgba(0, 217, 255, 0.05);
}

.table-premium tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--ares-text-secondary);
}

/* ==================== BADGES VIBRANTES ==================== */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.bg-primary-light {
    background: rgba(0, 217, 255, 0.15) !important;
}

.bg-success-light {
    background: rgba(0, 255, 136, 0.15) !important;
}

.bg-warning-light {
    background: rgba(255, 170, 0, 0.15) !important;
}

.bg-danger-light {
    background: rgba(255, 0, 111, 0.15) !important;
}

.bg-info-light {
    background: rgba(159, 122, 234, 0.15) !important;
}

/* ==================== PADRONIZAﾃ�グ GLOBAL DE BORDAS ==================== */
/* Garante que todas as tabelas e cards tenham bordas consistentes em ambos os temas */

/* Bordas padrﾃ｣o para tabelas Bootstrap */
.table {
    --bs-table-border-color: var(--ares-border);
}

.table> :not(caption)>*>* {
    border-color: var(--ares-border);
}

.table thead th {
    border-bottom-width: 1px;
    border-color: var(--ares-border);
}

.table tbody tr {
    border-color: var(--ares-border);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 217, 255, 0.03);
}

/* Light Theme - Bordas mais visﾃｭveis */
[data-theme="light"] .table {
    --bs-table-border-color: #e5e7eb;
}

[data-theme="light"] .table> :not(caption)>*>* {
    border-color: #e5e7eb;
}

[data-theme="light"] .table thead th {
    background-color: #f8fafc;
    color: #475569;
    border-bottom: 2px solid #d1d5db;
}

[data-theme="light"] .table tbody tr {
    border-color: #e5e7eb;
}

[data-theme="light"] .table-hover tbody tr:hover {
    background-color: #f1f5f9;
}

/* Cards padronizados */
[data-theme="light"] .card,
[data-theme="light"] .task-card,
[data-theme="light"] .stat-mini,
[data-theme="light"] .tasks-header {
    background: #ffffff !important;
    border-color: #d1d5db !important;
}

[data-theme="light"] .tasks-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%) !important;
    border: 1px solid #d1d5db !important;
}

[data-theme="light"] .stat-mini {
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
}

[data-theme="light"] .task-card {
    background: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .task-title {
    color: #1a1a2e !important;
}

[data-theme="light"] .task-description {
    color: #64748b !important;
}

/* Dropdowns em Light Theme */
[data-theme="light"] .dropdown-menu {
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .dropdown-item {
    color: #1a1a2e;
}

[data-theme="light"] .dropdown-item:hover {
    background: #f1f5f9;
    color: var(--ares-primary);
}

[data-theme="light"] .dropdown-divider {
    border-color: #e5e7eb;
}

/* Modals em Light Theme */
[data-theme="light"] .modal-content {
    background: #ffffff;
    border: 1px solid #d1d5db;
}

[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer {
    border-color: #e5e7eb;
}

[data-theme="light"] .modal-title {
    color: #1a1a2e;
}

/* Button Groups em Light Theme */
[data-theme="light"] .btn-group .btn-outline-primary,
[data-theme="light"] .btn-group .btn-outline-warning,
[data-theme="light"] .btn-group .btn-outline-danger,
[data-theme="light"] .btn-group .btn-outline-success {
    border-color: #d1d5db;
}

[data-theme="light"] .btn-group .btn-outline-primary.active {
    background: var(--ares-primary);
    border-color: var(--ares-primary);
    color: #ffffff;
}

[data-theme="light"] .btn-group .btn-outline-warning.active {
    background: var(--ares-warning);
    border-color: var(--ares-warning);
    color: #000000;
}

[data-theme="light"] .btn-group .btn-outline-danger.active {
    background: var(--ares-danger);
    border-color: var(--ares-danger);
    color: #ffffff;
}

[data-theme="light"] .btn-group .btn-outline-success.active {
    background: var(--ares-success);
    border-color: var(--ares-success);
    color: #000000;
}

.text-primary {
    color: var(--ares-primary) !important;
}

.text-success {
    color: var(--ares-success) !important;
}

.text-warning {
    color: var(--ares-warning) !important;
}

.text-danger {
    color: var(--ares-danger) !important;
}

.text-info {
    color: var(--ares-info) !important;
}

.text-muted {
    color: var(--ares-text-muted) !important;
}

.text-white {
    color: var(--ares-text-primary) !important;
}

/* ==================== ALERTAS ==================== */
.alert {
    border-radius: var(--radius-lg);
    border: 2px solid;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--ares-success);
    color: var(--ares-success);
}

.alert-danger {
    background: rgba(255, 0, 111, 0.1);
    border-color: var(--ares-danger);
    color: var(--ares-danger);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: var(--ares-warning);
    color: var(--ares-warning);
}

.alert-info {
    background: rgba(159, 122, 234, 0.1);
    border-color: var(--ares-info);
    color: var(--ares-info);
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--ares-primary);
    opacity: 0.7;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--ares-text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--ares-text-muted);
}

/* ==================== UTILITﾃヽIOS ==================== */
.glow-primary {
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5) !important;
}

.glow-success {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5) !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ares-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--ares-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--ares-primary) 0%, var(--ares-info) 100%);
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* ==================== TEMA CLARO ==================== */
[data-theme="light"] {
    /* Backgrounds claros */
    --ares-bg-primary: #f5f7fa;
    --ares-bg-secondary: #ffffff;
    --ares-bg-card: rgba(255, 255, 255, 0.98);
    --ares-bg-elevated: #ffffff;

    /* Cores de Acento (mais escuras para contraste) */
    --ares-primary: #0077cc;
    --ares-success: #00a854;
    --ares-warning: #d48806;
    --ares-danger: #cf1322;
    --ares-info: #6f42c1;

    /* Tipografia ESCURA para legibilidade */
    --ares-text-primary: #1a1a2e;
    --ares-text-secondary: #2d3436;
    --ares-text-muted: #5a6978;

    /* Bordas visﾃｭveis */
    --ares-border: rgba(0, 0, 0, 0.12);
    --ares-border-light: rgba(0, 0, 0, 0.08);

    /* Sombras suaves */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.12);
    --shadow-primary-glow: 0 4px 20px rgba(0, 119, 204, 0.25);
}

/* Sidebar no tema claro - BRANCO PURO */
[data-theme="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e5e7eb !important;
}

[data-theme="light"] .sidebar-content {
    background: #ffffff !important;
}

[data-theme="light"] .sidebar-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
}

[data-theme="light"] .sidebar-header h5 {
    color: #111827 !important;
}

[data-theme="light"] .sidebar-header .text-primary {
    color: #2563eb !important;
}

[data-theme="light"] .sidebar .nav-link {
    color: #374151 !important;
    background: transparent !important;
}

[data-theme="light"] .sidebar .nav-link i {
    color: #6b7280 !important;
}

[data-theme="light"] .sidebar .nav-link:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

[data-theme="light"] .sidebar .nav-link:hover i {
    color: #2563eb !important;
}

[data-theme="light"] .sidebar .nav-link.active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

[data-theme="light"] .sidebar .nav-link.active i {
    color: #ffffff !important;
}

[data-theme="light"] .nav-divider {
    color: #9ca3af !important;
    background: transparent !important;
}

[data-theme="light"] .sidebar-footer {
    background: #fafafa !important;
    border-top: 1px solid #e5e7eb !important;
}

[data-theme="light"] .sidebar-footer .nav-link {
    color: #4b5563 !important;
}

[data-theme="light"] .sidebar-footer .nav-link:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

[data-theme="light"] .sidebar-footer .text-danger-emphasis {
    color: #dc2626 !important;
}

[data-theme="light"] .sidebar-nav {
    background: #ffffff !important;
}

/* Navbar no tema claro */
[data-theme="light"] .navbar {
    background: #ffffff;
    border-bottom: 1px solid #e1e5eb;
}

/* Cards no tema claro - Mﾃ々IMO DESTAQUE */
[data-theme="light"] .card {
    background: #ffffff !important;
    border: 2px solid #9ca3af !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.20), 0 4px 10px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .card:hover {
    border-color: #6b7280 !important;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25), 0 6px 16px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-4px);
}

/* Textos e labels */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: #1a1a2e !important;
}

[data-theme="light"] .text-white {
    color: #1a1a2e !important;
}

[data-theme="light"] .text-muted {
    color: #5a6978 !important;
}

[data-theme="light"] p {
    color: #2d3436;
}

/* Formulﾃ｡rios no tema claro - BORDAS VISﾃ昂EIS */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background: #ffffff !important;
    border: 2px solid #9ca3af !important;
    color: #1a1a2e !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .form-label {
    color: #1f2937 !important;
    font-weight: 500 !important;
}

/* Tabelas no tema claro - BORDAS VISﾃ昂EIS */
[data-theme="light"] .table {
    color: #1a1a2e !important;
    border: 2px solid #9ca3af !important;
}

[data-theme="light"] .table thead {
    background: #f3f4f6 !important;
    border-bottom: 2px solid #9ca3af !important;
}

[data-theme="light"] .table th,
[data-theme="light"] .table td {
    border: 1px solid #d1d5db !important;
}

[data-theme="light"] .table-hover tbody tr:hover {
    background: rgba(37, 99, 235, 0.08) !important;
}

[data-theme="light"] .table-responsive {
    border: 2px solid #9ca3af !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Botﾃｵes no tema claro */
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

[data-theme="light"] .btn-outline-secondary {
    color: #4b5563 !important;
    border: 2px solid #9ca3af !important;
}

[data-theme="light"] .btn-outline-secondary:hover {
    background: #f3f4f6 !important;
    border-color: #6b7280 !important;
}

/* Sidebar - Borda sutil */
[data-theme="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e5e7eb !important;
    box-shadow: none !important;
}

[data-theme="light"] .sidebar-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
}

[data-theme="light"] .sidebar-footer {
    background: #fafafa !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Alerts no tema claro */
[data-theme="light"] .alert {
    border: 2px solid #9ca3af !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Badges no tema claro */
[data-theme="light"] .badge.bg-success-light {
    background: rgba(0, 168, 84, 0.15) !important;
    color: #00a854 !important;
}

/* Modais no tema claro */
[data-theme="light"] .modal-content {
    border: 2px solid #9ca3af !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

/* Dropdown no tema claro */
[data-theme="light"] .dropdown-menu {
    border: 2px solid #9ca3af !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Scrollbar no tema claro */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f0f2f5;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #9ca3af !important;
    border-radius: 4px !important;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #6b7280 !important;
}

/* ==================== DROPDOWNS PREMIUM ==================== */
.dropdown-menu {
    background: var(--ares-bg-secondary);
    border: 1px solid var(--ares-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 180px;
    z-index: 9999;
}

.dropdown-item {
    color: var(--ares-text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(0, 217, 255, 0.1);
    color: var(--ares-primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

/* CORREﾃ�グ: text-danger dentro de dropdowns */
.dropdown-item.text-danger {
    color: var(--ares-danger) !important;
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background: rgba(255, 0, 111, 0.15) !important;
    color: var(--ares-danger) !important;
}

.dropdown-item.text-success {
    color: var(--ares-success) !important;
}

.dropdown-item.text-success:hover,
.dropdown-item.text-success:focus {
    background: rgba(0, 255, 136, 0.15) !important;
    color: var(--ares-success) !important;
}

.dropdown-divider {
    border-color: var(--ares-border);
    margin: 0.25rem 0;
}

/* Light theme dropdown */
[data-theme="light"] .dropdown-menu {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .dropdown-item {
    color: #374151;
}

[data-theme="light"] .dropdown-item:hover {
    background: #f3f4f6;
    color: #0ea5e9;
}

[data-theme="light"] .dropdown-item.text-danger {
    color: #dc2626 !important;
}

[data-theme="light"] .dropdown-item.text-danger:hover {
    background: #fef2f2 !important;
}

/* ==================== TEMA ESCURO - CORREﾃ�髭S DE TABELAS (DRE) ==================== */
/* Garante que tabelas nﾃ｣o tenham fundo branco no tema escuro */
.dre-table {
    background-color: transparent !important;
    color: var(--ares-text-primary);
    width: 100%;
}

.dre-table td,
.dre-table th {
    background-color: transparent !important;
    border-color: var(--ares-border);
    color: var(--ares-text-secondary);
}

.dre-table th {
    color: var(--ares-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Linhas de Destaque no Tema Escuro */
.dre-row-highlight {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.dre-row-primary {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

.dre-row-success {
    background-color: rgba(5, 150, 105, 0.08) !important;
}

.dre-row-sub {
    font-size: 0.9rem;
    background-color: transparent !important;
}

.dre-row-total {
    background-color: rgba(255, 255, 255, 0.05) !important;
    font-size: 1.1rem;
    border-top: 2px solid var(--ares-border);
}

/* Ajustes gerais para tables no tema escuro */
.table:not(.table-light) {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ares-text-primary);
    background-color: transparent !important;
}

/* Forﾃｧa cores de texto nas linhas especiais */
.dre-row-primary td {
    color: #60a5fa !important;
}

.dre-row-success td {
    color: #34d399 !important;
}

.dre-row-total td {
    color: var(--ares-text-primary) !important;
    font-weight: 700;
}

/* Correﾃｧﾃ｣o para Light Theme dessas mesmas classes */
[data-theme="light"] .dre-table {
    color: #1a1a2e !important;
}

[data-theme="light"] .dre-table td,
[data-theme="light"] .dre-table th {
    border-color: #e5e7eb;
    color: #374151;
}

[data-theme="light"] .dre-row-primary {
    background-color: #eff6ff !important;
}

[data-theme="light"] .dre-row-primary td {
    color: #1d4ed8 !important;
}

[data-theme="light"] .dre-row-success {
    background-color: #f0fdf4 !important;
}

[data-theme="light"] .dre-row-success td {
    color: #047857 !important;
}

[data-theme="light"] .dre-row-total {
    background-color: #f8fafc !important;
    border-top: 2px solid #cbd5e1;
}

[data-theme="light"] .dre-row-total td {
    color: #0f172a !important;
}

/* ==============================================
   DEPARTMENTS PAGE - PREMIUM STYLES
   ============================================== */

/* KPI Mini Cards */
.kpi-mini-card {
    background: var(--ares-bg-card);
    border: 1px solid var(--ares-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.kpi-mini-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--ares-primary) 0%, var(--ares-info) 100%);
    border-radius: 4px 0 0 4px;
}

.kpi-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-glow);
    border-color: var(--ares-primary);
}

.kpi-mini-card .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-mini-card .kpi-icon.bg-primary-soft {
    background: rgba(0, 217, 255, 0.15);
    color: var(--ares-primary);
}

.kpi-mini-card .kpi-icon.bg-success-soft {
    background: rgba(0, 255, 136, 0.15);
    color: var(--ares-success);
}

.kpi-mini-card .kpi-icon.bg-warning-soft {
    background: rgba(255, 170, 0, 0.15);
    color: var(--ares-warning);
}

.kpi-mini-card .kpi-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--ares-text-primary);
}

.kpi-mini-card .kpi-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--ares-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* List Item Premium */
.list-item-premium {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ares-border);
    transition: all var(--transition-base);
    position: relative;
}

.list-item-premium:last-child {
    border-bottom: none;
}

.list-item-premium:hover {
    background: rgba(0, 217, 255, 0.05);
}

.list-item-premium::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(180deg, var(--ares-primary) 0%, var(--ares-info) 100%);
    transition: width var(--transition-fast);
}

.list-item-premium:hover::after {
    width: 3px;
}

.dept-color-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.dept-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
}

.dept-stat-item {
    font-size: 0.75rem;
    color: var(--ares-text-muted);
}

.dept-stat-item span {
    font-weight: 600;
}

/* Empty State Animated */
.empty-state-animated {
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-animated .empty-icon {
    font-size: 4rem;
    color: var(--ares-text-muted);
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

.empty-state-animated h5 {
    margin-top: 1rem;
    color: var(--ares-text-secondary);
    font-weight: 600;
}

.empty-state-animated p {
    color: var(--ares-text-muted);
    font-size: 0.9rem;
    max-width: 280px;
    margin: 0.5rem auto 1.5rem;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Card Header Premium */
.card-header-premium {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.08) 0%, rgba(159, 122, 234, 0.05) 100%);
    border-bottom: 1px solid var(--ares-border);
    padding: 1rem 1.25rem;
}

.card-header-premium h5 {
    margin: 0;
    font-weight: 600;
    color: var(--ares-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header-premium h5 i {
    color: var(--ares-primary);
}

/* Modal Premium */
.modal-content-premium {
    background: var(--ares-bg-elevated);
    backdrop-filter: blur(20px);
    border: 1px solid var(--ares-border);
    border-radius: var(--radius-xl);
}

.modal-content-premium .modal-header {
    border-bottom: 1px solid var(--ares-border);
    padding: 1.25rem 1.5rem;
}

.modal-content-premium .modal-body {
    padding: 1.5rem;
}

.modal-content-premium .modal-footer {
    border-top: 1px solid var(--ares-border);
    padding: 1rem 1.5rem;
}

/* Color Preview */
.color-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-preview-wrapper input[type="color"] {
    width: 60px;
    height: 42px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.color-preview-box {
    width: 100%;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--ares-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.animate-delay-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animate-delay-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

/* Light Theme Adjustments */
[data-theme="light"] .kpi-mini-card {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .kpi-mini-card:hover {
    border-color: var(--ares-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .card {
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .list-item-premium:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .card-header-premium {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%);
    border-bottom: 1px solid #cbd5e1;
}

[data-theme="light"] .empty-state-animated .empty-icon {
    color: #9ca3af;
}

[data-theme="light"] .modal-content-premium {
    background: #ffffff;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
}

/* --- ADICIONAL: Correﾃｧﾃｵes de Visibilidade em Tema Claro (ZEUS) --- */
[data-theme="light"] .kpi-label {
    color: #475569 !important;
    font-weight: 600 !important;
}

[data-theme="light"] .kpi-value {
    color: #0f172a !important;
}

[data-theme="light"] .table-stats-wrapper table th {
    color: #0f172a !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

[data-theme="light"] .table-stats-wrapper table td {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .table-name {
    color: #1e293b !important;
    font-weight: 500 !important;
}

[data-theme="light"] .security-tip {
    color: #334155 !important;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .security-tip span {
    color: #1e293b !important;
    font-weight: 500;
}

[data-theme="light"] .restore-step .step-content h6 {
    color: #0f172a !important;
    font-weight: 700 !important;
}

[data-theme="light"] .restore-step .step-content p {
    color: #475569 !important;
}

[data-theme="light"] .card-header-premium h6 {
    color: #0f172a !important;
}

[data-theme="light"] .tip-content h6 {
    color: #0f172a !important;
}

[data-theme="light"] .tip-content p {
    color: #475569 !important;
}

[data-theme="light"] .connection-status h6 {
    color: #0f172a !important;
}

[data-theme="light"] .status-info h6 {
    color: #0f172a !important;
}

/* Fix Badges Contrast in Light Theme */
[data-theme="light"] .badge.bg-primary-subtle {
    color: #0369a1 !important;
    background-color: #e0f2fe !important;
}

[data-theme="light"] .badge.bg-info-subtle {
    color: #0891b2 !important;
    background-color: #cffafe !important;
}

[data-theme="light"] .badge.bg-secondary-subtle {
    color: #334155 !important;
    background-color: #f1f5f9 !important;
}

[data-theme="light"] .badge.text-primary {
    color: #0369a1 !important;
}

[data-theme="light"] .badge.text-info {
    color: #0891b2 !important;
}

/* ==================== MELHORIA: BOTﾃグ MOBILE TOGGLE ==================== */
/* Botﾃ｣o que adapta cores conforme o tema para evitar 'borrﾃｵes' */
.btn-mobile-toggle {
    background: rgba(0, 217, 255, 0.1) !important;
    border: 1px solid rgba(0, 217, 255, 0.2) !important;
    color: var(--ares-primary) !important;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.1);
    z-index: 1060;
}

.btn-mobile-toggle:hover {
    background: var(--ares-primary) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 217, 255, 0.3);
}

[data-theme="light"] .btn-mobile-toggle {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .btn-mobile-toggle i {
    color: #1a1a2e !important;
}

[data-theme="light"] .btn-mobile-toggle:hover {
    background: var(--ares-primary) !important;
    color: white !important;
    border-color: var(--ares-primary) !important;
}

[data-theme="light"] .btn-mobile-toggle:hover i {
    color: white !important;
}

/* ==================== MOBILE MEDIA QUERIES (REFINADO) ==================== */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        left: -285px !important;
        width: 260px !important;
        /* Reduzido de 280px */
        height: 100vh !important;
        z-index: 1100 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        transform: translateX(0);
        visibility: hidden;
        margin: 0 !important;
    }

    .sidebar.active {
        transform: translateX(285px);
        visibility: visible;
        box-shadow: 15px 0 35px rgba(0, 0, 0, 0.6) !important;
    }

    .sidebar .nav-link {
        padding: 0.6rem 0.75rem !important;
        /* Reduzido */
        font-size: 0.85rem !important;
        /* Reduzido */
    }

    .sidebar .nav-link i {
        font-size: 1rem !important;
        /* Reduzido */
    }

    .nav-divider {
        padding: 0.75rem 0.75rem 0.35rem !important;
        /* Reduzido */
        font-size: 0.65rem !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 5px;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(3px);
        z-index: 1090;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    /* Ativado via JS adicionando .active no sidebar */
    .sidebar.active~.sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* Ajuste Footer Mobile */
    .footer-menu-item {
        padding: 8px 4px !important;
    }

    .footer-menu-item i {
        font-size: 1.1rem !important;
    }

    .footer-menu-item span {
        font-size: 0.55rem !important;
    }

    /* ==================== CORREﾃ�髭S GLOBAIS MOBILE ==================== */
    /* Forﾃｧar empilhamento de cabeﾃｧalhos de pﾃ｡gina */
    .container-fluid>.d-flex:first-child {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .container-fluid>.d-flex:first-child>div:first-child {
        text-align: left;
    }

    .container-fluid>.d-flex:first-child>div:first-child h4,
    .container-fluid>.d-flex:first-child>div:first-child h1 {
        text-align: center;
    }

    .container-fluid>.d-flex:first-child>div:first-child p {
        text-align: center;
    }

    .container-fluid>.d-flex:first-child>a.btn,
    .container-fluid>.d-flex:first-child>button.btn {
        width: auto !important;
        max-width: 280px;
        margin: 0 auto;
    }

    /* Tﾃｭtulos menores no mobile */
    h1,
    h2,
    h3,
    h4 {
        font-size: 1.25rem !important;
    }

    h5,
    h6 {
        font-size: 1rem !important;
    }

    /* Botﾃｵes menores e compactos */
    .btn {
        font-size: 0.85rem !important;
        padding: 0.5rem 1rem !important;
    }

    .btn-sm {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.65rem !important;
    }

    /* Grupos de botﾃｵes com scroll horizontal */
    .btn-group {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .btn-group::-webkit-scrollbar {
        display: none;
    }

    /* Cards de estatﾃｭsticas */
    .stat-mini {
        padding: 0.75rem !important;
    }

    .stat-mini .value {
        font-size: 1.25rem !important;
    }

    .stat-mini .label {
        font-size: 0.65rem !important;
    }

    /* Tasks Header compacto */
    .tasks-header {
        padding: 1rem !important;
    }

    .tasks-header h4 {
        font-size: 1.1rem !important;
    }

    .tasks-header p {
        font-size: 0.75rem !important;
    }

    /* Tabelas responsivas */
    .table-premium th,
    .table-premium td {
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Cards de mﾃｩtricas */
    .card-body {
        padding: 1rem !important;
    }

    .card h4,
    .card h5 {
        font-size: 1rem !important;
    }

    /* Empty states */
    .empty-state i {
        font-size: 2.5rem !important;
    }

    .empty-state h5 {
        font-size: 1rem !important;
    }

    .empty-state p {
        font-size: 0.8rem !important;
    }
}

/* ==================== TELAS MUITO PEQUENAS (320px) ==================== */
@media (max-width: 374px) {

    h1,
    h2,
    h3,
    h4 {
        font-size: 1.1rem !important;
    }

    .btn {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }

    .stat-mini .value {
        font-size: 1.1rem !important;
    }

    .stat-mini .label {
        font-size: 0.6rem !important;
    }

    .navbar-brand span {
        font-size: 1rem !important;
    }

    .card-body {
        padding: 0.75rem !important;
    }
}

/* ==================== BOTﾕES PERSONALIZADOS ARES ==================== */
.btn-ares-glow {
    background: linear-gradient(135deg, #00d9ff 0%, #00f2fe 100%);
    border: none;
    color: #0a0e14 !important;
    font-weight: 700;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px -10px rgba(0, 217, 255, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-ares-glow:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 217, 255, 0.8);
    filter: brightness(1.1);
    color: #000 !important;
}


/* ==================== BUTTON STANDARDIZATION V2 ==================== */
.btn-ares-glow {
    background: linear-gradient(135deg, #00d9ff 0%, #00f2fe 100%) !important;
    border: none !important;
    color: #000 !important;
    font-weight: 700 !important;
    padding: 0 1.25rem !important;
    height: 38px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 0.85rem !important;
    box-shadow: 0 10px 20px -10px rgba(0, 217, 255, 0.5) !important;
    transition: all 0.3s ease !important;
}

.btn-ares-glow:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px -10px rgba(0, 217, 255, 0.8) !important;
    filter: brightness(1.1) !important;
}

.btn-ares-glow-success {
    background: linear-gradient(135deg, #00ff88 0%, #00d1ff 100%) !important;
    border: none !important;
    color: #000 !important;
    font-weight: 700 !important;
    padding: 0 1.25rem !important;
    height: 38px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 0.85rem !important;
    box-shadow: 0 10px 20px -10px rgba(0, 255, 136, 0.5) !important;
    transition: all 0.3s ease !important;
}

.btn-ares-glow-success:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px -10px rgba(0, 255, 136, 0.8) !important;
    filter: brightness(1.1) !important;
}

.btn-ares-glow i,
.btn-ares-glow-success i {
    font-size: 1rem !important;
    margin-right: 6px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
}

/* FORCE BLACK ICON VISIBILITY */
.btn-ares-glow i,
.btn-ares-glow-success i {
    color: #000 !important;
    opacity: 1 !important;
}

/* FIX ICON SIZE AND ALIGNMENT V3 */
.btn-ares-glow i,
.btn-ares-glow-success i {
    font-size: 1.1rem !important;
    margin-right: 8px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    color: #000 !important;
    opacity: 1 !important;
    position: relative !important;
    top: 0 !important;
}

/* FIX ICON VERTICAL ALIGNMENT V4 */
.btn-ares-glow,
.btn-ares-glow-success {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn-ares-glow i,
.btn-ares-glow-success i {
    font-size: 1rem !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: baseline !important;
    color: #000 !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
}

/* DARK THEME INPUT GROUPS FIX */
.input-group-text {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--ares-primary) !important;
    border-right: none !important;
}

.input-group .form-control {
    border-left: none !important;
}

.input-group-text i {
    color: var(--ares-primary) !important;
    opacity: 0.8 !important;
}

/* TEXT CONTRAST FIX FOR DARK THEME */
.form-text {
    color: rgba(255, 255, 255, 0.6) !important;
}

.text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.text-secondary {
    color: rgba(255, 255, 255, 0.7) !important;
}