/* ===== PALETA INSTITUCIONAL ===== */
:root {
    --azul-bandera: #0033A0;
    --azul-claro: #1A5F9E;
    --verde-bosque: #2E8B57;
    --ambar: #F39C12;
    --rojo-coral: #E74C3C;
    --fondo-claro: #F8F9FA;
    --texto-oscuro: #2C3E50;
    --texto-gris: #6C757D;
}

body {
    background-color: var(--fondo-claro);
    color: var(--texto-oscuro);
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    padding-top: 20px;
}

/* Encabezado institucional */
.header-institucional {
    background: linear-gradient(135deg, var(--azul-bandera) 0%, var(--azul-claro) 100%);
    color: white;
    padding: 1.2rem 0;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    margin-bottom: 2rem;
}
.header-institucional h1 {
    font-weight: 600;
    letter-spacing: -0.5px;
}
.header-institucional i {
    color: white;
}
.header-institucional .badge-ano {
    background-color: rgba(255,255,255,0.20);
    color: white;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 30px;
}

/* Tarjetas de resumen */
.card-dashboard {
    background: white;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.card-dashboard .value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.card-dashboard .label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--texto-gris);
}
.card-dashboard .icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Colores específicos para iconos y valores */
.color-azul { color: var(--azul-bandera); }
.color-verde { color: var(--verde-bosque); }
.color-ambar { color: var(--ambar); }
.color-rojo { color: var(--rojo-coral); }
.bg-azul-soft { background-color: #E3ECF7; }
.bg-verde-soft { background-color: #E6F4EA; }
.bg-ambar-soft { background-color: #FEF5E7; }
.bg-rojo-soft { background-color: #FDEAEA; }

/* Badges de estado (deben coincidir con los usados en badgeEstado() ) */
.badge-devengado { background-color: var(--azul-claro); color: white; }
.badge-liquidado,
.badge-aprobada { background-color: var(--verde-bosque); color: white; }
.badge-pendiente { background-color: var(--ambar); color: white; }
.badge-anulado,
.badge-rechazada { background-color: var(--rojo-coral); color: white; }

/* Tablas */
.table th {
    font-weight: 600;
    color: var(--texto-oscuro);
    border-bottom: 2px solid #dee2e6;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}
.table-hover tbody tr:hover {
    background-color: #f1f9ff;
}

/* Estados de filas en tablas de partidas */
.tr-deficit {
    background-color: #FDEAEA !important;
    border-left: 4px solid var(--rojo-coral);
}
.tr-ejecutado {
    background-color: #E6F4EA !important;
    border-left: 4px solid var(--verde-bosque);
}
.tr-sin-presupuesto {
    opacity: 0.75;
    background-color: #f1f3f5 !important;
}

.saldo-positivo { color: var(--verde-bosque); font-weight: 700; }
.saldo-negativo { color: var(--rojo-coral); font-weight: 700; }
.saldo-cero { color: var(--texto-gris); font-weight: 600; }

/* Secciones (bloques con fondo blanco y sombra) */
.section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}
.section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--azul-bandera);
    border-bottom: 3px solid var(--verde-bosque);
    padding-bottom: 0.5rem;
    margin-bottom: 1.2rem;
    display: inline-block;
}
.section h2 i {
    color: var(--azul-bandera);
}

/* Leyenda de déficit */
.leyenda-deficit {
    border-top: 1px solid #dee2e6;
    padding-top: 0.8rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--texto-gris);
}
.leyenda-deficit i {
    color: var(--rojo-coral);
}

/* Responsive */
@media (max-width: 576px) {
    .card-dashboard .value { font-size: 1.4rem; }
    .header-institucional h1 { font-size: 1.6rem; }
}
