/* ============================================================
   NOVA UI — Design System Oficial | Servidor CrieArt
   Enterprise SaaS Premium | Dark/Light Theme
   ============================================================ */

/* --- THEME VARIABLES --- */
:root, html[data-theme='dark'] {
    --theme-accent: #8b5cf6;
    --theme-accent-rgb: 139, 92, 246;
    --theme-body-bg: #070814;
    --theme-body-bg-rgb: 7, 8, 20;
    --theme-surface-bg: #0f1224;
    --theme-surface-bg-rgb: 15, 18, 36;
    --theme-header-bg: #0b0f1d;
    --theme-header-bg-rgb: 11, 15, 29;
    --theme-header-active: #f8fafc;
    --theme-header-text-color: #f8fafc;
    --theme-link-color: #8b5cf6;
    --theme-link-hover-color: #22d3ee;
    --theme-border-color: #1f2440;
    --theme-muted-text-color: #8b93b7;
    --theme-success-color: #059669;
    --theme-warning-color: #d97706;
    --theme-danger-color: #dc2626;
    --theme-input-surface: rgba(10, 14, 28, 0.82);
    --theme-input-text: #f8fafc;
    --theme-input-placeholder: #8ea0c5;
    --theme-card-radius: 18px;
    --theme-input-radius: 14px;
    --theme-button-radius: 14px;
    --theme-font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    --theme-panel-bg: linear-gradient(180deg, rgba(12,14,27,0.94) 0%, rgba(11,13,25,0.82) 100%);
    --theme-panel-border: rgba(255, 255, 255, 0.10);
    --theme-panel-shadow: 0 30px 90px -56px rgba(0,0,0,0.74);
    --theme-soft-surface: rgba(255,255,255,0.03);
    --theme-soft-surface-hover: rgba(255,255,255,0.06);
    --theme-top-bg: radial-gradient(circle at top, rgba(139,92,246,0.16), transparent 20%), linear-gradient(180deg,#04050d 0%,#070814 32%,#090b19 100%);
    --nova-card-bg: linear-gradient(180deg, rgba(14,17,31,0.94) 0%, rgba(10,13,25,0.86) 100%);
    --nova-card-border: rgba(255,255,255,0.08);
    --nova-card-shadow: 0 24px 60px -42px rgba(0,0,0,0.66);
    --nova-soft-bg: rgba(255,255,255,0.03);
    --nova-soft-border: rgba(255,255,255,0.08);
    --nova-deep-bg: linear-gradient(180deg, rgba(6,8,18,0.98) 0%, rgba(9,12,24,0.98) 100%);
    --nova-deep-border: rgba(255,255,255,0.06);
    --nova-popover-bg: linear-gradient(180deg, rgba(13,17,32,0.99) 0%, rgba(10,12,24,0.98) 100%);
    --nova-popover-border: rgba(255,255,255,0.10);
    --nova-popover-shadow: 0 30px 80px -40px rgba(0,0,0,0.9);
    --nova-violet-surface-bg: linear-gradient(135deg, rgba(38,20,64,0.74) 0%, rgba(18,18,34,0.94) 48%, rgba(10,12,24,0.98) 100%);
    --nova-violet-surface-border: rgba(167,139,250,0.14);
    --nova-cyan-surface-bg: linear-gradient(135deg, rgba(10,52,74,0.46) 0%, rgba(12,20,36,0.96) 55%, rgba(9,12,24,0.98) 100%);
    --nova-cyan-surface-border: rgba(34,211,238,0.14);
    --nova-emerald-surface-bg: linear-gradient(135deg, rgba(8,64,58,0.42) 0%, rgba(11,20,28,0.96) 56%, rgba(10,12,24,0.98) 100%);
    --nova-emerald-surface-border: rgba(52,211,153,0.14);
    --nova-amber-surface-bg: linear-gradient(135deg, rgba(84,50,12,0.34) 0%, rgba(28,18,17,0.96) 52%, rgba(10,12,24,0.98) 100%);
    --nova-amber-surface-border: rgba(251,191,36,0.14);
}

html[data-theme='light'] {
    --theme-body-bg: #f4f7fb;
    --theme-surface-bg: #ffffff;
    --theme-header-bg: #ffffff;
    --theme-header-active: #0f172a;
    --theme-header-text-color: #0f172a;
    --theme-link-color: #4f46e5;
    --theme-link-hover-color: #0891b2;
    --theme-border-color: #dbe3f0;
    --theme-muted-text-color: #64748b;
    --theme-input-surface: #ffffff;
    --theme-input-text: #0f172a;
    --theme-input-placeholder: #94a3b8;
    --theme-panel-bg: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%);
    --theme-panel-border: rgba(148, 163, 184, 0.22);
    --theme-panel-shadow: 0 26px 70px -42px rgba(15, 23, 42, 0.18);
    --theme-soft-surface: rgba(15,23,42,0.04);
    --theme-soft-surface-hover: rgba(15,23,42,0.08);
    --theme-top-bg: radial-gradient(circle at top, rgba(79,70,229,0.08), transparent 30%), linear-gradient(180deg, #f8fbff 0%, #f4f7fb 50%, #edf3fb 100%);
    --nova-card-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --nova-card-border: rgba(148,163,184,0.22);
    --nova-card-shadow: 0 8px 24px -10px rgba(15,23,42,0.08), 0 4px 12px -4px rgba(15,23,42,0.05);
    --nova-soft-bg: rgba(15,23,42,0.04);
    --nova-soft-border: rgba(148,163,184,0.18);
    --nova-deep-bg: linear-gradient(180deg, #f1f5f9 0%, #e9eef7 100%);
    --nova-deep-border: rgba(148,163,184,0.16);
    --nova-popover-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --nova-popover-border: rgba(148,163,184,0.2);
    --nova-popover-shadow: 0 20px 40px -15px rgba(15,23,42,0.15);
    --nova-violet-surface-bg: linear-gradient(135deg, rgba(237,233,254,0.95) 0%, rgba(255,255,255,0.95) 100%);
    --nova-violet-surface-border: rgba(139,92,246,0.25);
    --nova-cyan-surface-bg: linear-gradient(135deg, rgba(207,250,254,0.95) 0%, rgba(255,255,255,0.95) 100%);
    --nova-cyan-surface-border: rgba(34,211,238,0.25);
    --nova-emerald-surface-bg: linear-gradient(135deg, rgba(209,250,229,0.95) 0%, rgba(255,255,255,0.95) 100%);
    --nova-emerald-surface-border: rgba(52,211,153,0.25);
    --nova-amber-surface-bg: linear-gradient(135deg, rgba(254,243,199,0.95) 0%, rgba(255,255,255,0.95) 100%);
    --nova-amber-surface-border: rgba(251,191,36,0.25);
}

/* --- GLOBAL RESET --- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    font-family: var(--theme-font-sans);
    background: var(--theme-top-bg, var(--theme-body-bg));
    color: var(--theme-header-text-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(var(--theme-accent-rgb), 0.28);
    color: #fff;
}

/* --- NOVA SURFACES --- */
.nova-card-surface {
    border: 1px solid var(--nova-card-border);
    background: var(--nova-card-bg);
    box-shadow: var(--nova-card-shadow);
    border-radius: var(--theme-card-radius);
}

.nova-soft-surface {
    border: 1px solid var(--nova-soft-border);
    background: var(--nova-soft-bg);
    border-radius: var(--theme-card-radius);
}

.nova-deep-surface {
    border: 1px solid var(--nova-deep-border);
    background: var(--nova-deep-bg);
    border-radius: var(--theme-card-radius);
}

.nova-accent-surface--violet {
    border: 1px solid var(--nova-violet-surface-border);
    background: var(--nova-violet-surface-bg);
    box-shadow: var(--nova-card-shadow);
    border-radius: var(--theme-card-radius);
}

.nova-accent-surface--cyan {
    border: 1px solid var(--nova-cyan-surface-border);
    background: var(--nova-cyan-surface-bg);
    box-shadow: var(--nova-card-shadow);
    border-radius: var(--theme-card-radius);
}

.nova-accent-surface--emerald {
    border: 1px solid var(--nova-emerald-surface-border);
    background: var(--nova-emerald-surface-bg);
    box-shadow: var(--nova-card-shadow);
    border-radius: var(--theme-card-radius);
}

.nova-accent-surface--amber {
    border: 1px solid var(--nova-amber-surface-border);
    background: var(--nova-amber-surface-bg);
    box-shadow: var(--nova-card-shadow);
    border-radius: var(--theme-card-radius);
}

/* --- NOVA ANIMATIONS --- */
.nova-reveal {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(0.985);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
                filter 700ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--nova-delay, 0ms);
    filter: blur(10px);
    will-change: opacity, transform, filter;
}

.nova-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
}

.nova-stagger-1 { --nova-delay: 80ms; }
.nova-stagger-2 { --nova-delay: 160ms; }
.nova-stagger-3 { --nova-delay: 240ms; }
.nova-stagger-4 { --nova-delay: 320ms; }
.nova-stagger-5 { --nova-delay: 400ms; }
.nova-stagger-6 { --nova-delay: 480ms; }

.nova-float { animation: nova-float 7s ease-in-out infinite; }
.nova-float-soft { animation: nova-float-soft 9s ease-in-out infinite; }
.nova-pulse-glow { animation: nova-pulse-glow 4.6s ease-in-out infinite; }

.nova-tilt-hover {
    transform-style: preserve-3d;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
                border-color 320ms ease,
                box-shadow 320ms ease;
}

.nova-tilt-hover:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(139, 92, 246, 0.28);
    box-shadow: 0 28px 70px -38px rgba(0, 0, 0, 0.9),
                0 0 0 1px rgba(139, 92, 246, 0.08),
                0 0 42px rgba(34, 211, 238, 0.07);
}

.nova-sheen {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.nova-sheen::after {
    content: "";
    position: absolute;
    inset: -140% auto -140% -35%;
    width: 38%;
    transform: rotate(18deg) translateX(-220%);
    background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.14), rgba(255,255,255,0));
    opacity: 0;
    pointer-events: none;
}

.nova-sheen:hover::after {
    opacity: 1;
    animation: nova-sheen 1.15s ease;
}

.nova-grid-glow {
    position: relative;
}

.nova-grid-glow::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.18), transparent 36%),
                radial-gradient(circle at 80% 12%, rgba(34, 211, 238, 0.12), transparent 30%),
                radial-gradient(circle at 65% 86%, rgba(236, 72, 153, 0.12), transparent 30%);
    opacity: 0.8;
    z-index: -1;
    filter: blur(22px);
}

@keyframes nova-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
}

@keyframes nova-float-soft {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -7px, 0); }
}

@keyframes nova-pulse-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(139, 92, 246, 0), 0 0 28px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 0 rgba(139, 92, 246, 0), 0 0 44px rgba(34, 211, 238, 0.24); }
}

@keyframes nova-sheen {
    0% { transform: rotate(18deg) translateX(-220%); }
    100% { transform: rotate(18deg) translateX(480%); }
}

/* --- CHART FIX (BUG CRÍTICO) --- */
.chart-container {
    position: relative;
    height: 320px;
    min-height: 320px;
    max-height: 320px;
    overflow: hidden;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
}

.chart-container-sm {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
}

/* --- SIDEBAR ENTERPRISE --- */
.nova-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--nova-card-bg);
    border-right: 1px solid var(--nova-card-border);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.nova-sidebar .sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nova-sidebar .sidebar-brand h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--theme-header-text-color);
    margin: 0;
}

.nova-sidebar .sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nova-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    color: var(--theme-muted-text-color);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
    margin-bottom: 2px;
    text-decoration: none;
}

.nova-sidebar .nav-link:hover {
    color: var(--theme-header-text-color);
    background: var(--theme-soft-surface-hover);
}

.nova-sidebar .nav-link.active {
    color: #fff;
    background: rgba(var(--theme-accent-rgb), 0.15);
    box-shadow: 0 0 20px rgba(var(--theme-accent-rgb), 0.1);
}

.nova-sidebar .nav-link.active i {
    color: var(--theme-accent);
}

.nova-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

/* --- NAVBAR ENTERPRISE --- */
.nova-navbar {
    height: 64px;
    background: var(--theme-header-bg);
    border-bottom: 1px solid var(--theme-border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1040;
}

/* --- MAIN WRAPPER --- */
.nova-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nova-content {
    flex: 1;
    padding: 2rem;
}

/* --- ANALYTICS CARDS NOVA --- */
.nova-stat-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nova-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 70px -38px rgba(0, 0, 0, 0.9),
                0 0 0 1px rgba(var(--theme-accent-rgb), 0.12);
}

.nova-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.nova-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--theme-header-text-color);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.nova-stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--theme-muted-text-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    margin-top: 0.25rem;
}

.nova-stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    margin-top: 0.5rem;
}

.nova-stat-card .stat-trend.up { background: rgba(5, 150, 105, 0.12); color: #34d399; }
.nova-stat-card .stat-trend.down { background: rgba(220, 38, 38, 0.12); color: #f87171; }

/* Icon colors */
.stat-icon-violet { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }
.stat-icon-cyan { background: rgba(34, 211, 238, 0.12); color: #22d3ee; }
.stat-icon-emerald { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.stat-icon-amber { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.stat-icon-rose { background: rgba(251, 113, 133, 0.12); color: #fb7185; }
.stat-icon-blue { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }

/* --- TIMELINE NOVA --- */
.nova-timeline {
    position: relative;
    padding-left: 1.75rem;
}

.nova-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, rgba(var(--theme-accent-rgb), 0.4), rgba(var(--theme-accent-rgb), 0.05));
    border-radius: 2px;
}

.nova-timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.nova-timeline-item:last-child { padding-bottom: 0; }

.nova-timeline-item .dot {
    position: absolute;
    left: -1.5rem;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--theme-accent);
    background: var(--theme-body-bg);
}

.nova-timeline-item .dot.dot-green { border-color: #34d399; }
.nova-timeline-item .dot.dot-red { border-color: #f87171; }
.nova-timeline-item .dot.dot-amber { border-color: #fbbf24; }
.nova-timeline-item .dot.dot-blue { border-color: #60a5fa; }

/* --- FORMS NOVA --- */
.nova-input {
    background: var(--theme-input-surface);
    border: 1px solid var(--theme-border-color);
    border-radius: var(--theme-input-radius);
    color: var(--theme-input-text);
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    transition: all 250ms ease;
    width: 100%;
}

.nova-input:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb), 0.15);
}

.nova-input::placeholder {
    color: var(--theme-input-placeholder);
}

/* --- BUTTONS NOVA --- */
.nova-btn {
    border-radius: var(--theme-button-radius);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem 1.25rem;
    transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid transparent;
}

.nova-btn-primary {
    background: var(--theme-accent);
    color: #fff;
    border-color: var(--theme-accent);
}

.nova-btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 12px 30px -12px rgba(var(--theme-accent-rgb), 0.4);
}

/* --- TABLES NOVA --- */
.nova-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.nova-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--theme-muted-text-color);
    font-weight: 600;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--theme-border-color);
    background: var(--theme-soft-surface);
}

.nova-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.85rem;
    color: var(--theme-header-text-color);
    transition: background 200ms ease;
}

.nova-table tbody tr:hover td {
    background: var(--theme-soft-surface-hover);
}

/* --- RESPONSIVE --- */
@media (max-width: 991.98px) {
    .nova-sidebar { display: none; }
    .nova-main { margin-left: 0; }
    .nova-content { padding: 1.25rem; }
}

@media (max-width: 575.98px) {
    .nova-content { padding: 1rem; }
    .nova-stat-card .stat-value { font-size: 1.4rem; }
    .chart-container { height: 240px; min-height: 240px; max-height: 240px; }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    .nova-reveal, .nova-float, .nova-float-soft, .nova-pulse-glow,
    .nova-tilt-hover, .nova-sheen::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        filter: none !important;
        opacity: 1 !important;
    }
}

/* --- SCROLLBAR --- */
.nova-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--theme-accent-rgb), 0.72) rgba(255, 255, 255, 0.05);
}

.nova-scrollbar::-webkit-scrollbar { width: 8px; }
.nova-scrollbar::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 999px; }
.nova-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--theme-accent-rgb), 0.96) 0%, rgba(var(--theme-accent-rgb), 0.68) 100%);
    border-radius: 999px;
}


/* ============================================================
   GLOBAL BOOTSTRAP OVERRIDES — Dark Theme Enterprise
   ============================================================ */

/* --- Modais Premium (corrige bug do modal branco) --- */
.modal-content {
    background: var(--nova-card-bg) !important;
    border: 1px solid var(--nova-card-border) !important;
    border-radius: var(--theme-card-radius) !important;
    color: var(--theme-header-text-color) !important;
    box-shadow: var(--nova-popover-shadow) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    color: var(--theme-header-text-color) !important;
    font-weight: 600;
    font-size: 1rem;
}

.modal-body {
    padding: 1.5rem;
    color: var(--theme-header-text-color);
}

.modal-footer {
    border-top: 1px solid rgba(255,255,255,0.05) !important;
    padding: 1rem 1.5rem;
}

.modal-backdrop.show {
    opacity: 0.7;
    background: #04050d;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.6;
}

.btn-close:hover { opacity: 1; }

html[data-theme='light'] .btn-close {
    filter: none;
}

/* --- Formulários Globais (input, select, textarea) --- */
.form-control,
.form-select {
    background: var(--theme-input-surface) !important;
    border: 1px solid var(--theme-border-color) !important;
    color: var(--theme-input-text) !important;
    border-radius: var(--theme-input-radius) !important;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    transition: all 250ms ease;
}

.form-control:focus,
.form-select:focus {
    background: var(--theme-input-surface) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-input-text) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb), 0.15) !important;
}

.form-control::placeholder {
    color: var(--theme-input-placeholder) !important;
}

.form-control[disabled],
.form-control:disabled {
    background: var(--theme-soft-surface) !important;
    color: var(--theme-muted-text-color) !important;
    opacity: 0.7;
}

.form-label {
    color: var(--theme-muted-text-color);
    font-weight: 500;
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-text {
    color: var(--theme-muted-text-color);
    font-size: 0.75rem;
}

.form-check-input {
    background-color: var(--theme-input-surface);
    border-color: var(--theme-border-color);
}

.form-check-input:checked {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
}

.form-check-input:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb), 0.15);
}

.form-check-label {
    color: var(--theme-header-text-color);
    font-size: 0.875rem;
}

/* Select dropdown options */
select.form-select option {
    background: var(--theme-surface-bg);
    color: var(--theme-header-text-color);
}

/* --- Botões Globais --- */
.btn {
    border-radius: var(--theme-button-radius);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1.25rem;
    transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #fff;
}

.btn-primary:hover {
    background: #7c3aed;
    border-color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 12px 30px -12px rgba(var(--theme-accent-rgb), 0.5);
}

.btn-outline-primary {
    background: transparent;
    border-color: rgba(var(--theme-accent-rgb), 0.4);
    color: var(--theme-accent);
}

.btn-outline-primary:hover {
    background: rgba(var(--theme-accent-rgb), 0.12);
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}

.btn-secondary {
    background: var(--theme-soft-surface);
    border-color: var(--theme-border-color);
    color: var(--theme-header-text-color);
}

.btn-secondary:hover {
    background: var(--theme-soft-surface-hover);
    border-color: var(--theme-border-color);
    color: var(--theme-header-text-color);
}

.btn-outline-secondary {
    background: transparent;
    border-color: var(--theme-border-color);
    color: var(--theme-muted-text-color);
}

.btn-outline-secondary:hover {
    background: var(--theme-soft-surface-hover);
    border-color: var(--theme-border-color);
    color: var(--theme-header-text-color);
}

.btn-success {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
    color: #fff;
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-warning {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.btn-link {
    color: var(--theme-link-color);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--theme-link-hover-color);
}

/* --- Tabelas Premium --- */
.table {
    color: var(--theme-header-text-color);
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255,255,255,0.05);
    margin-bottom: 0;
}

.table thead th {
    background: var(--theme-soft-surface) !important;
    color: var(--theme-muted-text-color) !important;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--theme-border-color) !important;
    border-top: none !important;
}

.table tbody td {
    padding: 0.875rem 1rem;
    border-color: rgba(255,255,255,0.04) !important;
    color: var(--theme-header-text-color);
    font-size: 0.85rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background 200ms ease;
}

.table-hover tbody tr:hover {
    --bs-table-hover-bg: var(--theme-soft-surface-hover);
    --bs-table-hover-color: var(--theme-header-text-color);
}

.table-responsive {
    border-radius: var(--theme-card-radius);
}

/* --- Cards Bootstrap → Nova --- */
.card {
    background: var(--nova-card-bg) !important;
    border: 1px solid var(--nova-card-border) !important;
    border-radius: var(--theme-card-radius) !important;
    color: var(--theme-header-text-color);
    box-shadow: var(--nova-card-shadow);
}

.card-header {
    background: rgba(255,255,255,0.02) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    color: var(--theme-header-text-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: rgba(255,255,255,0.02) !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
    padding: 1rem 1.5rem;
}

.card-title {
    color: var(--theme-header-text-color);
    font-weight: 600;
}

/* --- Alerts Premium --- */
.alert {
    border-radius: 12px;
    border: 1px solid;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
    color: #34d399;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
}

.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
    color: #fbbf24;
}

.alert-info {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
    color: #22d3ee;
}

/* --- Badges --- */
.badge {
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.badge.bg-success { background: rgba(5, 150, 105, 0.18) !important; color: #34d399 !important; }
.badge.bg-danger { background: rgba(220, 38, 38, 0.18) !important; color: #f87171 !important; }
.badge.bg-warning { background: rgba(217, 119, 6, 0.18) !important; color: #fbbf24 !important; }
.badge.bg-info { background: rgba(34, 211, 238, 0.18) !important; color: #22d3ee !important; }
.badge.bg-secondary { background: rgba(139, 147, 183, 0.18) !important; color: #8b93b7 !important; }
.badge.bg-primary { background: rgba(var(--theme-accent-rgb), 0.18) !important; color: #a78bfa !important; }

/* --- Dropdowns --- */
.dropdown-menu {
    background: var(--nova-popover-bg) !important;
    border: 1px solid var(--nova-popover-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--nova-popover-shadow);
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--theme-header-text-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    transition: all 150ms ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--theme-soft-surface-hover) !important;
    color: var(--theme-header-text-color);
}

.dropdown-item-text {
    color: var(--theme-muted-text-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.dropdown-divider {
    border-color: rgba(255,255,255,0.05);
    margin: 0.25rem 0;
}

/* --- Pagination --- */
.pagination {
    gap: 4px;
}

.page-item .page-link {
    background: var(--theme-soft-surface);
    border-color: var(--theme-border-color);
    color: var(--theme-muted-text-color);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.page-item .page-link:hover {
    background: var(--theme-soft-surface-hover);
    border-color: var(--theme-border-color);
    color: var(--theme-header-text-color);
}

.page-item.active .page-link {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #fff;
}

.page-item.disabled .page-link {
    background: rgba(255,255,255,0.02);
    color: rgba(139, 147, 183, 0.5);
    border-color: rgba(255,255,255,0.04);
}

/* --- Page Headers (consistent) --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-header-text-color);
    margin: 0;
}

.page-header .page-subtitle {
    font-size: 0.85rem;
    color: var(--theme-muted-text-color);
    margin-top: 0.25rem;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--theme-muted-text-color);
}

.empty-state .empty-icon {
    font-size: 3rem;
    color: rgba(139, 147, 183, 0.3);
    margin-bottom: 1rem;
}

.empty-state .empty-title {
    color: var(--theme-header-text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* --- Status Indicators --- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-dot.online { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.status-dot.offline { background: #f87171; }
.status-dot.idle { background: #fbbf24; }

/* --- Chart Card Light Theme --- */
html[data-theme='light'] .chart-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='light'] .chart-card:hover {
    border-color: rgba(79, 70, 229, 0.2);
}

/* --- Nova Stat Card Light Hover --- */
html[data-theme='light'] .nova-stat-card:hover {
    box-shadow: 0 16px 40px -16px rgba(15, 23, 42, 0.12),
                0 0 0 1px rgba(79, 70, 229, 0.1);
    transform: translateY(-4px);
}

/* --- Light theme progress bars --- */
html[data-theme='light'] .progress-premium {
    background: rgba(15, 23, 42, 0.06);
}

/* --- Light theme timeline --- */
html[data-theme='light'] .nova-timeline-item .dot {
    background: #ffffff;
}

/* --- Light theme quick action buttons --- */
html[data-theme='light'] .quick-action-btn i {
    color: #4f46e5;
}

/* --- Light theme accent surfaces --- */
html[data-theme='light'] .nova-accent-surface--violet {
    box-shadow: 0 8px 24px -10px rgba(79, 70, 229, 0.08);
}

html[data-theme='light'] .nova-accent-surface--cyan {
    box-shadow: 0 8px 24px -10px rgba(34, 211, 238, 0.08);
}

html[data-theme='light'] .nova-accent-surface--emerald {
    box-shadow: 0 8px 24px -10px rgba(52, 211, 153, 0.08);
}

html[data-theme='light'] .nova-accent-surface--amber {
    box-shadow: 0 8px 24px -10px rgba(251, 191, 36, 0.08);
}


/* ============================================================
   LIGHT THEME — overrides específicos para perfeita legibilidade
   ============================================================ */

html[data-theme='light'] body {
    background: #f4f7fb;
    color: #0f172a;
}

/* Sidebar light */
html[data-theme='light'] .nova-sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 0 30px -10px rgba(15, 23, 42, 0.06);
}

html[data-theme='light'] .nova-sidebar .sidebar-brand {
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

html[data-theme='light'] .nova-sidebar .sidebar-brand h4 {
    color: #0f172a;
}

html[data-theme='light'] .nova-sidebar .nav-link {
    color: #64748b;
}

html[data-theme='light'] .nova-sidebar .nav-link:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.04);
}

html[data-theme='light'] .nova-sidebar .nav-link.active {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.10);
    box-shadow: 0 0 16px rgba(79, 70, 229, 0.08);
}

html[data-theme='light'] .nova-sidebar .nav-link.active i {
    color: #4f46e5;
}

/* Navbar light */
html[data-theme='light'] .nova-navbar {
    background: #ffffff;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.06);
}

/* Stat cards light */
html[data-theme='light'] .nova-stat-card .stat-value {
    color: #0f172a;
}

html[data-theme='light'] .nova-stat-card .stat-label {
    color: #64748b;
}

html[data-theme='light'] .nova-stat-card:hover {
    box-shadow: 0 16px 40px -16px rgba(15, 23, 42, 0.12),
                0 0 0 1px rgba(79, 70, 229, 0.1);
}

/* Tilt hover light */
html[data-theme='light'] .nova-tilt-hover:hover {
    border-color: rgba(79, 70, 229, 0.25);
    box-shadow: 0 16px 40px -16px rgba(15, 23, 42, 0.12),
                0 0 0 1px rgba(79, 70, 229, 0.08);
}

/* Stat icons light — fundos um pouco mais saturados */
html[data-theme='light'] .stat-icon-violet { background: rgba(139,92,246,0.12); color: #6d28d9; }
html[data-theme='light'] .stat-icon-cyan { background: rgba(34,211,238,0.12); color: #0891b2; }
html[data-theme='light'] .stat-icon-emerald { background: rgba(52,211,153,0.12); color: #047857; }
html[data-theme='light'] .stat-icon-amber { background: rgba(251,191,36,0.14); color: #b45309; }
html[data-theme='light'] .stat-icon-rose { background: rgba(251,113,133,0.12); color: #be123c; }
html[data-theme='light'] .stat-icon-blue { background: rgba(96,165,250,0.12); color: #1d4ed8; }

/* Trends light */
html[data-theme='light'] .nova-stat-card .stat-trend.up { background: rgba(5, 150, 105, 0.1); color: #047857; }
html[data-theme='light'] .nova-stat-card .stat-trend.down { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

/* Chart cards / titles */
html[data-theme='light'] .chart-card .chart-title {
    color: #0f172a;
}

html[data-theme='light'] .chart-card .chart-subtitle {
    color: #64748b;
}

/* Page header */
html[data-theme='light'] .page-header h1 {
    color: #0f172a;
}

html[data-theme='light'] .page-header .page-subtitle {
    color: #64748b;
}

/* Tables light */
html[data-theme='light'] .table {
    color: #0f172a;
}

html[data-theme='light'] .table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme='light'] .table tbody td {
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.12) !important;
}

html[data-theme='light'] .table-hover tbody tr:hover {
    --bs-table-hover-bg: #f1f5f9;
}

/* Forms light */
html[data-theme='light'] .form-control,
html[data-theme='light'] .form-select {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme='light'] .form-control:focus,
html[data-theme='light'] .form-select:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

html[data-theme='light'] .form-control::placeholder {
    color: #94a3b8 !important;
}

html[data-theme='light'] .form-label {
    color: #475569;
}

/* Modal light */
html[data-theme='light'] .modal-content {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #0f172a !important;
}

html[data-theme='light'] .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme='light'] .modal-footer {
    border-top-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme='light'] .modal-header .modal-title {
    color: #0f172a !important;
}

html[data-theme='light'] .btn-close {
    filter: none;
}

/* Dropdowns light */
html[data-theme='light'] .dropdown-menu {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.12);
}

html[data-theme='light'] .dropdown-item {
    color: #0f172a;
}

html[data-theme='light'] .dropdown-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a;
}

html[data-theme='light'] .dropdown-divider {
    border-color: rgba(148, 163, 184, 0.18);
}

/* Badges light — mantém legibilidade */
html[data-theme='light'] .badge.bg-success { background: rgba(5, 150, 105, 0.15) !important; color: #047857 !important; }
html[data-theme='light'] .badge.bg-danger { background: rgba(220, 38, 38, 0.12) !important; color: #b91c1c !important; }
html[data-theme='light'] .badge.bg-warning { background: rgba(217, 119, 6, 0.15) !important; color: #b45309 !important; }
html[data-theme='light'] .badge.bg-info { background: rgba(34, 211, 238, 0.15) !important; color: #0e7490 !important; }
html[data-theme='light'] .badge.bg-secondary { background: rgba(100, 116, 139, 0.15) !important; color: #475569 !important; }
html[data-theme='light'] .badge.bg-primary { background: rgba(79, 70, 229, 0.12) !important; color: #4338ca !important; }

/* Alerts light */
html[data-theme='light'] .alert-success { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.25); color: #047857; }
html[data-theme='light'] .alert-danger { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); color: #b91c1c; }
html[data-theme='light'] .alert-warning { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.25); color: #b45309; }
html[data-theme='light'] .alert-info { background: rgba(34, 211, 238, 0.08); border-color: rgba(34, 211, 238, 0.25); color: #0e7490; }

/* Quick action buttons light */
html[data-theme='light'] .quick-action-btn {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.2);
    color: #475569;
}

html[data-theme='light'] .quick-action-btn:hover {
    background: rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.3);
    color: #4f46e5;
}

/* Pagination light */
html[data-theme='light'] .page-item .page-link {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.22);
    color: #475569;
}

html[data-theme='light'] .page-item .page-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

html[data-theme='light'] .page-item.active .page-link {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

/* Timeline light */
html[data-theme='light'] .nova-timeline::before {
    background: linear-gradient(to bottom, rgba(79,70,229,0.4), rgba(79,70,229,0.05));
}

html[data-theme='light'] .nova-timeline-item .dot {
    background: #ffffff;
    border-color: #4f46e5;
}

/* Progress bars light */
html[data-theme='light'] .progress-premium {
    background: rgba(15, 23, 42, 0.06);
}

/* Buttons light */
html[data-theme='light'] .btn-primary {
    background: #4f46e5;
    border-color: #4f46e5;
}

html[data-theme='light'] .btn-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

html[data-theme='light'] .btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

html[data-theme='light'] .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

html[data-theme='light'] .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #64748b;
}

html[data-theme='light'] .btn-outline-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Outline danger light */
html[data-theme='light'] .btn-outline-danger {
    border-color: rgba(220, 38, 38, 0.4);
    color: #b91c1c;
}

html[data-theme='light'] .btn-outline-danger:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
}

/* Code/pre light */
html[data-theme='light'] code {
    background: rgba(15, 23, 42, 0.05);
    color: #4f46e5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Card */
html[data-theme='light'] .card {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: #0f172a;
}

html[data-theme='light'] .card-header {
    background: #f8fafc !important;
    border-bottom-color: rgba(148, 163, 184, 0.15) !important;
    color: #0f172a;
}

html[data-theme='light'] .card-footer {
    background: #f8fafc !important;
    border-top-color: rgba(148, 163, 184, 0.15) !important;
}

html[data-theme='light'] .card-title {
    color: #0f172a;
}

/* Resource pill (landing) */
html[data-theme='light'] .resource-pill {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(148, 163, 184, 0.2);
    color: #334155;
}

html[data-theme='light'] .resource-pill i {
    color: #4f46e5;
}

/* Scrollbar light */
html[data-theme='light'] .nova-scrollbar {
    scrollbar-color: rgba(79, 70, 229, 0.4) rgba(15, 23, 42, 0.05);
}

html[data-theme='light'] .nova-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.04);
}

html[data-theme='light'] .nova-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4f46e5, #6366f1);
    border-color: #f4f7fb;
}

/* Empty states */
html[data-theme='light'] .empty-state .empty-title {
    color: #0f172a;
}

html[data-theme='light'] .empty-state {
    color: #64748b;
}

/* Status dots */
html[data-theme='light'] .status-dot.online { box-shadow: 0 0 8px rgba(5, 150, 105, 0.4); }
