:root {
    --mq-blue: #0F1131;
    --mq-green: #90B937;
    --mq-orange: #EC6824;
    --mq-white: #FFFFFF;
    --mq-light-gray: #F4F7F6;
    --mq-dark-gray: #333333;

    --bg-main: var(--mq-light-gray);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(15, 17, 49, 0.1);
    --text-main: var(--mq-blue);
    --text-muted: #666666;

    --gradient-primary: linear-gradient(135deg, var(--mq-blue) 0%, #1e225a 100%);
    --gradient-accent: linear-gradient(90deg, var(--mq-green), #7ba32c);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--mq-blue);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--mq-blue);
}

.logo span {
    font-size: 1.1rem;
    white-space: nowrap;
}

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    color: var(--mq-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Hero Section (Mockup Redesign) */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    background: radial-gradient(circle at top right, rgba(144, 185, 55, 0.08), transparent),
        radial-gradient(circle at bottom left, rgba(15, 17, 49, 0.03), transparent);
}

.hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 60px;
}

.hero-content {
    flex: 1.2;
    text-align: left;
}

.badge {
    background: var(--mq-blue);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 25px;
    display: inline-block;
}

h1 {
    font-size: 4.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 25px;
    color: var(--mq-blue);
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(90deg, var(--mq-green), #7ba32c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 580px;
    margin-bottom: 40px;
    line-height: 1.4;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--mq-blue);
    color: white;
    box-shadow: 0 10px 30px rgba(15, 17, 49, 0.3);
}

.btn-primary:hover {
    background: var(--mq-green);
    transform: translateY(-5px);
}

.btn-outline {
    border: 2px solid var(--mq-blue);
    background: transparent;
    color: var(--mq-blue);
}

.btn-pdf {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-pdf:hover {
    background: linear-gradient(135deg, #f05a49 0%, #d63031 100%);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.btn-pdf i {
    font-size: 1.2rem;
}


.btn-outline:hover {
    background: var(--mq-blue);
    color: white;
}

.hero-mockup {
    flex: 0.8;
    display: flex;
    justify-content: center;
}

.book-mockup {
    position: relative;
    width: 450px;
    height: 450px;
    transform: perspective(1000px) rotateY(-15deg);
    transition: all 0.5s ease;
}

.book-mockup:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.book-mockup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px 20px 20px 5px;
    box-shadow:
        15px 15px 40px rgba(0, 0, 0, 0.15),
        -5px 0 10px rgba(0, 0, 0, 0.05);
}

.hero-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.stat-card {
    padding: 30px 45px;
    display: flex;
    align-items: center;
    gap: 25px;
    min-width: 320px;
    background: white;
    border-radius: 25px;
}

.stat-card i {
    font-size: 2.5rem;
}

.highlight-blue i {
    color: var(--mq-blue);
}

.highlight-green {
    border: 2px solid var(--mq-green);
}

.highlight-green i {
    color: var(--mq-green);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--mq-blue);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Common Section Styles */
section {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
    color: var(--mq-blue);
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    position: relative;
    padding-bottom: 15px;
}

.section-header p::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

/* Alcalde Section */
.alcalde-card {
    display: flex;
    gap: 50px;
    padding: 80px 60px;
    align-items: center;
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

@media (max-width: 992px) {
    .alcalde-card {
        flex-direction: column;
        padding: 40px 20px;
        gap: 30px;
    }
    
    .alcalde-img {
        width: 100%;
        height: 350px;
    }
}

.alcalde-img {
    flex-shrink: 0;
    width: 380px;
    height: 480px;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
}

.alcalde-img:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.alcalde-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.alcalde-img:hover img {
    transform: scale(1.1);
}

.alcalde-text {
    flex: 1;
}

.alcalde-text h2 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--mq-blue);
    margin-bottom: 25px;
    line-height: 1.2;
}

.alcalde-text p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--mq-dark-gray);
    margin-bottom: 40px;
    font-style: italic;
    opacity: 0.9;
}

.alcalde-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.alcalde-info strong {
    font-size: 1.3rem;
    color: var(--mq-blue);
}

.institutional-bar {
    width: 140px;
    height: 10px;
    margin-top: 15px;
    background: linear-gradient(90deg, 
        #90B937 0%, #90B937 25%, 
        #EC6824 25%, #EC6824 50%, 
        #0F1131 50%, #0F1131 75%, 
        #00d2ff 75%, #00d2ff 100%);
    border-radius: 2px;
}

.institutional-bar.centered {
    margin: 15px auto 0;
}

/* Concejo Section */
.concejo-section {
    padding: 100px 0;
    background: #f8f9fa;
}

.concejo-presidencia {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.highlight-presidencia {
    border-color: var(--mq-green) !important;
    background: rgba(144, 185, 55, 0.05) !important;
    width: 280px;
}

.concejo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.concejal-card {
    padding: 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(15, 17, 49, 0.05);
}

.concejal-card:hover {
    transform: translateY(-10px);
    background: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--mq-green);
}

.concejal-img {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.5s ease;
}

.concejal-card:hover .concejal-img {
    border-color: var(--mq-green);
    transform: scale(1.05);
}

.concejal-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top; /* Alineamos arriba para no cortar cabezas */
}

.concejal-info strong {
    display: block;
    font-size: 1.1rem;
    color: var(--mq-blue);
    margin-bottom: 5px;
}

.concejal-info span {
    font-size: 0.9rem;
    color: var(--mq-dark-gray);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@media (max-width: 992px) {
    .concejo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .concejo-grid {
        grid-template-columns: 1fr;
    }
}


/* Dashboard Section */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.chart-container {
    padding: 40px;
    background: white;
    border-radius: 25px;
}

.chart-container.full-width {
    grid-column: span 2;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 20px;
}

.chart-box {
    text-align: center;
}

.chart-box h4 {
    margin-bottom: 20px;
    font-size: 1rem;
    color: var(--mq-blue);
    opacity: 0.7;
}

/* Bento Section Improvements */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 320px;
    gap: 30px;
}

.bento-item {
    background: white;
    border-radius: 30px;
    padding: 40px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 17, 49, 0.05);
}

.bento-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(15, 17, 49, 0.12);
    border-color: var(--mq-green);
}

.bento-item.large {
    grid-column: span 2;
    grid-row: span 2;
    padding: 0;
    display: flex;
}

.bento-content {
    flex: 1.2;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-icon-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.main-icon {
    font-size: 2.2rem;
    color: var(--mq-blue);
    background: linear-gradient(135deg, var(--mq-blue), #1e225a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bento-content h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--mq-blue);
}

.hitos-list-styled {
    list-style: none;
    margin-top: 25px;
}

.hitos-list-styled li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--mq-blue);
}

.hitos-list-styled li i {
    color: var(--mq-green);
    font-size: 1.1rem;
}

.bento-img {
    flex: 1;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s ease;
}

.bento-item:hover .bento-img {
    transform: scale(1.1);
}

.mini-badge-glow {
    background: var(--gradient-accent);
    color: white;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(144, 185, 55, 0.4);
}


/* Subvenciones Section */
.summary-card {
    display: flex;
    justify-content: space-around;
    padding: 40px;
    margin-bottom: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 25px;
}

.summary-value {
    font-size: 2.2rem;
    font-weight: 800;
}

.search-area {
    padding: 30px 40px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mq-green);
    font-size: 1.2rem;
    z-index: 5;
}

.search-area input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border-radius: 15px;
    border: 2px solid var(--glass-border);
    background: white;
    font-size: 1.1rem;
    outline: none;
    color: var(--mq-blue);
    transition: all 0.3s;
}

.search-area input:focus {
    border-color: var(--mq-green);
    box-shadow: 0 0 15px rgba(144, 185, 55, 0.2);
}

.table-wrapper {
    background: white;
    padding: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 600px;
}

td {
    padding: 20px 25px;
    background: var(--mq-light-gray);
    border: none;
    font-size: 1rem;
    color: var(--mq-blue);
}

tr td:first-child {
    border-radius: 15px 0 0 15px;
}

tr td:last-child {
    border-radius: 0 15px 15px 0;
    text-align: right;
    font-weight: 800;
    color: var(--mq-green);
    font-size: 1.1rem;
}

.org-name {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

.rank-badge {
    background: var(--mq-blue);
    color: white;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    width: 100%;
}

.pagination-wrapper .btn-outline {
    min-width: 250px;
    border: 2px solid var(--mq-blue);
    color: var(--mq-blue);
    background: transparent;
    font-weight: 700;
}

.pagination-wrapper .btn-outline:hover {
    background: var(--mq-blue);
    color: white;
}

/* Footer */
.glass-footer {
    padding: 60px 0;
    background: var(--mq-blue);
    color: white;
    margin-top: 80px;
}

/* Final Mobile Overhaul */
@media (max-width: 992px) {
    .glass-nav {
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        border-radius: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    .nav-container {
        padding: 10px 15px !important;
    }

    .logo span {
        display: none; /* Ocultamos el texto para que el logo respire */
    }

    .nav-logo {
        height: 35px;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .nav-links {
        position: fixed;
        top: 55px;
        left: 0;
        width: 100%;
        height: 0;
        background: white;
        flex-direction: column;
        padding: 0;
        gap: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        height: auto;
        padding: 10px 0;
        display: flex;
    }

    .nav-links li { width: 100%; border-bottom: 1px solid #f5f5f5; }
    .nav-links a { display: block; padding: 15px 25px; font-size: 1.1rem; }

    /* Hero Fix */
    .hero {
        min-height: auto !important;
        padding-top: 80px !important;
        padding-bottom: 30px !important;
        text-align: center;
    }

    .hero-main { flex-direction: column-reverse; gap: 20px; }
    
    .book-mockup {
        width: 160px;
        height: 220px;
        margin: 0 auto;
    }

    h1 { font-size: 1.8rem !important; }
    .hero-content p { font-size: 0.95rem; line-height: 1.4; margin-bottom: 20px; }

    /* Stats Fix */
    .hero-stats {
        flex-direction: column !important;
        gap: 15px !important;
        margin-top: 30px;
    }

    .stat-card {
        padding: 15px !important;
        width: 100% !important;
    }

    /* Charts Fix */
    .charts-grid, .comparison-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
    }

    .chart-container {
        width: 100% !important;
        min-height: 380px !important;
        padding: 20px !important;
    }

    canvas {
        max-width: 100% !important;
        height: 280px !important;
    }

    /* Bento Grid Fix */
    .bento-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
    }

    .bento-item {
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
    }

    .bento-item.large {
        flex-direction: column !important;
    }

    .bento-img {
        width: 100% !important;
        height: 220px !important;
    }

    .bento-content {
        padding: 25px !important;
    }

    .summary-card {
        flex-direction: column !important;
        padding: 30px !important;
        gap: 20px !important;
        text-align: center;
    }

    .summary-divider {
        width: 60px !important;
        height: 2px !important;
        margin: 0 auto !important;
        background: rgba(255, 255, 255, 0.2) !important;
    }

    .summary-value {
        font-size: 1.8rem !important;
    }

    .section-header h2 { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .stat-value { font-size: 1.4rem !important; }
    .stat-label { font-size: 0.8rem; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn { width: 100%; }
}