/* =========================================================
   NEXENG | Duct Pressure Drop Calculator
   NEXENG App Standard V3 - v5.0.0
   Depende de: /assets/css/nexeng-app-base.css
   ========================================================= */

:root {
    --pressure-sheet-border: rgba(15, 87, 130, 0.14);
    --pressure-sheet-head: rgba(232, 246, 253, 0.96);
    --pressure-input-bg: rgba(255, 252, 232, 0.98);
    --pressure-input-alt: rgba(255, 248, 218, 0.92);
    --pressure-calc-bg: rgba(244, 248, 252, 0.98);
    --pressure-calc-alt: rgba(236, 244, 250, 0.94);
    --pressure-total-bg: rgba(224, 242, 254, 0.94);
    --pressure-blue: #0284c7;
}

.nx-pressure-shell {
    --nx-max: 1740px;
    width: min(100% - 20px, var(--nx-max));
}

/* HERO */
.nx-pressure-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
    gap: 20px;
    align-items: stretch;
    padding: 32px 0 18px;
}

.nx-pressure-hero-main,
.nx-pressure-hero-total {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--nx-border, rgba(15, 87, 130, 0.14));
    border-radius: var(--nx-radius-lg, 30px);
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.13), transparent 42%),
        radial-gradient(circle at 92% 80%, rgba(6, 182, 212, 0.08), transparent 42%),
        rgba(255, 255, 255, 0.88);
    box-shadow: var(--nx-shadow-soft, 0 14px 36px rgba(15, 35, 60, 0.07));
}

.nx-pressure-hero-main {
    min-height: 212px;
    padding: clamp(24px, 3vw, 42px);
}

.nx-pressure-hero-main::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 44%;
    pointer-events: none;
    opacity: 0.38;
    background:
        linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.82) 46%, rgba(255, 255, 255, 0.96) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 320'%3E%3Cg fill='none' stroke='%230284c7' stroke-opacity='.22' stroke-width='2'%3E%3Cpath d='M58 184h160c36 0 64 28 64 64v22'/%3E%3Cpath d='M282 248h210c42 0 76-34 76-76V72'/%3E%3Cpath d='M130 126h210'/%3E%3Cpath d='M340 126c68 0 86 48 150 48h80'/%3E%3Cpath d='M88 88h168c34 0 62 28 62 62v94'/%3E%3Ccircle cx='90' cy='184' r='6' fill='%2306b6d4' stroke='none'/%3E%3Ccircle cx='504' cy='248' r='6' fill='%2306b6d4' stroke='none'/%3E%3C/g%3E%3C/svg%3E") center right / contain no-repeat;
}

.nx-pressure-hero-main > * {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.nx-pressure-hero-main h1 {
    margin: 12px 0 12px;
    color: var(--nx-text, #0f2137);
    font-size: clamp(2rem, 4vw, 4.05rem);
    line-height: 0.96;
    letter-spacing: -0.075em;
}

.nx-pressure-hero-main p {
    margin: 0;
    color: var(--nx-soft, #3f5871);
    max-width: 760px;
    font-size: 1.02rem;
    line-height: 1.65;
}

.nx-pressure-hero-total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 26px;
    border-color: rgba(2, 132, 199, 0.24);
}

.nx-pressure-hero-total strong {
    display: block;
    margin: 8px 0 2px;
    color: var(--nx-accent, #0284c7);
    font-size: clamp(2.3rem, 4vw, 3.9rem);
    line-height: 0.95;
    letter-spacing: -0.075em;
}

.nx-pressure-hero-total small,
.nx-summary-card small {
    color: var(--nx-muted, #6b7f95);
    font-weight: 750;
}

.nx-pressure-hero-total p {
    margin: 16px 0 0;
    color: var(--nx-soft, #3f5871);
    line-height: 1.55;
}

.nx-pressure-summary-grid {
    margin-bottom: 18px;
}

/* TOOLBAR */
.nx-pressure-toolbar {
    position: sticky;
    top: 94px;
    z-index: 35;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid var(--nx-border, rgba(15, 87, 130, 0.14));
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--nx-shadow-soft, 0 14px 36px rgba(15, 35, 60, 0.07));
    backdrop-filter: blur(18px);
}

.nx-pressure-toolbar-title {
    min-width: 220px;
}

.nx-pressure-toolbar h2 {
    margin: 4px 0 4px;
    color: var(--nx-text, #0f2137);
    font-size: 1.42rem;
    letter-spacing: -0.045em;
}

.nx-pressure-toolbar p {
    margin: 0;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.88rem;
}

.nx-pressure-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.nx-pressure-toolbar-actions .nx-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.86rem;
}

.nx-danger-soft:hover {
    color: var(--nx-danger, #dc2626) !important;
    border-color: rgba(220, 38, 38, 0.24) !important;
    background: rgba(220, 38, 38, 0.06) !important;
}

/* WORKSPACE */
.nx-pressure-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.nx-sheet-panel,
.nx-side-card,
.nx-reference-section {
    border: 1px solid var(--nx-border, rgba(15, 87, 130, 0.14));
    border-radius: var(--nx-radius-lg, 30px);
    background: rgba(255, 255, 255, 0.91);
    box-shadow: var(--nx-shadow-soft, 0 14px 36px rgba(15, 35, 60, 0.07));
}

.nx-sheet-panel {
    overflow: hidden;
    min-width: 0;
}

.nx-sheet-scroll {
    width: 100%;
    max-height: 65vh;
    overflow: auto;
    border-radius: var(--nx-radius-lg, 30px);
    background:
        linear-gradient(90deg, rgba(2, 132, 199, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(2, 132, 199, 0.04) 1px, transparent 1px),
        rgba(255, 255, 255, 0.92);
    background-size: 38px 38px;
}

.nx-pressure-sheet {
    width: 100%;
    min-width: 1260px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.80rem;
}

.nx-pressure-sheet th,
.nx-pressure-sheet td {
    border-right: 1px solid var(--pressure-sheet-border);
    border-bottom: 1px solid var(--pressure-sheet-border);
    padding: 0;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.96);
}

.nx-pressure-sheet th {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 42px;
    padding: 8px 6px;
    color: var(--nx-soft, #3f5871);
    background: var(--pressure-sheet-head);
    font-size: 0.72rem;
    line-height: 1.15;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: normal;
}

.nx-pressure-sheet th small {
    color: var(--nx-muted, #6b7f95);
    font-size: 0.66rem;
    font-weight: 850;
    text-transform: none;
}

.nx-pressure-sheet tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 18;
    height: 40px;
    padding: 8px;
    color: var(--nx-text, #0f2137);
    background: rgba(232, 246, 253, 0.98);
    font-weight: 950;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.nx-pressure-sheet tfoot td:first-child {
    text-align: left;
}

.nx-pressure-sheet tr.is-selected td {
    box-shadow: inset 0 2px 0 rgba(2, 132, 199, 0.28), inset 0 -2px 0 rgba(2, 132, 199, 0.16);
}

.nx-col-index { width: 36px; }
.nx-col-tag { width: 118px; }
.nx-col-type { width: 72px; }
.nx-col-dim { width: 98px; }
.nx-col-flow { width: 110px; }
.nx-col-length { width: 98px; }
.nx-col-material { width: 112px; }
.nx-col-acc { width: 54px; }
.nx-col-calc-sm { width: 70px; }
.nx-col-calc { width: 78px; }
.nx-col-total { width: 82px; }
.nx-col-status { width: 68px; }
.nx-col-actions { width: 88px; }

.nx-cell-index {
    color: var(--nx-muted, #6b7f95);
    background: rgba(248, 251, 255, 0.98) !important;
    font-weight: 950;
    text-align: center;
}

.nx-cell-edit {
    background: var(--pressure-input-bg) !important;
}

.nx-cell-edit:nth-child(even) {
    background: var(--pressure-input-alt) !important;
}

.nx-cell-calc {
    background: var(--pressure-calc-bg) !important;
}

.nx-cell-calc:nth-child(even) {
    background: var(--pressure-calc-alt) !important;
}

.nx-cell-total {
    background: var(--pressure-total-bg) !important;
}

.nx-cell-disabled {
    background: rgba(240, 244, 248, 0.86) !important;
    color: rgba(107, 127, 149, 0.65);
}

.nx-pressure-sheet input,
.nx-pressure-sheet select,
.nx-sheet-input,
.nx-sheet-select,
.nx-sheet-unit {
    width: 100%;
    height: 38px;
    min-width: 0;
    border: 0;
    border-radius: 0;
    padding: 0 8px;
    color: var(--nx-text, #0f2137);
    background: transparent;
    font: inherit;
    font-weight: 800;
    outline: none;
}

.nx-pressure-sheet input[type="number"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.nx-pressure-sheet input:focus,
.nx-pressure-sheet select:focus,
.nx-row-notes:focus {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px rgba(2, 132, 199, 0.30);
}

.nx-input-unit-combo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    min-height: 38px;
}

.nx-input-unit-combo .nx-sheet-input {
    padding-right: 4px;
}

.nx-input-unit-combo .nx-sheet-unit {
    border-left: 1px solid rgba(15, 87, 130, 0.12);
    padding: 0 3px;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.70rem;
    font-weight: 950;
    text-align: center;
    cursor: pointer;
}

.nx-cell-number,
.nx-cell-output {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 38px;
    padding: 0 8px;
    color: var(--nx-text, #0f2137);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nx-cell-total .nx-cell-number {
    color: var(--nx-accent, #0284c7);
    font-size: 0.84rem;
    font-weight: 950;
}

.nx-cell-actions {
    background: rgba(248, 251, 255, 0.96) !important;
    text-align: center;
}

.nx-cell-acc-btn {
    width: 34px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(2, 132, 199, 0.24);
    border-radius: 10px;
    color: var(--nx-accent, #0284c7);
    background: rgba(14, 165, 233, 0.08);
    font-weight: 950;
    cursor: pointer;
}

.nx-cell-acc-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.nx-cell-actions-wrap,
.nx-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
}

.nx-cell-action-btn,
.nx-icon-btn {
    width: 27px;
    height: 27px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(15, 87, 130, 0.13);
    border-radius: 9px;
    color: var(--nx-soft, #3f5871);
    background: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    font-weight: 950;
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nx-cell-action-btn:hover,
.nx-icon-btn:hover {
    transform: translateY(-1px);
    color: var(--nx-accent, #0284c7);
    border-color: rgba(2, 132, 199, 0.28);
    background: #ffffff;
}

.nx-cell-action-btn.danger:hover,
.nx-icon-btn.nx-delete:hover {
    color: var(--nx-danger, #dc2626);
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.06);
}

.nx-status-ok,
.nx-status-warn,
.nx-status-alert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 950;
    white-space: nowrap;
}

.nx-status-ok {
    color: var(--nx-success, #059669);
    background: rgba(5, 150, 105, 0.10);
    border: 1px solid rgba(5, 150, 105, 0.22);
}

.nx-status-warn {
    color: var(--nx-warning, #d97706);
    background: rgba(217, 119, 6, 0.10);
    border: 1px solid rgba(217, 119, 6, 0.22);
}

.nx-status-alert {
    color: var(--nx-danger, #dc2626);
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.22);
}

/* SIDE CARDS */
.nx-pressure-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(240px, 0.7fr));
    gap: 16px;
}

.nx-side-card {
    padding: 20px;
}

.nx-side-card h2 {
    margin: 6px 0 9px;
    color: var(--nx-text, #0f2137);
    font-size: 1.34rem;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.nx-side-card p,
.nx-side-card small {
    margin: 0;
    color: var(--nx-soft, #3f5871);
    line-height: 1.58;
    font-size: 0.90rem;
}

.nx-selected-card strong {
    display: block;
    margin: 8px 0 5px;
    color: var(--nx-accent, #0284c7);
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: -0.06em;
}

.nx-notes-label {
    display: block;
    margin-top: 14px;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nx-row-notes {
    width: 100%;
    resize: vertical;
    margin-top: 8px;
    border: 1px solid rgba(15, 87, 130, 0.14);
    border-radius: 16px;
    padding: 12px;
    color: var(--nx-text, #0f2137);
    background: rgba(255, 252, 232, 0.94);
    outline: none;
    font: inherit;
    font-size: 0.9rem;
}

/* REFERENCE */
.nx-reference-section {
    margin-top: 18px;
    padding: 22px;
}

.nx-reference-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.nx-reference-card {
    padding: 16px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.82));
    box-shadow: 0 10px 28px rgba(15, 35, 60, 0.04);
}

.nx-reference-card h3 {
    margin: 0;
    color: var(--nx-text, #0f2137);
    font-size: 1rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.nx-reference-card p {
    margin: 8px 0 0;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.84rem;
    line-height: 1.48;
}

/* MODAL */
.nx-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 35, 60, 0.36);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.nx-modal-overlay.is-active {
    opacity: 1;
    pointer-events: all;
}

.nx-modal-box {
    width: min(100%, 820px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(2, 132, 199, 0.22);
    border-radius: 28px;
    background: radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.12), transparent 40%), rgba(255, 255, 255, 0.97);
    box-shadow: var(--nx-shadow, 0 24px 70px rgba(15, 35, 60, 0.10));
    overflow: hidden;
    transform: translateY(12px) scale(0.985);
    transition: transform 0.22s ease;
}

.nx-modal-overlay.is-active .nx-modal-box {
    transform: translateY(0) scale(1);
}

.nx-modal-header,
.nx-modal-footer {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(15, 87, 130, 0.10);
}

.nx-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.nx-modal-header h2 {
    margin: 6px 0 0;
    color: var(--nx-text, #0f2137);
    font-size: 1.55rem;
    letter-spacing: -0.045em;
}

.nx-modal-header p {
    margin: 6px 0 0;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.9rem;
}

.nx-modal-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid rgba(15, 87, 130, 0.14);
    border-radius: 999px;
    background: #ffffff;
    color: var(--nx-text, #0f2137);
    font-size: 1.55rem;
    line-height: 1;
}

.nx-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px 22px;
}

.nx-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(15, 87, 130, 0.10);
    border-bottom: 0;
}

.nx-modal-total {
    color: var(--nx-muted, #6b7f95);
    font-size: 0.9rem;
    font-weight: 750;
}

.nx-modal-total strong {
    color: var(--nx-accent, #0284c7);
    font-size: 1.15rem;
    font-weight: 950;
}

.nx-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nx-accessory-category {
    margin-bottom: 18px;
}

.nx-accessory-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--nx-accent, #0284c7);
    font-size: 0.76rem;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nx-accessory-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(130px, auto);
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(15, 87, 130, 0.09);
}

.nx-accessory-item:last-child {
    border-bottom: 0;
}

.nx-accessory-name {
    color: var(--nx-soft, #3f5871);
    font-size: 0.9rem;
    font-weight: 750;
}

.nx-accessory-drop {
    color: var(--nx-muted, #6b7f95);
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: right;
}

.nx-accessory-drop strong {
    display: block;
    color: var(--nx-accent, #0284c7);
    font-size: 0.82rem;
}

.nx-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid rgba(15, 87, 130, 0.16);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.nx-qty-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: rgba(248, 251, 255, 0.92);
    color: var(--nx-soft, #3f5871);
    font-size: 1rem;
    font-weight: 900;
}

.nx-qty-btn:hover {
    color: var(--nx-accent, #0284c7);
    background: rgba(2, 132, 199, 0.08);
}

.nx-qty-val {
    width: 42px;
    height: 34px;
    display: grid;
    place-items: center;
    border-left: 1px solid rgba(15, 87, 130, 0.10);
    border-right: 1px solid rgba(15, 87, 130, 0.10);
    color: var(--nx-text, #0f2137);
    font-weight: 950;
}

/* RESPONSIVE */
@media (max-width: 1280px) {
    .nx-pressure-hero,
    .nx-pressure-detail-grid,
    .nx-reference-grid {
        grid-template-columns: 1fr;
    }

    .nx-pressure-toolbar {
        position: sticky;
        top: 86px;
        align-items: stretch;
        flex-direction: column;
    }

    .nx-pressure-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .nx-pressure-shell {
        width: min(100% - 24px, var(--nx-max));
    }

    .nx-pressure-hero {
        padding-top: 24px;
    }

    .nx-pressure-hero-main::after {
        opacity: 0.16;
        width: 100%;
    }

    .nx-pressure-toolbar-actions .nx-btn {
        flex: 1 1 calc(50% - 8px);
    }

    .nx-modal-footer,
    .nx-modal-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .nx-modal-actions,
    .nx-modal-actions .nx-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .nx-pressure-shell {
        width: min(100% - 16px, var(--nx-max));
    }

    .nx-pressure-toolbar-actions .nx-btn {
        flex-basis: 100%;
    }

    .nx-accessory-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .nx-accessory-drop {
        text-align: left;
    }
}

@media print {
    .nx-topbar,
    .nx-pressure-toolbar,
    .nx-pressure-detail-grid,
    .nx-reference-section,
    .nx-disclaimer,
    .nx-footer,
    .nx-modal-overlay,
    .nx-toast-container,
    .nx-pwa-help {
        display: none !important;
    }

    body {
        background: #ffffff !important;
    }

    .nx-pressure-shell {
        width: 100%;
    }

    .nx-pressure-hero,
    .nx-summary-grid {
        display: none !important;
    }

    .nx-sheet-scroll {
        max-height: none;
        overflow: visible;
    }

    .nx-sheet-panel {
        box-shadow: none;
        border: 0;
    }

    .nx-pressure-sheet {
        min-width: 0;
        font-size: 9px;
    }

    .nx-pressure-sheet th,
    .nx-pressure-sheet td {
        border-color: #cccccc;
    }

    .nx-input-unit-combo {
        display: block;
    }

    .nx-sheet-unit {
        display: none !important;
    }
}


/* =========================================================
   NEXENG APP STANDARD V3 OVERRIDES - DUCT PRESSURE V5
   Objetivo: alinear esta app con el nuevo estándar visual
   del catálogo NEXENG: header fijo rectangular, mayor ancho
   útil, hero compacto, tabla más usable y marca V19.
   ========================================================= */

:root {
    --nx-app-v3-max: 1860px;
    --nx-app-v3-gutter: clamp(12px, 1.5vw, 28px);
    --nx-app-v3-header-h: 96px;
}

html,
body {
    overflow-x: clip;
}

body {
    padding-top: calc(var(--nx-app-v3-header-h) + 14px) !important;
}

.nx-pressure-shell.nx-app-standard-v3 {
    --nx-max: var(--nx-app-v3-max);
    width: min(calc(100vw - (var(--nx-app-v3-gutter) * 2)), var(--nx-app-v3-max)) !important;
    max-width: var(--nx-app-v3-max) !important;
    padding-bottom: 36px !important;
}

/* Header fijo rectangular, consistente con el catálogo */
.nx-app-standard-v3 .nx-topbar {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    min-height: var(--nx-app-v3-header-h) !important;
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    gap: 18px !important;
    padding: 14px clamp(18px, 2.2vw, 38px) !important;
    border-width: 0 0 1px !important;
    border-color: rgba(15, 87, 130, 0.13) !important;
    border-radius: 0 0 18px 18px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 16px 42px rgba(15, 35, 60, 0.12) !important;
    backdrop-filter: blur(18px) !important;
    z-index: 1000 !important;
}

.nx-app-standard-v3 .nx-actions {
    justify-content: flex-end !important;
    gap: 10px !important;
}

/* Marca V19: visible en header sin depender del texto NX */
.nx-app-standard-v3 .nx-brand-mark {
    width: 52px !important;
    height: 52px !important;
    flex: 0 0 52px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(14, 165, 233, 0.18) !important;
    background:
        radial-gradient(circle at 20% 12%, rgba(56, 189, 248, 0.16), transparent 42%),
        #ffffff !important;
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.14) !important;
    color: transparent !important;
    font-size: 0 !important;
    overflow: hidden !important;
}

.nx-app-standard-v3 .nx-brand-mark::before {
    content: "";
    width: 82%;
    height: 82%;
    display: block;
    background: url('/assets/brand/nexeng-mark-v19.png?v=19.0.0') center / contain no-repeat;
}

.nx-app-standard-v3 .nx-brand-text strong {
    font-size: 1.02rem !important;
    letter-spacing: 0.14em !important;
}

.nx-app-standard-v3 .nx-brand-text span {
    font-size: 0.74rem !important;
}

/* Hero V3: más compacto y ancho */
.nx-app-standard-v3 .nx-pressure-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px) !important;
    gap: 20px !important;
    padding: 24px 0 16px !important;
}

.nx-app-standard-v3 .nx-pressure-hero-main {
    min-height: 190px !important;
    padding: clamp(22px, 2.6vw, 38px) !important;
}

.nx-app-standard-v3 .nx-pressure-hero-main h1 {
    font-size: clamp(2.15rem, 3.35vw, 4rem) !important;
    letter-spacing: -0.07em !important;
}

.nx-app-standard-v3 .nx-pressure-hero-main p {
    max-width: 860px !important;
    font-size: 0.98rem !important;
    line-height: 1.58 !important;
}

.nx-app-standard-v3 .nx-pressure-hero-total {
    padding: 24px !important;
}

.nx-app-standard-v3 .nx-pressure-hero-total strong {
    font-size: clamp(2.35rem, 3.4vw, 3.9rem) !important;
}

/* Resumen más compacto */
.nx-app-standard-v3 .nx-pressure-summary-grid {
    gap: 14px !important;
    margin-bottom: 14px !important;
}

.nx-app-standard-v3 .nx-summary-card {
    min-height: 82px !important;
    padding: 16px 18px !important;
}

.nx-app-standard-v3 .nx-summary-card strong {
    font-size: 1.25rem !important;
}

/* Toolbar sticky más controlada bajo el header */
.nx-app-standard-v3 .nx-pressure-toolbar {
    top: calc(var(--nx-app-v3-header-h) + 8px) !important;
    margin: 14px 0 !important;
    padding: 14px 16px !important;
    border-radius: 22px !important;
    z-index: 900 !important;
}

.nx-app-standard-v3 .nx-pressure-toolbar h2 {
    font-size: 1.25rem !important;
}

.nx-app-standard-v3 .nx-pressure-toolbar-actions .nx-btn {
    min-height: 38px !important;
    padding: 0 13px !important;
    font-size: 0.84rem !important;
}

/* Tabla V3 */
.nx-app-standard-v3 .nx-sheet-scroll {
    max-height: calc(100vh - 330px) !important;
    min-height: 360px !important;
    border-radius: 24px !important;
}

.nx-app-standard-v3 .nx-pressure-sheet {
    min-width: 1420px !important;
    font-size: 0.79rem !important;
}

.nx-app-standard-v3 .nx-pressure-sheet th {
    height: 44px !important;
    top: 0 !important;
    background: linear-gradient(180deg, rgba(232, 246, 253, 0.98), rgba(216, 239, 250, 0.98)) !important;
}

.nx-app-standard-v3 .nx-pressure-sheet td {
    height: 39px !important;
}

.nx-app-standard-v3 .nx-pressure-sheet input,
.nx-app-standard-v3 .nx-pressure-sheet select,
.nx-app-standard-v3 .nx-sheet-input,
.nx-app-standard-v3 .nx-sheet-select,
.nx-app-standard-v3 .nx-sheet-unit {
    height: 39px !important;
}

/* Primera columna fija para orientación en tablas anchas */
.nx-app-standard-v3 .nx-pressure-sheet th:first-child,
.nx-app-standard-v3 .nx-pressure-sheet td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 19 !important;
}

.nx-app-standard-v3 .nx-pressure-sheet th:first-child {
    z-index: 25 !important;
}

/* Colores estándar: editable vs calculado */
.nx-app-standard-v3 .nx-cell-edit {
    background: rgba(255, 252, 224, 0.98) !important;
}

.nx-app-standard-v3 .nx-cell-calc {
    background: rgba(239, 247, 252, 0.98) !important;
}

.nx-app-standard-v3 .nx-cell-total {
    background: rgba(224, 242, 254, 0.96) !important;
}

/* Paneles inferiores más alineados */
.nx-app-standard-v3 .nx-pressure-detail-grid {
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(260px, 0.7fr)) !important;
}

.nx-app-standard-v3 .nx-side-card,
.nx-app-standard-v3 .nx-reference-section,
.nx-app-standard-v3 .nx-disclaimer {
    border-radius: 24px !important;
}

/* Footer */
.nx-app-standard-v3 .nx-footer {
    margin-top: 22px !important;
}

@media (min-width: 1700px) {
    .nx-app-standard-v3 .nx-pressure-hero {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px) !important;
    }

    .nx-app-standard-v3 .nx-pressure-sheet {
        min-width: 1500px !important;
    }
}

@media (max-width: 1280px) {
    .nx-app-standard-v3 .nx-pressure-hero,
    .nx-app-standard-v3 .nx-pressure-detail-grid,
    .nx-app-standard-v3 .nx-reference-grid {
        grid-template-columns: 1fr !important;
    }

    .nx-app-standard-v3 .nx-pressure-toolbar {
        top: calc(var(--nx-app-v3-header-h) + 8px) !important;
    }
}

@media (max-width: 820px) {
    :root {
        --nx-app-v3-header-h: 148px;
        --nx-app-v3-gutter: 12px;
    }

    .nx-app-standard-v3 .nx-topbar {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 12px 14px !important;
    }

    .nx-app-standard-v3 .nx-actions {
        justify-content: flex-start !important;
    }

    .nx-app-standard-v3 .nx-actions .nx-btn {
        min-height: 38px !important;
        padding: 0 12px !important;
        font-size: 0.82rem !important;
    }

    .nx-app-standard-v3 .nx-pressure-hero {
        padding-top: 14px !important;
    }

    .nx-app-standard-v3 .nx-pressure-hero-main h1 {
        font-size: clamp(2rem, 10vw, 3rem) !important;
    }

    .nx-app-standard-v3 .nx-pressure-toolbar {
        position: relative !important;
        top: auto !important;
    }

    .nx-app-standard-v3 .nx-sheet-scroll {
        max-height: none !important;
        min-height: 0 !important;
    }
}

@media (max-width: 560px) {
    :root {
        --nx-app-v3-header-h: 178px;
        --nx-app-v3-gutter: 8px;
    }

    .nx-app-standard-v3 .nx-brand-mark {
        width: 46px !important;
        height: 46px !important;
        flex-basis: 46px !important;
    }

    .nx-app-standard-v3 .nx-actions .nx-btn {
        flex: 1 1 calc(50% - 8px) !important;
    }

    .nx-app-standard-v3 .nx-actions .nx-btn-primary {
        flex-basis: 100% !important;
    }

    .nx-app-standard-v3 .nx-pressure-hero-main,
    .nx-app-standard-v3 .nx-pressure-hero-total {
        border-radius: 22px !important;
    }
}
