@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --sidebar-width: 250px;
    --sidebar-bg: #212529;
    --sidebar-text: #e9ecef;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
    margin-bottom: 0; /* Override default */
}

/* Layout & Sidebar */
#wrapper {
    overflow-x: hidden;
    min-height: 100vh;
}

#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -15rem; /* -250px if rem=16px roughly */
    width: 15rem; /* 250px */
    transition: margin 0.25s ease-out;
    position: fixed;
    z-index: 1000;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sidebar-wrapper .sidebar-heading {
    padding: 0.875rem 1.25rem;
    font-size: 1.2rem;
    color: white;
}

#sidebar-wrapper .list-group {
    width: 15rem;
}

#page-content-wrapper {
    width: 100%;
    margin-left: 0;
    transition: margin 0.25s ease-out;
    min-height: 100vh;
    padding-left: 0; /* Default mobile */
}

/* Sidebar Active State */
#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

/* Desktop behavior: Sidebar visible by default */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        min-width: 0;
        width: 100%;
        margin-left: 15rem; /* Push content */
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: -15rem; /* Hide on toggle */
    }
    
    #wrapper.toggled #page-content-wrapper {
        margin-left: 0;
    }
}

/* Sidebar Links */
.list-group-item-dark {
    background-color: var(--sidebar-bg);
    color: #adb5bd;
    border: none;
    border-left: 4px solid transparent;
}

.list-group-item-dark:hover {
    background-color: #2c3034;
    color: #fff;
    border-left-color: rgba(255,255,255,0.5);
}

.list-group-item-dark.active {
    background-color: #1a1d20;
    color: #fff;
    border-left-color: var(--primary-color);
    border-color: transparent;
}

/* Cards & UI Elements */
.card {
    border: none;
    border-radius: 0.5rem;
}

.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important;
}

/* Utilities */
.w-20 {
    width: 20px;
    text-align: center;
}

/* Login Page Specifics if shared */
.login-card {
    border-radius: 10px;
}

/* Seletor de empresa na sidebar */
.sidebar-empresa {
    background-color: var(--sidebar-bg);
}

.sidebar-empresa-select {
    background-color: #2c3034;
    color: #e9ecef;
    border-color: #495057;
    font-size: 0.8rem;
}

.sidebar-empresa-select:focus {
    background-color: #2c3034;
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.sidebar-empresa-select option {
    background-color: #2c3034;
    color: #e9ecef;
}

/* 
=====================================
CONTAS A PAGAR (AP) AUTOMATION STYLES
=====================================
*/
:root {
    /* Paleta Semântica para AP */
    --ap-primary: #1e293b; /* Navy Dark Grey - primária/neutral */
    --ap-secondary: #475569; /* Cinza médio */
    --ap-bg-light: #f1f5f9;  /* Fundo cards/tables */
    
    /* Cores de Alerta (Strict usage) */
    --ap-critical: #e11d48; /* Vermelho - Somente erro/crítico/exceção/fraude */
    --ap-trend-up: #0ea5e9; /* Azul - Métricas boas/positivas */
    --ap-trend-down: #f97316; /* Laranja - Atenção/Negativo moderado */
    
    /* Auxiliares */
    --ap-success-muted: #10b981; /* Verde pálido (quando exigido) */
}

.ap-dashboard-card {
    border: none;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ap-dashboard-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}
.ap-metric-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ap-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ap-metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ap-primary);
    margin-top: 0.5rem;
}
/* Progressive Disclosure & Tables */
.ap-table thead {
    background-color: var(--ap-bg-light);
    color: var(--ap-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}
.ap-table td, .ap-table th {
    vertical-align: middle;
    padding: 1rem 1.25rem;
}
.ap-badge-critical {
    background-color: #ffe4e6;
    color: var(--ap-critical);
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}
.ap-badge-pending {
    background-color: #fff7ed;
    color: var(--ap-trend-down);
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}
.ap-badge-neutral {
    background-color: #e0f2fe;
    color: var(--ap-trend-up);
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}
