
:root {
    /* Identidad DPI Executive */
    --dpi-background: #101827;
    --dpi-surface: #182438;
    --dpi-surface-light: #202f45;
    --dpi-primary: #2785F7;
    --dpi-primary-hover: #4095FF;
    /* Textos */
    --dpi-text: #F3F6FC;
    --dpi-text-secondary: #9BAAC0;
    /* Estados */
    --dpi-success: #25C685;
    --dpi-warning: #F5B942;
    --dpi-danger: #F06464;
    /* Bordes */
    --dpi-border: #263449;
    /* Dimensiones */
    --dpi-radius: 16px;
    --dpi-radius-small: 12px;
    /* Sombras */
    --dpi-shadow: 0 8px 28px rgba(0, 0, 0, 0.20);
}

/* =====================================
   CONFIGURACIÓN GENERAL
===================================== */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--dpi-background);
    color: var(--dpi-text);
    font-family: Inter, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* =====================================
   COMPONENTES GENERALES
===================================== */

.dpi-card {
    background: var(--dpi-surface);
    border: 1px solid var(--dpi-border);
    border-radius: var(--dpi-radius);
    box-shadow: var(--dpi-shadow);
}

.dpi-button {
    background: var(--dpi-primary);
    color: white;
    border: none;
    border-radius: var(--dpi-radius-small);
    padding: 12px 18px;
    font-weight: 600;
}

.dpi-transition {
    transition: all 0.25s ease;
}

/* =====================================
   MOBILE APP SHELL
===================================== */

.dpi-app {
    min-height: 100vh;
    background: var(--dpi-background);
    color: var(--dpi-text);
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.dpi-header {
    height: 68px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--dpi-background);
    border-bottom: 1px solid var(--dpi-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dpi-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.dpi-brand-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: var(--dpi-primary);
    color: white;
    font-size: 21px;
    font-weight: 800;
    border-radius: 12px;
}

.dpi-brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.dpi-brand-subtitle {
    font-size: 9px;
    color: var(--dpi-text-secondary);
    letter-spacing: 1.5px;
    margin-top: 3px;
}

.dpi-header-action {
    width: 40px;
    height: 40px;
    border: 1px solid var(--dpi-border);
    border-radius: 12px;
    background: var(--dpi-surface);
    color: var(--dpi-text);
}

.dpi-main {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* =====================================
   NAVEGACIÓN INFERIOR
===================================== */

.dpi-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 68px;
    padding: 8px 5px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #141F30;
    border-top: 1px solid var(--dpi-border);
    z-index: 200;
}

.dpi-nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--dpi-text-secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color .2s ease;
}

    .dpi-nav-item.active {
        color: var(--dpi-primary);
    }

    .dpi-nav-item svg {
        font-size: 22px;
    }

@media (min-width: 768px) {
    .dpi-main {
        padding: 28px;
    }

    .dpi-bottom-nav {
        max-width: 650px;
        left: 50%;
        transform: translateX(-50%);
        border: 1px solid var(--dpi-border);
        border-bottom: none;
        border-radius: 18px 18px 0 0;
    }
}

/* =====================================
   DASHBOARD GENERAL
===================================== */

.dashboard-general {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Encabezado */

.dashboard-welcome h1 {
    color: var(--dpi-text);
    font-size: 25px;
    font-weight: 700;
    margin: 5px 0;
}

.dashboard-welcome p {
    color: var(--dpi-text-secondary);
    font-size: 13px;
    margin: 0;
}

.dashboard-eyebrow {
    color: var(--dpi-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

/* Filtros */

.dashboard-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-filter-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--dpi-text-secondary);
    font-size: 13px;
}

.dashboard-year-select {
    width: 115px;
}

/* =====================================
   TARJETAS KPI GENERALES
===================================== */

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-kpi {
    position: relative;
    overflow: hidden;
    background: var(--dpi-surface) !important;
    border: 1px solid var(--dpi-border);
    border-radius: var(--dpi-radius) !important;
    padding: 16px;
    min-width: 0;
    animation: dpi-card-enter 750ms cubic-bezier(.2,.8,.2,1) both;
    transition: transform 280ms ease, box-shadow 280ms ease, border-color 280ms ease;
}

/* Iconos KPI */

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: transform 300ms ease;
}

    .kpi-icon.blue {
        color: #55A0FF;
        background: rgba(39,133,247,.15);
    }

    .kpi-icon.green {
        color: #25C685;
        background: rgba(37,198,133,.15);
    }

    .kpi-icon.cyan {
        color: #36C5D8;
        background: rgba(54,197,216,.15);
    }

    .kpi-icon.orange {
        color: #F5B942;
        background: rgba(245,185,66,.15);
    }

/* Textos KPI */

.kpi-label {
    color: var(--dpi-text-secondary);
    font-size: 12px;
    margin-bottom: 7px;
}

.kpi-value {
    color: var(--dpi-text);
    font-size: clamp(19px, 5vw, 24px);
    font-weight: 700;
    letter-spacing: -.5px;
    overflow-wrap: anywhere;
}

.kpi-description {
    color: var(--dpi-text-secondary);
    font-size: 10px;
    margin-top: 6px;
}

/* Actividad: obras y oficios */

.kpi-dual-values {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.kpi-divider {
    width: 1px;
    height: 38px;
    background: var(--dpi-border);
}

.kpi-dual-values .kpi-value {
    font-size: clamp(20px, 5vw, 25px);
}

.kpi-dual-values .kpi-description {
    line-height: 1.4;
}

/* Distribución en escritorio */

@media (min-width: 768px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =====================================
   ANIMACIONES KPI
===================================== */

@keyframes dpi-card-enter {
    0% {
        opacity: 0;
        transform: translateY(22px) scale(.98);
    }

    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.005);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Entrada escalonada */

.dashboard-kpi:nth-child(1) {
    animation-delay: 80ms;
}

.dashboard-kpi:nth-child(2) {
    animation-delay: 170ms;
}

.dashboard-kpi:nth-child(3) {
    animation-delay: 260ms;
}

.dashboard-kpi:nth-child(4) {
    animation-delay: 350ms;
}

.dashboard-kpi:nth-child(5) {
    animation-delay: 440ms;
}

/* Efecto de brillo */

.dashboard-kpi::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient( 110deg, transparent, rgba(255,255,255,.045), transparent );
    pointer-events: none;
    transition: left 650ms ease;
}

/* Interacción con cursor */

@media (hover: hover) {
    .dashboard-kpi:hover {
        transform: translateY(-5px);
        border-color: rgba(39,133,247,.55);
        box-shadow: 0 12px 30px rgba(0,0,0,.28), 0 0 18px rgba(39,133,247,.08);
    }

        .dashboard-kpi:hover::after {
            left: 140%;
        }

        .dashboard-kpi:hover .kpi-icon {
            transform: scale(1.09) rotate(-3deg);
        }
}

/* =====================================
   AVANCE FINANCIERO
===================================== */

.dashboard-financial-progress {
    margin-top: 20px;
    padding: 20px;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

    .dashboard-section-header h3 {
        margin: 0;
        color: var(--dpi-text);
        font-size: 17px;
        font-weight: 700;
    }

    .dashboard-section-header p {
        margin: 5px 0 0;
        color: var(--dpi-text-secondary);
        font-size: 12px;
    }

.financial-progress-item {
    margin-bottom: 22px;
}

    .financial-progress-item:last-child {
        margin-bottom: 0;
    }

.financial-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 9px;
    color: var(--dpi-text-secondary);
    font-size: 13px;
}

    .financial-progress-label strong {
        color: var(--dpi-text);
        font-size: 14px;
        font-weight: 700;
    }

/* =====================================
   ACCESIBILIDAD
===================================== */

@media (prefers-reduced-motion: reduce) {
    .dashboard-kpi,
    .dashboard-kpi .kpi-icon,
    .dashboard-kpi::after {
        animation: none;
        transition: none;
    }
}

/* =====================================
   RESPONSIVE - TELÉFONOS
===================================== */

@media (max-width: 600px) {
    html,
    body {
        font-size: 14px;
    }

    .dpi-card {
        border-radius: 14px;
    }

    .dashboard-financial-progress {
        padding: 16px;
    }

    .dashboard-section-header {
        margin-bottom: 20px;
    }
}
/* =====================================
   MUDSELECT - ALTURA COMPACTA GLOBAL
===================================== */

/* Contenedor del selector */
.mud-input-control:has(.mud-select-input) .mud-input {
    height: 50px !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
}

/* Área del contenido */
.mud-input-control:has(.mud-select-input) .mud-input-slot {
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Texto seleccionado */
.mud-input-control:has(.mud-select-input) .mud-select-input {
    height: 100% !important;
    min-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: normal !important;
}

/* Flecha desplegable */
.mud-input-control:has(.mud-select-input) .mud-input-adornment {
    margin-top: 0 !important;
    align-self: center !important;
}



/* =====================================
   ANÁLISIS POR DIMENSIONES
===================================== */

.dashboard-dimension-analysis {
    padding: 20px;
}

.dimension-analysis-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dimension-item-card {
    background: var(--dpi-surface-light);
    border: 1px solid var(--dpi-border);
    border-radius: 12px;
    padding: 15px;
    transition: border-color .25s ease, transform .25s ease;
}

    .dimension-item-card:hover {
        border-color: rgba(39,133,247,.55);
        transform: translateY(-2px);
    }

.dimension-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.dimension-item-title h4 {
    margin: 0;
    color: var(--dpi-text);
    font-size: 14px;
    font-weight: 700;
}

.dimension-item-title span {
    display: block;
    margin-top: 5px;
    color: var(--dpi-text-secondary);
    font-size: 11px;
}

.dimension-item-advance {
    color: var(--dpi-success);
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
}

.dimension-item-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
}

.dimension-metric {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

    .dimension-metric span {
        color: var(--dpi-text-secondary);
        font-size: 10px;
    }

    .dimension-metric strong {
        color: var(--dpi-text);
        font-size: 13px;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

.dimension-show-all {
    margin-top: 16px;
}

.dimension-empty {
    padding: 25px 12px;
    text-align: center;
    color: var(--dpi-text-secondary);
    font-size: 13px;
}

/* Iconografía de dimensiones */

.dimension-item-title {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.dimension-item-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .dimension-item-icon .mud-icon-root {
        font-size: 22px;
    }

.dimension-icon-fondo {
    color: #55A0FF;
    background: rgba(39,133,247,.15);
}

.dimension-icon-fuente {
    color: #25C685;
    background: rgba(37,198,133,.15);
}

.dimension-icon-dependencia {
    color: #B18AFF;
    background: rgba(177,138,255,.15);
}

.dimension-icon-programa {
    color: #F5B942;
    background: rgba(245,185,66,.15);
}

.dimension-icon-municipio {
    color: #36C5D8;
    background: rgba(54,197,216,.15);
}

.dimension-item-heading {
    min-width: 0;
}

    .dimension-item-heading h4 {
        overflow-wrap: anywhere;
    }


/* =====================================
   TARJETA DONA - DISTRIBUCIÓN
===================================== */

.dashboard-kpi-donut {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.donut-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.donut-chart {
    position: relative;
    width: 116px;
    min-width: 116px;
    height: 116px;
}

    .donut-chart svg {
        width: 100%;
        height: 100%;
        transform: rotate(0deg);
    }

    .donut-chart circle {
        transition: stroke-dasharray 700ms ease, stroke-dashoffset 700ms ease;
    }

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5px;
}

    .donut-center strong {
        color: var(--dpi-text);
        font-size: 11px;
        font-weight: 800;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .donut-center span {
        color: var(--dpi-text-secondary);
        font-size: 9px;
        margin-top: 3px;
    }

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

    .donut-legend-item .mud-icon-root {
        font-size: 19px;
        flex-shrink: 0;
    }

    .donut-legend-item div {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .donut-legend-item span {
        color: var(--dpi-text-secondary);
        font-size: 10px;
    }

    .donut-legend-item strong {
        color: var(--dpi-text);
        font-size: 12px;
        font-weight: 700;
    }


.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
    min-width: 0;
}

.donut-legend-item strong {
    color: var(--dpi-text);
    font-size: 10px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.donut-legend-item .donut-percent {
    color: var(--dpi-text-secondary);
    font-size: 10px;
    font-weight: 600;
}

