/* =============================================================================
   Dashboard · Estilos específicos de index.php (home)
   ============================================================================= */

/* ── Fondo de la página: blanco + texto azul (solo Dashboard) ── */
body.dash-body { background: #ffffff; color: var(--bg-section); }
.dash-body .dash-header-title   { color: var(--bg-section); }
.dash-body .dash-header-sub     { color: var(--border-strong); }
.dash-body .dash-section-title  { color: var(--bg-section); border-bottom-color: #c7d6f0; }
.dash-body .dash-legend         { color: var(--bg-section); }


.dash-header { margin-bottom: 1.2rem; }
.dash-header-title { margin: 0 0 0.3rem; font-size: 1.5rem; }
.dash-header-sub   { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* ── HERO ── */
.dash-hero {
    position: relative; overflow: hidden;
    border-radius: var(--radius-xl); margin-bottom: 1.8rem;
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
.dash-hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: var(--bg-section);
}
.dash-hero-inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
    padding: 1.6rem 1.8rem;
}
.dash-hero-left {
    display: flex; align-items: center; gap: 1rem; min-width: 0;
}
.dash-hero-icon {
    flex-shrink: 0;
    width: 54px; height: 54px; border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-hover), var(--brand-dark));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(255,31,71,0.45);
}
.dash-hero-icon svg { width: 26px; height: 26px; stroke: var(--text); }

.dash-hero-kicker {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-muted); font-weight: 700; margin-bottom: 0.15rem;
}
.dash-hero-title {
    margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.01em;
    color: var(--text);
}
.dash-hero-sub {
    margin: 0.25rem 0 0; font-size: 0.9rem;
    color: #c7d6f0; font-weight: 500;
}

.dash-hero-stats {
    display: flex; gap: 0.6rem; flex-wrap: wrap;
}
.dash-hero-stat {
    min-width: 78px;
    padding: 0.6rem 0.9rem; border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    display: flex; flex-direction: column; gap: 0.15rem; align-items: flex-start;
}
.dash-hero-stat--wide { min-width: 120px; }
.dash-hero-stat-num {
    font-size: 1.15rem; font-weight: 800; color: var(--text); line-height: 1;
}
.dash-hero-stat-lbl {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); font-weight: 600;
}

.dash-hero-legend {
    position: relative; z-index: 1;
    display: flex; flex-wrap: wrap; gap: 0.6rem;
    padding: 0.9rem 1.8rem;
    background: rgba(0,0,0,0.22);
    border-top: 1px solid rgba(255,255,255,0.08);
}
.dash-hero-legend .dash-legend-item {
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: 0.4rem 0.9rem 0.4rem 0.45rem;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    font-size: 0.92rem; font-weight: 700; color: var(--text);
    letter-spacing: 0.02em;
    transition: background var(--t-fast), transform var(--t-fast);
}
.dash-hero-legend .dash-legend-item:hover {
    background: rgba(255,255,255,0.14);
    transform: translateY(-1px);
}
.dash-hero-legend .dash-form-cell {
    width: 30px; height: 30px;
    font-size: 0.85rem; font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    cursor: default;
}

@media (max-width: 480px) {
    .dash-hero-legend .dash-legend-item { font-size: 0.82rem; padding: 0.35rem 0.7rem 0.35rem 0.4rem; }
    .dash-hero-legend .dash-form-cell { width: 26px; height: 26px; font-size: 0.78rem; }
}

.dash-section-title {
    font-size: 1rem; font-weight: 700; color: var(--text);
    margin: 1.8rem 0 0.8rem; padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-strong);
}

/* ── Leyenda ── */
.dash-legend {
    display: flex; flex-wrap: wrap; gap: 1rem;
    font-size: 0.78rem; color: var(--text-soft); margin-bottom: 0.6rem;
}
.dash-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.dash-legend-item .dash-form-cell { cursor: default; }

/* ── Grid de tarjetas ── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem;
}

.dash-card {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-section) 100%);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 0.9rem 1rem; color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-base);
}
.dash-card:hover {
    border-color: var(--border-hover); transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dash-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; margin-bottom: 0.6rem;
}
.dash-card-name {
    font-size: 0.92rem; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-card-summary { display: inline-flex; gap: 0.25rem; flex-shrink: 0; }

.dash-chip {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 5px; border-radius: var(--radius-xs);
    font-size: 0.7rem; font-weight: 800; color: var(--text);
}
.dash-chip--W { background: var(--success); color: var(--text); }
.dash-chip--D { background: var(--warning); color: #1a1a1a; }
.dash-chip--L { background: var(--danger); color: var(--text); }

/* ── "Gráfica": 10 celdas W/D/L ── */
.dash-form {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}
.dash-form-cell {
    aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: 5px; font-size: 0.75rem; font-weight: 800;
    color: var(--text); letter-spacing: 0.4px; cursor: help;
    user-select: none;
}
.dash-form-cell--W { background: var(--success); }
.dash-form-cell--D { background: var(--warning); color: #1a1a1a; }
.dash-form-cell--L { background: var(--danger); }
.dash-form-cell--empty {
    background: rgba(255,255,255,0.06);
    border: 1px dashed rgba(255,255,255,0.15);
    cursor: default;
}

.dash-card-meta {
    margin-top: 0.4rem; font-size: 0.68rem; font-weight: 700;
    color: var(--text); text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Sparkline (tendencia de puntos acumulados) ── */
.dash-spark {
    display: block; width: 100%; height: 38px;
    margin-top: 0.55rem;
    overflow: visible;
}
.dash-spark-avg  { stroke: rgba(255,255,255,0.18); stroke-width: 0.5; stroke-dasharray: 2 2; }
.dash-spark-fill { fill: rgba(147,187,253,0.18); stroke: none; }
.dash-spark-line { fill: none; stroke: #93bbfd; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dash-spark-dot  { fill: #fff; stroke: #1e3a8a; stroke-width: 0.6; vector-effect: non-scaling-stroke; }

.dash-spark--empty {
    font-size: 0.7rem; color: #8aabd8; text-align: center;
    padding: 0.6rem 0; font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 720px) {
    .dash-hero-inner { padding: 1.2rem 1.2rem; }
    .dash-hero-title { font-size: 1.4rem; }
    .dash-hero-sub   { font-size: 0.82rem; }
    .dash-hero-icon  { width: 46px; height: 46px; border-radius: 12px; }
    .dash-hero-icon svg { width: 22px; height: 22px; }
    .dash-hero-stats { width: 100%; }
    .dash-hero-stat  { flex: 1; min-width: 0; }
    .dash-hero-legend { padding: 0.6rem 1.2rem; gap: 0.7rem; }
}
@media (max-width: 480px) {
    .dash-header-title { font-size: 1.2rem; }
    .dash-section-title { font-size: 0.95rem; }
    .dash-hero-title { font-size: 1.2rem; }
    .dash-hero-kicker { font-size: 0.65rem; }
    .dash-hero-inner { padding: 1rem; gap: 1rem; }
    .dash-hero-legend { padding: 0.5rem 0.9rem; gap: 0.5rem; }
    .dash-hero-stat  { padding: 0.5rem 0.7rem; min-width: 0; }
    .dash-hero-stat-num { font-size: 1rem; }
    .dash-card { padding: 0.8rem 0.9rem; }
}
@media (max-width: 360px) {
    .dash-hero-stats { gap: 0.4rem; }
    .dash-hero-stat-lbl { font-size: 0.6rem; letter-spacing: 0.5px; }
    .dash-hero-title { font-size: 1.1rem; }
}
