:root {
    --guinda: #6E1B2F;
    --guinda-dark: #4A101E;
    --guinda-soft: #F9EFF2;
    --oro: #C68B2C;
    --oro-light: #FBF4E6;
    --verde: #1E6B52;
    --verde-soft: #E8F5F0;
    --alerta: #B45309;
    --alerta-soft: #FEF3C7;
    --rojo: #B91C1C;
    --rojo-soft: #FEE2E2;
    --bg: #F6F4EF;
    --surface: #FFFFFF;
    --border: #E5DFD5;
    --text: #1E242B;
    --text-muted: #5A6470;
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(30, 36, 43, 0.05);
    --shadow-md: 0 10px 28px rgba(30, 36, 43, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    margin-top: 0;
    line-height: 1.25;
}

.serif {
    font-family: 'Merriweather', Georgia, serif;
}

a {
    color: var(--guinda);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Top bar */
.topbar {
    background: var(--guinda-dark);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    padding: 0.45rem 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar-info .sep {
    margin: 0 0.5rem;
    opacity: 0.45;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-link {
    color: #F3D599;
    font-weight: 600;
}

.badge-citizen {
    background: var(--verde);
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Header & Navigation */
.site-header {
    background: var(--surface);
    border-bottom: 3px solid var(--oro);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand-kicker {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--oro);
    font-weight: 700;
}

.brand-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.15rem;
    color: var(--guinda);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.main-nav a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.94rem;
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
    background: var(--guinda-soft);
    color: var(--guinda);
    text-decoration: none;
}

.main-nav a.active {
    background: var(--guinda);
    color: #fff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--guinda);
    display: block;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--guinda-dark) 0%, var(--guinda) 62%, #8A253D 100%);
    color: #fff;
    padding: 3.5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(198, 139, 44, 0.18) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 2.5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-block;
    background: rgba(198, 139, 44, 0.22);
    border: 1px solid rgba(231, 193, 122, 0.5);
    color: #F7DC9E;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(1.9rem, 3.2vw, 2.75rem);
    margin-bottom: 1rem;
    color: #fff;
}

.hero p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.88);
    max-width: 58ch;
    margin-bottom: 1.75rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.hero-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    padding: 1.5rem;
}

.hero-panel h3 {
    font-size: 1rem;
    color: #F7DC9E;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.hero-stat {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    padding: 0.9rem;
}

.hero-stat strong {
    display: block;
    font-size: 1.35rem;
    color: #fff;
}

.hero-stat span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.78);
}

/* Page header */
.page-banner {
    background: linear-gradient(135deg, var(--guinda-dark), var(--guinda));
    color: #fff;
    padding: 2.25rem 0;
    border-bottom: 4px solid var(--oro);
}

.page-banner h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(1.5rem, 2.6vw, 2.15rem);
    margin-bottom: 0.45rem;
}

.page-banner p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    max-width: 68ch;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.68rem 1.25rem;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.92rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--guinda);
    color: #fff;
}

.btn-primary:hover {
    background: var(--guinda-dark);
}

.btn-gold {
    background: var(--oro);
    color: #1F1607;
}

.btn-gold:hover {
    background: #D69B38;
}

.btn-outline-light {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-outline {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--guinda);
    color: var(--guinda);
}

.btn-success {
    background: var(--verde);
    color: #fff;
}

.btn-danger {
    background: var(--rojo);
    color: #fff;
}

.btn-sm {
    padding: 0.42rem 0.85rem;
    font-size: 0.82rem;
}

/* Sections & Grids */
.section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.section-kicker {
    display: block;
    color: var(--oro);
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.section-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.6rem;
    color: var(--guinda);
    margin: 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}

.pillar-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border-top: 4px solid var(--guinda);
}

.pillar-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.pillar-card.gold { border-top-color: var(--oro); }
.pillar-card.green { border-top-color: var(--verde); }

.icon-badge {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--guinda-soft);
    color: var(--guinda);
    margin-bottom: 1rem;
}

.icon-badge.gold {
    background: var(--oro-light);
    color: #9A6612;
}

.icon-badge.green {
    background: var(--verde-soft);
    color: var(--verde);
}

/* Badges & Pills */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.badge-success { background: var(--verde-soft); color: var(--verde); }
.badge-warning { background: var(--alerta-soft); color: var(--alerta); }
.badge-danger  { background: var(--rojo-soft); color: var(--rojo); }
.badge-neutral { background: #EFECE6; color: var(--text-muted); }
.badge-guinda  { background: var(--guinda-soft); color: var(--guinda); }

/* Activity cards */
.activity-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.activity-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    font-size: 0.83rem;
    color: var(--text-muted);
}

.activity-meta strong {
    display: block;
    color: var(--text);
}

/* Filter bar & Forms */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 180px;
}

.form-group label {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.62rem 0.85rem;
    border: 1px solid #CFC8BC;
    border-radius: 8px;
    font-size: 0.94rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

.form-control:focus {
    outline: 2px solid rgba(110, 27, 47, 0.25);
    border-color: var(--guinda);
}

/* INE Access Card */
.ine-portal-box {
    background: linear-gradient(180deg, #FFFFFF 0%, #FAF7F2 100%);
    border: 2px solid var(--oro);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.ine-demo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.demo-chip {
    background: var(--oro-light);
    border: 1px solid #E4C892;
    color: #6B4409;
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.demo-chip:hover {
    background: #F4E2BE;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.82rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #F3EFE8;
    color: var(--guinda-dark);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody tr:hover {
    background: #FAF8F4;
}

.text-right { text-align: right; }

/* Financial Progress Bars & Charts */
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    border-left: 4px solid var(--guinda);
}

.kpi-card.gold { border-left-color: var(--oro); }
.kpi-card.green { border-left-color: var(--verde); }
.kpi-card.slate { border-left-color: #334155; }

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text);
    margin: 0.2rem 0;
}

.progress-track {
    height: 10px;
    background: #ECE7DE;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.4rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--guinda), var(--oro));
    border-radius: 999px;
}

.bar-row {
    margin-bottom: 0.9rem;
}

.bar-row-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.86rem;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}

/* Alerts */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--rojo-soft);
    color: #7F1D1D;
    border-color: #FECACA;
}

.alert-success {
    background: var(--verde-soft);
    color: #14532D;
    border-color: #A7F3D0;
}

.alert-info {
    background: var(--oro-light);
    color: #78350F;
    border-color: #FDE68A;
}

/* Tabs in Admin */
.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.58rem 1.05rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--guinda);
    color: #fff;
    border-color: var(--guinda);
}

/* Footer */
.site-footer {
    background: #1B1D21;
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 0;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2.25rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.footer-brand strong {
    color: #fff;
    display: block;
}

.footer-brand p {
    margin: 0;
    font-size: 0.82rem;
    color: #E7C17A;
}

.footer-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.68);
}

.site-footer h4 {
    color: #E7C17A;
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
}

.footer-links, .footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.88rem;
}

.footer-links li, .footer-contact li {
    margin-bottom: 0.45rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.82);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 60;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    background: var(--surface);
    border-radius: 14px;
    max-width: 620px;
    width: 100%;
    padding: 1.6rem;
    box-shadow: var(--shadow-md);
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 960px) {
    .hero-grid, .grid-3, .grid-4, .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .hero-grid, .grid-3, .grid-2, .grid-4, .footer-grid {
        grid-template-columns: 1fr;
    }
    .nav-toggle {
        display: flex;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 74px;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 2px solid var(--oro);
        box-shadow: var(--shadow-md);
    }
    .main-nav.open {
        display: flex;
    }
    .main-nav a {
        width: 100%;
    }
}

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .card, .ine-portal-box { box-shadow: none; border-color: #bbb; }
}
