@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    /* Premium SAAS Dark Theme */
    --bg-main: #0b0f19;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-sidebar: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981;
    --accent-red: #ef4444;
    --accent-warning: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.08);
    --sidebar-width: 280px;
    
    --glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
    --glow-emerald: 0 0 20px rgba(16, 185, 129, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.dashboard-body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #1e1b4b 0%, var(--bg-main) 40%);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    z-index: 10;
}
.sidebar-logo {
    padding: 32px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-logo h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.badge.neon {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    align-self: flex-start;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 24px 12px;
    gap: 8px;
}
.nav-link {
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-link i { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    transform: translateX(4px);
}
.nav-link.active {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-blue));
    color: white;
    box-shadow: var(--glow-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.5s ease;
}
h1 { 
    font-family: 'Outfit', sans-serif; 
    font-size: 2.5rem; 
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.text-muted { color: var(--text-muted); line-height: 1.5; }

/* Cards (Glassmorphism) */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease backwards;
}
.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}
.card-header {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th { 
    color: var(--text-muted); 
    font-weight: 600; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
}
.table tr { transition: background 0.2s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-active { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Buttons & Inputs */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}
.btn-primary { 
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-blue));
    color: white; 
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.btn-primary:hover { 
    box-shadow: var(--glow-blue);
    transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary { 
    background: rgba(255, 255, 255, 0.05); 
    color: var(--text-main); 
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { 
    background: rgba(255, 255, 255, 0.1); 
    border-color: rgba(255, 255, 255, 0.2);
}

.input-control, .select-empresa {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
.input-control:focus, .select-empresa:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.9);
}
.select-empresa { max-width: 500px; }

/* Grid de Regularização */
.controls-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.switch-container { display: flex; align-items: center; gap: 12px; }
.aviso-inativo {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--accent-red);
    padding: 20px; margin-bottom: 24px; color: #fca5a5;
    border-radius: 0 12px 12px 0;
    display: flex; align-items: center; gap: 12px;
}

.ano-row { margin-bottom: 24px; }
.ano-label { font-weight: 700; margin-bottom: 12px; font-family: 'Outfit'; font-size: 1.1rem; color: #e2e8f0; }
.meses-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.mes-cell {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px; padding: 12px; text-align: center;
    font-size: 0.85rem; font-weight: 600;
    transition: all 0.3s;
}
.mes-cell.pendente { color: var(--text-muted); }
.mes-cell.processando { 
    border-color: var(--accent-indigo); 
    color: var(--accent-indigo); 
    background: rgba(99, 102, 241, 0.1);
    animation: pulseBorder 1.5s infinite; 
}
.mes-cell.concluido { 
    background: rgba(16, 185, 129, 0.15); 
    border-color: rgba(16, 185, 129, 0.4); 
    color: var(--accent-emerald); 
}

@keyframes pulseBorder { 
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); } 
    70% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); } 
}

/* Console Output */
.console-output {
    background: #0f172a;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #a7f3d0;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.console-output p { margin-bottom: 10px; display: flex; gap: 8px; align-items: flex-start; }

/* Modal */
.modal-overlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content {
    background: var(--bg-main);
    padding: 40px;
    border-radius: 24px;
    width: 100%; max-width: 600px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content { transform: scale(1); }

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-red); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 4px;
    height: 20px;
    width: 100%;
}
@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
