/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

:root {
    /* Brand Colors - Official Palette */
    --gob-red: #9F2241;
    --gob-red-dark: #691C32;
    --gob-beige: #BCA986;
    --gob-beige-dark: #AB9470;
    --gob-green: #235B4E;
    --gob-green-dark: #10312B;
    --gob-gray: #888B8D;
    --gob-gray-dark: #53565A;

    /* Functional Colors */
    --primary-color: var(--gob-red);
    --secondary-color: var(--gob-beige);
    --dark-bg: #1a1a1a;
    --light-bg: #f5f7fa;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.95);

    /* Modern Gradients */
    --primary-gradient: linear-gradient(135deg, var(--gob-red) 0%, var(--gob-red-dark) 100%);
    --sidebar-gradient: linear-gradient(180deg, var(--gob-red) 0%, var(--gob-red-dark) 100%);

    /* Spacing & Borders */
    --border-radius: 16px;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    overflow-x: hidden;
    display: flex;
}

/* --- Layout --- */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-gradient);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    transition: var(--transition);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 3rem;
    text-align: center;
}

.sidebar-logo {
    max-width: 150px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    position: relative;
}

.nav-link-custom {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link-custom:hover,
.nav-link-custom.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(5px);
    backdrop-filter: blur(5px);
}

.nav-link-custom i {
    font-size: 1.2rem;
    width: 24px;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    transition: var(--transition);
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.page-title p {
    color: #6c757d;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.year-selector {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.year-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(159, 34, 65, 0.1);
}

/* Cards & Widgets */
.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-title {
    color: #64748b;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tabs */
.custom-tabs {
    background: white;
    padding: 0.5rem;
    border-radius: 50px;
    display: inline-flex;
    gap: 0.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.custom-tab {
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    background: transparent;
    cursor: pointer;
}

.custom-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(159, 34, 65, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .toggle-sidebar-btn {
        display: block !important;
    }
}

.toggle-sidebar-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Chart Layout Updates */
.dashboard-card {
    position: relative;
    padding-bottom: 35px;
}

.chart-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.chart-source {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}