/**
 * RepairBill — formularios POS y listados: móvil / tablet
 * - input-group + Select2: botones permanecen en la misma fila
 * - tablas anchas: desplazamiento horizontal táctil
 * - pestañas y controles: mejor uso en pantallas pequeñas
 */

/* Bootstrap 4: .input-group usa flex-wrap; con Select2 el append baja de línea → forzar una fila */
.content .input-group.mb-3,
.content .input-group.input-group-search {
    flex-wrap: nowrap;
    align-items: stretch;
}

.content .input-group > .select2-container,
.content .input-group > .select2-container--bootstrap4 {
    flex: 1 1 0%;
    width: 1% !important;
    min-width: 0;
    max-width: 100%;
}

.content .input-group .select2-container .select2-selection--single {
    height: calc(2.25rem + 2px);
}

.content .input-group-append,
.content .input-group-prepend {
    flex-shrink: 0;
}

.content .input-group-append .btn,
.content .input-group-prepend .btn {
    white-space: nowrap;
}

/* Tablas de detalle en formularios (venta, cotización, orden, compra, NC, etc.) */
.rb-table-products-wrap {
    overflow-x: visible;
    overflow-y: visible;
    max-width: 100%;
    margin-bottom: 1rem;
}

/*
 * Listados POS (list.html): en escritorio ancho NO hay barra horizontal.
 * theme-modern.css usa overflow:hidden en .card → visible para menús desplegables.
 * Scroll horizontal solo en @media (max-width: 991.98px) más abajo.
 */
section.content .card:has(#data_wrapper),
section.content .card:has(#data_wrapper) .card-body {
    overflow: visible !important;
}

section.content .card:has(#data_wrapper) .card-body > .container-fluid {
    min-width: 0;
    max-width: 100%;
}

section.content .rb-pos-table-scroll,
section.content .dataTables-scroll-height {
    overflow-x: visible;
    overflow-y: visible;
    max-width: 100%;
    width: 100%;
    margin-bottom: 1rem;
}

/* Formularios: sin scroll doble en detalle de líneas */
.rb-table-products-wrap .dataTables_wrapper,
.rb-table-products-wrap .dataTables_scroll {
    overflow: visible !important;
    max-width: 100%;
}

/* Listados: wrapper DataTables no recorta menús; el scroll va en .rb-pos-table-scroll (solo móvil/tablet) */
.rb-pos-table-scroll .dataTables_wrapper,
.rb-pos-table-scroll .dataTables_scroll,
.dataTables-scroll-height .dataTables_wrapper,
.dataTables-scroll-height .dataTables_scroll {
    overflow: visible !important;
    max-width: none;
}

section.content #data_wrapper.dataTables_wrapper {
    overflow: visible !important;
    max-width: 100%;
    width: 100%;
    display: flow-root;
}

/* Pie DataTables: info y paginación debajo de la tabla, sin superponer filas */
section.content #data_wrapper.dataTables_wrapper::after {
    content: '';
    display: block;
    clear: both;
}

section.content #data_wrapper .dataTables_length,
section.content #data_wrapper .dataTables_filter {
    margin-bottom: 0.5rem;
}

section.content #data_wrapper .dataTables_scroll,
section.content #data_wrapper .dataTables-scroll-height {
    clear: both;
    width: 100%;
    height: auto !important;
    max-height: none !important;
    overflow-x: visible;
    overflow-y: visible;
    margin-bottom: 0.25rem;
}

section.content #data_wrapper .dataTables_info {
    clear: both;
    float: none !important;
    width: 100%;
    padding-top: 0.65rem;
    margin: 0;
}

section.content #data_wrapper .dataTables_paginate {
    clear: both;
    float: none !important;
    width: 100%;
    text-align: right;
    padding-top: 0.35rem;
    padding-bottom: 0.15rem;
    margin: 0;
}

section.content .card > .card-footer {
    clear: both;
    position: relative;
    z-index: 2;
}

section.content .rb-pos-table-scroll table#data.dataTable,
section.content .rb-pos-table-scroll table.table#data,
section.content #data_wrapper table#data.dataTable,
section.content .rb-pos-table-scroll table#data-alignment,
section.content .rb-pos-table-scroll table#data-other {
    width: 100%;
}

section.content .dataTables_scroll--receptions,
section.content #data_wrapper .dataTables_scroll--receptions {
    overflow-x: visible !important;
    overflow-y: visible !important;
    max-width: 100%;
    width: 100%;
}

@media (max-width: 991.98px) {
    /* —— POS: scroll horizontal táctil en tablas anchas (formularios, listados, modales) —— */
    section.content .rb-table-products-wrap,
    section.content .rb-pos-table-scroll,
    section.content .dataTables-scroll-height,
    section.content .appointment-table-wrap,
    section.content .terceros-table-wrap,
    section.content .card-body > .container-fluid > .dataTables_wrapper,
    section.content .card-body .rb-pos-table-scroll .dataTables_wrapper,
    section.content .dataTables_scroll--receptions,
    section.content #data_wrapper .dataTables_scroll--receptions,
    section.content #data_wrapper .dataTables-scroll-height,
    .modal-content .rb-table-products-wrap,
    .modal-content .rb-pos-table-scroll,
    .modal-content .table-responsive,
    .modal-content .modal-body > .container-fluid:has(table.table),
    .modal-content .modal-body > .container-fluid:has(.dataTables_wrapper),
    .modal-content .modal-body .dataTables_wrapper,
    .modal-content .modal-body > .container-fluid > .row > [class*='col-']:has(table.table) {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        scrollbar-width: thin;
    }

    section.content .rb-table-products-wrap .dataTables_wrapper,
    section.content .rb-table-products-wrap .dataTables_scroll,
    section.content .rb-pos-table-scroll .dataTables_wrapper,
    section.content .rb-pos-table-scroll .dataTables_scroll,
    section.content .card-body > .container-fluid > .dataTables_wrapper .dataTables_scroll,
    section.content .appointment-table-wrap .dataTables_wrapper,
    section.content .appointment-table-wrap .dataTables_scroll,
    .modal-content .rb-table-products-wrap .dataTables_wrapper,
    .modal-content .rb-table-products-wrap .dataTables_scroll,
    .modal-content .rb-pos-table-scroll .dataTables_scroll,
    .modal-content .modal-body .dataTables_wrapper,
    .modal-content .modal-body .dataTables_scroll {
        overflow: visible !important;
        max-width: none;
    }

    /* Detalle de líneas (venta, cotización, compra, O/R, NC, kits, modales detalle, etc.) */
    section.content .rb-table-products-wrap table.table,
    .modal-content .rb-table-products-wrap table.table,
    section.content table#tblProducts,
    .modal-content table#tblProducts {
        table-layout: auto !important;
        width: auto !important;
        min-width: 980px;
    }

    /* Listados DataTables (#data) y tablas auxiliares */
    section.content .rb-pos-table-scroll table.table,
    section.content .appointment-table-wrap table.table,
    section.content .terceros-table-wrap table.table,
    section.content .card-body > .container-fluid > .dataTables_wrapper table#data,
    section.content table#tblSearchProducts,
    section.content table#tblRetentionDetail,
    section.content table#tblPayments,
    section.content table#tblAdditionalInfo,
    section.content table#data-alignment,
    section.content table#data-other,
    section.content table#tblEstadoHistorial,
    .modal-content table#tblSearchProducts,
    .modal-content table#tblPayments,
    .modal-content table#tblRetentionDetail,
    .modal-content table#tblAdditionalInfo {
        table-layout: auto !important;
        width: auto !important;
        min-width: 720px;
    }

    /* Pedido / devolución de repuestos (más columnas) */
    section.content #data_wrapper table#data.table {
        min-width: 980px;
    }

    /* Cabeceras legibles (sin letras apiladas) */
    section.content .rb-table-products-wrap table.table thead th,
    section.content .rb-pos-table-scroll table.table thead th,
    section.content .appointment-table-wrap table.table thead th,
    section.content .terceros-table-wrap table.table thead th,
    section.content .card-body > .container-fluid > .dataTables_wrapper table.table thead th,
    section.content table#tblSearchProducts thead th,
    section.content table#tblRetentionDetail thead th,
    section.content table#tblPayments thead th,
    section.content table#data-alignment thead th,
    section.content table#data-other thead th,
    .modal-content .rb-table-products-wrap table.table thead th,
    .modal-content table#tblSearchProducts thead th,
    .modal-content table#tblProducts thead th,
    .modal-content table#tblPayments thead th,
    .modal-content table#tblRetentionDetail thead th,
    .modal-content table#tblAdditionalInfo thead th {
        white-space: nowrap;
        font-size: 0.72rem;
        letter-spacing: 0;
        text-transform: none;
        padding: 0.4rem 0.35rem;
        vertical-align: middle;
    }

    section.content .rb-table-products-wrap table.table thead th.pos-dscto-th small,
    .modal-content table.table thead th.pos-dscto-th small {
        display: inline;
        margin-top: 0;
        margin-left: 0.2rem;
    }

    section.content .rb-table-products-wrap table.table tbody td,
    section.content .rb-pos-table-scroll table.table tbody td,
    section.content .appointment-table-wrap table.table tbody td,
    section.content .terceros-table-wrap table.table tbody td,
    section.content .card-body > .container-fluid > .dataTables_wrapper table.table tbody td,
    section.content table#tblSearchProducts tbody td,
    section.content table#tblRetentionDetail tbody td,
    section.content table#tblPayments tbody td,
    .modal-content .rb-table-products-wrap table.table tbody td,
    .modal-content table#tblSearchProducts tbody td,
    .modal-content table#tblProducts tbody td,
    .modal-content table#tblPayments tbody td,
    .modal-content table#tblRetentionDetail tbody td,
    .modal-content table#tblAdditionalInfo tbody td {
        white-space: nowrap;
        font-size: 0.8125rem;
        padding: 0.4rem 0.35rem;
        vertical-align: middle;
        max-width: none;
        overflow: visible;
    }

    section.content .rb-table-products-wrap table.table tbody td .pos-line-total,
    section.content table#tblProducts tbody td .pos-line-total,
    .modal-content table.table tbody td .pos-line-total {
        white-space: nowrap !important;
        overflow: visible;
        text-overflow: clip;
    }

    section.content table.table tbody td:has(.pos-num-stepper),
    section.content table.table tbody td:has(.pos-dscto-cell),
    .modal-content table.table tbody td:has(.pos-num-stepper),
    .modal-content table.table tbody td:has(.pos-dscto-cell) {
        min-width: 4.25rem;
    }

    /* Modales anchos: aprovechan el ancho en tablet / móvil */
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 1rem);
        margin-left: auto;
        margin-right: auto;
    }

    .modal-content .modal-body > .container-fluid:has(table.table),
    .modal-content .modal-body > .container-fluid:has(.dataTables_wrapper) {
        padding-left: 0;
        padding-right: 0;
        overflow-x: auto;
    }

    .modal-content [id$='DetailMeta'] {
        word-break: break-word;
        overflow-wrap: anywhere;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    /* Bootstrap .table-responsive y pantallas custom (M.O. terceros, etc.) */
    section.content .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    section.content .table-responsive > table.table {
        table-layout: auto !important;
        width: auto !important;
        min-width: 720px;
    }

    section.content .table-responsive > table.table thead th {
        white-space: nowrap;
        font-size: 0.72rem;
        padding: 0.4rem 0.35rem;
    }

    section.content .table-responsive > table.table tbody td {
        white-space: nowrap;
        font-size: 0.8125rem;
        padding: 0.4rem 0.35rem;
    }
}

/* Pestañas de pago y similares: no romper en muchas columnas */
.content .nav-tabs.rb-nav-tabs-scroll,
.content ul.nav-tabs.flex-nowrap {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.content .nav-tabs.rb-nav-tabs-scroll .nav-item,
.content ul.nav-tabs.flex-nowrap .nav-item {
    white-space: nowrap;
}

.content .nav-tabs.rb-nav-tabs-scroll .nav-link,
.content ul.nav-tabs.flex-nowrap .nav-link {
    white-space: nowrap;
}

/* Fallback: listados sin .rb-pos-table-scroll (p. ej. tablas sueltas en card-body) */
section.content .card-body > .container-fluid > .dataTables_wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* TouchSpin: zona táctil mínima recomendada */
@media (max-width: 991.98px) {
    .bootstrap-touchspin .input-group-btn > .btn {
        min-height: 2.75rem;
        min-width: 2.65rem;
    }
}

/* Botones de pie de formulario POS */
@media (max-width: 575.98px) {
    .rb-form-actions-responsive .btn {
        display: block;
        width: 100%;
        margin: 0.4rem 0 !important;
    }
}

/*
 * Pantallas ≤991px (móvil y tablet estrecha):
 * AdminLTE por defecto oculta el sidebar solo hasta 767px; entre 768–991 el menú sigue
 * fijo a 250px pero el contenido tiene margin-left: 0 → el área útil queda “comprimida”
 * detrás del menú. Misma lógica que en teléfono: sidebar fuera del lienzo hasta abrir.
 */
@media (max-width: 991.98px) {
    .main-sidebar,
    .main-sidebar::before {
        margin-left: -250px !important;
        box-shadow: none !important;
    }

    body.sidebar-open .main-sidebar,
    body.sidebar-open .main-sidebar::before {
        margin-left: 0 !important;
    }

    body:not(.layout-top-nav) .wrapper .content-wrapper,
    body:not(.layout-top-nav) .wrapper .main-header,
    body:not(.layout-top-nav) .wrapper .main-footer {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .wrapper {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .wrapper .content-wrapper {
        overflow-x: hidden;
        min-width: 0;
    }

    .content-wrapper > .content {
        padding-left: max(0.35rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.35rem, env(safe-area-inset-right, 0px));
    }

    .content-header .container-fluid,
    section.content > .container-fluid {
        max-width: 100%;
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    }

    .content > .container {
        max-width: 100%;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    /* Tarjetas: menos margen lateral para ganar ancho en pantallas angostas */
    .content .card .card-body {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .content .card .card-header {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    /* Modales estándar: casi todo el ancho con notch seguro */
    .modal-dialog:not(.modal-xl) {
        max-width: calc(100vw - 1.25rem);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 575.98px) {
    .breadcrumb {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .content-header .container-fluid,
    section.content > .container-fluid {
        padding-left: max(0.35rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.35rem, env(safe-area-inset-right, 0px));
    }
}

/*
 * Panel (layout-top-nav / hzt_body): `.content > .container` usa max-width de Bootstrap.
 * Si el viewport efectivo es ancho (zoom alejado en el celular), la banda útil queda como
 * columna centrada con grandes márgenes. En táctil forzar 100 % como el escritorio estrecho real.
 */
/*
 * Barra superior: evitar fila única saturada (scroll horizontal / texto cortado).
 * En ≤991px (tablet) las acciones derechas pueden pasar a segunda fila con wrap.
 * En ≤767px (teléfono) se anula el wrap: una sola fila compacta (ver bloque siguiente).
 */
@media (max-width: 991.98px) {
    .main-header.navbar {
        flex-wrap: wrap;
        align-items: stretch;
        align-content: flex-start;
        row-gap: 0;
        padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
        padding-bottom: 0.35rem;
    }

    /* Layout sidebar (dos <ul> directos): primera fila menú + segunda fila iconos */
    body:not(.layout-top-nav) .main-header.navbar > .navbar-nav.ml-auto {
        flex-basis: 100%;
        margin-left: 0 !important;
        padding-top: 0.35rem;
        margin-top: 0.15rem;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.15rem;
    }

    html[data-theme='dark'] body:not(.layout-top-nav) .main-header.navbar > .navbar-nav.ml-auto {
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    /* Layout menú superior: toolbar dentro de .container */
    body.layout-top-nav .main-header.navbar > .container {
        flex-wrap: wrap;
        max-width: 100%;
        min-width: 0;
    }

    body.layout-top-nav .main-header.navbar > .container > .navbar-nav.ml-auto {
        flex-basis: 100%;
        margin-left: 0 !important;
        padding-top: 0.35rem;
        margin-top: 0.2rem;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.15rem;
    }

    html[data-theme='dark'] body.layout-top-nav .main-header.navbar > .container > .navbar-nav.ml-auto {
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    .main-header .navbar-nav .nav-link {
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .main-header .navbar-nav .nav-item.d-flex.align-items-center {
        min-height: 2.75rem;
    }

    .main-header .navbar-nav .rb-theme-toggle {
        min-height: 2.65rem;
        min-width: 2.65rem;
    }

    /* Nombre de usuario / RUC / perfil: evitar desborde en una sola línea */
    .rb-navbar-truncate {
        display: inline-block;
        max-width: min(42vw, 11rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }
}

/*
 * Teléfonos (≤767px): una sola fila de cabecera — la regla anterior (≤991) partía la barra
 * en dos hileras (hamburguesa arriba, iconos abajo) y ocupaba demasiado alto en móvil.
 * Los iconos derechos pueden desplazarse en horizontal si no caben.
 */
@media (max-width: 767.98px) {
    .main-header.navbar {
        flex-wrap: nowrap !important;
        align-items: center !important;
        align-content: center !important;
        row-gap: 0 !important;
        padding-top: 0.2rem !important;
        padding-bottom: 0.2rem !important;
        min-height: 0;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    body:not(.layout-top-nav) .main-header.navbar > .navbar-nav:first-child {
        flex-shrink: 0;
    }

    body:not(.layout-top-nav) .main-header.navbar > .navbar-nav.ml-auto {
        flex: 1 1 0% !important;
        flex-basis: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
        margin-left: 0.25rem !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        border-top: none !important;
        flex-wrap: nowrap !important;
        /* overflow-x:auto recorta en Y y oculta dropdowns (campana). El scroll horizontal va en la barra. */
        overflow-x: visible !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-end;
        gap: 0;
        scrollbar-width: none;
    }

    body:not(.layout-top-nav) .main-header.navbar > .navbar-nav.ml-auto > .nav-item {
        flex-shrink: 0;
    }

    body:not(.layout-top-nav) .main-header.navbar > .navbar-nav.ml-auto::-webkit-scrollbar {
        display: none;
    }

    body.layout-top-nav .main-header.navbar > .container {
        flex-wrap: nowrap !important;
        align-items: center !important;
        padding-top: 0.2rem !important;
        padding-bottom: 0.2rem !important;
        min-width: 0;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    body.layout-top-nav .main-header.navbar > .container > .navbar-nav.ml-auto {
        flex: 1 1 0% !important;
        flex-basis: 0 !important;
        min-width: 0 !important;
        margin-left: 0.25rem !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        border-top: none !important;
        flex-wrap: nowrap !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-end;
        scrollbar-width: none;
    }

    body.layout-top-nav .main-header.navbar > .container > .navbar-nav.ml-auto > .nav-item {
        flex-shrink: 0;
    }

    body.layout-top-nav .main-header.navbar > .container > .navbar-nav.ml-auto::-webkit-scrollbar {
        display: none;
    }

    .main-header .navbar-nav .nav-link {
        min-height: 2.35rem !important;
        padding: 0.3rem 0.45rem !important;
    }

    .main-header .navbar-nav .nav-item.d-flex.align-items-center {
        min-height: 2.35rem !important;
    }

    .main-header .navbar-nav .rb-theme-toggle {
        min-height: 2.35rem !important;
        min-width: 2.35rem !important;
    }
}

/* Teléfonos muy estrechos: tipografía base un poco mayor para lectura */
@media (max-width: 575.98px) {
    html {
        font-size: 16px;
    }
}

@media not all and (min-width: 992px) and (hover: hover) and (pointer: fine) {
    body.layout-top-nav .content-header > .container,
    body.layout-top-nav section.content > .container,
    body.layout-top-nav .content > .container {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: max(0.45rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.45rem, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    body.layout-top-nav .wrapper {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    body.layout-top-nav .content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        overflow-x: hidden;
    }

    body.layout-top-nav .dashboard-admin.container-fluid {
        padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
    }
}

/*
 * Portal técnico (recepción / técnico en celular): antes mucho texto usaba .small (80 %).
 * Tamaños y cajas de tiempo orientativo más legibles en ≤991px.
 */
@media (max-width: 991.98px) {
    .rb-technician-portal .card-body {
        font-size: 1.0625rem;
        line-height: 1.5;
    }

    .rb-technician-portal .card-header .card-title {
        font-size: 1.3rem;
        line-height: 1.25;
    }

    .rb-technician-portal .rb-portal-intro {
        font-size: 1rem;
        line-height: 1.45;
    }

    .rb-technician-portal .rb-portal-section-title {
        font-size: 1.05rem;
        font-weight: 600;
    }

    .rb-technician-portal .rb-portal-lead {
        font-size: 1.125rem;
        font-weight: 500;
        line-height: 1.4;
    }

    .rb-technician-portal .rb-portal-meta,
    .rb-technician-portal .rb-portal-detail-grid {
        font-size: 1rem !important;
        line-height: 1.45;
    }

    .rb-technician-portal .rb-portal-desc {
        font-size: 1.0625rem;
        line-height: 1.5;
    }

    .rb-technician-portal .rb-portal-intake {
        font-size: 1rem !important;
        line-height: 1.45;
    }

    .rb-technician-portal .rb-portal-intake strong {
        font-size: 1.05rem;
    }

    .rb-technician-portal .form-control {
        font-size: 1.05rem;
        min-height: 2.75rem;
    }

    .rb-technician-portal .form-control-file {
        font-size: 1rem;
    }

    .rb-technician-portal .rb-portal-history li {
        font-size: 1rem;
        line-height: 1.45;
        margin-bottom: 0.4rem;
    }

    .rb-technician-portal .badge {
        font-size: 0.9rem;
        padding: 0.35em 0.55em;
    }

    .rb-technician-portal .btn {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .rb-technician-portal .card-body {
        font-size: 1.1rem;
    }

    .rb-technician-portal .rb-portal-lead {
        font-size: 1.2rem;
    }

    .rb-technician-portal .rb-portal-desc {
        font-size: 1.1rem;
    }
}

/* Campana POS: grupos por tipo de notificación */
.rb-nav-notif-grouped .rb-notif-between-groups {
    margin: 0.15rem 0;
    opacity: 0.85;
}

.rb-nav-notif-grouped .rb-notif-group .dropdown-header {
    white-space: normal;
}

.rb-nav-notif-grouped .workshop-feed-item + .workshop-feed-item {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/*
 * Listados POS (móvil): menú «Acciones» de fila como panel en primer plano.
 */
@media (max-width: 767.98px) {
    .rb-mobile-actions-modal {
        padding-right: 0 !important;
    }

    .rb-mobile-actions-modal .modal-dialog {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        max-width: 100%;
        width: 100%;
    }

    .rb-mobile-actions-modal .modal-content {
        border: none;
        border-radius: 1rem 1rem 0 0;
        max-height: min(85vh, calc(100vh - 1rem));
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
    }

    .rb-mobile-actions-modal .modal-header {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .rb-mobile-actions-modal .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rb-mobile-actions-modal .modal-footer {
        border-top: none;
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    }

    .rb-mobile-actions-list .list-group-item {
        padding: 0.95rem 1.25rem;
        font-size: 1rem;
        border-left: 0;
        border-right: 0;
    }

    .rb-mobile-actions-list .list-group-item-action:not(.disabled):active {
        background-color: rgba(0, 0, 0, 0.06);
    }

    .rb-mobile-actions-list .list-group-item i,
    .rb-mobile-actions-list .list-group-item .rb-mobile-action-icon {
        display: inline-block;
        width: 1.25rem;
        min-width: 1.25rem;
        text-align: center;
        color: #6c757d;
        vertical-align: -0.05em;
    }

    [data-theme='dark'] .rb-mobile-actions-list .list-group-item i,
    [data-theme='dark'] .rb-mobile-actions-list .list-group-item .rb-mobile-action-icon {
        color: #adb5bd;
    }

    .rb-mobile-actions-divider {
        height: 1px;
        background: rgba(0, 0, 0, 0.08);
    }

    /* Botones sueltos en columna de acciones (móvil): un solo disparador «Acciones». */
    td.rb-mobile-actions-enhanced .rb-mobile-inline-action-hidden {
        display: none !important;
    }

    /*
     * Calendarios (daterangepicker): panel inferior como «Acciones».
     */
    body.rb-mobile-daterange-open {
        overflow: hidden;
    }

    .rb-mobile-daterange-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 10060;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .rb-mobile-daterange-backdrop.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .daterangepicker.rb-mobile-daterange-sheet {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 1rem 1rem 0 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18) !important;
        z-index: 10070 !important;
        pointer-events: auto;
        touch-action: manipulation;
        max-height: min(88vh, calc(100vh - 0.5rem));
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    .daterangepicker.rb-mobile-daterange-sheet:before,
    .daterangepicker.rb-mobile-daterange-sheet:after {
        display: none !important;
    }

    .rb-mobile-daterange-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 0;
        z-index: 20;
        background: inherit;
        pointer-events: auto;
    }

    .rb-mobile-daterange-title {
        font-weight: 700;
        font-size: 1rem;
        line-height: 1.2;
    }

    .rb-mobile-daterange-close {
        font-size: 1.75rem;
        line-height: 1;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        position: relative;
        z-index: 21;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .daterangepicker.rb-mobile-daterange-sheet .drp-calendars {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .daterangepicker.rb-mobile-daterange-sheet .drp-calendar {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem 0.75rem 0.75rem !important;
    }

    .daterangepicker.rb-mobile-daterange-sheet .calendar-table {
        width: 100%;
    }

    .daterangepicker.rb-mobile-daterange-sheet .calendar-table th,
    .daterangepicker.rb-mobile-daterange-sheet .calendar-table td {
        min-width: 2rem;
        height: 2.2rem;
        line-height: 2.2rem;
        font-size: 0.95rem;
    }

    .daterangepicker.rb-mobile-daterange-sheet .drp-buttons {
        position: sticky;
        bottom: 0;
        background: inherit;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    .daterangepicker.rb-mobile-daterange-sheet .ranges {
        width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem 0.75rem !important;
    }

    .daterangepicker.rb-mobile-daterange-sheet .ranges ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        width: 100%;
    }

    .daterangepicker.rb-mobile-daterange-sheet .ranges li {
        flex: 1 1 calc(50% - 0.35rem);
        margin: 0 !important;
        border-radius: 0.5rem;
        text-align: center;
        font-size: 0.875rem;
        padding: 0.55rem 0.35rem;
    }

    .content input[name="date_range"],
    .content #spare_date_range,
    .content [data-rb-mobile-daterange] {
        min-height: calc(2.25rem + 2px);
        font-size: 0.9375rem;
    }

    html[data-theme='dark'] .rb-mobile-daterange-header {
        border-bottom-color: #273454;
    }

    html[data-theme='dark'] .rb-mobile-daterange-backdrop {
        background: rgba(0, 0, 0, 0.58);
    }
}

/* Menús «Acciones» en filas de tablas POS: iconos discretos (gris, tamaño reducido). */
.rb-pos-row-actions-dd .dropdown-menu {
    min-width: 12.5rem;
    padding-bottom: 0.35rem;
}

.rb-pos-row-actions-dd .dropdown-item {
    font-size: 0.875rem;
}

.rb-pos-row-actions-dd .dropdown-item i {
    color: #6c757d;
    font-size: 0.82rem;
}

html[data-theme='dark'] .rb-pos-row-actions-dd .dropdown-item i {
    color: #adb5bd;
}

/* Tooltips: el globo no debe interceptar clics en botones/enlaces del POS. */
body .tooltip {
    pointer-events: none !important;
}
