/* ============================================================
   Tandem Desing - Custom overrides sobre Materio
   ============================================================ */

/* =============================================================================
   Intranet Materio: pie visible siempre; scroll solo en la zona de contenido
   (marcador en <html> de _LayoutMaterio.cshtml — no afecta _LayoutMaterioBlank).
   ============================================================================= */
html.tandem-intranet-chrome {
    /* Alto explícito al viewport: los porcentajes en body/layout encajan siempre tras fuentes/Maps/DT. */
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    /* Un solo viewport de scroll; sin esto algunos navegadores encadenan rueda a <html>/<body>. */
    overflow: hidden;
}

html.tandem-intranet-chrome body {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Filas hijas del wrapper: menu + pagina deben encajar en el viewport */
html.tandem-intranet-chrome .layout-wrapper.layout-content-navbar {
    /* flex-basis 0%: si es "auto", el bloque crece con el contenido y body{overflow:hidden} recorta sin barra de scroll */
    flex: 1 1 0% !important;
    min-height: 0 !important;
    max-height: 100%;
    align-items: stretch;
    overflow: hidden;
}

html.tandem-intranet-chrome .layout-wrapper.layout-content-navbar > .layout-container {
    flex: 1 1 0% !important;
    min-width: 0;
    min-height: 0 !important;
    max-height: 100%;
    /* sustituye min-block-size: 100vh de Materio, que forzaba altura documento */
    min-block-size: 0;
    align-self: stretch;
}

html.tandem-intranet-chrome .layout-content-navbar .layout-menu {
    max-height: 100%;
    align-self: stretch;
}

html.tandem-intranet-chrome .layout-content-navbar .layout-page {
    /* Sustituye flex 1 1 auto de Materio: basis 0 para altura acotada al viewport (cadena flex + scroll) */
    flex: 1 1 0% !important;
    min-height: 0 !important;
    max-height: 100%;
    overflow: hidden;
}

/* El menú fijo no debe tapar el formulario: el contenido empieza después de su ancho. */
@media (min-width: 1200px) {
    html.tandem-intranet-chrome.layout-menu-fixed:not(.layout-menu-collapsed) .layout-content-navbar .layout-page {
        padding-inline-start: var(--bs-menu-width) !important;
    }

    html.tandem-intranet-chrome.layout-menu-fixed.layout-menu-collapsed .layout-content-navbar .layout-page {
        padding-inline-start: var(--bs-menu-collapsed-width) !important;
    }
}

html.tandem-intranet-chrome .layout-content-navbar .content-wrapper {
    min-height: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden;
}

/*
 * Contenido principal (.tandem-layout-main-scroll): scroll vertical SIEMPRE aqui.
 * flex 1 1 0% + min-height:0: sin "basis 0" el area crece al contenido (flex-basis:auto),
 * no aparece overflow-y y el exceso queda oculto por body { overflow: hidden }.
 * Las pantallas especificas debajo vuelven a display:flex / overflow:hidden con :has(...)
 * cuando el scroll secundario vive dentro (DataTables / Jobside / STL).
 * Sin flex interno aqui: menos choques rueda/encadenamiento; el contenido va en bloque normal.
 */
html.tandem-intranet-chrome .layout-content-navbar .content-wrapper > .container-fluid.flex-grow-1.container-p-y.tandem-layout-main-scroll {
    /*
     * !important: Bootstrap `.flex-grow-1` usa flex-grow:!important y Materio puede dejar flex-basis:auto.
     * Sin basis 0 + min-height 0 FORZADOS, esta caja crece con el contenido → overflow-y nunca activa,
     * la barra “desaparece” tras el pintado final y body sigue recortando (TSql_Company/Edit, etc.).
     */
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 0 !important;
    min-height: 0 !important;
    overflow-x: hidden;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* Intranet flex panels: .tandem-scroll-y = min-height:0 + overflow-y:auto inside a flex chain; .tandem-fill-scroll = flex:1 1 auto + min-height:0 + overflow-y:auto (body under a fixed flex header, e.g. long card stacks). */
.tandem-scroll-y {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tandem-fill-scroll {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Separador: linea azul (color plantilla) entre contenido y pie ---- */
.layout-content-navbar .content-footer.footer {
    border-top: 1px solid var(--tandem-primary, var(--bs-primary));
}

/* ---- Menu lateral: fondo ligeramente mas oscuro (barra superior sin override) ---- */
.layout-content-navbar {
    --tandem-chrome-bg: color-mix(in srgb, var(--bs-body-bg, #fff) 94%, var(--bs-heading-color, #2e263d) 6%);
}

.layout-content-navbar #layout-menu.layout-menu.menu-vertical {
    background-color: var(--tandem-chrome-bg) !important;
}

/* ---- Barra superior: linea fina inferior (mismo tono que separadores .menu-header) ---- */
.layout-content-navbar .layout-navbar.bg-navbar-theme {
    border-bottom: 1px solid rgba(var(--bs-base-color-rgb), 0.2);
}

/* ---- Popups AJAX (DesignTools _Create / _Edit / _Delete) ---- */

/* Backdrop oscuro detras del popup */
#Loading {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(75, 70, 92, 0.55) !important;
    opacity: 1 !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
    z-index: 1190 !important;
}

/* Carcasa del popup: card blanca centrada con sombra fuerte */
.tandem-popup-shell {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(750px, 92vw) !important;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1.25rem 3rem rgba(75, 70, 92, 0.45),
                0 0.5rem 1.5rem rgba(75, 70, 92, 0.25) !important;
    border: 1px solid rgba(75, 70, 92, 0.1) !important;
    z-index: 1200 !important;
}

.tandem-popup-content {
    width: 100%;
    height: auto;
}

/* El contenido AJAX (_Create/_Edit/_Delete) ya viene con clase .tandem-popup */
.tandem-popup-shell .tandem-popup {
    background-color: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}


/* ---- Auth pages: skyline + tarjeta centrada ---- */
.tandem-login-skyline {
    width: 100%;
    max-width: 2200px;
    height: auto;
    max-height: 430px;
    object-fit: contain;
    object-position: center bottom;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 46px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.96;
    mix-blend-mode: multiply;
    filter: contrast(1.08);
}

.tandem-auth-inner {
    position: relative;
    min-height: calc(100vh - 3rem);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2.25rem;
}

.tandem-auth-inner .card {
    position: relative;
    z-index: 2;
}

/* Login compacto: la tarjeta no debe tapar la palabra «Desing» del skyline
   (Login.cshtml además baja el skyline por JS si aún se solapa). */
.tandem-login-card .app-brand {
    margin-top: 0.75rem !important;
}

.tandem-login-card .card-body {
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
}

.tandem-login-card .card-body .mb-5 {
    margin-bottom: 1rem !important;
}

@media (min-width: 576px) {
    .tandem-login-card.p-sm-7 {
        padding: 1.25rem 1.5rem !important;
    }
}

@media (max-height: 800px) {
    .authentication-wrapper.container-p-y:has(.tandem-login-card) {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .tandem-auth-inner.py-6:has(.tandem-login-card) {
        padding-top: 0.75rem !important;
    }

    .tandem-login-card .card-body .mb-5 {
        margin-bottom: 0.75rem !important;
    }

    .tandem-login-card .card-body > p.mb-5 {
        margin-bottom: 0.75rem !important;
    }
}

/* ---- Listas DataTables: altura a viewport, scroll en la tabla -----------
   El contenedor principal deja de crecer con todas las filas; el scroll
   vertical queda en .dataTables_scrollBody (requiere scrollY en la init). */
html.tandem-intranet-chrome .layout-content-navbar .content-wrapper > .container-fluid.flex-grow-1.container-p-y.tandem-layout-main-scroll:has(.tandem-dt-list-page) {
    display: flex;
    flex-direction: column;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.tandem-dt-list-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-height: 100%;
    overflow: hidden;
}

/* Intranet con pie fijo: el alto util es el del contenedor flex, no un vh fijo */
html.tandem-intranet-chrome .tandem-dt-list-page {
    max-height: 100%;
}

.tandem-dt-list-page > .card {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0 !important;
}

.tandem-dt-list-page > .card > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    /* Permite que hijos con tabla ancha reduzcan el ancho útil y activen scrollX en scrollBody */
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tandem-dt-list-page .dataTables_wrapper {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tandem-dt-list-page .dataTables_wrapper .dataTables_scroll {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.tandem-dt-list-page .dataTables_wrapper .dataTables_scrollBody {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Jobside Details: workspace (columna izquierda: card-body con .tandem-fill-scroll; derecha: tabs + scroll en .tandem-jobside-tab-content) ----- */
html.tandem-intranet-chrome .layout-content-navbar .content-wrapper > .container-fluid.flex-grow-1.container-p-y.tandem-layout-main-scroll:has(.tandem-jobside-workspace) {
    display: flex;
    flex-direction: column;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.tandem-jobside-workspace {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
}

html.tandem-intranet-chrome .tandem-jobside-workspace {
    max-height: 100%;
}

/* Detalle de obra, oferta y cliente: al 100% del navegador se ve como al 80%.
   Baja la raíz rem; el zoom con ancho 125% recortaba el lado derecho. */
html.tandem-intranet-chrome:has(.tandem-jobside-workspace) {
    --bs-root-font-size: 12.8px;
}

/* ---- Desing_2 STL viewer: lienzo a pantalla completa en el área de contenido (sin pie de página) ----- */
html.tandem-intranet-chrome .layout-content-navbar .content-wrapper > .container-fluid.flex-grow-1.container-p-y.tandem-layout-main-scroll:has(.tandem-desing2-stl-viewport) {
    display: flex;
    flex-direction: column;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

html.tandem-intranet-chrome body.desing2-stl-fullpage .layout-content-navbar .content-footer.footer {
    display: none !important;
}

.tandem-desing2-stl-viewport {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    width: 100%;
}

.tandem-desing2-stl-viewport__toolbar {
    flex: 0 0 auto;
}

.tandem-desing2-stl-viewport__fill {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tandem-desing2-stl-viewport__fill #ma-stl-viewer-shell {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.tandem-desing2-stl-viewport__fill #master-article-details-stl-viewer-canvas {
    /* flex-basis 0: el lienzo ocupa todo el hueco flex aunque solo haya hijos absolute */
    flex: 1 1 0;
    min-height: 0 !important;
    overflow: hidden;
}

.tandem-desing2-stl-viewport__fill #ma-stl-viewer-gl-host {
    min-height: 0;
}

/* Desing_2 STL — cotas herramienta línea (HTML tipo TinkerCAD sobre #master-article-details-stl-viewer-canvas) */
.desing2-stl-view-scope .desing2-stl-floor-dim-overlay {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 21;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-wall-dim-readout--construction,
.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-floor-dim-readout--compact.desing2-stl-wall-dim-readout--construction {
    pointer-events: none;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
    max-width: none;
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1;
    color: #171717;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-wall-dim-readout--construction.desing2-stl-wall-dim-readout--editable,
.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-floor-dim-readout--compact.desing2-stl-wall-dim-readout--construction.desing2-stl-wall-dim-readout--editable {
    pointer-events: auto;
    cursor: pointer;
    color: #0a3d82;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-wall-dim-readout--construction.desing2-stl-wall-dim-readout--editable.desing2-stl-floor-dim-readout--on-dark,
.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-floor-dim-readout--compact.desing2-stl-wall-dim-readout--construction.desing2-stl-wall-dim-readout--editable.desing2-stl-floor-dim-readout--on-dark {
    color: #c5d8f5;
    text-shadow: 0 0 3px #0f172a, 0 0 3px #0f172a;
}

.desing2-stl-view-scope .desing2-stl-wall-dim-readout--construction.desing2-stl-floor-dim-readout--on-dark {
    color: #f5f5f5;
    text-shadow: 0 0 3px #0f172a, 0 0 3px #0f172a;
}

.desing2-stl-view-scope .desing2-stl-wall-dim-readout--thickness {
    font-weight: 600;
}

.desing2-stl-view-scope .desing2-stl-wall-dim-readout--atk60-panel {
    font-weight: 600;
    color: #0891b2;
}

.desing2-stl-view-scope .desing2-stl-wall-dim-readout--atk60-height {
    font-weight: 600;
    color: #0891b2;
}

.desing2-stl-view-scope .desing2-stl-wall-dim-readout--atk60-remate {
    font-weight: 500;
    color: #ca8a04;
}

/* Desing_2 STL — reglas borde visor (superior +X, derecha +Z); inset dentro del lienzo */
.desing2-stl-view-scope {
    --ma-stl-edge-ruler-thickness: 26px;
}

.desing2-stl-view-scope .ma-stl-edge-rulers-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    --ma-stl-edge-ruler-thickness: 26px;
}

.desing2-stl-view-scope .ma-stl-edge-ruler {
    position: absolute;
    display: block;
    pointer-events: none;
}

.desing2-stl-view-scope .ma-stl-edge-ruler--top {
    top: 0;
    left: 0;
    right: var(--ma-stl-edge-ruler-thickness);
    height: var(--ma-stl-edge-ruler-thickness);
}

.desing2-stl-view-scope .ma-stl-edge-ruler--right {
    top: var(--ma-stl-edge-ruler-thickness);
    right: 0;
    bottom: 0;
    width: var(--ma-stl-edge-ruler-thickness);
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout {
    pointer-events: auto;
    min-width: 0;
    width: auto;
    max-width: 4.5rem;
    padding: 0.18rem 0.38rem;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    border-radius: 999px;
    border: 1px solid rgba(32, 32, 32, 0.45);
    background: rgba(255, 255, 255, 0.96);
    color: #171717;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-floor-dim-readout--compact {
    max-width: 4rem;
    padding: 0.14rem 0.32rem;
    font-size: 0.84rem;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-floor-dim-readout--hot {
    border-color: rgba(251, 146, 60, 0.95);
    box-shadow: 0 2px 6px rgba(251, 146, 60, 0.25);
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-floor-dim-readout--on-dark {
    border-color: rgba(240, 240, 240, 0.5);
    background: rgba(30, 30, 30, 0.96);
    color: #fafafa;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-floor-dim-readout--compact.desing2-stl-wall-dim-readout--construction,
.desing2-stl-view-scope .desing2-stl-floor-dim-readout.desing2-stl-wall-dim-readout--construction {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
}

/* Cotas en vivo herramienta línea (`picking2`): sólo lectura, no compite con edición hover. */
.desing2-stl-view-scope .desing2-stl-floor-dim-overlay.desing2-stl-floor-dim-overlay--line-tool-preview .desing2-stl-floor-dim-readout {
    pointer-events: none;
    cursor: default;
    opacity: 0.94;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-input {
    pointer-events: auto;
    box-sizing: content-box;
    min-width: 0;
    width: 5.5ch;
    max-width: 4.75rem;
    padding: 0.18rem 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    border-radius: 999px;
    border: 1px solid rgba(32, 32, 32, 0.45);
    background: rgba(255, 255, 255, 0.98);
    color: #171717;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.desing2-stl-view-scope .desing2-stl-floor-dim-input.desing2-stl-floor-dim-readout--on-dark {
    border-color: rgba(240, 240, 240, 0.55);
    background: rgba(24, 24, 24, 0.98);
    color: #fafafa;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-input.desing2-stl-floor-dim-input--compact {
    width: 5ch;
    max-width: 4.25rem;
    padding: 0.14rem 0.3rem;
    font-size: 0.84rem;
}

.desing2-stl-view-scope.is-wall-dim-editing #ma-stl-viewer-gl-host,
.desing2-stl-view-scope.is-wall-dim-editing .desing2-stl-wall-dim-readout,
.desing2-stl-view-scope.is-wall-dim-editing .ma-stl-edge-rulers-overlay {
    opacity: 0.5;
}

.desing2-stl-view-scope.is-wall-dim-editing .desing2-stl-wall-dim-readout {
    pointer-events: none;
}

.desing2-stl-view-scope .desing2-stl-floor-dim-input.desing2-stl-floor-dim-input--compact.desing2-stl-wall-dim-input--focus {
    opacity: 1;
    z-index: 6;
    transform: translate(-50%, -50%);
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 600;
    width: 6.4ch;
    max-width: none;
    padding: 0.28rem 0.55rem;
    border-width: 1px;
    border-color: rgba(10, 61, 130, 0.45);
    color: #0a3d82;
    box-shadow: none;
}

/* Desing_2 STL — asa azul midpoint segmento usuario (mover en planta XZ durante edición cotas) */
.desing2-stl-view-scope .desing2-stl-floor-line-drag-handle {
    pointer-events: auto;
    position: absolute;
    width: 10px;
    height: 10px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    background: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
    cursor: grab;
    transform: translate(-50%, -50%);
    z-index: 22;
    touch-action: none;
}

.desing2-stl-view-scope .desing2-stl-floor-line-drag-handle:hover,
.desing2-stl-view-scope .desing2-stl-floor-line-drag-handle.desing2-stl-floor-line-drag-handle--hot {
    background: #3b82f6;
    box-shadow:
        0 0 0 2px rgba(59, 130, 246, 0.55),
        0 0 10px rgba(59, 130, 246, 0.7);
}

.desing2-stl-view-scope .desing2-stl-floor-line-drag-handle.desing2-stl-floor-line-drag-handle--dragging {
    cursor: grabbing;
    background: #60a5fa;
}

/* Desing_2 STL — asas azules P1/P2 segmento usuario (estirar a lo largo del eje; ocultas si conectadas) */
.desing2-stl-view-scope .desing2-stl-floor-line-endpoint-handle {
    pointer-events: auto;
    position: absolute;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: grab;
    transform: translate(-50%, -50%);
    z-index: 23;
    touch-action: none;
}

.desing2-stl-view-scope .desing2-stl-floor-line-endpoint-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 11px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
    pointer-events: none;
}

.desing2-stl-view-scope .desing2-stl-floor-line-p1-handle:hover,
.desing2-stl-view-scope .desing2-stl-floor-line-p1-handle.desing2-stl-floor-line-p1-handle--hot,
.desing2-stl-view-scope .desing2-stl-floor-line-p2-handle:hover,
.desing2-stl-view-scope .desing2-stl-floor-line-p2-handle.desing2-stl-floor-line-p2-handle--hot {
    cursor: grab;
}

.desing2-stl-view-scope .desing2-stl-floor-line-p1-handle:hover::after,
.desing2-stl-view-scope .desing2-stl-floor-line-p1-handle.desing2-stl-floor-line-p1-handle--hot::after,
.desing2-stl-view-scope .desing2-stl-floor-line-p2-handle:hover::after,
.desing2-stl-view-scope .desing2-stl-floor-line-p2-handle.desing2-stl-floor-line-p2-handle--hot::after {
    background: #3b82f6;
    box-shadow:
        0 0 0 2px rgba(59, 130, 246, 0.55),
        0 0 8px rgba(59, 130, 246, 0.65);
}

.desing2-stl-view-scope .desing2-stl-floor-line-p1-handle.desing2-stl-floor-line-p1-handle--dragging,
.desing2-stl-view-scope .desing2-stl-floor-line-p2-handle.desing2-stl-floor-line-p2-handle--dragging {
    cursor: grabbing;
    will-change: left, top;
}

.desing2-stl-view-scope .desing2-stl-floor-line-p1-handle.desing2-stl-floor-line-p1-handle--dragging::after,
.desing2-stl-view-scope .desing2-stl-floor-line-p2-handle.desing2-stl-floor-line-p2-handle--dragging::after {
    background: #60a5fa;
}

/* Desing_2 STL — marquee selección por ventana/cruce (genérico; herramientas opt-in) */
.desing2-stl-window-selection-marquee {
    position: fixed;
    z-index: 10050;
    pointer-events: none;
    box-sizing: border-box;
    border: 1px solid #2563eb;
    background: rgba(37, 99, 235, 0.1);
}
.desing2-stl-window-selection-marquee.desing2-stl-window-selection-marquee--crossing {
    border-style: dashed;
}

/* Desing_2 STL — HUD ángulo snap conexión línea (junto a esfera cian/verde) */
.desing2-stl-view-scope .ma-stl-line-snap-angle-hud {
    position: absolute;
    z-index: 14;
    pointer-events: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 0.375rem;
    padding: 0.2rem 0.45rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

/* Desing_2 STL — panel lateral izquierdo hover (compacto ↔ menú espacio futuro); no mueve lienzo Three.js */
.desing2-stl-view-scope #master-article-details-stl-viewer-canvas {
    /* Un poco más bajo que el borde inferior de la brújula (--desing2-stl-compass-size ×1.5 + hueco superior) para no solaparse */
    --desing2-stl-side-panel-top-offset: 72px;
    /* Rosa náutica: compacta, desplazada a la derecha del strip colapsado (#desing2-stl-hover-side-panel --d2-hsp-collapsed); z-index por encima si el panel expande encima */
    --desing2-stl-hsp-sheet-collapsed: 32px;
    --desing2-stl-compass-gap-from-collapsed-strip: 10px;
    --desing2-stl-compass-size: 54px;
    --desing2-stl-compass-gap-above-panel: 18px;
}

.desing2-stl-hover-side-panel {
    position: absolute;
    left: 0;
    top: var(--desing2-stl-side-panel-top-offset);
    bottom: 48px;
    z-index: 9;
    max-width: 100%;
    pointer-events: none;
    --d2-hsp-peek: 20px;
    --d2-hsp-collapsed: 32px;
    --d2-hsp-expanded: min(276px, 78vw);
    margin-left: calc(-1 * var(--d2-hsp-peek));
    padding-left: var(--d2-hsp-peek);
}

.desing2-stl-hover-side-panel__hover-zone {
    height: 100%;
    pointer-events: auto;
    display: flex;
    align-items: stretch;
}

.desing2-stl-hover-side-panel__sheet {
    width: var(--d2-hsp-collapsed);
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Collapsed (~32px): solid white strip; expanded gets paper tint via rules below */
    background: #fff;
    box-shadow: inset -3px 0 0 rgba(var(--bs-primary-rgb), 0.08), 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: rgba(var(--bs-black-rgb), 0.1) !important;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s, background-color 0.2s ease, box-shadow 0.2s ease;
}

.desing2-stl-hover-side-panel:not(.is-hover-locked) .desing2-stl-hover-side-panel__hover-zone:hover > .desing2-stl-hover-side-panel__sheet,
.desing2-stl-hover-side-panel .desing2-stl-hover-side-panel__sheet:focus-within {
    width: var(--d2-hsp-expanded);
    background: rgba(var(--bs-paper-bg-rgb), 0.94);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transition-delay: 0.1s;
}

.desing2-stl-hover-side-panel.is-hover-locked .desing2-stl-hover-side-panel__sheet:not(:focus-within) {
    width: var(--d2-hsp-collapsed) !important;
    background: #fff !important;
    box-shadow: inset -3px 0 0 rgba(var(--bs-primary-rgb), 0.08), 0 8px 24px rgba(15, 23, 42, 0.08);
    transition-delay: 0s !important;
}

.desing2-stl-hover-side-panel__toolbar {
    flex-shrink: 0;
    background-color: inherit;
    min-height: 40px;
}

.desing2-stl-hover-side-panel__toolbar .btn {
    opacity: 0.78;
}

.desing2-stl-hover-side-panel:not(.is-hover-locked)
    .desing2-stl-hover-side-panel__hover-zone:hover
    .desing2-stl-hover-side-panel__toolbar
    .btn,
.desing2-stl-hover-side-panel .desing2-stl-hover-side-panel__sheet:focus-within .desing2-stl-hover-side-panel__toolbar .btn,
.desing2-stl-hover-side-panel__toolbar .btn:hover,
.desing2-stl-hover-side-panel__toolbar .btn:focus-visible {
    opacity: 1;
}

/* Aceptar Configuración: visible también con el panel plegado (solo icono, apilado bajo el de plegar) */
.desing2-stl-hover-side-panel .desing2-stl-hover-side-panel__toolbar {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 3px;
    padding: 4px 2px;
}

.desing2-stl-hover-side-panel .desing2-stl-config-accept-label {
    display: none;
}

.desing2-stl-hover-side-panel .desing2-stl-config-accept-btn {
    width: 26px;
    min-width: 26px;
    padding: 2px 0;
}

.desing2-stl-hover-side-panel:not(.is-hover-locked) .desing2-stl-hover-side-panel__hover-zone:hover .desing2-stl-hover-side-panel__toolbar,
.desing2-stl-hover-side-panel .desing2-stl-hover-side-panel__sheet:focus-within .desing2-stl-hover-side-panel__toolbar {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.desing2-stl-hover-side-panel:not(.is-hover-locked) .desing2-stl-hover-side-panel__hover-zone:hover .desing2-stl-config-accept-label,
.desing2-stl-hover-side-panel .desing2-stl-hover-side-panel__sheet:focus-within .desing2-stl-config-accept-label {
    display: inline;
}

.desing2-stl-hover-side-panel:not(.is-hover-locked) .desing2-stl-hover-side-panel__hover-zone:hover .desing2-stl-config-accept-btn,
.desing2-stl-hover-side-panel .desing2-stl-hover-side-panel__sheet:focus-within .desing2-stl-config-accept-btn {
    width: auto;
    min-width: 0;
    padding: 2px 8px;
}

.desing2-stl-hover-side-panel__collapse:focus-visible {
    box-shadow: 0 0 0 2px rgba(var(--bs-black-rgb), 0.2);
}

.desing2-stl-hover-side-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    clip-path: none;
    transition: opacity 0.18s ease 0.08s, visibility 0s linear 0.08s, max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s,
        flex-basis 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s, min-height 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

/* Collapsed: no tabs/labels/selects bleed — strip is toolbar (~fold) only */
.desing2-stl-hover-side-panel:not(.is-hover-locked)
    .desing2-stl-hover-side-panel__hover-zone:not(:hover)
    > .desing2-stl-hover-side-panel__sheet:not(:focus-within)
    .desing2-stl-hover-side-panel__body,
.desing2-stl-hover-side-panel.is-hover-locked
    .desing2-stl-hover-side-panel__sheet:not(:focus-within)
    .desing2-stl-hover-side-panel__body {
    opacity: 0;
    visibility: hidden;
    flex-grow: 0;
    flex-basis: 0;
    max-height: 0;
    min-height: 0 !important;
    overflow: hidden;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    pointer-events: none;
    clip-path: inset(0);
    transition: opacity 0.14s ease, visibility 0s linear 0.14s, max-height 0.22s ease, flex-basis 0.22s ease,
        min-height 0.22s ease;
}

/* Expanded (hover or focus-within): ensure body layout wins over collapsed rule above */
.desing2-stl-hover-side-panel:not(.is-hover-locked) .desing2-stl-hover-side-panel__hover-zone:hover > .desing2-stl-hover-side-panel__sheet
    .desing2-stl-hover-side-panel__body,
.desing2-stl-hover-side-panel .desing2-stl-hover-side-panel__sheet:focus-within .desing2-stl-hover-side-panel__body {
    flex-grow: 1;
    flex-basis: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
}

/* Collapsed strip: avoid orphan border under fold row when body is height-collapsed */
.desing2-stl-hover-side-panel:not(.is-hover-locked)
    .desing2-stl-hover-side-panel__hover-zone:not(:hover)
    > .desing2-stl-hover-side-panel__sheet:not(:focus-within)
    .desing2-stl-hover-side-panel__toolbar,
.desing2-stl-hover-side-panel.is-hover-locked
    .desing2-stl-hover-side-panel__sheet:not(:focus-within)
    .desing2-stl-hover-side-panel__toolbar {
    border-bottom-color: transparent;
}

/* Pestañas (mismo patrón Materio/Jobside: .nav.nav-tabs + .tab-content con scroll) */
.desing2-stl-hover-side-panel__tabs-bar {
    flex-shrink: 0;
}

.desing2-stl-hover-side-panel__tabs-bar .nav-tabs {
    border-bottom-color: rgba(var(--bs-black-rgb), 0.12);
}

.desing2-stl-hover-side-panel__tabs-bar .nav-tabs .nav-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.desing2-stl-hover-side-panel__tab-content {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Desing_2 STL — panel lateral derecho (muros); centrado vertical, hover desplegable como el izquierdo */
.desing2-stl-hover-right-panel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9;
    max-width: 100%;
    pointer-events: none;
    --d2-hrp-peek: 20px;
    /* Colapsado: tira vertical con los 3 iconos siempre visibles */
    --d2-hrp-collapsed: 52px;
    /* mapeo + boceto + mapa + plegar */
    --d2-hrp-expanded: min(340px, 90vw);
    margin-right: calc(-1 * var(--d2-hrp-peek));
    padding-right: var(--d2-hrp-peek);
}

.desing2-stl-hover-right-panel__hover-zone {
    pointer-events: auto;
    display: flex;
    align-items: stretch;
}

.desing2-stl-hover-right-panel__sheet {
    width: var(--d2-hrp-collapsed);
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: inset 3px 0 0 rgba(var(--bs-primary-rgb), 0.08), 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: rgba(var(--bs-black-rgb), 0.1) !important;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s, background-color 0.2s ease, box-shadow 0.2s ease;
}

.desing2-stl-hover-right-panel:not(.is-hover-locked) .desing2-stl-hover-right-panel__hover-zone:hover > .desing2-stl-hover-right-panel__sheet,
.desing2-stl-hover-right-panel .desing2-stl-hover-right-panel__sheet:focus-within {
    width: var(--d2-hrp-expanded);
    background: rgba(var(--bs-paper-bg-rgb), 0.94);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transition-delay: 0.1s;
}

.desing2-stl-hover-right-panel.is-hover-locked .desing2-stl-hover-right-panel__sheet:not(:focus-within) {
    width: var(--d2-hrp-collapsed) !important;
    background: #fff !important;
    box-shadow: inset 3px 0 0 rgba(var(--bs-primary-rgb), 0.08), 0 8px 24px rgba(15, 23, 42, 0.08);
    transition-delay: 0s !important;
}

.desing2-stl-hover-right-panel__toolbar {
    flex-shrink: 0;
    background-color: inherit;
    min-height: 52px;
    gap: 0.25rem;
}

.desing2-stl-hover-right-panel__tools {
    min-width: 0;
}

/* Colapsado: iconos en columna para que el de mapa no quede fuera de la tira */
.desing2-stl-hover-right-panel:not(.is-hover-locked)
    .desing2-stl-hover-right-panel__hover-zone:not(:hover)
    > .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__tools,
.desing2-stl-hover-right-panel.is-hover-locked
    .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__tools {
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.desing2-stl-hover-right-panel__toolbar .desing2-stl-right-panel__wallmap-btn,
.desing2-stl-hover-right-panel__toolbar .desing2-stl-right-panel__imagesketch-btn,
.desing2-stl-hover-right-panel__toolbar .desing2-stl-right-panel__mapbuilding-btn,
.desing2-stl-hover-right-panel__toolbar .desing2-stl-right-panel__connection-btn {
    padding: 0.35rem !important;
}

.desing2-stl-view-scope .desing2-stl-right-panel__conn-icon {
    display: block;
    width: 1.45rem;
    height: 1.45rem;
    font-size: 1.45rem;
    line-height: 1;
    color: #3d8bfd;
}

.desing2-conn-test {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    font-size: 12px;
    color: #2c3340;
}

.desing2-conn-test__section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #e4e8ee;
}

.desing2-conn-test__section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.desing2-conn-test__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.desing2-conn-test__head .btn { font-size: 11px; padding: 0.1rem 0.45rem; }

.desing2-conn-test__quality {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}

.desing2-conn-test__dots { display: flex; gap: 4px; }
.desing2-conn-test__dots i {
    width: 8px; height: 8px; border-radius: 50%;
    background: #d5dee8; display: block;
}
.desing2-conn-test__quality.is-good .desing2-conn-test__dots i.is-on,
.desing2-conn-test__quality.is-good [data-conn="quality-label"] { color: #2f9d6a; }
.desing2-conn-test__quality.is-good .desing2-conn-test__dots i.is-on { background: #2f9d6a; }
.desing2-conn-test__quality.is-ok .desing2-conn-test__dots i.is-on { background: #3d8bfd; }
.desing2-conn-test__quality.is-ok [data-conn="quality-label"] { color: #3d8bfd; }
.desing2-conn-test__quality.is-poor .desing2-conn-test__dots i.is-on { background: #c45c26; }
.desing2-conn-test__quality.is-poor [data-conn="quality-label"] { color: #c45c26; }
.desing2-conn-test__quality.is-bad .desing2-conn-test__dots i.is-on,
.desing2-conn-test__quality.is-fail .desing2-conn-test__dots i.is-on { background: #d64545; }
.desing2-conn-test__quality.is-bad [data-conn="quality-label"],
.desing2-conn-test__quality.is-fail [data-conn="quality-label"] { color: #d64545; }

.desing2-conn-test__block {
    margin: 0.25rem 0 0;
    font-size: 11px;
    font-weight: 700;
    color: #5e6a75;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.desing2-conn-test__rows {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.desing2-conn-test__rows > div {
    display: grid;
    grid-template-columns: 7.2rem 1fr;
    gap: 0.35rem;
    align-items: baseline;
}

.desing2-conn-test__rows dt {
    margin: 0;
    font-weight: 600;
    color: #5e6a75;
}

.desing2-conn-test__rows dd {
    margin: 0;
    word-break: break-word;
}

.desing2-stl-view-scope .desing2-stl-right-panel__map-icon {
    display: block;
    width: 1.55rem;
    height: 1.55rem;
    font-size: 1.55rem;
    line-height: 1;
    color: #dc3545;
}

.desing2-stl-view-scope .desing2-stl-right-panel__mapbuilding-btn {
    outline: 1px solid rgba(220, 53, 69, 0.45);
    background: rgba(220, 53, 69, 0.12);
    min-width: 2.6rem;
}

.desing2-stl-view-scope .desing2-stl-right-panel__mapbuilding-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
    line-height: 1;
}

.desing2-stl-view-scope .desing2-stl-right-panel__mapbuilding-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #dc3545;
    text-transform: uppercase;
}

/* Colapsado: solo pin; al expandir se ve la etiqueta Mapa */
.desing2-stl-hover-right-panel:not(.is-hover-locked)
    .desing2-stl-hover-right-panel__hover-zone:not(:hover)
    > .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-right-panel__mapbuilding-label,
.desing2-stl-hover-right-panel.is-hover-locked
    .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-right-panel__mapbuilding-label {
    display: none;
}

.desing2-stl-hover-right-panel__collapse .icon-base {
    font-size: 1.5rem;
    line-height: 1;
}

.desing2-stl-hover-right-panel__toolbar .btn {
    opacity: 0.78;
}

.desing2-stl-hover-right-panel:not(.is-hover-locked)
    .desing2-stl-hover-right-panel__hover-zone:hover
    .desing2-stl-hover-right-panel__toolbar
    .btn,
.desing2-stl-hover-right-panel .desing2-stl-hover-right-panel__sheet:focus-within .desing2-stl-hover-right-panel__toolbar .btn,
.desing2-stl-hover-right-panel__toolbar .btn:hover,
.desing2-stl-hover-right-panel__toolbar .btn:focus-visible {
    opacity: 1;
}

.desing2-stl-hover-right-panel__collapse:focus-visible {
    box-shadow: 0 0 0 2px rgba(var(--bs-black-rgb), 0.2);
}

.desing2-stl-view-scope .desing2-stl-right-panel__wall-icon {
    display: block;
    width: 1.9rem;
    height: 1.9rem;
    color: rgba(15, 23, 42, 0.82);
    object-fit: contain;
}

.desing2-stl-hover-right-panel__strip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

/* Colapsado: primer icono de la tira; botón plegar oculto hasta expandir */
.desing2-stl-hover-right-panel:not(.is-hover-locked)
    .desing2-stl-hover-right-panel__hover-zone:not(:hover)
    > .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__collapse,
.desing2-stl-hover-right-panel.is-hover-locked
    .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__collapse {
    opacity: 0;
    visibility: hidden;
    width: 0;
    min-width: 0;
    padding: 0 !important;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}

.desing2-stl-hover-right-panel__body:has(#desing2-connection-test-panel:not(.d-none)) {
    max-height: min(70vh, 540px);
}

.desing2-stl-hover-right-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(50vh, 320px);
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    clip-path: none;
    transition: opacity 0.18s ease 0.08s, visibility 0s linear 0.08s, max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s,
        flex-basis 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s, min-height 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

.desing2-stl-hover-right-panel:not(.is-hover-locked)
    .desing2-stl-hover-right-panel__hover-zone:not(:hover)
    > .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__body,
.desing2-stl-hover-right-panel.is-hover-locked
    .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__body {
    opacity: 0;
    visibility: hidden;
    flex-grow: 0;
    flex-basis: 0;
    max-height: 0;
    min-height: 0 !important;
    overflow: hidden;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    pointer-events: none;
    clip-path: inset(0);
    transition: opacity 0.14s ease, visibility 0s linear 0.14s, max-height 0.22s ease, flex-basis 0.22s ease,
        min-height 0.22s ease;
}

.desing2-stl-hover-right-panel:not(.is-hover-locked) .desing2-stl-hover-right-panel__hover-zone:hover > .desing2-stl-hover-right-panel__sheet
    .desing2-stl-hover-right-panel__body,
.desing2-stl-hover-right-panel .desing2-stl-hover-right-panel__sheet:focus-within .desing2-stl-hover-right-panel__body {
    flex-grow: 1;
    flex-basis: auto;
    max-height: min(50vh, 320px);
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.desing2-stl-hover-right-panel:not(.is-hover-locked) .desing2-stl-hover-right-panel__hover-zone:hover > .desing2-stl-hover-right-panel__sheet
    .desing2-stl-hover-right-panel__body:has(#desing2-connection-test-panel:not(.d-none)),
.desing2-stl-hover-right-panel .desing2-stl-hover-right-panel__sheet:focus-within
    .desing2-stl-hover-right-panel__body:has(#desing2-connection-test-panel:not(.d-none)) {
    max-height: min(70vh, 540px);
}

.desing2-stl-hover-right-panel:not(.is-hover-locked)
    .desing2-stl-hover-right-panel__hover-zone:not(:hover)
    > .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__toolbar,
.desing2-stl-hover-right-panel.is-hover-locked
    .desing2-stl-hover-right-panel__sheet:not(:focus-within)
    .desing2-stl-hover-right-panel__toolbar {
    border-bottom-color: transparent;
}

.desing2-stl-view-scope .desing2-stl-right-panel__wallmap-btn.active,
.desing2-stl-view-scope .desing2-stl-right-panel__wallmap-btn[aria-pressed='true'],
.desing2-stl-view-scope .desing2-stl-right-panel__imagesketch-btn.active,
.desing2-stl-view-scope .desing2-stl-right-panel__imagesketch-btn[aria-pressed='true'],
.desing2-stl-view-scope .desing2-stl-right-panel__mapbuilding-btn.active,
.desing2-stl-view-scope .desing2-stl-right-panel__mapbuilding-btn[aria-pressed='true'] {
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: rgba(var(--bs-primary-rgb), 1);
}

.desing2-stl-view-scope .desing2-stl-right-panel__wallmap-btn:disabled {
    opacity: 0.55;
    pointer-events: none;
}

.desing2-stl-image-sketch-form__preview-wrap {
    max-height: min(52vh, 420px);
    overflow: auto;
    background: rgba(var(--bs-black-rgb), 0.03);
}

.desing2-stl-image-sketch-modal .modal-body {
    min-height: 8rem;
}

.desing2-stl-image-sketch-form__preview {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.desing2-stl-map-building-form__map-wrap {
    width: 100%;
}

.desing2-stl-map-building-form__map {
    width: 100%;
    height: min(58vh, 480px);
    min-height: 320px;
    z-index: 0;
}

.desing2-stl-map-building-form__map .maplibregl-canvas,
.desing2-stl-map-building-form__map .maplibregl-canvas-container {
    width: 100% !important;
    height: 100% !important;
}

.desing2-stl-map-building-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(1px);
    pointer-events: all;
}

.desing2-stl-map-building-loading.d-none {
    display: none !important;
}

.desing2-stl-map-building-modal .modal-body {
    min-height: 12rem;
}

/* Desing_2 — Configuración: sección L (espesores X / Y) */
.desing2-config-wall-section,
.desing2-config-enclosure-section {
    padding-top: 0.15rem;
    border-top: 1px solid rgba(var(--bs-border-color-rgb, 76, 78, 100), 0.35);
}

.desing2-config-wall-section__figure,
.desing2-config-enclosure-section__figure {
    margin: 0;
    padding: 0.35rem 0.25rem 0.15rem;
    text-align: center;
    background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.65);
    border-radius: 0.375rem;
}

.desing2-config-wall-section__svg,
.desing2-config-enclosure-section__svg {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
    margin: 0 auto;
}

/* Desing_2 — barras flotantes del lienzo (superior e inferior); siempre visibles, discretas */
.desing2-stl-view-scope {
    --desing2-stl-tool-btn: 2.4375rem;
}

.desing2-stl-top-bars {
    position: absolute;
    top: 1rem;
    left: 13rem;
    right: 0.75rem;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    column-gap: calc(var(--desing2-stl-tool-btn) * 2);
    row-gap: 0.4rem;
    pointer-events: none;
}

.desing2-stl-top-bars > .desing2-stl-mode-toolbar,
.desing2-stl-top-bars > .desing2-stl-top-toolbar {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    flex: 0 0 auto;
    max-width: 100%;
    pointer-events: none;
}

.desing2-stl-top-toolbar {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.desing2-stl-mode-toolbar {
    position: absolute;
    top: 1rem;
    left: 13rem;
    z-index: 10;
    pointer-events: none;
}

@media (max-width: 1280px) {
    .desing2-stl-top-bars {
        left: calc(
            var(--desing2-stl-hsp-sheet-collapsed, 32px)
            + var(--desing2-stl-compass-gap-from-collapsed-strip, 10px)
            + var(--desing2-stl-compass-size, 54px)
            + 0.75rem
        );
        right: 0.4rem;
    }
}

@media (max-width: 720px) {
    .desing2-stl-top-bars {
        left: 0.4rem;
        right: 0.4rem;
    }

    .desing2-stl-top-bars > .desing2-stl-mode-toolbar,
    .desing2-stl-top-bars > .desing2-stl-top-toolbar {
        overflow-x: auto;
    }
}

.desing2-stl-mode-toolbar .desing2-stl-floating-toolbar__inner {
    background: rgba(255, 255, 255, 0.78);
    align-items: flex-start !important;
    gap: 0.35rem;
}

.desing2-stl-mode-toolbar__systems {
    pointer-events: auto;
    min-width: 7.5rem;
}

.desing2-stl-mode-toolbar__systems-toggle {
    width: 100%;
    min-height: 2.0625rem;
    justify-content: space-between;
    color: var(--tandem-primary, var(--bs-primary));
    border-color: var(--tandem-primary, var(--bs-primary));
    background: color-mix(in srgb, var(--tandem-primary, var(--bs-primary)) 14%, transparent);
    font-size: 0.8125rem;
    line-height: 1.15;
    text-align: left;
}

.desing2-stl-mode-toolbar__systems-toggle:hover,
.desing2-stl-mode-toolbar__systems-toggle:focus-visible,
.desing2-stl-mode-toolbar__systems-toggle.show {
    color: #ff6600;
    border-color: rgba(255, 102, 0, 0.45);
    background: rgba(255, 102, 0, 0.08);
}

.desing2-stl-mode-toolbar__systems-menu {
    min-width: 7.5rem;
    padding: 0.35rem 0;
    border-color: rgba(51, 65, 85, 0.12);
    box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.12);
}

.desing2-stl-mode-toolbar__systems-menu .dropdown-item {
    font-size: 0.8125rem;
}

.desing2-stl-mode-toolbar__systems-menu .dropdown-item.active {
    color: #fff;
    font-weight: 600;
    background: var(--tandem-primary, var(--bs-primary));
}

.desing2-stl-mode-toolbar__systems-menu .dropdown-item.disabled,
.desing2-stl-mode-toolbar__systems-menu .dropdown-item:disabled {
    color: rgba(51, 65, 85, 0.38);
    cursor: not-allowed;
}

.tandem-article-maintenance {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
}

.tandem-article-maintenance[hidden] {
    display: none !important;
}

.tandem-article-maintenance__card {
    min-width: 16rem;
    max-width: 22rem;
    padding: 1.25rem 1.4rem;
    border-radius: 0.85rem;
    border: 1px solid #c5ced8;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    text-align: center;
}

.tandem-article-maintenance__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e3a5f;
}

.tandem-article-maintenance__seconds {
    font-size: 0.95rem;
    color: #3d4a5c;
}

.desing2-stl-render-overlay {
    position: absolute;
    inset: 0;
    z-index: 62;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    pointer-events: auto;
}

/* La carga/guardado no debe dejar el canvas muerto si la petición no termina. */
#ma-stl-design-persist-overlay {
    pointer-events: none;
}

.desing2-stl-render-overlay__card {
    min-width: 180px;
    padding: 1.25rem 1.5rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.25);
    background-color: rgba(255, 255, 255, 0.96);
    color: var(--bs-heading-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.desing2-stl-render-overlay__spinner {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.22rem;
}

.desing2-stl-render-overlay__text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
}

.desing2-stl-render-overlay__card--formwork {
    min-width: 260px;
    max-width: 360px;
}

.desing2-stl-render-overlay__status,
.desing2-stl-render-overlay__eta {
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    line-height: 1.35;
}

.desing2-stl-render-overlay__eta {
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.desing2-stl-render-overlay__progress {
    width: 100%;
    height: 0.42rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.desing2-stl-render-overlay__progress-bar {
    height: 100%;
    width: 8%;
    border-radius: inherit;
    background: var(--bs-primary, #696cff);
    transition: width 0.28s ease;
}

#ma-stl-viewer-shell {
    position: relative;
}

.desing2-stl-persist-overlay {
    z-index: 80;
    background-color: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.desing2-stl-bottom-toolbar {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    left: auto;
    z-index: 10;
    pointer-events: none;
}

.desing2-material-count {
    position: absolute;
    left: calc(var(--desing2-stl-hsp-sheet-collapsed, 32px) + var(--desing2-stl-compass-gap-from-collapsed-strip, 10px));
    top: calc(
        max(2px, var(--desing2-stl-side-panel-top-offset, 72px) - var(--desing2-stl-compass-size, 54px) - var(--desing2-stl-compass-gap-above-panel, 18px))
        + var(--desing2-stl-compass-size, 54px)
        + 4px
    );
    bottom: 0.75rem;
    z-index: 40;
    width: min(840px, calc(100% - 4.5rem));
    max-width: calc(100% - 3.5rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 0.7rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    transform: translateX(calc(-100% - 1.25rem));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.desing2-material-count.is-open {
    transform: none;
}

.desing2-material-count[hidden] {
    display: none !important;
}

.design-material-count-popup.modal-content {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.design-material-count-popup .desing2-material-count {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-width: none;
    height: min(72vh, 680px);
    transform: none;
    border-radius: 0.7rem;
}

.design-material-count-popup .desing2-material-count__tabs-row {
    padding-left: 0.7rem;
}

.design-material-count-popup .desing2-material-count__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.design-material-count-popup .desing2-material-count__body > .tab-pane.active {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.design-material-count-popup__logo {
    height: 28px;
    width: auto;
    flex: 0 0 auto;
}

.design-material-count-popup__brand {
    flex: 0 0 auto;
    font-size: 0.95rem;
    line-height: 1;
}

.design-material-count-popup #designMaterialCountButtons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.design-material-count-popup #designMaterialCountButtons .dt-buttons {
    display: flex;
    gap: 0.25rem;
}

.desing2-wall-list__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

#desing2PhaseClear {
    margin-right: auto;
}

.desing2-wall-list table.dataTable tbody td {
    padding: 2px 4px;
    height: 36px;
    vertical-align: middle;
    line-height: 1;
    font-size: 0.75rem;
}

.desing2-wall-list table.dataTable thead th {
    white-space: normal;
    font-size: 0.68rem;
}

.desing2-wall-list .desing2-wall-list-check input,
.desing2-wall-list .desing2-wall-list-tape input {
    margin: 0;
    vertical-align: middle;
}

.desing2-wall-list .desing2-wall-list-tape label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0 4px 0 0;
}

.desing2-wall-list .desing2-wall-list-tape img {
    height: 56px;
    width: auto;
    max-width: 104px;
    object-fit: contain;
    background: #fff;
    display: block;
}

.desing2-wall-list .desing2-wall-list-tape img.is-mirror {
    transform: scaleX(-1);
}

.desing2-wall-list .desing2-wall-list-group {
    width: 11rem;
    max-width: 100%;
    height: 28px;
    padding: 0 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: left;
    background: #fff;
}

.desing2-group-sheet .desing2-material-count__details-scroll table thead th:last-child {
    width: 2.6rem;
}

.desing2-group-sheet .desing2-group-number,
.desing2-group-sheet .desing2-group-name {
    width: 100%;
    height: 1.7rem;
    border: 1px solid #c5ced8;
    border-radius: 0.2rem;
    padding: 0 0.35rem;
    font-size: 0.76rem;
    font-weight: 400;
    background: #fff;
    box-sizing: border-box;
}

.desing2-group-sheet .desing2-group-number {
    max-width: 7rem;
}

.desing2-group-sheet .desing2-group-number[readonly] {
    background: #f4f7fb;
    color: #1e3a5f;
}

.desing2-group-sheet .desing2-material-count__row-actions {
    width: auto;
    min-width: 2.2rem;
}

.desing2-group-sheet__empty td {
    color: #64748b;
    font-weight: 400;
    text-transform: none;
}

.desing2-group-sheet__add {
    align-self: flex-start;
    margin: 0.45rem 0.7rem;
}

.desing2-group-sheet__message {
    margin: 0 0.7rem 0.35rem;
    color: #b42318;
    font-size: 0.85rem;
}

.desing2-group-sheet .desing2-wall-list__foot {
    background: #f8fafc;
    border-top: 1px solid #d5dbe3;
}

.desing2-phase-dialog {
    width: calc(100% - 1.5rem);
    max-width: 34rem;
    transition: max-width 0.22s ease;
}

.desing2-phase-dialog.is-expanded {
    max-width: 1140px;
}

.design-material-count-popup .desing2-phase-sheet {
    height: auto;
}

.desing2-phase-dialog.is-expanded .desing2-phase-sheet {
    height: min(86vh, 860px);
}

.desing2-phase-dialog:not(.is-expanded) .desing2-material-count__body {
    flex: 0 0 auto;
}

.desing2-phase-setup {
    display: flex;
    gap: 1rem;
    padding: 0.15rem 0.15rem 0.55rem;
}

.desing2-phase-sheet__field {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin: 0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
}

.desing2-phase-qty {
    width: 5.25rem;
    max-width: 5.25rem;
    height: 2rem;
    padding: 0 0.45rem;
    border: 1px solid #d5dbe3;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.desing2-phase-qty:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.55);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.desing2-phase-qty:focus {
    border-color: var(--bs-primary, #696cff);
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.desing2-phase-sheet .desing2-phase-name {
    width: 100%;
    height: 2rem;
    padding: 0 0.7rem;
    border: 1px solid #d5dbe3;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    font-size: 0.8rem;
    font-weight: 400;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.desing2-phase-sheet .desing2-phase-name:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.55);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.desing2-phase-sheet .desing2-phase-name:focus {
    border-color: var(--bs-primary, #696cff);
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.desing2-phase-sheet .desing2-phase-color {
    width: 2.15rem;
    height: 2.15rem;
    padding: 0.15rem;
    border: 1px solid #d5dbe3;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.desing2-phase-sheet .desing2-phase-color:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.55);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.desing2-phase-sheet .desing2-phase-color:focus {
    border-color: var(--bs-primary, #696cff);
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.desing2-phase-sheet .desing2-phase-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.desing2-phase-sheet .desing2-phase-color::-webkit-color-swatch {
    border: 0;
    border-radius: 999px;
}

.desing2-phase-sheet tr.is-picking td {
    background: #f3f7fb;
}

.desing2-phase-stage {
    display: none;
    align-items: stretch;
    gap: 0.55rem;
    margin-top: 0.45rem;
    min-height: 280px;
    height: min(42vh, 420px);
}

.desing2-phase-stage:has(.desing2-phase-view:not([hidden])),
.desing2-phase-stage:has(.desing2-phase-legend:not([hidden])) {
    display: flex;
}

.desing2-phase-dialog.is-expanded #desing2PhasePaneTeams {
    min-height: 0;
    overflow: hidden;
}

.desing2-phase-dialog.is-expanded .desing2-phase-stage {
    flex: 1 1 auto;
    height: auto;
    min-height: 240px;
}

.desing2-phase-dialog.is-expanded #desing2PhaseTableWrap {
    flex: 0 1 auto;
    max-height: 11rem;
    overflow: auto;
}

.desing2-phase-legend {
    display: flex;
    flex: 0 0 22rem;
    flex-direction: column;
    gap: 0.15rem;
    width: 22rem;
    min-height: 0;
    margin: 0;
    padding: 0.45rem 0.35rem 0.55rem 0.65rem;
    border: 1px solid #c5ced8;
    border-radius: 0.2rem;
    background: #f8fafc;
    color: #1e3a5f;
    font-size: 0.78rem;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e8eef4;
}

.desing2-phase-legend::-webkit-scrollbar {
    width: 10px;
}

.desing2-phase-legend::-webkit-scrollbar-track {
    background: #e8eef4;
    border-radius: 999px;
}

.desing2-phase-legend::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border: 2px solid #e8eef4;
    border-radius: 999px;
}

.desing2-phase-legend[hidden] {
    display: none !important;
}

.desing2-phase-legend__title {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 0 0.35rem;
    padding: 0 0.35rem 0.35rem 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
}

.desing2-phase-legend__chip {
    display: block;
    margin: 0;
    padding: 0.45rem 0.35rem 0.4rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.desing2-phase-legend__chip:last-child {
    border-bottom: 0;
}

.desing2-phase-legend__phase {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.desing2-phase-legend__idle {
    margin: 0.28rem 0 0.1rem 1.1rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
}

.desing2-phase-legend__list {
    margin: 0.1rem 0 0 1.1rem;
    padding: 0 0.4rem 0 0.9rem;
    color: #334155;
    font-size: 0.75rem;
    line-height: 1.35;
}

.desing2-phase-legend__list li {
    margin: 0.12rem 0;
}

.desing2-phase-legend__list b {
    font-variant-numeric: tabular-nums;
}

.desing2-phase-legend__chip i {
    flex: 0 0 auto;
    width: 0.7rem;
    height: 0.7rem;
    margin-top: 0.22rem;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.desing2-phase-view {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 260px;
    height: auto;
    margin-top: 0;
    border: 1px solid #c5ced8;
    border-radius: 0.2rem;
    overflow: hidden;
    background: #e7eef5;
}

.desing2-phase-view[hidden] {
    display: none !important;
}

.desing2-phase-view canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.desing2-phase-view__hint {
    position: absolute;
    left: 0.55rem;
    bottom: 0.4rem;
    margin: 0;
    padding: 0.15rem 0.4rem;
    border-radius: 0.2rem;
    background: rgba(255, 255, 255, 0.88);
    color: #1e3a5f;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
}

.desing2-wall-list .dataTables_filter {
    margin: 0.15rem 0.4rem 0.15rem;
    font-size: 0.75rem;
}

.desing2-material-count.is-placed {
    bottom: auto;
    transform: none !important;
}

.desing2-material-count__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    cursor: grab;
    user-select: none;
}

.desing2-material-count__head button,
.desing2-material-count__head .dt-buttons {
    cursor: pointer;
}

.desing2-material-count__title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-right: auto;
}

.desing2-material-count table.dataTable thead th {
    font-size: 60%;
    font-weight: 600;
    line-height: 1.1;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

.desing2-material-count__details-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid #c5ced8;
    border-radius: 0.2rem;
    background: #fff;
}

.desing2-material-count__details-scroll table {
    margin: 0;
    font-size: 0.76rem;
}

.desing2-material-count__details-scroll table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #fff !important;
    background: #1d6fbf !important;
    background-color: #1d6fbf !important;
    border: none !important;
    border-bottom: none !important;
    white-space: nowrap;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.15;
    min-height: 1.85rem;
    height: 1.85rem;
    padding: 0.42rem 0.3rem;
    vertical-align: middle;
    text-transform: uppercase;
}

.desing2-material-count__details-scroll tbody td {
    padding: 0.33rem 0.45rem;
    vertical-align: middle;
}

.desing2-material-count__tabs-row {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    padding: 0 0.7rem 0.35rem calc(0.45rem + 1px + 0.3rem + 25px);
}

.desing2-material-count__tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.desing2-material-count__search {
    flex: 0 0 auto;
    margin-left: auto;
    padding-bottom: 0.2rem;
}

.desing2-material-count__search .dataTables_filter {
    position: static;
    float: none;
    margin: 0;
    background: transparent;
}

.desing2-material-count__search .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.72rem;
    white-space: nowrap;
}

.desing2-material-count__search .dataTables_filter input {
    width: 12rem;
    max-width: 12rem;
    margin-left: 0;
}

.desing2-material-count__actions-col {
    width: 9rem;
    min-width: 9rem;
}

.desing2-material-count__row-actions {
    white-space: nowrap;
    text-align: center;
    width: 9rem;
    min-width: 9rem;
    overflow: visible;
}

.desing2-material-count__head .dt-buttons .btn,
#desing2-material-count-reset {
    color: #1d6fbf !important;
    background: #fff !important;
    border: 1px solid #1d6fbf !important;
    box-shadow: none !important;
    width: 2rem;
    height: 2rem;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.desing2-material-count__head .dt-buttons .btn:hover,
#desing2-material-count-reset:hover {
    color: #155a9c !important;
    background: #e7eef6 !important;
    border-color: #155a9c !important;
}

.desing2-material-count__head .dt-buttons .btn .icon-base,
.desing2-material-count__head .dt-buttons .btn .ri,
#desing2-material-count-reset .icon-base,
#desing2-material-count-reset .ri {
    color: currentColor !important;
    background-color: currentColor !important;
    border: 0 !important;
    width: 1.15rem;
    height: 1.15rem;
    inline-size: 1.15rem;
    block-size: 1.15rem;
    font-size: 1.15rem;
}

.desing2-material-count__row-actions .btn + .btn {
    margin-left: 0.12rem;
}

.desing2-material-count__row-actions .btn {
    padding: 0;
    width: 1.45rem;
    height: 1.45rem;
    line-height: 1;
    color: #1e3a5f !important;
    background: #fff !important;
    border: 1px solid #c5ced8 !important;
    box-shadow: none !important;
}

.desing2-material-count__row-actions .btn:hover {
    color: #1d6fbf !important;
    background: #e7eef6 !important;
    border-color: #1d6fbf !important;
}

.desing2-material-count__row-actions .btn.is-faded,
.desing2-material-count__row-actions .btn.is-faded:hover {
    color: #fff !important;
    background: #1d6fbf !important;
    border-color: #1d6fbf !important;
}

.desing2-material-count__row-actions .btn .icon-base,
.desing2-material-count__row-actions .btn .ri {
    color: currentColor !important;
    background-color: currentColor !important;
    border: 0 !important;
    width: 1rem;
    height: 1rem;
    inline-size: 1rem;
    block-size: 1rem;
    font-size: 1rem;
}

.desing2-material-count__summary {
    flex: 0 0 auto;
    min-height: 52px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.45rem 0.55rem 0.55rem;
    border-top: 1px solid #d5dbe3;
    background: #f8fafc;
}

.desing2-material-count__summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.38rem 0.5rem;
    border: 1px solid #dce3eb;
    border-radius: 0.35rem;
    background: #fff;
}

.desing2-material-count__summary-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #5f6b7a;
    font-size: 0.74rem;
    font-weight: 600;
}

.desing2-material-count__summary-item strong {
    flex: 0 0 auto;
    color: #1e3a5f;
    font-size: 0.86rem;
    font-weight: 700;
}

.desing2-article-stl {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 41;
    width: 300px;
    height: 320px;
    max-width: calc(100% - 1.5rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 0.45rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.desing2-article-stl[hidden] {
    display: none !important;
}

.desing2-article-stl.is-placed {
    right: auto;
    max-width: none;
}

.desing2-article-stl.is-screen {
    left: 8px !important;
    top: 8px !important;
    right: auto !important;
    bottom: auto !important;
    width: calc(100% - 16px) !important;
    height: calc(100% - 16px) !important;
    max-width: none !important;
    z-index: 42;
}

.desing2-article-stl__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid #e6ebf1;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.desing2-article-stl__head.is-dragging {
    cursor: grabbing;
}

.desing2-article-stl__head .icon-base,
.desing2-article-stl__head .ri {
    color: currentColor !important;
    background-color: currentColor !important;
}

.desing2-article-stl__title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desing2-article-stl .plugin-blocks__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 6px 8px 0;
    border-bottom: 0;
}

/* Fondos blancos fijos para los menús de herramientas del visor STL (también en modo oscuro). */
#desing2-article-stl,
#desing2-article-stl .desing2-article-stl__head,
#plugin-blocks-tools,
#plugin-blocks-tools .plugin-blocks__tool:not(.is-on),
#desing2-article-stl .desing2-article-stl__head .btn,
#desing2-article-stl .desing2-article-stl__head select,
#desing2-article-stl .desing2-article-stl__head .dropdown-menu,
.desing2-article-stl,
.desing2-article-stl__head,
.desing2-article-stl .plugin-blocks__tools,
.desing2-article-stl .plugin-blocks__tool:not(.is-on) {
    background-color: #ffffff !important;
}

/* Cualquier barra/menú de herramientas del visor STL: fondo blanco siempre (oscuro incluido). */
.desing2-stl-view-scope [id$="toolbar"]:not(#master-article-stl-viewer-toolbar),
.desing2-stl-view-scope [class*="modes-toolbar"],
.desing2-stl-view-scope .plugin-blocks,
.desing2-stl-view-scope .desing2-article-stl,
.desing2-stl-view-scope .desing2-article-stl__head,
.desing2-stl-view-scope .plugin-blocks__tools {
    background-color: #ffffff !important;
    color-scheme: light;
}
.desing2-stl-view-scope .plugin-blocks__tool:not(.is-on) {
    color: #186cb7 !important;
}

.desing2-article-stl .plugin-blocks__tool {
    width: 28px;
    height: 26px;
    padding: 0;
    border: 1px solid #90caf9;
    background: #fff;
    color: #1565c0;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.desing2-article-stl .plugin-blocks__tool.is-on {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
}

.desing2-article-stl .plugin-blocks__tool svg {
    width: 15px;
    height: 15px;
    display: block;
}

.desing2-article-stl .plugin-blocks__viewer {
    position: relative;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    margin: 8px 6px 6px;
    border: 2px solid #1565c0;
    background: #fafafa;
    overflow: hidden;
}

.desing2-article-stl__resize {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 7;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    touch-action: none;
    background:
        linear-gradient(135deg, transparent 0 50%, #1565c0 50% 62%, transparent 62% 70%, #1565c0 70% 80%, transparent 80%);
}

.desing2-article-stl .plugin-blocks__viewer-host {
    position: absolute;
    inset: 0;
}

.desing2-article-stl .plugin-blocks__viewer-host canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.desing2-article-stl .plugin-blocks__empty {
    margin: 0.6rem;
    color: #6b7785;
    font-size: 0.82rem;
}

.desing2-article-stl .plugin-blocks__vc {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    user-select: none;
}

.desing2-article-stl .plugin-blocks__vc-scene {
    width: 86px;
    height: 70px;
    perspective: 380px;
    perspective-origin: 70% 18%;
}

.desing2-article-stl .plugin-blocks__vc-cube {
    position: relative;
    width: 54px;
    height: 54px;
    margin-left: auto;
    transform-style: preserve-3d;
}

.desing2-article-stl .plugin-blocks__vc-face {
    position: absolute;
    width: 54px;
    height: 54px;
    box-sizing: border-box;
    border: 1px solid #1f1f1f;
    background: linear-gradient(180deg, #f7f8fa 0%, #e4e7ec 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: #3a3f4a;
    cursor: pointer;
}

.desing2-article-stl .plugin-blocks__vc-face--front { transform: rotateY(0deg) rotateX(180deg) translateZ(-27px); }
.desing2-article-stl .plugin-blocks__vc-face--back { transform: rotateY(180deg) rotateX(180deg) translateZ(-27px); }
.desing2-article-stl .plugin-blocks__vc-face--right { transform: rotateY(90deg) rotateX(180deg) translateZ(-27px); }
.desing2-article-stl .plugin-blocks__vc-face--left { transform: rotateY(-90deg) rotateX(180deg) translateZ(-27px); }
.desing2-article-stl .plugin-blocks__vc-face--top { transform: rotateX(-90deg) rotateX(180deg) translateZ(-27px); }
.desing2-article-stl .plugin-blocks__vc-face--bottom { transform: rotateX(90deg) rotateX(180deg) translateZ(-27px); }

.desing2-article-stl .plugin-blocks__vc-cams {
    display: flex;
    background: #fff;
    border: 1px solid #d7d0c3;
    border-radius: 8px;
    overflow: hidden;
}

.desing2-article-stl .plugin-blocks__vc-cams button {
    width: 32px;
    height: 28px;
    padding: 0;
    border: 0;
    border-right: 1px solid #d7d0c3;
    background: #fff;
    color: #455a64;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desing2-article-stl .plugin-blocks__vc-cams button:last-child { border-right: 0; }
.desing2-article-stl .plugin-blocks__vc-cams button.is-on { background: #1565c0; color: #fff; }
.desing2-article-stl .plugin-blocks__vc-cams svg { width: 16px; height: 16px; }

.desing2-article-stl .plugin-blocks__clip { display: none; pointer-events: none; }
.desing2-article-stl .plugin-blocks__clip.is-on { display: block; }

.desing2-article-stl .plugin-blocks__clip-y {
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 28px;
    width: 22px;
    z-index: 6;
    pointer-events: auto;
}

.desing2-article-stl .plugin-blocks__clip-y input {
    position: absolute;
    left: -48px;
    top: 50%;
    width: 120px;
    transform: rotate(-90deg);
    transform-origin: center;
}

.desing2-article-stl .plugin-blocks__clip-x {
    position: absolute;
    left: 28px;
    right: 96px;
    bottom: 4px;
    z-index: 6;
    pointer-events: auto;
}

.desing2-article-stl .plugin-blocks__clip-x input { width: 100%; }

.desing2-article-stl__status {
    flex: 0 0 auto;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.8125rem;
    padding: 0.45rem 0.55rem;
}

.desing2-material-count__stl-canvas,
.desing2-material-count__stl-status {
    display: none;
}

.desing2-material-count__summary.is-stl-open {
    flex: 0 0 300px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #c5ced8;
}

.desing2-material-count__summary.is-stl-open .desing2-material-count__stl-canvas {
    display: block;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
}

.desing2-material-count__summary.is-stl-open .desing2-material-count__stl-canvas canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.desing2-material-count__summary.is-stl-open .desing2-material-count__stl-status {
    display: block;
    flex: 0 0 auto;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.8125rem;
    line-height: 1.3;
    padding: 0.45rem 0.5rem;
}

.desing2-material-count__loading {
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    bottom: 0;
    top: 4.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.78);
}

.desing2-material-count__loading[hidden] {
    display: none !important;
}

.desing2-material-count.is-loading .desing2-material-count__body,
.desing2-material-count.is-loading .desing2-material-count__summary {
    visibility: hidden;
}

.desing2-material-count__status {
    margin: 0.05rem 0.55rem 0;
    color: #3d4a5c;
    font-size: 0.78rem;
}

.desing2-material-count__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0.55rem 0.4rem;
}

.desing2-material-count .tab-pane.active.show {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
}

.desing2-material-count .dataTables_wrapper {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    border: 1px solid #c5ced8;
    border-radius: 0.2rem;
    background: #fff;
}

.desing2-material-count .dataTables_length,
.desing2-material-count .dataTables_info,
.desing2-material-count .dataTables_paginate {
    display: none !important;
}

.desing2-material-count .dataTables_wrapper .dataTables_filter {
    display: none;
}

.desing2-material-count .dataTables_filter input {
    max-width: 11rem;
}

.desing2-material-count__head .dt-buttons {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.desing2-material-count__head .dt-buttons .btn {
    margin-right: 0;
}

.desing2-material-count table.dataTable {
    width: 100% !important;
    max-width: 100% !important;
}

.desing2-material-count__soon {
    margin: 1.2rem 0.4rem;
    color: #8b95a1;
    font-size: 0.85rem;
}

.desing2-material-count .dataTables_wrapper .dataTables_filter,
.desing2-material-count .dataTables_wrapper .dataTables_length {
    font-size: 0.75rem;
}

.desing2-material-count table.dataTable {
    font-size: 0.78rem;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.desing2-worker-pick__choices {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.desing2-worker-pick__choice {
    padding: 0;
    border: 1px solid rgba(51, 65, 85, 0.16);
    border-radius: 0.375rem;
    background: #fff;
    line-height: 0;
    overflow: hidden;
}

.desing2-worker-pick__choice:hover,
.desing2-worker-pick__choice:focus-visible {
    border-color: var(--tandem-primary, #ff6600);
}

.desing2-worker-pick__figure {
    width: 180px;
    height: 240px;
    display: block;
    object-fit: contain;
    background: #f4f6f8;
}

.desing2-stl-floating-toolbar__inner {
    pointer-events: auto;
    padding: 0.2rem 0.3rem;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(51, 65, 85, 0.1);
    border-radius: 0.375rem;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

.desing2-stl-floating-toolbar__group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.desing2-stl-floating-toolbar__group-gap {
    display: inline-block;
    width: calc(var(--desing2-stl-tool-btn, 2.4375rem) * 2);
    flex-shrink: 0;
}

.desing2-stl-floating-toolbar__sep {
    display: inline-block;
    width: 1px;
    height: 1rem;
    margin: 0 0.1rem;
    background: rgba(51, 65, 85, 0.16);
    flex-shrink: 0;
}

.desing2-stl-view-scope .desing2-stl-floating-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary {
    color: rgba(51, 65, 85, 0.72);
    border-color: rgba(51, 65, 85, 0.18);
    background: transparent;
    font-size: 0.75rem;
    opacity: 0.82;
}

.desing2-stl-view-scope .desing2-stl-floating-toolbar .desing2-stl-floating-toolbar__tool-btn.btn-outline-secondary {
    padding: 0.28rem 0.45rem;
    line-height: 1;
    min-width: var(--desing2-stl-tool-btn, 2.4375rem);
}

.desing2-stl-view-scope .desing2-stl-floating-toolbar .desing2-stl-floating-toolbar__tool-btn.btn-outline-secondary .icon-base {
    display: block;
    font-size: 1.425rem;
}

.desing2-stl-view-scope .desing2-stl-floating-toolbar .desing2-stl-tool-icon {
    width: 1.425rem;
    height: 1.425rem;
}

.desing2-stl-view-scope .desing2-stl-floating-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary:hover,
.desing2-stl-view-scope .desing2-stl-floating-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary:focus-visible {
    background: rgba(51, 65, 85, 0.07);
    color: rgba(15, 23, 42, 0.88);
    border-color: rgba(51, 65, 85, 0.28);
    opacity: 1;
}

.desing2-stl-view-scope .desing2-stl-floating-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary:disabled {
    opacity: 0.35;
}

.desing2-stl-view-scope .desing2-stl-floating-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary.active:not(:disabled) {
    background: rgba(51, 65, 85, 0.1);
    color: rgba(15, 23, 42, 0.9);
    border-color: rgba(51, 65, 85, 0.32);
    opacity: 1;
}

/* Barra superior Desing_2 — hover naranja, herramienta activa en color plantilla */
.desing2-stl-view-scope .desing2-stl-top-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary:hover:not(:disabled):not(.active),
.desing2-stl-view-scope .desing2-stl-top-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary:focus-visible:not(:disabled):not(.active),
.desing2-stl-view-scope .desing2-stl-mode-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary:hover:not(:disabled):not(.active),
.desing2-stl-view-scope .desing2-stl-mode-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary:focus-visible:not(:disabled):not(.active) {
    color: #ff6600;
    border-color: rgba(255, 102, 0, 0.45);
    background: rgba(255, 102, 0, 0.08);
    opacity: 1;
}

.desing2-stl-view-scope .desing2-stl-top-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary.active:not(:disabled),
.desing2-stl-view-scope .desing2-stl-mode-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary.active:not(:disabled) {
    color: var(--tandem-primary, var(--bs-primary));
    border-color: var(--tandem-primary, var(--bs-primary));
    background: color-mix(in srgb, var(--tandem-primary, var(--bs-primary)) 14%, transparent);
    opacity: 1;
}

.desing2-stl-view-scope .desing2-stl-top-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary.active:not(:disabled):hover,
.desing2-stl-view-scope .desing2-stl-top-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary.active:not(:disabled):focus-visible,
.desing2-stl-view-scope .desing2-stl-mode-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary.active:not(:disabled):hover,
.desing2-stl-view-scope .desing2-stl-mode-toolbar .ma-stl-viewer-toolbar-btn.btn-outline-secondary.active:not(:disabled):focus-visible {
    color: var(--tandem-primary, var(--bs-primary));
    border-color: var(--tandem-primary, var(--bs-primary));
    background: color-mix(in srgb, var(--tandem-primary, var(--bs-primary)) 20%, transparent);
    opacity: 1;
}

/* Desing_2 — flyout submenú reglas/rejilla (barra inferior derecha) */
.desing2-stl-floating-toolbar__flyout {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.desing2-stl-floating-toolbar__flyout-toggle.is-open,
.desing2-stl-floating-toolbar__flyout-toggle.has-active-children:not(:disabled) {
    background: rgba(51, 65, 85, 0.1);
    color: rgba(15, 23, 42, 0.9);
    border-color: rgba(51, 65, 85, 0.32);
    opacity: 1;
}

.desing2-dim-kinds-slot {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.desing2-dim-kinds[hidden],
#ma-stl-tool-dim-kinds[hidden],
#desing2-dim-kinds-sep[hidden] {
    display: none !important;
}

#ma-stl-tool-dim-kinds.is-visible {
    display: inline-flex !important;
}

#desing2-dim-kinds-sep.is-visible {
    display: inline-block !important;
}

.desing2-dim-kinds.is-visible {
    display: flex !important;
}

.desing2-dim-kinds-pop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
}

.desing2-dim-kinds-pop[hidden] {
    display: none !important;
}

.desing2-dim-kinds-pop .desing2-dim-kinds {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(22rem, calc(100vw - 2rem));
}

.desing2-dim-kinds {
    position: relative;
    z-index: 30;
    width: 17.5rem;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 0.7rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.desing2-dim-kinds__head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: var(--tandem-primary, var(--bs-primary));
    color: #fff;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.desing2-dim-kinds__head:active {
    cursor: grabbing;
}

.desing2-dim-kinds__head .desing2-material-count__title {
    color: #fff;
    margin-right: 0;
}

.desing2-dim-kinds__head .design-material-count-popup__logo {
    height: 22px;
}

.desing2-dim-kinds__close {
    margin-left: auto;
    cursor: pointer;
    color: #fff !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.desing2-dim-kinds__close:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}

.desing2-dim-kinds__list {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0.15rem 0.4rem;
}

.desing2-dim-kinds__list label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.32rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.desing2-dim-kinds__list label:hover {
    background: #f4f7fb;
}

.desing2-dim-kinds__list .form-check-input {
    margin: 0;
    flex: 0 0 auto;
}

.desing2-dim-kinds__develop {
    border-top: 1px solid #e2e8f0;
    margin-top: 0.15rem;
    padding-top: 0.15rem;
}

.desing2-dim-kinds__develop-title {
    padding: 0.35rem 0.65rem 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.desing2-stl-floating-toolbar__flyout-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.35rem);
    z-index: 20;
    min-width: max-content;
    padding: 0.35rem 0.4rem 0.4rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(51, 65, 85, 0.12);
    border-radius: 0.375rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.desing2-stl-floating-toolbar__flyout-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(51, 65, 85, 0.55);
    margin-bottom: 0.3rem;
    padding: 0 0.05rem;
    white-space: nowrap;
    user-select: none;
}

.desing2-stl-floating-toolbar__flyout-items {
    flex-wrap: nowrap;
}

.desing2-stl-view-scope .ma-stl-compass-overlay {
    position: absolute;
    left: calc(var(--desing2-stl-hsp-sheet-collapsed, 32px) + var(--desing2-stl-compass-gap-from-collapsed-strip, 10px));
    top: max(
        2px,
        calc(var(--desing2-stl-side-panel-top-offset, 72px) - var(--desing2-stl-compass-size, 54px) - var(--desing2-stl-compass-gap-above-panel, 18px))
    );
    z-index: 12;
    pointer-events: none;
    width: var(--desing2-stl-compass-size, 54px);
    height: var(--desing2-stl-compass-size, 54px);
    line-height: 0;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.14));
}

.desing2-stl-view-scope .ma-stl-compass-overlay svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Desing_2 STL — cortes: barra Y (vertical) a la derecha del strip lateral; z-index por encima del panel */
.desing2-stl-view-scope .ma-stl-clip-controls {
    position: absolute;
    inset: 0;
    z-index: 12;
}

.desing2-stl-view-scope .ma-stl-clip-y-wrap {
    left: calc(var(--desing2-stl-hsp-sheet-collapsed, 32px) + var(--desing2-stl-compass-gap-from-collapsed-strip, 10px));
    z-index: 12;
}

.desing2-stl-view-scope .ma-stl-clip-x-wrap {
    left: 50%;
    right: auto;
    width: var(--ma-stl-clip-bar-span, 52%);
    max-width: var(--ma-stl-clip-bar-max, 280px);
    transform: translateX(-50%);
    z-index: 12;
}

/* Pestañas tipo carpeta (mismo aspecto que el panel Diseños del inicio). */
.nav-tabs.tandem-folder-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-bottom: 0 !important;
}

.nav-tabs.tandem-folder-tabs .nav-link {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.42rem 0.95rem 0.48rem;
    border: 1px solid #c5ced8 !important;
    border-radius: 0.55rem 0.55rem 0 0 !important;
    background: #fff;
    color: var(--bs-body-color);
    margin-bottom: 0;
}

.nav-tabs.tandem-folder-tabs .nav-link:hover:not(.active),
.nav-tabs.tandem-folder-tabs .nav-link:focus:not(.active) {
    background: #f4f7fb;
    color: var(--bs-primary);
    border-color: #c5ced8 !important;
}

.nav-tabs.tandem-folder-tabs .nav-link.active,
.nav-tabs.tandem-folder-tabs .nav-link.active:hover,
.nav-tabs.tandem-folder-tabs .nav-link.active:focus {
    background: var(--bs-primary) !important;
    background-color: var(--bs-primary) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-color: var(--bs-primary) !important;
    box-shadow: none !important;
}

.tandem-jobside-workspace-toolbar {
    flex: 0 0 auto;
}

.tandem-jobside-workspace-toolbar > h4 {
    flex: 1 1 auto;
    min-width: 0;
}

.tandem-jobside-workspace-toolbar > div {
    flex-shrink: 0;
}

.tandem-jobside-workspace-row {
    flex: 1 1 auto;
    min-height: 0;
}

.tandem-jobside-workspace .tandem-jobside-col-left,
.tandem-jobside-workspace .tandem-jobside-col-right {
    min-height: 0;
}

.tandem-jobside-workspace .tandem-jobside-col-left {
    display: flex;
    flex-direction: column;
}

.tandem-jobside-workspace .tandem-jobside-col-left > .card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.tandem-jobside-workspace .tandem-jobside-col-left > .card > .card-header {
    flex-shrink: 0;
}

/* Cuerpo izquierdo: flex-basis 0 obliga al alto acotado del padre (sin esto el card crece y no aparece scroll). */
.tandem-jobside-workspace .tandem-jobside-col-left > .card > .card-body.tandem-fill-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tandem-jobside-workspace .tandem-jobside-right-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tandem-jobside-workspace .tandem-jobside-right-card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tandem-jobside-workspace .tandem-jobside-tab-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Documents tab: menús DataTables / dropdowns en panel con scroll */
.tandem-jobside-workspace .dash-tree-toggle {
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 1;
}

.tandem-jobside-workspace .dash-tree-sign {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border: 1px solid var(--bs-primary);
    border-radius: 0.2rem;
    background: #fff;
    color: var(--bs-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.tandem-jobside-workspace tr:hover .dash-tree-toggle .dash-tree-sign,
.tandem-jobside-workspace .dash-tree-toggle:hover .dash-tree-sign,
.tandem-jobside-workspace .dash-tree-toggle[aria-expanded="true"] .dash-tree-sign {
    background: var(--bs-primary);
    color: #fff;
}

.tandem-jobside-workspace .dash-client-tree {
    --dash-tree-line: #b7bec8;
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-left: var(--dash-tree-gutter, 1.15rem);
    padding: 0.15rem 0.35rem 0.45rem 1.05rem;
    border-left: 1px solid var(--dash-tree-line);
    background: #fff;
    overflow: visible;
}

.tandem-jobside-workspace .dash-client-tree-node {
    position: relative;
    margin-bottom: 0.35rem;
}

.tandem-jobside-workspace .dash-client-tree-monthline {
    position: relative;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    min-height: 2rem;
    padding: 0.3rem 0.45rem 0.3rem 0.15rem;
    border-radius: 0.4rem;
}

.tandem-jobside-workspace .dash-client-tree-label {
    font-weight: 600;
    color: var(--bs-body-color);
}

.tandem-jobside-workspace .dash-client-tree-count,
.tandem-jobside-workspace .dash-client-tree-date {
    color: var(--bs-secondary-color);
}

.tandem-jobside-workspace .dash-client-tree-offer {
    color: var(--bs-primary);
    font-weight: 700;
}

.tandem-jobside-workspace .dash-client-tree-designs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0 0 0.15rem;
}

.tandem-jobside-workspace .dash-client-tree-head,
.tandem-jobside-workspace .dash-client-tree-design {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    gap: 1rem;
}

.tandem-jobside-workspace .dash-client-tree-head > span:nth-child(1),
.tandem-jobside-workspace .dash-client-tree-design > .dash-client-tree-name {
    flex: 1.6 1 0;
    min-width: 8rem;
}

.tandem-jobside-workspace .dash-client-tree-head > span:nth-child(2),
.tandem-jobside-workspace .dash-client-tree-design > .dash-client-tree-offer {
    flex: 1 1 0;
    min-width: 6rem;
}

.tandem-jobside-workspace .dash-client-tree-head > span:nth-child(3),
.tandem-jobside-workspace .dash-client-tree-design > .dash-client-tree-date {
    flex: 0 0 10.5rem;
}

.tandem-jobside-workspace .dash-client-tree-head {
    margin-left: 1.7rem;
    width: calc(100% - 1.7rem);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--bs-heading-color);
    padding: 0.35rem 0.7rem;
    background: var(--bs-table-header-bg-color, #f6f7fb) !important;
    border-radius: 0.25rem;
}

.tandem-jobside-workspace .dash-client-tree-design {
    position: relative;
    min-height: 2.2rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.4rem;
    background: #fff;
    border: 1px solid transparent;
}

.tandem-jobside-workspace .dash-client-tree-design:hover {
    border-color: var(--bs-primary);
}

.dash-client-tree-design > .dash-client-tree-eye,
.tandem-jobside-workspace .dash-client-tree-head > .dash-client-tree-eye,
.tandem-jobside-workspace .dash-client-tree-design > .dash-client-tree-eye {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.15rem;
    flex: 0 0 auto;
    min-width: 4.75rem;
    margin-left: auto;
    justify-self: auto;
}

.tandem-jobside-workspace table.dataTable tr.dash-client-tree-row > td,
.tandem-jobside-workspace table.dataTable tr.dash-client-tree-row:hover > td {
    --bs-table-bg-state: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-bg-type: transparent !important;
    box-shadow: none !important;
    padding: 0.25rem 0.75rem 0.45rem !important;
    background: #fff !important;
    background-color: #fff !important;
    overflow: visible;
    width: 100%;
}

.tandem-jobside-workspace tr:has(> td .dash-client-tree-root[aria-expanded="true"]) > td.dash-tree-col {
    position: relative;
}

.tandem-jobside-workspace tr:has(> td .dash-client-tree-root[aria-expanded="true"]) > td.dash-tree-col::after {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(50% + 0.72rem);
    bottom: -1px;
    border-left: 1px solid #b7bec8;
}

.tandem-jobside-workspace .dash-client-tree-monthline::before,
.tandem-jobside-workspace .dash-client-tree-design::before {
    content: "";
    position: absolute;
    left: calc(-1.05rem + 1px);
    top: 50%;
    width: 0.85rem;
    border-top: 1px solid var(--dash-tree-line, #b7bec8);
}

.tandem-jobside-workspace .dash-client-tree-node:last-child .dash-client-tree-monthline::after,
.tandem-jobside-workspace .dash-client-tree-design:last-child::after {
    content: "";
    position: absolute;
    left: calc(-1.05rem - 1px);
    top: calc(50% + 1px);
    width: 3px;
    height: 400px;
    background: #fff;
}

.tandem-jobside-workspace .dash-client-tree-leaves {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0 0 0.15rem 0.62rem;
    padding-left: 1.05rem;
    border-left: 1px solid var(--dash-tree-line, #b7bec8);
    overflow: hidden;
}

.tandem-jobside-workspace .tandem-jobside-tab-content .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible;
}

.tandem-jobside-workspace.tandem-jobside-workspace--expanded .tandem-jobside-col-left {
    opacity: 0.42;
    transition: opacity 0.2s ease;
}

/* ---- DataTables: modo un solo scroll (global) ------------------------- */
html.master-articles-one-scroll,
body.master-articles-one-scroll {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
}

body.master-articles-one-scroll .layout-content-navbar .layout-page,
body.master-articles-one-scroll .layout-content-navbar .content-wrapper,
body.master-articles-one-scroll .layout-content-navbar .content-wrapper > .container-fluid.flex-grow-1.container-p-y,
body.master-articles-one-scroll .layout-content-navbar .content-wrapper > .container-fluid.flex-grow-1 {
    overflow: hidden !important;
    max-height: 100% !important;
}

.master-articles-partial-scroll {
    max-height: var(--ma-partial-height, calc(100dvh - 14rem));
    height: var(--ma-partial-height, calc(100dvh - 14rem));
    overflow: hidden !important;
    min-width: 0;
}

.master-articles-partial-scroll .dataTables_wrapper .dataTables_scroll {
    min-width: 0;
}

.master-articles-partial-scroll .dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
    border-bottom: 0 !important;
    min-width: 0;
}

/* Master Articles (scroll en cuerpo): no encoger filas de herramientas ni pie DT */
.master-articles-partial-scroll .dataTables_wrapper .dt-buttons,
.master-articles-partial-scroll .dataTables_wrapper .dataTables_filter,
.master-articles-partial-scroll .dataTables_wrapper .dataTables_processing,
.master-articles-partial-scroll .dataTables_wrapper .dataTables_info,
.master-articles-partial-scroll .dataTables_wrapper .dataTables_paginate {
    flex-shrink: 0;
}

/* ---- DataTables (Bootstrap 5) integracion con Materio ---- */
.dataTables_wrapper {
    padding: 0.5rem 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin: 0.5rem 0;
}

.dataTables_wrapper .dataTables_filter input.form-control-sm,
.dataTables_wrapper .dataTables_length select.form-select-sm {
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5rem;
}

#ma-stl-viewer-shell,
#master-article-details-stl-viewer-canvas {
    min-width: 0;
    max-width: 100%;
}

#master-article-details-stl-viewer-canvas {
    overflow-x: clip;
}

.dataTables_wrapper table.dataTable thead th,
.dataTables_wrapper table.dataTable thead td {
    background-color: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-heading-color);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.5px;
    padding: 0.875rem 1rem;
}

.desing2-material-count .dataTables_wrapper table.dataTable thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #1d6fbf;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.15;
    min-height: 1.85rem;
    height: 1.85rem;
    padding: 0.42rem 0.3rem;
    vertical-align: middle;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none;
}

.desing2-material-count .dataTables_wrapper table.dataTable thead th.sorting:before,
.desing2-material-count .dataTables_wrapper table.dataTable thead th.sorting:after,
.desing2-material-count .dataTables_wrapper table.dataTable thead th.sorting_asc:before,
.desing2-material-count .dataTables_wrapper table.dataTable thead th.sorting_asc:after,
.desing2-material-count .dataTables_wrapper table.dataTable thead th.sorting_desc:before,
.desing2-material-count .dataTables_wrapper table.dataTable thead th.sorting_desc:after {
    color: #fff;
    opacity: 0.85;
    border-bottom-color: #fff;
    border-top-color: #fff;
}

.desing2-material-count .dataTables_wrapper table.dataTable tbody tr:nth-child(even) td {
    background: #f2f3f5;
}

.desing2-material-count .dataTables_wrapper table.dataTable tbody tr:nth-child(odd) td {
    background: #fff;
}

.desing2-material-count .dataTables_wrapper table.dataTable tbody tr:hover td {
    background: #e7eef6;
}

.desing2-material-count .dataTables_wrapper table.dataTable {
    border-collapse: separate;
    border-spacing: 0;
}

.desing2-material-count .dataTables_wrapper table.dataTable tbody td {
    padding-top: 0.16rem;
    padding-bottom: 0.16rem;
    vertical-align: middle;
}

.desing2-material-count table.dataTable {
    table-layout: fixed;
}

.desing2-material-count table.dataTable th:nth-child(1),
.desing2-material-count table.dataTable td:nth-child(1) {
    width: 5.4rem;
    max-width: 5.4rem;
    white-space: nowrap;
}

.desing2-material-count table.dataTable th:nth-child(2),
.desing2-material-count table.dataTable td:nth-child(2) {
    width: auto;
    white-space: normal;
    word-break: break-word;
}

.desing2-material-count table.dataTable th:nth-child(3),
.desing2-material-count table.dataTable td:nth-child(3) {
    width: 4rem;
    max-width: 4rem;
    white-space: nowrap;
}

.desing2-material-count table.dataTable th:last-child,
.desing2-material-count table.dataTable td:last-child {
    width: 9rem !important;
    min-width: 9rem !important;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
    padding-left: 0.15rem !important;
    padding-right: 0.15rem !important;
}

.dataTables_wrapper table.dataTable tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.dataTables_wrapper table.dataTable tbody tr:hover {
    background-color: var(--bs-gray-50);
}

.dataTables_wrapper .dt-buttons .btn {
    margin-right: 0.25rem;
}

.dataTables_wrapper .pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 2px;
    border: none;
}

.dataTables_wrapper .pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    color: #fff;
}

/* ---- Botones de accion en tablas (editar, eliminar, etc.) ---- */
table.dataTable .btn-icon,
table.dataTable .btn-action {
    padding: 0.25rem 0.5rem;
    margin: 0 1px;
    border-radius: 0.375rem;
}

/* La ultima columna (Acciones) en DataTables siempre debe acomodar los iconos */
table.dataTable td:last-child,
table.dataTable th:last-child {
    white-space: nowrap;
    min-width: 8rem;
}

/* MasterArticles: la columna ID sigue siendo la ultima en el DOM aunque este oculta; forzar ancho en Acciones */
#Master_Articles.dataTable td.tandem-ma-actions-col,
#Master_Articles.dataTable th.tandem-ma-actions-col {
    min-width: 14rem;
    white-space: nowrap;
    vertical-align: middle;
}

/* Forzar que los iconos/botones embebidos en celdas no se rompan */
table.dataTable td a,
table.dataTable td button,
table.dataTable td .btn {
    white-space: nowrap;
}

/* Pequeno reset: imagenes y elementos dentro de celdas se alinean */
table.dataTable td img {
    vertical-align: middle;
}

/* ---- Cards: pequenos ajustes ---- */
.card .card-body {
    padding: 1.25rem 1.5rem;
}

/* ---- Forzar que los enlaces dentro de breadcrumb h4 sean discretos ---- */
h4 .text-muted a {
    color: inherit;
    text-decoration: none;
}
h4 .text-muted a:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* ---- Botones legacy (.btn-success, .btn-warning con success class) ---- */
a.success {
    color: var(--bs-success) !important;
    text-decoration: none;
}

/* Filled buttons must keep white foreground text */
.btn-primary,
.btn-success,
.btn-info,
.btn-danger,
.btn-warning {
    color: #fff !important;
}

/* ---- Compatibilidad: estilos de la app vieja que aun se usan ---- */
.well {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.TopMenu {
    background: var(--bs-card-bg);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-box-shadow-sm);
}

/* ---- DataTables Buttons (export, columns, etc.) collection dropdown ---- */
div.dt-button-collection {
    background: #E8E5F3;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow);
    padding: 0.5rem;
    width: 14rem !important;
    min-width: 14rem !important;
    max-width: 14rem !important;
    z-index: 1080;
    inset: auto !important;
    position: absolute !important;
}

div.dt-button-collection h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bs-secondary-color);
    margin: 0.5rem 0.75rem 0.25rem;
    padding: 0;
    border: none;
}

div.dt-button-collection h5.not-top-heading {
    margin-top: 0.5rem;
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.75rem;
}

div.dt-button-collection .dt-button,
div.dt-button-collection button.dt-button,
div.dt-button-collection a.dt-button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #fff !important;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    margin: 0;
    box-shadow: none;
}

div.dt-button-collection .dt-button:hover,
div.dt-button-collection button.dt-button:hover,
div.dt-button-collection a.dt-button:hover {
    background: var(--bs-primary-bg-subtle);
    color: #fff !important;
}

div.dt-button-collection .dt-button.active,
div.dt-button-collection button.dt-button.active {
    background: var(--bs-primary);
    color: #fff;
}

/* Boton trigger (el de "<i class=fas fa-bars>") */
.dt-buttons .btn.custom-html-collection,
.dt-buttons .buttons-collection {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
}

.dt-buttons .btn.custom-html-collection:hover,
.dt-buttons .buttons-collection:hover {
    background: color-mix(in sRGB, var(--bs-primary) 85%, #000);
    color: #fff;
}

/* Backdrop oscuro detras del dropdown - quitar */
div.dt-button-background {
    display: none !important;
}

/* Sub-dropdowns como pageLength y colvis dentro del collection */
div.dt-button-collection .dt-button-collection-inner select,
div.dt-button-collection select {
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0.75rem;
}

/* Último diseño del usuario, fijo al pie del menú. */
html.tandem-intranet-chrome #layout-menu.menu-vertical .menu-inner {
    flex: 1 1 auto;
    block-size: auto;
    min-block-size: 0;
    overflow: auto;
}

.tandem-menu-last-design {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    box-sizing: border-box;
    margin-block: 0.15rem 0.75rem;
    margin-inline: 0 1.125rem;
    padding-block: 0.15rem 0.15rem;
    padding-inline: var(--bs-menu-vertical-link-padding-x, 1.45rem);
    text-decoration: none;
    color: var(--bs-body-color);
    cursor: pointer;
    user-select: none;
}

.tandem-menu-last-design:hover {
    color: var(--bs-body-color);
}

.tandem-menu-last-design-photo {
    display: block;
    width: 150px;
    height: 108px;
    max-width: calc(100% - 0.4rem);
    object-fit: cover;
    border-radius: 0.35rem;
    background: #fff;
    border: 1px solid #e4e6ea;
}

.tandem-menu-last-design-photo--empty {
    background: #eef1f6;
}

.tandem-menu-last-design-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 150px;
    max-width: 100%;
    text-align: start;
    line-height: 1.25;
}

.tandem-menu-last-design-offer {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.tandem-menu-last-design-hint {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    line-height: 1.2;
}

.tandem-menu-last-design-name {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

html.layout-menu-collapsed .layout-menu:not(:hover):not(.layout-menu-hover) .tandem-menu-last-design {
    align-items: center;
    margin-inline: 0;
    padding-inline: 0.35rem;
    overflow: hidden;
}

html.layout-menu-collapsed .layout-menu:not(:hover):not(.layout-menu-hover) .tandem-menu-last-design-title {
    display: none;
}

.app-brand-logo .tandem-brand-lockup {
    height: 32px;
    width: auto;
    max-width: 168px;
    object-fit: contain;
}
html.layout-menu-collapsed .layout-menu:not(:hover):not(.layout-menu-hover) .app-brand-logo .tandem-brand-lockup {
    width: 28px;
    height: 28px;
    max-width: 28px;
    object-fit: cover;
    object-position: left center;
}
html.layout-menu-collapsed .layout-menu:not(:hover):not(.layout-menu-hover) .tandem-menu-last-design-photo {
    width: 46px;
    height: 46px;
    max-width: 46px;
}

#tandem-opening-design {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(44, 51, 64, 0.28);
}

#tandem-opening-design[hidden] {
    display: none !important;
}

.tandem-opening-design-card {
    width: 240px;
    background: #fff;
    border: 1px solid #ece7e1;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(44, 51, 64, 0.16);
    text-align: center;
    padding: 8px 0 22px;
}

.tandem-opening-design-card p {
    margin: 14px 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #2C3340;
}

.tandem-opening-design-clock {
    width: 56px;
    height: 56px;
    margin: 18px auto 0;
    position: relative;
}

.tandem-opening-design-ring {
    position: absolute;
    inset: 0;
    border: 4px solid transparent;
    border-top-color: var(--tandem-primary, #349d7d);
    border-radius: 50%;
    animation: tandem-opening-design-spin 0.85s linear infinite;
}

.tandem-opening-design-hands {
    position: absolute;
    inset: 0;
    animation: tandem-opening-design-spin 1.35s linear infinite;
}

.tandem-opening-design-hands:before,
.tandem-opening-design-hands:after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 2px;
    transform-origin: 50% 0;
}

.tandem-opening-design-hands:before {
    width: 2.4px;
    height: 14px;
    margin: -14px 0 0 -1.2px;
    background: #2C3340;
}

.tandem-opening-design-hands:after {
    width: 2.4px;
    height: 10px;
    margin: 0 0 0 -1.2px;
    background: var(--tandem-primary, #349d7d);
    transform: rotate(90deg);
}

.tandem-opening-design-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: var(--tandem-primary, #349d7d);
    border-radius: 50%;
}

@keyframes tandem-opening-design-spin {
    to { transform: rotate(360deg); }
}

