@media (max-width: 575.98px) {
    .has-megamenu .btn {
        padding: .25rem .5rem;
        max-width: calc(100vw - 6.5rem);
        white-space: normal;
        text-align: right;
    }

    .has-megamenu .btn h4 {
        font-size: 1rem;
    }

    .dropdown-menu.mega-menu {
        width: calc(100vw - 1.5rem) !important;
        max-width: calc(100vw - 1.5rem);
    }

    body.bg-login {
        height: auto;
        min-height: 100%;
        padding: 1rem 0 2rem;
        align-items: flex-start !important;
        overflow-y: auto;
    }

    .form-signin {
        margin: 0 1rem;
    }
}

@media (max-width: 800px) {
    .table-responsive {
        overflow: visible;
    }

    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
        width: 100%;
    }

    .table-responsive thead {
        display: none;
    }

    .table-responsive tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }

    .table-responsive td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 46%;
        min-height: 32px;
        text-align: left !important;
        white-space: normal;
    }

    .table-responsive td:before {
        content: attr(data-title);
        position: absolute;
        left: 8px;
        top: 8px;
        width: 42%;
        font-weight: 700;
        white-space: normal;
    }
}

table.tabla-buscar,
table.tabla-buscar.dataTable,
.dataTables_wrapper {
    width: 100% !important;
}

table.tabla-buscar.dataTable th,
table.tabla-buscar.dataTable td {
    box-sizing: border-box;
}

.table-responsive:has(table.tabla-buscar) table {
    display: table;
    width: 100% !important;
}

.table-responsive:has(table.tabla-buscar) thead {
    display: table-header-group;
}

.table-responsive:has(table.tabla-buscar) tbody {
    display: table-row-group;
}

.table-responsive:has(table.tabla-buscar) tr {
    display: table-row;
    width: auto;
    border: initial;
    margin: 0;
}

.table-responsive:has(table.tabla-buscar) th,
.table-responsive:has(table.tabla-buscar) td {
    display: table-cell;
    width: auto;
    position: static;
    padding-left: .75rem;
    min-height: 0;
    white-space: normal;
}

.table-responsive:has(table.tabla-buscar) {
    overflow-x: auto;
}

.table-responsive:has(table.tabla-buscar) td:before,
.table-responsive:has(table.tabla-buscar) th:before {
    content: none;
}

.dataTables_wrapper .dataTables_filter input {
    max-width: 100%;
}

.pagination {
    flex-wrap: wrap;
}

.file-upload-btn {
    width: 100%;
    color: #fff;
    background: #59e3a7;
    border: none;
    padding: 10px;
    border-radius: 4px;
    border-bottom: 4px solid #15824B;
    font-weight: 700;
    text-transform: uppercase;
}

.image-upload-wrap {
    margin-top: 20px;
    border: 4px dashed #1FB264;
    position: relative;
}

.file-upload-input {
    position: absolute;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    outline: none;
    opacity: 0;
    cursor: pointer;
}

.drag-text {
    text-align: center;
}

.drag-text h3 {
    font-weight: 100;
    text-transform: uppercase;
    color: #15824B;
    padding: 40px 12px;
}

.file-upload-content {
    display: none;
    text-align: center;
}

.file-upload-image {
    max-height: 200px;
    max-width: 100%;
    margin: auto;
    padding: 20px;
}

.remove-image {
    color: #fff;
    background: #cd4535;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

#Divresultados {
    max-height: 50vh;
    overflow-y: auto;
}

.botones-accion {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
}

.botones-accion form {
    display: inline-flex;
    margin: 0;
}

.botones-accion .btn {
    margin: 0;
    white-space: nowrap;
}

.btn-repetir {
    font-size: .75rem;
    line-height: 1.1;
    padding: .1rem .4rem;
}

.dash-aviso {
    background: #fff6ef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.dash-periodos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dash-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dash-total {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.dash-pendiente,
.dash-pago {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border-top: 1px solid #e7ebf0;
    padding: 0.85rem 0;
}

.dash-pendiente {
    flex-wrap: wrap;
    align-items: flex-start;
}

.dash-pendiente-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.dash-pendiente-fila > :first-child {
    min-width: 0;
    flex: 1;
}

.dash-carrito-aviso {
    flex: 1 0 100%;
    text-align: right;
    margin: 0.35rem 0 0;
}

.dash-carrito-aviso:has(.js-carrito-aviso:empty) {
    display: none;
}

.dash-pendiente.dash-urgente {
    border-left: 4px solid #e36a12;
    padding-left: 0.75rem;
}

.dash-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
}

.dash-acciones form {
    display: inline-flex;
    margin: 0;
}

.js-carrito-aviso:empty {
    display: none;
}

td .js-carrito-aviso:not(:empty) {
    display: block;
    margin-top: 0.35rem;
    white-space: normal;
}

.espacio-tablero,
.espacio-fichas {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 991.98px) {
    .espacio-tablero,
    .espacio-fichas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .espacio-tablero,
    .espacio-fichas {
        grid-template-columns: minmax(0, 1fr);
    }
}

.espacio-tarjeta,
.espacio-ficha,
.espacio-categoria {
    border: 1px solid #e7ebf0;
    border-radius: 12px;
    background: #fff;
}

.espacio-tarjeta,
.espacio-ficha {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    padding: 1rem;
}

.espacio-ficha .botones-accion {
    flex-wrap: wrap;
}

.espacio-ficha form:last-of-type {
    margin-top: auto;
}

.espacio-ficha strong,
.espacio-ficha .text-muted,
.espacio-ficha .small {
    overflow-wrap: anywhere;
}

.espacio-tarjeta.urgente,
.espacio-ficha.urgente {
    border-color: #e36a12;
}

.espacio-enlace {
    display: block;
    color: inherit;
}

.espacio-enlace:hover {
    color: inherit;
    text-decoration: none;
}

.espacio-monto {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.espacio-aviso {
    background: #fff1ea;
    color: #e36a12;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    white-space: nowrap;
}

.espacio-barra {
    display: flex;
    height: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: #e7ebf0;
}

.espacio-barra .pendiente {
    background: #fb7756;
}

.espacio-barra .pagado {
    background: #2f9e63;
}

.espacio-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.espacio-cats img,
.espacio-categoria img,
.espacio-ficha-icono {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.espacio-categoria {
    padding: 0.85rem 0.5rem;
}

.espacio-categoria:hover {
    text-decoration: none;
    border-color: #b7c3d0;
}

.espacio-ficha-icono {
    margin-right: 0.75rem;
}
