﻿/* Estilos generales de tarjetas (los usan también otras páginas, p. ej. Power BI y Alertas) */
.mud-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mud-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Cards de estadísticas del dashboard */
.dashboard-stat-card .mud-card-content {
    padding: 16px;
}

.dashboard-stat-card h4 {
    margin: 0;
}

/* Timeline de actividad */
.activity-timeline .mud-timeline-item-content {
    padding-left: 16px;
}

/* Widget de próximas auditorías */
.upcoming-audits .mud-paper {
    transition: background-color 0.2s ease;
}

.upcoming-audits .mud-paper:hover {
    background-color: #f5f5f5;
}

/* Botones de accesos rápidos */
.quick-access-buttons .mud-button-root {
    text-transform: none;
    justify-content: flex-start;
}


/* =====================================================================
   Inicio (Home) — línea gráfica IMF
   Azul institucional, verde para estados positivos, turquesa como acento.
   Prefijo "home-" porque este archivo se carga en toda la app.
   ===================================================================== */

.home {
    --home-azul: #084D90;
    --home-azul-oscuro: #063B6F;
    --home-verde: #0F8F2F;
    --home-turquesa: #54D6C9;
    --home-texto: #0f172a;
    --home-texto-suave: #64748b;
    --home-borde: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 8px 0 24px;
}

.home-skeleton {
    border-radius: 14px;
}

/* ---------- Encabezado ----------
   Tarjeta clara, igual que el resto: el menú lateral ya aporta el azul
   institucional, así que aquí se evita repetir un bloque azul pesado. */
.home-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid var(--home-borde);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.home-hero-fecha {
    margin: 0 0 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--home-texto-suave);
}

/* La barra superior ya muestra la fecha; aquí solo se ve en celulares,
   donde la barra la oculta (ver mainlayout.css). */
@media (min-width: 601px) {
    .home-hero-fecha {
        display: none;
    }
}

.home-hero-saludo {
    margin: 0;
    font-size: clamp(1.3rem, 1.8vw, 1.6rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--home-texto);
}

.home-hero-sub {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--home-texto-suave);
}

.home-hero-acciones {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.home-hero-periodo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #F1F5F9;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

    .home-hero-periodo .mud-icon-root {
        font-size: 16px;
        color: var(--home-azul);
    }

.home-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #EEF4FB;
    color: var(--home-azul);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .home-hero-btn:hover {
        background: var(--home-azul);
        color: #ffffff;
        text-decoration: none;
    }

    .home-hero-btn:focus-visible,
    .home-kpi-link:focus-visible,
    .home-reunion:focus-visible,
    .home-acceso:focus-visible,
    .home-seccion-link:focus-visible {
        outline: 3px solid rgba(84, 214, 201, 0.8);
        outline-offset: 2px;
    }

/* ---------- Secciones ---------- */
.home-seccion-header,
.home-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-seccion-header {
    margin-bottom: 12px;
}

    .home-seccion-header h2,
    .home-card-header h2 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        color: var(--home-texto);
    }

.home-seccion-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--home-azul);
    text-decoration: none;
    white-space: nowrap;
}

    .home-seccion-link:hover {
        text-decoration: underline;
    }

    .home-seccion-link .mud-icon-root {
        font-size: 16px;
    }

/* ---------- Tonos (variables por color) ---------- */
.home-tono-azul {
    --home-color: #084D90;
    --home-bg: #E7EEF7;
    --home-fg: #084D90;
}

.home-tono-ambar {
    --home-color: #f59e0b;
    --home-bg: #fef3c7;
    --home-fg: #b45309;
}

.home-tono-celeste {
    --home-color: #3b82f6;
    --home-bg: #dbeafe;
    --home-fg: #1d4ed8;
}

.home-tono-verde {
    --home-color: #0F8F2F;
    --home-bg: #E3F4E7;
    --home-fg: #0F8F2F;
}

.home-tono-rojo {
    --home-color: #ef4444;
    --home-bg: #fee2e2;
    --home-fg: #b91c1c;
}

.home-tono-turquesa {
    --home-color: #14b8a6;
    --home-bg: #D5F5F1;
    --home-fg: #0f766e;
}

/* ---------- KPIs ---------- */
.home-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.home-kpi {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 14px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--home-borde);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    color: inherit;
    text-decoration: none;
}

.home-kpi-link {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

    .home-kpi-link:hover {
        transform: translateY(-2px);
        border-color: var(--home-color);
        box-shadow: 0 10px 18px -10px rgba(15, 23, 42, 0.25);
        text-decoration: none;
    }

.home-kpi-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--home-bg);
    color: var(--home-fg);
}

.home-kpi-datos {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-kpi-valor {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--home-texto);
    font-variant-numeric: tabular-nums;
}

.home-kpi-etiqueta {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--home-texto-suave);
}

.home-kpi-flecha {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #cbd5e1;
    transition: color 0.15s ease, transform 0.15s ease;
}

.home-kpi-link:hover .home-kpi-flecha {
    color: var(--home-color);
    transform: translateX(2px);
}

.home-kpi-barra {
    grid-column: 1 / -1;
    height: 6px;
    margin-top: 14px;
    border-radius: 999px;
    background: #EEF2F6;
    overflow: hidden;
}

    .home-kpi-barra > span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: var(--home-color);
    }

.home-kpi-detalle {
    grid-column: 1 / -1;
    margin-top: 4px;
    font-size: 0.72rem;
    color: #94a3b8;
}

/* ---------- Tarjetas (reuniones y accesos) ---------- */
.home-columnas {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

.home-card {
    background: #ffffff;
    border: 1px solid var(--home-borde);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.home-card-header {
    padding: 16px 18px;
    border-bottom: 1px solid #EEF2F6;
}

/* Próximas reuniones */
.home-reuniones {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.home-reunion {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 14px;
    padding: 10px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

    .home-reunion:hover {
        background: #F5F8FB;
        text-decoration: none;
    }

.home-reunion-fecha {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 52px;
    padding: 6px 0;
    border-radius: 10px;
    background: #F1F5F9;
    color: var(--home-texto);
    line-height: 1.1;
}

.home-reunion-dia {
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.home-reunion-mes {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--home-texto-suave);
}

/* Hoy: mismo rojo que la tarjeta del día actual en Calendario (--cal-rojo) */
.home-reunion-hoy .home-reunion-fecha {
    background: var(--cal-rojo, #D93D38);
    color: #ffffff;
    box-shadow: 0 6px 14px -8px rgba(217, 61, 56, 0.6);
}

    .home-reunion-hoy .home-reunion-fecha .home-reunion-mes {
        color: rgba(255, 255, 255, 0.8);
    }

.home-reunion-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.home-reunion-proveedor,
.home-reunion-detalle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-reunion-proveedor {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--home-texto);
}

.home-reunion-detalle {
    font-size: 0.78rem;
    color: var(--home-texto-suave);
}

.home-pill {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--home-pill-bg, #f1f5f9);
    color: var(--home-pill-fg, #475569);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-estado-coordinado { --home-pill-bg: #fef3c7; --home-pill-fg: #b45309; }
.home-estado-ejecucion { --home-pill-bg: #dbeafe; --home-pill-fg: #1d4ed8; }
.home-estado-cerrado { --home-pill-bg: #E3F4E7; --home-pill-fg: #0F8F2F; }
.home-estado-cancelado { --home-pill-bg: #fee2e2; --home-pill-fg: #b91c1c; }
.home-estado-otro { --home-pill-bg: #f1f5f9; --home-pill-fg: #475569; }

.home-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 16px;
    font-size: 0.85rem;
    color: #94a3b8;
}

    .home-vacio .mud-icon-root {
        font-size: 36px;
        color: #cbd5e1;
    }

/* Accesos rápidos */
.home-accesos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.home-acceso {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--home-borde);
    border-radius: 12px;
    background: #ffffff;
    color: var(--home-texto);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

    .home-acceso:hover {
        border-color: var(--home-color, var(--home-azul));
        background: #FAFCFE;
        box-shadow: 0 8px 14px -10px rgba(15, 23, 42, 0.3);
        text-decoration: none;
    }

.home-acceso-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--home-bg, #E7EEF7);
    color: var(--home-fg, var(--home-azul));
}

    .home-acceso-icono .mud-icon-root {
        font-size: 20px;
    }

/* Acción principal: Nueva auditoría */
.home-acceso-destacado {
    grid-column: 1 / -1;
    border-color: var(--home-azul);
    background: var(--home-azul);
    color: #ffffff;
}

    .home-acceso-destacado:hover {
        background: var(--home-azul-oscuro);
        border-color: var(--home-azul-oscuro);
    }

    .home-acceso-destacado .home-acceso-icono {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .home-columnas {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .home-hero {
        padding: 18px;
    }

    .home-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .home-kpi {
        grid-template-columns: 1fr;
        align-content: start;
        row-gap: 10px;
        padding: 14px;
    }

    .home-kpi-barra {
        margin-top: 4px;
    }

    /* El estado pasa bajo el nombre para no cortar el proveedor */
    .home-reunion {
        grid-template-columns: 52px minmax(0, 1fr);
        row-gap: 6px;
    }

        .home-reunion .home-pill {
            grid-column: 2;
            justify-self: start;
        }

    .home-accesos {
        grid-template-columns: 1fr;
    }

    .home-kpi-icono {
        width: 40px;
        height: 40px;
    }

    .home-kpi-valor {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-kpi-link,
    .home-kpi-flecha,
    .home-acceso,
    .home-hero-btn {
        transition: none;
    }

        .home-kpi-link:hover {
            transform: none;
        }
}
