/**
 * Premium CSS - Movve BPO
 * Design moderno e minimalista com animações sutis
 * Tema: Azul e Branco
 */

/* ==================================
   Design Tokens - Variáveis CSS
   ================================== */
:root {
    /* Cores Primárias - Azul */
    --color-primary: #2563EB;
    --color-primary-dark: #1D4ED8;
    --color-primary-light: #3B82F6;
    --color-primary-pale: #DBEAFE;
    --color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);

    /* Cores Semânticas */
    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-danger: #EF4444;
    --color-danger-light: #FEE2E2;
    --color-info: #06B6D4;

    /* Backgrounds - Light Mode */
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-subtle: #F1F5F9;
    --bg-hover: rgba(37, 99, 235, 0.06);

    /* Texto */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-on-primary: #FFFFFF;

    /* Bordas */
    --border-color: #E2E8F0;
    --border-hover: rgba(37, 99, 235, 0.3);

    /* Sombras - Sutis */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.12);

    /* Transições - Rápidas e Suaves */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Bordas Arredondadas */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Animações Minimalistas */
    --animation-duration: 0.3s;
    --animation-stagger: 0.05s;
}

/* ==================================
   Dark Mode - Tema Escuro Elegante
   ================================== */
[data-theme="dark"],
.dark-mode {
    --bg-body: #0A0F1A;
    --bg-card: #111827;
    --bg-card-hover: #1F2937;
    --bg-subtle: #1F2937;
    --bg-hover: rgba(59, 130, 246, 0.12);

    --text-primary: #FFFFFF;
    --text-secondary: #E2E8F0;
    --text-muted: #94A3B8;

    --color-primary: #3B82F6;
    --color-primary-light: #60A5FA;
    --color-primary-pale: rgba(59, 130, 246, 0.15);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.4);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-body: #0A0F1A;
        --bg-card: #111827;
        --bg-card-hover: #1F2937;
        --bg-subtle: #1F2937;
        --bg-hover: rgba(59, 130, 246, 0.12);
        --text-primary: #FFFFFF;
        --text-secondary: #E2E8F0;
        --text-muted: #94A3B8;
        --color-primary: #3B82F6;
        --color-primary-light: #60A5FA;
        --color-primary-pale: rgba(59, 130, 246, 0.15);
        --border-color: rgba(255, 255, 255, 0.08);
        --border-hover: rgba(59, 130, 246, 0.4);
        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
    }
}

/* ==================================
   Base & Tipografia
   ================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-body);
    color: var(--text-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* ==================================
   SVG - Controle Global e Por Contexto
   Garante que todos os SVGs tenham tamanhos controlados
   ================================== */

/* Reset global para SVGs - tamanho padrão seguro */
svg {
    display: inline-block !important;
    vertical-align: middle;
    flex-shrink: 0 !important;
    width: 1em;
    height: 1em;
    max-width: 100%;
    overflow: visible;
}

/* SVGs com tamanho inline devem respeitar */
svg[width],
svg[height] {
    width: auto;
    height: auto;
}

/* SVGs em botões - padrão 16px */
.btn svg,
button svg,
[type="button"] svg,
[type="submit"] svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0 !important;
}

/* Botões de ícone */
.btn-icon svg,
.btn-ghost svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
}

/* SVGs em navegação/sidebar */
.nav-link svg,
.sidebar svg,
.sidebar-nav svg,
.nav-item svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    flex-shrink: 0 !important;
}

/* Container de ícones em stats */
.stats-icon-wrapper {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.stats-icon-wrapper svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    flex-shrink: 0 !important;
}

/* Stats cards gerais */
.stat-card svg,
.stats-card svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

/* Empty states */
.empty-state svg,
.empty-state-icon svg {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
}

/* Ações em tabelas */
.table-actions svg,
.table svg,
td svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

/* Alertas */
.alert svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
}

/* Badges */
.badge svg {
    width: 12px !important;
    height: 12px !important;
}

/* Page header */
.page-header svg,
.page-header-left svg,
.page-header-right svg {
    width: 16px !important;
    height: 16px !important;
}

/* Cards em geral */
.card svg,
.card-header svg,
.card-body svg,
.card-title svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

/* Monte Carlo */
.mc-scenario-icon svg,
.monte-carlo-card svg {
    width: 20px !important;
    height: 20px !important;
}

/* Modais */
.modal svg,
.modal-header svg,
.modal-close svg {
    width: 16px !important;
    height: 16px !important;
}

/* Forms */
.form-group svg,
.input-group svg {
    width: 16px !important;
    height: 16px !important;
}

/* Dropdowns */
.dropdown svg,
.dropdown-menu svg,
.dropdown-item svg {
    width: 16px !important;
    height: 16px !important;
}

/* Topbar */
.topbar svg,
.mobile-topbar svg {
    width: 20px !important;
    height: 20px !important;
}

/* User avatar area */
.user-info svg,
.user-avatar svg {
    width: 16px !important;
    height: 16px !important;
}

/* Logo - exceção para logo que pode ser maior */
.logo svg,
.sidebar-header svg,
.logo-link svg {
    width: auto !important;
    height: auto !important;
    max-height: 40px;
}

/* Gráficos - não limitar SVGs de chart.js ou outros gráficos */
.chart-container svg,
canvas+svg {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
}

/* Ícones específicos de status */
.status-icon svg,
.icon-sm svg {
    width: 14px !important;
    height: 14px !important;
}

.icon-md svg {
    width: 20px !important;
    height: 20px !important;
}

.icon-lg svg {
    width: 24px !important;
    height: 24px !important;
}

.icon-xl svg {
    width: 32px !important;
    height: 32px !important;
}

/* ==================================
   Animações Minimalistas
   ================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Classes de animação */
.animate-fade {
    animation: fadeIn var(--animation-duration) ease-out;
}

.animate-slide {
    animation: slideUp var(--animation-duration) ease-out;
}

.animate-scale {
    animation: scaleIn var(--animation-duration) ease-out;
}

/* Animação automática em elementos */
.page-header {
    animation: slideUp 0.3s ease-out;
}

.card {
    animation: fadeIn 0.25s ease-out;
}

.stats-grid>*,
.grid>.card {
    animation: slideUp 0.3s ease-out backwards;
}

.stats-grid>*:nth-child(1) {
    animation-delay: 0s;
}

.stats-grid>*:nth-child(2) {
    animation-delay: 0.05s;
}

.stats-grid>*:nth-child(3) {
    animation-delay: 0.1s;
}

.stats-grid>*:nth-child(4) {
    animation-delay: 0.15s;
}

.stats-grid>*:nth-child(5) {
    animation-delay: 0.2s;
}

.stats-grid>*:nth-child(6) {
    animation-delay: 0.25s;
}

/* ==================================
   Cards
   ================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

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

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==================================
   Stat Cards
   ================================== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

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

.stats-value,
.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stats-label,
.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stats-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-icon-wrapper.blue {
    background: var(--color-primary-pale);
    color: var(--color-primary);
}

.stats-icon-wrapper.green {
    background: var(--color-success-light);
    color: var(--color-success);
}

.stats-icon-wrapper.orange {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.stats-icon-wrapper.red {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* ==================================
   Botões
   ================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--text-on-primary);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    color: var(--color-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--color-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--color-primary);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ==================================
   Formulários
   ================================== */
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-select {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    background-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==================================
   Tabelas
   ================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table tbody td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

/* ==================================
   Badges
   ================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-info {
    background: var(--color-primary-pale);
    color: var(--color-primary);
}

.badge-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* ==================================
   Alertas
   ================================== */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.2s ease-out;
}

.alert-success {
    background: var(--color-success-light);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error,
.alert-danger {
    background: var(--color-danger-light);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: var(--color-warning-light);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: var(--color-primary-pale);
    color: var(--color-primary-dark);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* ==================================
   Page Header
   ================================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
}

/* ==================================
   Sidebar
   ================================== */
.sidebar {
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
}

.sidebar .nav-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-item.active .nav-link {
    color: #FFFFFF;
    background: rgba(59, 130, 246, 0.2);
}

/* ==================================
   Empty State
   ================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ==================================
   Monte Carlo Cards
   ================================== */
.monte-carlo-card {
    animation: slideUp 0.3s ease-out;
}

.monte-carlo-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.monte-carlo-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.monte-carlo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.mc-scenario-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all var(--transition-base);
}

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

.mc-scenario-pessimista {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

.mc-scenario-realista {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
    border-color: rgba(37, 99, 235, 0.2);
}

.mc-scenario-otimista {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.mc-scenario-probabilidade {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    border-color: rgba(139, 92, 246, 0.2);
}

.mc-scenario-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mc-scenario-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ==================================
   Login Page
   ================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    padding: 2.5rem;
    position: relative;
    animation: scaleIn 0.4s ease-out;
}

.login-logo {
    display: block;
    margin: 0 auto 2rem;
    height: 48px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.875rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ==================================
   Modals
   ================================== */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-container.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    animation: scaleIn 0.2s ease-out;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==================================
   Scrollbar
   ================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================================
   Utilities
   ================================== */
.text-primary {
    color: var(--color-primary) !important;
}

.text-success {
    color: var(--color-success) !important;
}

.text-warning {
    color: var(--color-warning) !important;
}

.text-danger {
    color: var(--color-danger) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-primary {
    background-color: var(--color-primary) !important;
}

.bg-success {
    background-color: var(--color-success) !important;
}

.bg-warning {
    background-color: var(--color-warning) !important;
}

.bg-danger {
    background-color: var(--color-danger) !important;
}

/* ==================================
   Dark Mode - Componentes Específicos
   ================================== */
[data-theme="dark"] body,
.dark-mode body {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

[data-theme="dark"] .card,
.dark-mode .card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .stat-card,
.dark-mode .stat-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control,
.dark-mode .form-control {
    background: var(--bg-subtle);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus,
.dark-mode .form-control:focus {
    background: var(--bg-card);
    border-color: var(--color-primary);
}

[data-theme="dark"] .form-select,
.dark-mode .form-select {
    background-color: var(--bg-subtle);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .table thead th,
.dark-mode .table thead th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

[data-theme="dark"] .table tbody td,
.dark-mode .table tbody td {
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .table tbody tr:hover,
.dark-mode .table tbody tr:hover {
    background: var(--bg-hover);
}

[data-theme="dark"] .btn-secondary,
.dark-mode .btn-secondary {
    background: var(--bg-subtle);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-secondary:hover,
.dark-mode .btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--color-primary-light);
}

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

[data-theme="dark"] .badge-info,
.dark-mode .badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93C5FD;
}

[data-theme="dark"] .badge-success,
.dark-mode .badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6EE7B7;
}

[data-theme="dark"] .badge-warning,
.dark-mode .badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #FCD34D;
}

[data-theme="dark"] .badge-danger,
.dark-mode .badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
}

[data-theme="dark"] .alert-success,
.dark-mode .alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error,
.dark-mode .alert-danger,
.dark-mode .alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .alert-warning,
.dark-mode .alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #FCD34D;
    border-color: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .alert-info,
.dark-mode .alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: #93C5FD;
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .login-card,
.dark-mode .login-card {
    background: var(--bg-card);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

[data-theme="dark"] .login-title,
.dark-mode .login-title {
    color: #FFFFFF;
}

[data-theme="dark"] .login-subtitle,
.dark-mode .login-subtitle {
    color: var(--text-secondary);
}

[data-theme="dark"] .empty-state-icon,
.dark-mode .empty-state-icon {
    background: var(--bg-subtle);
}

[data-theme="dark"] .mc-scenario-card,
.dark-mode .mc-scenario-card {
    border-color: var(--border-color);
}

[data-theme="dark"] .mc-scenario-value,
.dark-mode .mc-scenario-value {
    color: #FFFFFF;
}

[data-theme="dark"] ::-webkit-scrollbar-track,
.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-body);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb,
.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover,
.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==================================
   Stats Grid & Stat Cards
   ================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

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

.stat-card-header {
    margin-bottom: 0.75rem;
}

.stat-card-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* Icon Wrappers */
.stats-icon-wrapper.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.stats-icon-wrapper.blue {
    background: rgba(37, 99, 235, 0.1);
    color: #2563EB;
}

.stats-icon-wrapper.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.stats-icon-wrapper.red {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==================================
   Focus States
   ================================== */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==================================
   Print Styles
   ================================== */
@media print {

    .sidebar,
    .topbar,
    .mobile-topbar,
    .btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ==================================
   Responsive
   ================================== */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .monte-carlo-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
}

@media (max-width: 480px) {
    .monte-carlo-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.5rem;
    }
}