/* Card principal dentro del TD */
.card-criticidad {
    background-color: #0b1528;
    border: 1px solid #1a2942;
    border-radius: 12px;
    padding: 20px 24px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);

    /* --- Agrega esta línea para centrarlo --- */
    margin: 0 auto;
}

/* Cabecera de la tarjeta */
.card-criticidad .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-criticidad .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.card-criticidad .card-link {
    font-size: 13px;
    color: #38bdf8;
    text-decoration: underline;
    cursor: pointer;
}

.card-criticidad .card-link:hover {
    color: #7dd3fc;
}

/* Cuerpo de la tarjeta */
.card-criticidad .card-body {
    display: flex;
    align-items: center;
    gap: 28px;
}

/* Contenedor del gráfico y texto central */
/* Asegurar visibilidad del contenedor del canvas */
.chart-container {
    position: relative;
    width: 220px !important;
    height: 220px !important;
    display: block !important;
    flex-shrink: 0;
}

#chartCriticidad {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.chart-center-text .total-num {
    display: block;
    font-size: 26px;
    /* Aumentado ligeramente */
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.chart-center-text .total-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Leyenda estilo tabla lateral */
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.dot-critica {
    background-color: #ff3b30;
}

.dot-media {
    background-color: #ffcc00;
}

.dot-baja {
    background-color: #34c759;
}

.dot-informativa {
    background-color: #007aff;
}

.legend-label {
    color: #e2e8f0;
    width: 100px;
    font-weight: 400;
}

.legend-percent {
    color: #e2e8f0;
    width: 60px;
    text-align: right;
    font-weight: 400;
}

.legend-val {
    color: #ffffff;
    font-weight: 600;
    margin-left: auto;
    text-align: right;
    min-width: 35px;
}


/************************************
*************DASH LINEAS*****************
************************************/
/* Ancho extendido para la tarjeta del segundo gráfico (Tendencia) */
.card-tendencia {
    max-width: 100% !important;
    /* Aprovecha todo el ancho del td */
    width: 95%;
}

/* Filtros de días (Botones estilo píldora) */
.time-filters {
    display: flex;
    background-color: #060d19;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #1a2942;
    gap: 4px;
}

.btn-filter {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter.active {
    background-color: #0082fb;
    /* Azul activo */
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 130, 251, 0.4);
}

.btn-filter:hover:not(.active) {
    color: #ffffff;
}

/* Leyenda superior horizontal */
.chart-legend-top {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #e2e8f0;
}

.legend-item-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.line-dot {
    width: 12px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

/* Contenedor responsivo de la línea */
.chart-container-line {
    position: relative;
    width: 100%;
    height: 180px;
}

#chartTendencia {
    width: 100% !important;
    height: 100% !important;
}