/* ============================================================
   Dashboard de Control — estilos globales (sin CSS isolation)
   Carga vía wwwroot/index.html.
   ============================================================ */

.kgc-dash-wrap {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 0 .25rem .75rem;
}

.kgc-dash-loading {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Top bar ---------- */
.kgc-dash-topbar {
    background: linear-gradient(135deg, #008678 0%, #006d63 100%);
    border-radius: .75rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    margin-bottom: .25rem;
    color: #fff;
}

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

.kgc-dash-topbar .bar-left {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    flex-wrap: wrap;
}

.kgc-dash-topbar .bar-title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    letter-spacing: .2px;
}

.kgc-dash-topbar .bar-subtitle {
    color: rgba(255, 255, 255, .9);
    font-size: .92rem;
    font-weight: 500;
    padding-left: .75rem;
    border-left: 1px solid rgba(255, 255, 255, .4);
    line-height: 1.2;
}

.kgc-dash-topbar .kgc-export-btn {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .05);
    color: #047857;
    font-weight: 600;
    border-radius: .55rem;
    padding: .4rem .9rem;
    font-size: .9rem;
    transition: background .12s ease, color .12s ease, transform .12s ease, box-shadow .12s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
}

.kgc-dash-topbar .kgc-export-btn:hover {
    background: #f0fdf4;
    color: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .12);
}

.kgc-dash-topbar .kgc-export-btn i {
    color: #047857;
}

/* ---------- Card host (Syncfusion SfCard tweaks) ---------- */
.kgc-dash-wrap .e-card.kgc-cc {
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding-top: 0 !important;
    margin-top: 0 !important;
    height: 100%;
    border-radius: .65rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.kgc-dash-wrap .e-card.kgc-cc > *:first-child {
    margin-top: 0 !important;
}

.kgc-dash-wrap .e-card.kgc-cc .e-card-header {
    margin: 0 !important;
    padding: .75rem 1.1rem !important;
    position: static !important;
}

.kgc-dash-wrap .e-card.kgc-cc .e-card-content {
    padding: 1rem !important;
    overflow: visible;
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.kgc-dash-wrap .e-card.kgc-cc .e-card-content > *:first-child {
    margin-top: 0 !important;
}

.kgc-dash-wrap .e-card.kgc-cc .e-card-content svg,
.kgc-dash-wrap .e-card.kgc-cc .e-card-content canvas {
    display: block;
}

/* ---------- KPI tiles ---------- */
.kgc-dash-wrap .kpi-tile {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 12px;
    padding: .9rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.kgc-dash-wrap .kpi-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
    border-color: rgba(0, 0, 0, .12);
}

/* ---------- Gauge card ---------- */
.kgc-gauge-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.kgc-gauge-tile .kpi-top {
    width: 100%;
    justify-content: center;
}

.kgc-gauge-tile .kpi-title {
    font-size: .95rem;
    font-weight: 600;
    color: #374151;
}

.kgc-gauge-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.kgc-gauge-tile .kpi-sub {
    width: 100%;
    text-align: center;
}

.kgc-dash-gauges-row {
    justify-content: center;
}

/* ---------- Chart hosts ---------- */
.kgc-dash-wrap .kgc-chart-host {
    width: 100%;
    height: 380px;
}

.kgc-dash-wrap .kgc-center {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .kgc-dash-topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }

    .kgc-dash-topbar .bar-subtitle {
        padding-left: 0;
        border-left: none;
    }
}
