/* ───────────────────────────────────────────────────────────────────────────
   Tablas de detalle de Reportes (Components/Grids/Views).
   Global a propósito: las ~13 tablas de detalle comparten la misma estructura
   (barra de resumen, píldoras de conteo, estados vacío / "haz clic en la gráfica")
   y el CSS con scope de cada componente no se puede compartir entre ellas.
   Todo lleva el prefijo rd- para no chocar con el resto de la app.
   ─────────────────────────────────────────────────────────────────────────── */

/* Estructura */
.rd-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rd-stack {
    display: flex;
    flex-direction: column;
}

.rd-full {
    width: 100%;
    height: 100%;
}

.rd-full-height {
    height: 100%;
}

/* Contenedor de la grilla: ocupa el espacio que deja la barra de resumen.
   Selector doble porque el CSS propio de varias tablas da min-height:120px a su
   *-grid-host (clase + atributo de scope) y esta regla debe ganarle, como ganaba
   el estilo en línea. */
.rd-fill.rd-fill {
    flex: 1;
    min-height: 0;
}

.rd-fill-below-summary {
    height: calc(100% - 70px);
}

.rd-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Barra de resumen del detalle (mes / proceso / persona elegida) */
.rd-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 10px 15px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
}

.rd-summary--wrap {
    flex-wrap: wrap;
    gap: 10px;
}

.rd-summary--soft {
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.08);
}

.rd-summary--green {
    flex-shrink: 0;
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.08);
}

.rd-summary-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rd-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--st-info-fg);
}

.rd-summary-icon--green {
    color: var(--st-success-fg);
}

.rd-summary-label {
    color: var(--st-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rd-summary-value {
    color: var(--st-text-strong);
    font-size: 14px;
    font-weight: 600;
}

.rd-summary-stats {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rd-summary-stats--wrap {
    flex-wrap: wrap;
}

.rd-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rd-row-gap {
    display: flex;
    gap: 8px;
}

.rd-stat-label {
    color: var(--st-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.rd-muted {
    color: var(--st-text-muted);
    font-size: 12px;
}

/* Píldoras de conteo */
.rd-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.rd-badge--amber { background: var(--st-warning-bg-strong); color: var(--st-warning-text); }
.rd-badge--slate { background: var(--st-fill-5); color: var(--st-text-body); }
.rd-badge--slate-light { background: var(--st-fill-6); color: var(--st-text-secondary); }
.rd-badge--green { background: var(--st-success-bg-strong); color: var(--st-success-text); }
.rd-badge--blue { background: var(--st-info-bg-strong); color: var(--st-info-text); }
.rd-badge--blue-strong { background: var(--st-info-bg-strong); color: var(--st-info-fg); }
.rd-badge--sky { background: var(--st-info-bg-strong); color: var(--st-info-text); }
.rd-badge--red { background: var(--st-danger-bg-strong); color: var(--st-danger-fg); }
.rd-badge--red-soft { background: var(--st-danger-bg); color: var(--st-danger-text); }
.rd-badge--rose { background: var(--st-danger-bg-strong); color: var(--st-danger-text); }

/* Estado "haz clic en la gráfica" y mensajes */
.rd-placeholder {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--st-text-subtle);
}

.rd-placeholder--padded {
    padding: 20px;
    text-align: center;
}

.rd-placeholder-icon {
    margin-bottom: 10px;
    opacity: 0.3;
}

.rd-placeholder-text {
    font-size: 13px;
}

.rd-message {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    color: var(--st-text-subtle);
    font-size: 13px;
}

.rd-empty-cell {
    padding: 20px;
    color: var(--st-text-subtle);
    text-align: center;
}

/* Tablas con barras de proporción (carga por proceso / por operario) */
.rd-num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.rd-bar-track {
    flex: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--st-fill-3);
}

.rd-bar-value {
    min-width: 36px;
    color: var(--st-text-muted);
    font-size: 11px;
    text-align: right;
}

/* Persona (detalle de adopción) */
.rd-avatar {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.rd-avatar-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rd-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.rd-bar-fill--green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* Selector de vista (precisión de sugerencias: Procesos / Responsables) */
.rd-pill {
    padding: 4px 12px;
    border: none;
    border-radius: 12px;
    background: var(--st-fill-3);
    color: var(--st-text-muted);
    font-size: 12px;
    cursor: pointer;
}

.rd-pill.active {
    background: #3b82f6;
    color: #fff;
}

.rd-pill--green.active {
    background: #10b981;
}
