/* ============================================================
   RESPONSIVE PERSONALIZADO — SOLO CELULAR / TABLET (AppTDM)
   ============================================================ */

@media (max-width: 768px) {

    .d-flex {
        flex-wrap: wrap !important;
    }

    /* Header móvil */
    .header-mobile-stack,
    .header-mobile-stack~.p-2.ms-auto,
    .header-mobile-stack * {
        flex-wrap: nowrap !important;
    }

    .header-mobile-stack,
    .header-mobile-badges {
        width: 100% !important;
        margin-bottom: 12px !important;
    }

    .header-mobile-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 8px 0 !important;
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }

    .header-mobile-info {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .header-mobile-stack .badge {
        font-size: 0.78rem !important;
        padding: 5px 10px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    .header-mobile-stack a[href="#myProfile"] {
        font-size: 0.85rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }

    .p-2.ms-auto {
        width: 100% !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding-top: 4px !important;
    }

    .p-2.ms-auto a {
        font-size: 1.3rem !important;
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
    }

    /* Corrección de columnas en celular */
    .col-lg-12.col-12.mb-3.position-relative {
        display: block !important;
        width: 100% !important;
    }

    /* Botones de Tableros (board-buttons) */
    .board-buttons {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        margin-top: 10px !important;
    }

    .board-buttons .btn {
        width: 100% !important;
        display: block !important;
        margin-bottom: 8px !important;
        font-size: 0.9rem !important;
        padding: 10px !important;
    }

    .board-buttons .btn:last-child {
        margin-bottom: 0 !important;
    }

    /* Fila de campos en formularios dinámicos */
    .row.mb-2 .col-3:nth-child(1),
    .row.mb-2 .col-3:nth-child(2) {
        width: 50% !important;
        flex: 0 0 50% !important;
    }

    .row.mb-2 .col-3:nth-child(3),
    .row.mb-2 .col-3:nth-child(4) {
        width: 100% !important;
        flex: 0 0 100% !important;
    }

    .row.mb-2 .col-3 {
        margin-bottom: 14px !important;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem !important;
        padding: 8px 12px !important;
    }

    .select2-selection {
        min-height: 40px !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
        font-size: 0.9rem !important;
        display: flex !important;
        align-items: center !important;
    }

    /* ============================================================
       TABLA RESPONSIVE EN CELULARES
       ============================================================ */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .table-responsive .table {
        min-width: 520px;
        margin-bottom: 0;
    }

    .table-responsive .table th {
        font-size: 0.78rem !important;
        white-space: nowrap !important;
        padding: 0.5rem 0.35rem !important;
    }

    .table-responsive .table td {
        padding: 0.4rem 0.35rem !important;
        vertical-align: middle !important;
        font-size: 0.85rem !important;
    }

    /* Modales en pantalla completa en celular */
    .modal-dialog {
        margin: 0.5rem;
    }
}