/* =========================================================
   INDEX DASHBOARD OPERATIVO - GRUPO SEF
   Agregar al final de dist/css/app.css o cargar este archivo.
========================================================= */

.sef-dashboard-row,
.sef-dashboard-row > [class*="col-"] {
    width: 100%;
    max-width: 100%;
}

.sef-content:has(.sef-dashboard-page) {
    max-width: 100% !important;
    width: 100% !important;
}

.sef-dashboard-page {
    width: 100%;
    max-width: 100%;
    padding: 22px;
    overflow: visible !important;
    transform: none !important;
}

.sef-dashboard-page:hover {
    transform: none !important;
}

.sef-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(620px 260px at 8% 20%, rgba(245,158,11,.18), transparent 62%),
        radial-gradient(580px 260px at 92% 10%, rgba(59,130,246,.14), transparent 62%),
        linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
}

.sef-dashboard-hero h1 {
    margin: 0;
    color: #fff;
    font-size: 32px;
    font-weight: 950;
    line-height: 1.1;
    letter-spacing: -.7px;
}

.sef-dashboard-hero p {
    max-width: 760px;
    margin: 8px 0 0;
    color: #a7b2c5;
    font-size: 14px;
    line-height: 1.55;
}

.dash-filter-panel {
    margin-bottom: 18px;
}

.dash-filter-grid {
    grid-template-columns: minmax(280px, 1.7fr) minmax(170px, .75fr) minmax(170px, .75fr) minmax(155px, .55fr) !important;
}

.dash-filter-actions .sef-action-btn + .sef-action-btn {
    margin-top: 0;
}

.dash-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(245,158,11,.22);
    background: rgba(245,158,11,.08);
    color: #fde68a;
}

.dash-alert i {
    margin-top: 3px;
    color: #f59e0b;
}

.dash-alert strong,
.dash-alert span {
    display: block;
}

.dash-alert strong {
    color: #fff;
    margin-bottom: 3px;
}

.dash-alert span {
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.45;
}

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dash-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 145px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(360px 160px at 0% 0%, rgba(255,255,255,.08), transparent 58%),
        rgba(255,255,255,.035);
    box-shadow: 0 14px 32px rgba(0,0,0,.32);
}

.dash-kpi-card::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -38px;
    width: 125px;
    height: 125px;
    border-radius: 999px;
    background: rgba(255,255,255,.045);
}

.dash-kpi-card span,
.dash-kpi-card strong,
.dash-kpi-card small {
    position: relative;
    z-index: 2;
    display: block;
}

.dash-kpi-card span {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .45px;
}

.dash-kpi-card strong {
    margin-top: 10px;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    font-weight: 950;
}

.dash-kpi-card small {
    margin-top: 10px;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.35;
}

.dash-kpi-icon {
    position: absolute;
    right: 18px;
    bottom: 16px;
    z-index: 2;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255,255,255,.065);
    border: 1px solid rgba(255,255,255,.08);
}

.dash-kpi-card.accent { border-color: rgba(245,158,11,.20); }
.dash-kpi-card.accent .dash-kpi-icon { color: #f59e0b; background: rgba(245,158,11,.10); }
.dash-kpi-card.danger { border-color: rgba(239,68,68,.20); }
.dash-kpi-card.danger .dash-kpi-icon { color: #fca5a5; background: rgba(239,68,68,.12); }
.dash-kpi-card.primary { border-color: rgba(59,130,246,.22); }
.dash-kpi-card.primary .dash-kpi-icon { color: #93c5fd; background: rgba(59,130,246,.12); }
.dash-kpi-card.success { border-color: rgba(34,197,94,.22); }
.dash-kpi-card.success .dash-kpi-icon { color: #86efac; background: rgba(34,197,94,.12); }

.dash-insight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dash-insight-card {
    min-height: 108px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.032);
}

.dash-insight-card span {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.dash-insight-card strong {
    display: block;
    margin-top: 9px;
    color: #fff;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 900;
    max-height: 42px;
    overflow: hidden;
}

.dash-insight-card small {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 12px;
}

.dash-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dash-chart-card,
.dash-mini-table-card {
    min-width: 0;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(520px 220px at 0% 0%, rgba(59,130,246,.07), transparent 64%),
        rgba(255,255,255,.032);
    overflow: hidden;
}

.dash-chart-card.wide {
    grid-column: 1 / -1;
}

.dash-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dash-card-head h3 {
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -.2px;
}

.dash-card-head p {
    margin: 5px 0 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.35;
}

.dash-chart-box {
    position: relative;
    height: 315px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(15,23,42,.52);
    border: 1px solid rgba(255,255,255,.055);
}

.dash-chart-box.tall {
    height: 360px;
}

.dash-table-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.dash-table-wrap {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
}

.dash-table-wrap::-webkit-scrollbar {
    height: 8px;
}

.dash-table-wrap::-webkit-scrollbar-track {
    background: rgba(255,255,255,.05);
    border-radius: 999px;
}

.dash-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(245,158,11,.62);
    border-radius: 999px;
}

.dash-mini-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.dash-mini-table th {
    padding: 12px 14px;
    color: #94a3b8;
    background: rgba(15,23,42,.96);
    border: none;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

.dash-mini-table th:first-child {
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.dash-mini-table th:last-child {
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

.dash-mini-table td {
    padding: 13px 14px;
    color: #e5e7eb;
    background: rgba(255,255,255,.035);
    border-top: 1px solid rgba(255,255,255,.055);
    border-bottom: 1px solid rgba(255,255,255,.055);
    font-size: 12px;
    vertical-align: middle;
}

.dash-mini-table td:first-child {
    border-left: 1px solid rgba(255,255,255,.055);
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    white-space: nowrap;
}

.dash-mini-table td:last-child {
    border-right: 1px solid rgba(255,255,255,.055);
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}

.dash-mini-table small {
    color: #93c5fd;
}

.dash-pill {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fde68a;
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.24);
    font-weight: 800;
    white-space: nowrap;
}

.dash-empty-row {
    text-align: center;
    color: #94a3b8 !important;
}

.dash-loading::before {
    content: "Actualizando datos...";
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    padding: 12px 16px;
    border-radius: 999px;
    color: #111827;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(0,0,0,.38);
}

@media (max-width: 1180px) {
    .dash-kpi-grid,
    .dash-insight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-chart-grid,
    .dash-table-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sef-dashboard-page {
        padding: 14px;
    }

    .sef-dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
    }

    .sef-dashboard-hero h1 {
        font-size: 26px;
    }

    .dash-filter-grid {
        grid-template-columns: 1fr !important;
    }

    .dash-kpi-grid,
    .dash-insight-grid {
        grid-template-columns: 1fr;
    }

    .dash-chart-card,
    .dash-mini-table-card {
        padding: 12px;
    }

    .dash-chart-box,
    .dash-chart-box.tall {
        height: 285px;
    }
}
