/* Complementos visuales para Charts.css y accesos favoritos.
   Se mantiene separado de app.css para que los reportes puedan desplegarse
   o retirarse sin alterar el resto de la interfaz. */

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
    gap: 1.5rem;
}

.analytics-card .card-header {
    min-height: 78px;
}

.analytics-chart-wrap {
    min-height: 250px;
    padding: .85rem .25rem .35rem;
}

.analytics-chart-wrap .charts-css {
    --color: #1671d9;
    --primary-axis-color: #cbd9e8;
    --secondary-axes-color: #e4ecf5;
    --secondary-axes-width: 1px;
    color: #52677f;
    font-size: .78rem;
}

.analytics-chart-wrap .charts-css.bar {
    /* Charts.css reserva el margen mediante --labels-size. Mantenerlo igual
       al ancho del th evita que etiquetas largas invadan las barras. */
    --labels-size: 11rem;
    height: 230px;
}

.analytics-chart-wrap .charts-css.column {
    --labels-size: 2.2rem;
    height: 310px;
}

.analytics-chart-wrap .charts-css .data {
    color: #102d50;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1;
}

.analytics-chart-wrap .charts-css.bar tbody th {
    width: 11rem;
    padding-right: 1rem;
    color: #3c526c;
    font-size: .79rem;
    font-weight: 700;
    line-height: 1.15;
}

.analytics-chart-wrap .charts-css.bar td {
    border-radius: .5rem;
    box-shadow: inset 0 -2px 0 rgba(16, 45, 80, .1);
    transition: filter .18s ease, box-shadow .18s ease;
}

.analytics-chart-wrap .charts-css.bar td:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 10px rgba(16, 45, 80, .16);
}

.analytics-chart-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem 1rem;
    color: #6c7d92;
    font-size: .75rem;
    font-weight: 650;
}

.analytics-chart-meta span:first-child {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .7rem;
    border: 1px solid #d8e8f9;
    border-radius: .7rem;
    color: #214f80;
    background: #eff7ff;
}

.analytics-chart-meta strong {
    font-weight: 850;
}

.dashboard-chart-wrap {
    min-height: 250px;
}

.dashboard-bars tbody th {
    justify-content: space-between !important;
    gap: .45rem;
}

.dashboard-bars tbody th strong {
    display: inline-grid;
    flex: 0 0 auto;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0 .32rem;
    place-items: center;
    border-radius: .52rem;
    color: #173c62;
    background: #edf4fb;
    font-size: .77rem;
    font-weight: 850;
}

.analytics-report-panel {
    padding: 1.25rem 1.4rem 1rem;
    border: 1px solid #dce7f3;
    border-radius: 1rem;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 65%);
    box-shadow: 0 10px 28px rgba(24, 58, 94, .04);
}

.analytics-report-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .7rem 1rem;
}

.analytics-report-heading h3 {
    margin: .14rem 0 .25rem;
    color: #173a61;
    font-size: 1.1rem;
    font-weight: 800;
}

.analytics-report-heading p {
    margin: 0;
    color: #687e97;
    font-size: .79rem;
}

.analytics-scale {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .7rem;
    border: 1px solid #dce9f5;
    border-radius: 999px;
    color: #3f6488;
    background: #fff;
    font-size: .72rem;
    font-weight: 750;
    white-space: nowrap;
}

.analytics-period-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: .15rem;
    scrollbar-color: #b5cbe1 #eff4fa;
}

.analytics-period-scroll:focus-visible {
    outline: 3px solid #8cc2ff;
    outline-offset: 2px;
}

.analytics-period-chart {
    min-width: 720px;
    margin: 0 auto;
}

.analytics-period-chart tbody th {
    color: #415b78;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.analytics-period-chart td {
    border-radius: .38rem .38rem 0 0;
    transition: filter .18s ease;
}

.analytics-period-chart td:hover {
    filter: brightness(1.12);
}

.analytics-chart-hint {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: .7rem 0 0;
    color: #7388a0;
    font-size: .72rem;
}

.analytics-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1rem;
    margin: 1rem 0 .25rem;
    padding: 0;
    list-style: none;
}

.analytics-legend li {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #49617c;
    font-size: .75rem;
    font-weight: 700;
}

.analytics-legend i {
    width: .86rem;
    height: .86rem;
    border-radius: .28rem;
    background: var(--legend-color, #1671d9);
}

.dashboard-welcome {
    position: relative;
    overflow: hidden;
    padding: 1.35rem 1.5rem;
    border: 1px solid #dce8f6;
    border-radius: 1.1rem;
    background: linear-gradient(125deg, #f8fbff 0%, #edf6ff 60%, #e4f2ff 100%);
}

.dashboard-welcome::after {
    position: absolute;
    right: -2.5rem;
    bottom: -4rem;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: rgba(22, 113, 217, .08);
    content: "";
}

.dashboard-welcome h2 {
    position: relative;
    z-index: 1;
    margin: .2rem 0 .35rem;
    color: #0b2a52;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.dashboard-welcome p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #52677f;
}

.shortcut-groups {
    display: grid;
    gap: 1.2rem;
}

.shortcut-group-header {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .65rem;
    color: #304967;
}

.shortcut-group-header h3 {
    margin: 0;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.shortcut-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: .8rem;
    border: 1px solid #dfe8f3;
    border-radius: .85rem;
    background: #fff;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.shortcut-item:hover {
    transform: translateY(-2px);
    border-color: #adcaea;
    box-shadow: 0 8px 22px rgba(16, 45, 80, .08);
}

.shortcut-item > a {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.shortcut-icon {
    display: grid;
    flex: 0 0 2.35rem;
    width: 2.35rem;
    height: 2.35rem;
    margin-right: .7rem;
    place-items: center;
    border-radius: .72rem;
    color: #1671d9;
    background: #eaf4ff;
}

.shortcut-copy {
    min-width: 0;
}

.shortcut-copy strong,
.shortcut-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shortcut-copy strong {
    color: #193a60;
    font-size: .87rem;
}

.shortcut-copy small {
    margin-top: .12rem;
    color: #78889c;
    font-size: .69rem;
}

.shortcut-item .dropdown-toggle::after {
    display: none;
}

.shortcut-visibility {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    margin-top: .3rem;
    color: #3f719f;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.shortcut-scope-option {
    height: 100%;
    padding: .85rem;
    border: 1px solid #dfe8f3;
    border-radius: .8rem;
    background: #f9fbfe;
}

.shortcut-scope-option label {
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .shortcut-list {
        grid-template-columns: 1fr;
    }

    .analytics-chart-wrap .charts-css.bar tbody th {
        width: 8.5rem;
        padding-right: .45rem;
        font-size: .68rem;
    }

    .analytics-chart-wrap .charts-css.bar {
        --labels-size: 8.5rem;
    }

    .dashboard-bars tbody th strong {
        min-width: 1.4rem;
        min-height: 1.4rem;
        font-size: .69rem;
    }

    .analytics-report-panel {
        padding: 1rem .8rem .85rem;
    }

    .analytics-chart-hint {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shortcut-item,
    .analytics-chart-wrap .charts-css.bar td,
    .analytics-period-chart td {
        transition: none;
    }
}
