/**
 * =====================================================================
 * SISTEMA DE ESTILOS PREMIUM - DARK GLASSMORPHISM
 * =====================================================================
 * Desenvolvido de forma personalizada para oferecer uma interface de alto
 * padrão (SaaS corporativo), com animações e efeitos de profundidade.
 */

:root {
    --bg-main: #0b0f19;
    --bg-surface: rgba(20, 27, 45, 0.65);
    --bg-surface-hover: rgba(30, 41, 59, 0.8);
    --border-color: rgba(255, 255, 255, 0.07);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    
    --warning: #f59e0b;
    --warning-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    
    --danger: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);
    
    --sidebar-width: 260px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Reset & Estilos Gerais */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 2. Glassmorphism Utilities */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6);
}

/* 3. Layout Principal (Sidebar & Content) */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Estilizada */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(13, 18, 30, 0.95);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-brand i {
    color: var(--primary);
    font-size: 1.4rem;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-size: 0.925rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.sidebar-link:hover, .sidebar-item.active .sidebar-link {
    color: var(--text-primary);
    background: var(--primary-light);
    transform: translateX(4px);
}
.sidebar-item.active .sidebar-link i {
    color: var(--primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

/* Área de Conteúdo Principal */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    transition: var(--transition-smooth);
}

/* 4. Títulos e Badges */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.text-muted-custom {
    color: var(--text-secondary);
}

/* Barra de Progresso Personalizada */
.progress-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    position: relative;
    margin: 10px 0;
}
.progress-bar-custom {
    height: 100%;
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar-custom.green {
    background: var(--success-gradient);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.progress-bar-custom.yellow {
    background: var(--warning-gradient);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.progress-bar-custom.red {
    background: var(--danger-gradient);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* 5. Estilização de Cards de CNPJ */
.cnpj-card {
    position: relative;
    overflow: hidden;
}
.cnpj-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}
.cnpj-card.border-green::before { background: var(--success); }
.cnpj-card.border-yellow::before { background: var(--warning); }
.cnpj-card.border-red::before { background: var(--danger); }

/* 6. Inputs e Formulários Premium */
.form-control, .form-select {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}
.form-control:focus, .form-select:focus {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* Botões */
.btn-primary-custom {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.925rem;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary-custom:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary-custom {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.925rem;
    transition: var(--transition-smooth);
}
.btn-secondary-custom:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* 7. Tabelas Customizadas */
.table-responsive {
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}
.table-custom {
    margin-bottom: 0;
    color: var(--text-primary);
}
.table-custom th {
    background: rgba(13, 18, 30, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}
.table-custom td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.925rem;
}
.table-custom tr:last-child td {
    border-bottom: none;
}
.table-custom tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 8. Estilos de Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 45%), var(--bg-main);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

/* 9. Grid de Meses (Controle de Calendário) */
.month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.month-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}
.month-card.empty {
    border-style: dashed;
    border-width: 2px;
}

/* Responsive Overrides */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}
