/* ----- Recomendación: poner esto globalmente al inicio del site.css ----- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* =============================
   DATA_FRAME Y CALENDARIOS - Estilos optimizados
   ============================= */
.data_frame {
    display: block;
    width: 100%;
    height: 100%;
    color: black;
    background-color: #262944;
    overflow-y: auto;
    border: 2px solid darkorange;
    border-radius: 4px;
    padding: 10px;
}

    /* Elementos internos */
    .data_frame select {
        width: 400px;
        height: 40px;
    }

    .data_frame ul {
        list-style: none;
        padding: 10px;
        margin: 0;
    }

    .data_frame li {
        padding: 0;
    }

    .data_frame a {
        text-decoration: none;
        color: blue;
    }


    /* Grid adaptable: máximo 3 calendarios por fila */
    .data_frame .row.g-3.my-3 {
        display: grid;
        /* usar minmax(0,1fr) para evitar columnas que no se encogen */
        grid-template-columns: repeat(auto-fit, minmax(calc(100% / 3 - 1rem), 1fr));
        gap: 1rem;
        justify-items: stretch;
        width: 100%;
        margin: 0 auto;
    }

        /* wrapper de cada partial */
        .data_frame .row.g-3.my-3 > div {
            width: 100%;
            padding: 0;
        }

/* ----------------------------
   PLANNING-MONTH (tarjeta)
   ---------------------------- */
.planning-month {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #31345b 0%, #2a2d4e 100%);
    color: #f2f2f2;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #ff9500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform .25s ease, box-shadow .25s ease;
}

    .planning-month:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    }

    /* encabezado */
    .planning-month .month-header {
        text-align: center;
        background: linear-gradient(90deg, #ff9800 0%, #ffb74d 100%);
        color: #1c1e35;
        padding: 6px 0;
        margin-bottom: 10px;
        border-radius: 6px 6px 0 0;
        font-weight: bold;
        letter-spacing: .5px;
    }

        .planning-month .month-header h5 {
            color: black;
            margin: 0;
            font-size: 1.5rem;
        }


    /* grid interno de 7 columnas (usar minmax(0,1fr) por seguridad) */
    .planning-month .month-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
    }

    /* día (común) */
    .planning-month .day-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 6px;
        min-height: 34px;
        border-radius: 4px;
        background: rgba(255,255,255,0.03);
        transition: background .18s ease, color .18s ease, box-shadow .18s ease;
    }

        /* día vacío */
        .planning-month .day-card.empty {
            background: transparent;
        }

    /* número del día */
    .planning-month .day-number {
        width: 2ch;
        text-align: right;
        font-size: .85rem;
        color: #e6e6e6;
        font-weight: 600;
    }

    /* select dentro del día: texto oscuro para legibilidad + estilos consistentes */
    .planning-month .day-card select.day-code {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        font-size: .85rem;
        font-weight: 600;
        color: #212529 !important; /* legible sobre fondos */
        background-color: rgba(255,255,255,0.9) !important;
        border: 1px solid rgba(0,0,0,0.15);
        border-radius: 4px;
        padding: 2px;
    }

        .planning-month .day-card select.day-code:focus {
            outline: none;
            background-color: #fff !important;
            color: #000 !important;
            border-color: #666;
        }

        .planning-month .day-card select.day-code option {
            color: #212529;
            background: #fff;
        }

    /* =============================
   COLORES POR TIPO (clases)
   ============================= */
    /* nota: usamos selectores con .planning-month para mantener scope */
    .planning-month .day-card.day-lb {
        background: #0d6efd;
        color: #fff;
    }

    .planning-month .day-card.day-nl {
        background: #1e7e34;
        color: #fff;
    }

    .planning-month .day-card.day-vc {
        background: #ffc107;
        color: #fff;
    }

    .planning-month .day-card.day-ba {
        background: #F09B59;
        color: #fff;
    }

    .planning-month .day-card.day-au {
        background: #dc3545;
        color: #fff;
    }

    .planning-month .day-card.day-ot {
        background: #6c757d;
        color: #fff;
    }

        /* que el select y el número hereden el color legible */
        .planning-month .day-card.day-lb select,
        .planning-month .day-card.day-nl select,
        .planning-month .day-card.day-vc select,
        .planning-month .day-card.day-ba select,
        .planning-month .day-card.day-au select,
        .planning-month .day-card.day-ot select {
            background: rgba(255,255,255,0.85) !important; /* mantener select legible */
            color: #212529 !important;
            border: 1px solid rgba(0,0,0,0.15);
        }

    /* contraste específico para día amarillo */
    .planning-month .day-card.day-vc .day-number {
        color: #222;
    }

/* tabla superior (campos) */
.data_frame nav table {
    width: 100%;
    table-layout: fixed;
}

/* responsive: tablet -> 2 col, móvil -> 1 col */
@media (max-width:991px) {
    .data_frame .row.g-3.my-3 {
        grid-template-columns: repeat(auto-fit, minmax(calc(100% / 2 - 1rem), 1fr));
    }
}

@media (max-width:600px) {
    .data_frame .row.g-3.my-3 {
        grid-template-columns: 1fr;
    }
}
