/* A&A Legal FinOps - Production CSS v6.1 */
/* IMPORTANT: loaded AFTER bootstrap, so selectors must be specific enough to override */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==================== RESET / BASE ==================== */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background-color: #eef1f6 !important;
    min-height: 100vh;
    color: #2c3e50;
    font-size: 0.875rem;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ==================== TOP HEADER BAR ==================== */
.aa-top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #1b2e4b 0%, #152438 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.aa-top-header .aa-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.aa-top-header .aa-brand img.aa-brand-logo {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
}

.aa-top-header .aa-brand .aa-red {
    color: #e74c3c;
}

.aa-top-header .aa-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.aa-top-header .aa-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
}

.aa-top-header .aa-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #e67e22;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ==================== SIDEBAR ==================== */
.aa-sidebar {
    padding-top: 0 !important;
    width: 240px;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
}

.aa-sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.aa-sidebar-nav a.aa-nav-item {
    color: #2c3e50;
    padding: 0.55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    margin: 1px 0;
    transition: all 0.15s ease;
}

.aa-sidebar-nav a.aa-nav-item:hover {
    background-color: #f0f4f8;
    color: #1b2e4b;
    text-decoration: none;
}

.aa-sidebar-nav a.aa-nav-item.active {
    color: #2980b9;
    background-color: #ebf5ff;
    border-left-color: #2980b9;
    font-weight: 600;
}

.aa-sidebar-nav a.aa-nav-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.aa-sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.aa-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c9b;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 0.4rem 0;
    font-weight: 500;
}

.aa-sidebar-footer a:hover {
    color: #e74c3c;
    text-decoration: none;
}

.aa-sidebar-footer a.aa-change-pw {
    color: #2c3e50;
    margin-bottom: 0.4rem;
}

.aa-sidebar-footer a.aa-change-pw:hover {
    color: #2980b9;
}

/* ==================== MAIN CONTENT ==================== */
.aa-main {
    margin-left: 240px;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
    padding: 0;
}

.aa-content {
    max-width: 1400px;
    padding: 1.5rem;
}

/* ==================== PAGE HEADER ==================== */
.aa-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.aa-page-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.aa-page-header .aa-page-sub {
    font-size: 0.82rem;
    color: #7f8c9b;
    margin-top: 0.15rem;
}

/* ==================== KPI CARDS ==================== */
.aa-kpi {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease;
}

.aa-kpi:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.aa-kpi .aa-kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7f8c9b;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.aa-kpi .aa-kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
}

.aa-kpi .aa-kpi-compare {
    font-size: 0.75rem;
    margin-top: 0.4rem;
    color: #7f8c9b;
}

/* KPI color variants */
.aa-kpi.kpi-green .aa-kpi-value { color: #27ae60; }
.aa-kpi.kpi-green .aa-kpi-compare { color: #27ae60; }
.aa-kpi.kpi-red .aa-kpi-value { color: #e74c3c; }
.aa-kpi.kpi-red .aa-kpi-compare { color: #e74c3c; }
.aa-kpi.kpi-orange .aa-kpi-value { color: #e67e22; }
.aa-kpi.kpi-orange .aa-kpi-compare { color: #e67e22; }
.aa-kpi.kpi-blue .aa-kpi-value { color: #2980b9; }
.aa-kpi.kpi-blue .aa-kpi-compare { color: #2980b9; }

/* ==================== PANELS ==================== */
.aa-panel {
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
}

.aa-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* ==================== TABLES ==================== */
.aa-table-wrap {
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.aa-table-wrap .table { margin-bottom: 0; }

.aa-table-wrap .table th {
    background-color: #f8fafc;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7f8c9b;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.65rem 0.85rem;
    white-space: nowrap;
}

.aa-table-wrap .table td {
    vertical-align: middle;
    font-size: 0.85rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.aa-table-wrap .table tbody tr:hover {
    background-color: #f8fafc;
}

/* ==================== TAB FILTERS ==================== */
.aa-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

a.aa-tab {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

a.aa-tab:hover {
    border-color: #2980b9;
    color: #2980b9;
    text-decoration: none;
}

a.aa-tab.active {
    background-color: #1b2e4b;
    color: #ffffff;
    border-color: #1b2e4b;
}

/* ==================== FORMS ==================== */
.aa-form-card {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
}

.form-control, .form-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    border-color: #e2e8f0;
}

.form-control:focus, .form-select:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(41,128,185,0.1);
}

/* ==================== BUTTONS ==================== */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-primary {
    background-color: #1b2e4b !important;
    border-color: #1b2e4b !important;
}

.btn-primary:hover {
    background-color: #152438 !important;
    border-color: #152438 !important;
}

a.aa-btn-action {
    color: #2980b9;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

a.aa-btn-action:hover {
    text-decoration: underline;
}

/* ==================== CXC STACKED BAR ==================== */
.aa-cxc-bar {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    height: 28px;
    margin-bottom: 1rem;
}

.aa-cxc-bar .aa-bar-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    padding: 0 0.5rem;
}

/* ==================== LOGIN ==================== */
.aa-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1b2e4b 0%, #1a365d 100%);
    padding: 1rem;
}

.aa-login-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.aa-login-card h3 {
    color: #1b2e4b;
    font-weight: 700;
}

.aa-login-card .aa-login-logo {
    height: 80px;
    width: auto;
    margin-bottom: 0.5rem;
}

/* ==================== UTILITIES ==================== */
.text-monto-positivo { color: #27ae60 !important; font-weight: 600; }
.text-monto-negativo { color: #e74c3c !important; font-weight: 600; }
.text-orange { color: #e67e22 !important; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .aa-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .aa-sidebar.show {
        transform: translateX(0);
    }
    .aa-main {
        margin-left: 0;
    }
    .aa-top-header .aa-user-name {
        display: none;
    }
}
