/* ---------- Estructura ---------- */
.app-shell {
    /* Header a todo el ancho, sidebar y contenido debajo */
    grid-template-areas: 'rz-header rz-header' 'rz-sidebar rz-body';
}

.app-header {
    border-bottom: 1px solid var(--rz-base-300, rgba(128, 128, 128, .25));
}

.page-container {
    max-width: 1480px;
    margin: 0 auto;
}

.grow {
    flex: 1 1 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -.01em;
}

.brand-icon {
    color: #2563eb;
}

.muted {
    color: var(--rz-text-secondary-color, #64748b);
    font-size: .875rem;
}

.row-title {
    font-weight: 600;
}

/* ---------- Paneles y tarjetas de indicador ---------- */
.panel {
    height: 100%;
}

.kpi-wrap {
    height: 100%;
    cursor: pointer;
    border-radius: var(--rz-card-border-radius, 8px);
}

.kpi-wrap:focus-visible {
    outline: 2px solid var(--accent, #2563eb);
    outline-offset: 2px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    height: 100%;
    padding: 1rem 1.1rem;
    border-left: 4px solid var(--accent, #2563eb);
}

.kpi-wrap:hover .kpi-card {
    box-shadow: var(--rz-shadow-3, 0 4px 14px rgba(0, 0, 0, .12));
}

.kpi-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    color: var(--accent, #2563eb);
    background: color-mix(in srgb, var(--accent, #2563eb) 14%, transparent);
}

.kpi-title {
    font-size: .875rem;
    color: var(--rz-text-secondary-color, #64748b);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    font-size: .8125rem;
    color: var(--rz-text-secondary-color, #64748b);
}

/* ---------- Chip de estado ---------- */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .2rem .7rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--c) 75%, var(--rz-text-color, #0f172a));
    background: color-mix(in srgb, var(--c) 14%, transparent);
}

.status-chip .dot,
.list-row .dot {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--c);
    flex: 0 0 auto;
}

/* ---------- Listas del dashboard ---------- */
.list-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .7rem 0;
    border-top: 1px solid var(--rz-base-300, rgba(128, 128, 128, .2));
}

.list-row:first-of-type {
    border-top: 0;
}

.session-figures {
    text-align: right;
    white-space: nowrap;
}

/* ---------- Donut ---------- */
.donut-total {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* ---------- Indicador "en vivo" (único movimiento automático) ---------- */
.live-indicator {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--rz-text-secondary-color, #64748b);
}

.live-dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: #16a34a;
    animation: live-pulse 2s ease-out infinite;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, .5);
    }

    100% {
        box-shadow: 0 0 0 .6rem rgba(22, 163, 74, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot {
        animation: none;
    }
}

/* ---------- Tabla ---------- */
.chargers-grid {
    --rz-grid-cell-padding: .65rem .75rem;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}
/* ---------- Pantalla de carga (Blazor WebAssembly) ---------- */
.boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    background: #f8fafc;
    color: #0f172a;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    .boot {
        background: #0b1220;
        color: #e2e8f0;
    }
}

.boot-battery {
    position: relative;
    box-sizing: border-box;
    width: 168px;
    height: 76px;
    padding: 5px;
    border: 4px solid currentColor;
    border-radius: 16px;
}

/* Borne de la batería */
.boot-battery::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -14px;
    width: 8px;
    height: 26px;
    transform: translateY(-50%);
    border-radius: 0 5px 5px 0;
    background: currentColor;
}

/* El relleno sigue el progreso real de descarga de Blazor */
.boot-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    border-radius: 8px;
    background-image: linear-gradient(90deg, #2563eb, #22c55e);
    background-size: 150px 100%;
    background-repeat: no-repeat;
    transition: width .25s ease-out;
}

.boot-bolt {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 34px;
    height: 34px;
    fill: #facc15;
    stroke: rgba(15, 23, 42, .65);
    stroke-width: 1.2;
    stroke-linejoin: round;
    animation: boot-pulse 1.4s ease-in-out infinite;
}

@keyframes boot-pulse {

    0%,
    100% {
        opacity: .7;
    }

    50% {
        opacity: 1;
    }
}

.boot-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.boot-status {
    font-size: .9375rem;
    opacity: .7;
    font-variant-numeric: tabular-nums;
}

.boot-status::after {
    content: var(--blazor-load-percentage-text, "0%");
    margin-left: .4rem;
}

@media (prefers-reduced-motion: reduce) {
    .boot-bolt {
        animation: none;
    }

    .boot-fill {
        transition: none;
    }
}