/* =========================================================
   NEXENG Duct Sizer Celeste Text Fix v4B
   Corrige texto invisible en columnas calculadas/celestes.
   ========================================================= */

/* Logo visible en dark mode */
body.nx-theme-dark .nx-brand-logo,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-brand-logo {
    filter: brightness(0) invert(1) drop-shadow(0 6px 18px rgba(0,174,239,.18)) !important;
    opacity: .96 !important;
}

/* Encabezados oscuros con texto claro */
body.nx-theme-dark .nx-sheet thead th,
body.nx-theme-dark .nx-sheet thead th *,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet thead th,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet thead th * {
    color: #eaf6ff !important;
    -webkit-text-fill-color: #eaf6ff !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Texto base en cuerpo de tabla sobre fondos claros */
body.nx-theme-dark .nx-sheet tbody td,
body.nx-theme-dark .nx-sheet tbody td *,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td * {
    color: #0f2238 !important;
    -webkit-text-fill-color: #0f2238 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Inputs/selects dentro de la tabla */
body.nx-theme-dark .nx-sheet tbody td input,
body.nx-theme-dark .nx-sheet tbody td select,
body.nx-theme-dark .nx-sheet tbody td textarea,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td input,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td select,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td textarea {
    color: #0f2238 !important;
    -webkit-text-fill-color: #0f2238 !important;
    background: transparent !important;
    opacity: 1 !important;
    text-shadow: none !important;
    color-scheme: light !important;
}

body.nx-theme-dark .nx-sheet tbody td select option,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td select option {
    background: #ffffff !important;
    color: #0f2238 !important;
}

/* Columnas calculadas/celestes por posición */
body.nx-theme-dark .nx-sheet tbody td:nth-child(9),
body.nx-theme-dark .nx-sheet tbody td:nth-child(10),
body.nx-theme-dark .nx-sheet tbody td:nth-child(11),
body.nx-theme-dark .nx-sheet tbody td:nth-child(12),
body.nx-theme-dark .nx-sheet tbody td:nth-child(13),
body.nx-theme-dark .nx-sheet tbody td:nth-child(14),
body.nx-theme-dark .nx-sheet tbody td:nth-child(15),
body.nx-theme-dark .nx-sheet tbody td:nth-child(16),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(9),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(10),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(11),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(12),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(13),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(14),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(15),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(16) {
    color: #0f2238 !important;
    -webkit-text-fill-color: #0f2238 !important;
    font-weight: 850 !important;
}

/* Select/botón de rectangular sugerido */
body.nx-theme-dark .nx-sheet tbody td:nth-child(14) select,
body.nx-theme-dark .nx-sheet tbody td:nth-child(14) button,
body.nx-theme-dark .nx-sheet tbody td:nth-child(14) .nx-btn,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(14) select,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(14) button,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(14) .nx-btn {
    color: #0f5f86 !important;
    -webkit-text-fill-color: #0f5f86 !important;
    background: #f8fcff !important;
    border-color: rgba(0,143,211,.22) !important;
}

/* Estado OK */
body.nx-theme-dark .nx-sheet tbody td:nth-child(15),
body.nx-theme-dark .nx-sheet tbody td:nth-child(15) *,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(15),
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(15) * {
    color: #047857 !important;
    -webkit-text-fill-color: #047857 !important;
}

/* Acciones copiar / borrar */
body.nx-theme-dark .nx-sheet tbody td:nth-child(16) button,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:nth-child(16) button {
    color: #294861 !important;
    -webkit-text-fill-color: #294861 !important;
    background: #f8fbff !important;
    border-color: rgba(15,34,56,.10) !important;
}

/* Totales */
body.nx-theme-dark .nx-sheet tbody tr:last-child td,
body.nx-theme-dark .nx-sheet tfoot td,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody tr:last-child td,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tfoot td {
    color: #0f2238 !important;
    -webkit-text-fill-color: #0f2238 !important;
    background: #e6f5ff !important;
    font-weight: 950 !important;
}

/* Primera columna */
body.nx-theme-dark .nx-sheet tbody td:first-child,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td:first-child {
    color: #31546f !important;
    -webkit-text-fill-color: #31546f !important;
    background: #eef8ff !important;
    font-weight: 950 !important;
}

/* Selección */
body.nx-theme-dark .nx-sheet tbody td.is-selected,
body.nx-theme-dark .nx-sheet tbody td.nx-selected,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td.is-selected,
body.nx-duct-sizer-core-shell-v1.nx-theme-dark .nx-sheet tbody td.nx-selected {
    outline: 2px solid #0877e8 !important;
    outline-offset: -2px !important;
    box-shadow: inset 0 0 0 999px rgba(8,103,216,.08) !important;
}
