/* css/modules/estadisticas.css */

.est-wrapper { padding: 0 4px 40px; }

.est-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.est-title  { font-size: 1rem; font-weight: 700; color: #0f172a; margin: 0; display: flex; align-items: center; gap: 8px; padding-top: 2px; }

/* Filter bar */
.est-filter-bar  { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.est-filter-row  { display: flex; align-items: center; gap: 6px; }
.est-filter-label { font-size: 0.65rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; min-width: 26px; text-align: right; }

.est-loading { padding: 60px; text-align: center; color: #94a3b8; font-size: 0.82rem; display: flex; align-items: center; justify-content: center; gap: 10px; }

/* KPIs */
.est-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.est-kpi  { background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.est-kpi-val { font-size: 1.05rem; font-weight: 700; color: #0f172a; }
.est-kpi-lbl { font-size: 0.68rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.est-kpi-baz .est-kpi-val { color: #1d4ed8; }
.est-kpi-caf .est-kpi-val { color: #059669; }

/* Layout rows */
.est-row-full { margin-bottom: 14px; }
.est-row-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

/* Charts Wrappers */
.est-chart-wrap { position: relative; width: 100%; height: 240px; }
.est-chart-wrap-lg { position: relative; width: 100%; height: 300px; }
.est-chart-wrap-xl { position: relative; width: 100%; height: 380px; }
.est-chart-wrap-circ { position: relative; width: 100%; height: 250px; max-width: 250px; margin: 0 auto; }

/* Cards */
.est-card { background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; }
.est-card-title { font-size: 0.75rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px; }

/* Donut pair */
.est-donuts { display: flex; gap: 16px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.est-donuts > div { flex: 1; min-width: 120px; max-width: 200px; }
.est-donut-label { font-size: 0.7rem; font-weight: 700; color: #64748b; text-align: center; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Heatmap GitHub-style */
#chart-heatmap-wrapper { display: flex; flex-direction: column; align-items: center; gap: 15px; overflow-x: auto; padding-bottom: 10px; }
.est-heatmap-new { display: flex; flex-direction: column; gap: 5px; }
.est-hm-row { display: flex; gap: 5px; align-items: center; }
.est-hm-header { margin-bottom: 2px; }
.est-hm-header .est-hm-x-label { width: 40px; text-align: center; font-size: 0.65rem; color: #94a3b8; font-weight: 600; }
.est-hm-y-label { width: 30px; font-size: 0.65rem; color: #94a3b8; font-weight: 600; text-align: right; margin-right: 6px; }
.est-hm-cell { width: 40px; height: 26px; border-radius: 4px; cursor: pointer; transition: transform 0.1s; border: 1px solid rgba(27,31,35,0.06); display: flex; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 700; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.est-hm-cell:hover { transform: scale(1.1); border-color: rgba(27,31,35,0.15); box-shadow: 0 2px 5px rgba(0,0,0,0.15); z-index: 10; position: relative; }
.est-hm-c0 { background-color: #ebedf0; color: transparent; text-shadow: none; }
.est-hm-c1 { background-color: #9be9a8; color: #1e293b; text-shadow: none; }
.est-hm-c2 { background-color: #40c463; }
.est-hm-c3 { background-color: #30a14e; }
.est-hm-c4 { background-color: #216e39; }

.est-hm-legend { display: flex; align-items: center; gap: 6px; font-size: 0.65rem; color: #64748b; font-weight: 600; margin-left: auto; margin-right: auto; }
.est-hm-legend .est-hm-cell { width: 20px; height: 20px; cursor: default; transform: none; box-shadow: none; color: transparent; text-shadow: none; }

/* Info icon + tooltip */
.est-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-left: 5px;
    color: #cbd5e1;
    font-size: 0.75rem;
    cursor: default;
    vertical-align: middle;
    line-height: 1;
}
.est-info-icon:hover { color: #94a3b8; }

.est-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 9px 12px;
    border-radius: 7px;
    width: 240px;
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 100;
    pointer-events: none;
}
.est-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.est-info-icon:hover .est-tooltip,
.est-info-icon:focus .est-tooltip { display: block; }

/* Responsive */
@media (max-width: 900px) {
    .est-row-2 { grid-template-columns: 1fr; }
    .est-kpis  { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
