/* ═══════════════════════════════════════════════════════════════════════════
   notas-tecnicas.css — Vista de Notas Técnicas
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Layout principal ────────────────────────────────────────────────────── */

.nt-layout {
    display: grid;
    grid-template-columns: 35fr 65fr;
    gap: 1.25rem;
    align-items: start;
}

.nt-panel {
    min-height: 420px;
}

/* ─── Panel izquierdo: lista ──────────────────────────────────────────────── */

.nt-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.nt-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .9rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    position: relative;
    animation: hbs-pop-in .28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.nt-item:hover {
    background: var(--hbs-bg);
    border-color: var(--hbs-border);
}

.nt-item.is-active {
    background: rgba(16, 94, 166, .08);
    border-color: rgba(16, 94, 166, .25);
    box-shadow: inset 3px 0 0 var(--hbs-primary);
}

.nt-item__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--hbs-primary) 0%, var(--hbs-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
}

.nt-item__body {
    flex: 1;
    min-width: 0;
}

.nt-item__name {
    font-weight: 600;
    font-size: .92rem;
    color: var(--hbs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nt-item__meta {
    font-size: .76rem;
    color: var(--hbs-muted);
    margin-top: .1rem;
}

.nt-item__actions {
    display: flex;
    gap: .3rem;
    opacity: 0;
    transition: opacity .15s ease;
}

.nt-item:hover .nt-item__actions,
.nt-item.is-active .nt-item__actions {
    opacity: 1;
}

.nt-item__btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--hbs-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    cursor: pointer;
    color: var(--hbs-muted);
    transition: background .15s, color .15s, border-color .15s;
}

.nt-item__btn:hover {
    background: var(--hbs-bg);
    color: var(--hbs-text);
}

.nt-item__btn--danger:hover {
    background: rgba(239, 68, 68, .08);
    color: var(--hbs-danger);
    border-color: rgba(239, 68, 68, .2);
}

/* ─── Empty state lista ───────────────────────────────────────────────────── */

.nt-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2.5rem 1rem;
    color: var(--hbs-muted);
    text-align: center;
}

.nt-list-empty > i {
    font-size: 2.2rem;
    opacity: .3;
}

.nt-list-empty p {
    font-size: .88rem;
    line-height: 1.55;
    margin: 0;
}

/* ─── Panel derecho: placeholder ─────────────────────────────────────────── */

.nt-panel--placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--hbs-muted);
    text-align: center;
    padding: 3rem 2rem;
}

.nt-placeholder-icon {
    font-size: 3rem;
    opacity: .18;
}

.nt-panel--placeholder p {
    font-size: .92rem;
    max-width: 260px;
    line-height: 1.55;
    margin: 0;
}

/* ─── Panel derecho: detalle ─────────────────────────────────────────────── */

.nt-detail-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hbs-border);
}

.nt-detail-title-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.nt-detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hbs-text);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.nt-detail-meta {
    font-size: .78rem;
    color: var(--hbs-muted);
    margin: .35rem 0 0;
}

.nt-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--hbs-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    cursor: pointer;
    color: var(--hbs-muted);
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}

.nt-icon-btn:hover {
    background: var(--hbs-bg);
    color: var(--hbs-text);
}

.nt-icon-btn--danger:hover {
    background: rgba(239, 68, 68, .08);
    color: var(--hbs-danger);
    border-color: rgba(239, 68, 68, .2);
}

.nt-help-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(46, 184, 203, .35);
    background: rgba(46, 184, 203, .07);
    color: var(--hbs-secondary);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    margin-left: auto;
}

.nt-help-btn:hover {
    background: rgba(46, 184, 203, .14);
    border-color: rgba(46, 184, 203, .5);
}

/* ─── Caja de fórmula ─────────────────────────────────────────────────────── */

.nt-formula-box {
    background: linear-gradient(135deg, rgba(16, 94, 166, .05) 0%, rgba(46, 184, 203, .07) 100%);
    border: 1px solid rgba(16, 94, 166, .15);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.nt-formula-box::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--hbs-primary), var(--hbs-secondary));
    border-radius: 14px 0 0 14px;
}

.nt-formula-box__label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--hbs-primary);
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.nt-formula-line {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    font-size: .95rem;
    line-height: 1.6;
    padding: .2rem 0;
}

.nt-formula-name {
    font-weight: 700;
    color: var(--hbs-primary);
    font-size: 1rem;
}

.nt-formula-eq {
    font-weight: 700;
    color: var(--hbs-muted);
    font-size: 1.1rem;
}

.nt-formula-text {
    color: var(--hbs-text);
    font-size: .93rem;
}

.nt-formula-vars {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}

.nt-var-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
}

.nt-formula-line--sub {
    font-size: .87rem;
    color: var(--hbs-muted);
    padding-left: 1px;
}

.nt-formula-line--result {
    font-size: .95rem;
    font-weight: 700;
    color: var(--hbs-primary);
    padding-left: 1px;
}

.nt-formula-empty {
    font-size: .85rem;
    color: var(--hbs-muted);
    font-style: italic;
    padding: .25rem 0;
}

/* ─── Variables ───────────────────────────────────────────────────────────── */

.nt-vars-section {
    margin-bottom: 1.25rem;
}

.nt-vars-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.nt-vars-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--hbs-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.nt-vars-title i {
    color: var(--hbs-secondary);
}

.nt-vars-table-wrap {
    border: 1px solid var(--hbs-border);
    border-radius: 12px;
    overflow: hidden;
}

.nt-vars-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.nt-vars-table thead th {
    background: var(--hbs-bg);
    color: var(--hbs-muted);
    font-weight: 600;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--hbs-border);
}

.nt-vars-table thead th:last-child {
    text-align: right;
    width: 80px;
}

.nt-vars-table tbody tr {
    border-bottom: 1px solid var(--hbs-border);
    transition: background .12s ease;
    animation: hbs-pop-in .25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.nt-vars-table tbody tr:last-child {
    border-bottom: none;
}

.nt-vars-table tbody tr:hover {
    background: var(--hbs-bg);
}

.nt-vars-table td {
    padding: .65rem 1rem;
    color: var(--hbs-text);
    vertical-align: middle;
}

.nt-vars-table td:last-child {
    text-align: right;
}

.nt-var-name-cell {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.nt-var-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nt-var-pct-badge {
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
    color: #fff;
}

.nt-var-row-actions {
    display: flex;
    gap: .3rem;
    justify-content: flex-end;
}

.nt-vars-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.75rem 1rem;
    color: var(--hbs-muted);
    text-align: center;
}

.nt-vars-empty i {
    font-size: 1.6rem;
    opacity: .3;
}

.nt-vars-empty p {
    font-size: .85rem;
    margin: 0;
}

/* ─── Calculadora ─────────────────────────────────────────────────────────── */

.nt-calc {
    border: 1px solid var(--hbs-border);
    border-radius: 12px;
    overflow: hidden;
}

.nt-calc__summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--hbs-text);
    cursor: pointer;
    user-select: none;
    list-style: none;
    background: var(--hbs-bg);
    transition: background .15s;
}

.nt-calc__summary::-webkit-details-marker { display: none; }
.nt-calc__summary::marker { display: none; }

.nt-calc__summary:hover { background: rgba(16, 94, 166, .04); }

.nt-calc__arrow {
    margin-left: auto;
    font-size: .75rem;
    color: var(--hbs-muted);
    transition: transform .2s ease;
}

.nt-calc[open] .nt-calc__arrow {
    transform: rotate(180deg);
}

.nt-calc__body {
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--hbs-border);
    background: #fff;
}

.nt-calc__hint {
    font-size: .8rem;
    color: var(--hbs-muted);
    margin: 0 0 .75rem;
}

.nt-calc__row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.nt-calc__field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1;
    min-width: 140px;
}

.nt-calc__label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--hbs-muted);
}

.nt-calc__input {
    padding: .55rem .85rem;
    border: 1px solid var(--hbs-border);
    border-radius: 10px;
    font-size: .92rem;
    color: var(--hbs-text);
    background: var(--hbs-bg);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    width: 100%;
}

.nt-calc__input:focus {
    border-color: var(--hbs-primary);
    box-shadow: 0 0 0 3px rgba(16, 94, 166, .1);
    background: #fff;
}

.nt-calc__result-box {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    background: linear-gradient(135deg, var(--hbs-primary) 0%, var(--hbs-secondary) 100%);
    padding: .5rem 1.1rem;
    border-radius: 10px;
    color: #fff;
    min-width: 140px;
}

.nt-calc__result-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    opacity: .8;
}

.nt-calc__result-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.nt-calc__result-exact {
    font-size: .68rem;
    font-weight: 400;
    opacity: .75;
    margin-top: .1rem;
    letter-spacing: .01em;
}

.nt-calc__warning {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--hbs-warning);
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 8px;
    padding: .5rem .75rem;
    margin-top: .75rem;
}

/* ─── Modales ─────────────────────────────────────────────────────────────── */

.nt-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    animation: hbs-fade-in .18s ease both;
}

.nt-modal__box {
    background: #fff;
    border-radius: var(--hbs-radius);
    padding: 1.75rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: var(--hbs-shadow-lg);
    animation: hbs-pop-in .28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    margin: auto;
}

.nt-modal__box--wide {
    max-width: 560px;
}

.nt-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--hbs-border);
    background: var(--hbs-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    cursor: pointer;
    color: var(--hbs-muted);
    transition: background .15s, color .15s;
}

.nt-modal__close:hover {
    background: var(--hbs-danger);
    color: #fff;
    border-color: var(--hbs-danger);
}

.nt-modal__title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hbs-text);
    margin-bottom: 1.25rem;
}

.nt-modal__title i {
    color: var(--hbs-primary);
}

.nt-modal__field {
    margin-bottom: 1rem;
}

.nt-modal__label {
    display: block;
    font-size: .83rem;
    font-weight: 600;
    color: var(--hbs-text);
    margin-bottom: .35rem;
}

.nt-modal__label span {
    color: var(--hbs-danger);
    margin-left: .15rem;
}

.nt-modal__input {
    width: 100%;
    padding: .6rem .9rem;
    border: 1px solid var(--hbs-border);
    border-radius: 10px;
    font-size: .92rem;
    color: var(--hbs-text);
    background: var(--hbs-bg);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    box-sizing: border-box;
}

.nt-modal__input:focus {
    border-color: var(--hbs-primary);
    box-shadow: 0 0 0 3px rgba(16, 94, 166, .1);
    background: #fff;
}

.nt-modal__input.is-invalid {
    border-color: var(--hbs-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

.nt-modal__input-wrap {
    position: relative;
}

.nt-modal__input--pct {
    padding-right: 2.5rem;
}

.nt-modal__input-suffix {
    position: absolute;
    right: .9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .88rem;
    font-weight: 700;
    color: var(--hbs-muted);
    pointer-events: none;
}

.nt-modal__error {
    font-size: .78rem;
    color: var(--hbs-danger);
    margin: .3rem 0 0;
}

.nt-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hbs-border);
}

.nt-modal__footer--center {
    justify-content: center;
}

/* ─── Modal ayuda ─────────────────────────────────────────────────────────── */

.nt-help-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hbs-border);
}

.nt-help-hero__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--hbs-primary), var(--hbs-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.nt-help-hero__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hbs-text);
    margin: 0 0 .2rem;
}

.nt-help-hero__sub {
    font-size: .82rem;
    color: var(--hbs-muted);
    margin: 0;
}

.nt-help-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.nt-help-section {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}

.nt-help-section__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(16, 94, 166, .07);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: var(--hbs-primary);
    flex-shrink: 0;
    margin-top: .1rem;
}

.nt-help-section h4 {
    font-size: .88rem;
    font-weight: 700;
    color: var(--hbs-text);
    margin: 0 0 .25rem;
}

.nt-help-section p {
    font-size: .83rem;
    color: var(--hbs-muted);
    margin: 0;
    line-height: 1.55;
}

.nt-help-formula {
    background: rgba(16, 94, 166, .06);
    border: 1px solid rgba(16, 94, 166, .12);
    border-radius: 8px;
    padding: .5rem .85rem;
    font-size: .84rem;
    font-weight: 600;
    color: var(--hbs-primary);
    margin-top: .4rem;
    font-family: 'Courier New', Courier, monospace;
}

.nt-help-example {
    background: linear-gradient(135deg, rgba(16, 94, 166, .04), rgba(46, 184, 203, .06));
    border: 1px solid rgba(16, 94, 166, .12);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.nt-help-example__title {
    font-size: .83rem;
    font-weight: 700;
    color: var(--hbs-primary);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.nt-help-example__steps {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.nt-help-step {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    font-size: .84rem;
    color: var(--hbs-text);
}

.nt-help-step__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--hbs-primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: .05rem;
}

.nt-help-step--result .nt-help-step__num {
    background: var(--hbs-secondary);
    font-size: .7rem;
}

.nt-help-step--result {
    font-size: .92rem;
    margin-top: .25rem;
}

.nt-help-tip {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    background: rgba(245, 158, 11, .07);
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 10px;
    padding: .7rem .9rem;
    font-size: .82rem;
    color: var(--hbs-text);
    line-height: 1.5;
}

.nt-help-tip > i {
    color: var(--hbs-warning);
    margin-top: .1rem;
    flex-shrink: 0;
}

/* ─── Confirm dialog ──────────────────────────────────────────────────────── */

.nt-confirm {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: hbs-fade-in .15s ease both;
}

.nt-confirm__box {
    background: #fff;
    border-radius: var(--hbs-radius);
    padding: 1.75rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--hbs-shadow-lg);
    animation: hbs-pop-in .25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.nt-confirm__icon {
    font-size: 2rem;
    color: var(--hbs-danger);
    margin-bottom: .75rem;
}

.nt-confirm__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--hbs-text);
    margin: 0 0 .5rem;
}

.nt-confirm__body {
    font-size: .88rem;
    color: var(--hbs-muted);
    margin: 0 0 1.25rem;
    line-height: 1.55;
}

.nt-confirm__footer {
    display: flex;
    gap: .65rem;
    justify-content: center;
}

.nt-confirm__ok {
    background: var(--hbs-danger);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, .3);
}

.nt-confirm__ok:hover {
    background: #dc2626;
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */

.nt-toast {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--hbs-text);
    color: #fff;
    padding: .7rem 1.1rem;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 500;
    box-shadow: var(--hbs-shadow-lg);
    animation: hbs-pop-in .28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.nt-toast__icon {
    font-size: 1rem;
}

.nt-toast__icon--success { color: var(--hbs-success); }
.nt-toast__icon--error   { color: #f87171; }

/* ─── Animación fila eliminada ────────────────────────────────────────────── */

@keyframes nt-row-out {
    from { opacity: 1; transform: scaleY(1); max-height: 60px; }
    to   { opacity: 0; transform: scaleY(0); max-height: 0; padding: 0; }
}

.nt-var-row--removing {
    animation: nt-row-out .22s ease forwards;
    transform-origin: top;
    pointer-events: none;
    overflow: hidden;
}

/* ─── Fuente de referencia (badge en panel detalle) ─────────────────────── */

.nt-source-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    background: rgba(46, 184, 203, .1);
    border: 1px solid rgba(46, 184, 203, .3);
    color: var(--hbs-secondary);
    font-size: .76rem;
    font-weight: 600;
    margin-top: .4rem;
}

.nt-source-badge--warn {
    background: rgba(245, 158, 11, .1);
    border-color: rgba(245, 158, 11, .3);
    color: var(--hbs-warning);
}

/* ─── Chip de referencia dentro de la fórmula ───────────────────────────── */

.nt-formula-ref-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .6rem;
    border-radius: 999px;
    background: rgba(46, 184, 203, .15);
    border: 1px solid rgba(46, 184, 203, .35);
    color: var(--hbs-secondary);
    font-size: .82rem;
    font-weight: 700;
}

/* ─── Badge de referencia en la lista de notas ───────────────────────────── */

.nt-item__ref-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-left: .5rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    background: rgba(46, 184, 203, .1);
    color: var(--hbs-secondary);
    font-size: .68rem;
    font-weight: 600;
}

/* ─── Selector de fuente en modal ────────────────────────────────────────── */

.nt-source-toggle {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .6rem;
}

.nt-source-opt {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .85rem;
    border: 1px solid var(--hbs-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    font-size: .88rem;
    color: var(--hbs-text);
}

.nt-source-opt:hover {
    background: var(--hbs-bg);
    border-color: rgba(16, 94, 166, .2);
}

.nt-source-opt input[type="radio"] {
    accent-color: var(--hbs-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nt-source-opt:has(input:checked) {
    background: rgba(16, 94, 166, .06);
    border-color: rgba(16, 94, 166, .3);
    color: var(--hbs-primary);
    font-weight: 600;
}

.nt-modal__hint {
    font-size: .78rem;
    color: var(--hbs-muted);
    margin: .35rem 0 0;
    line-height: 1.45;
}

.nt-modal__select {
    margin-top: .5rem;
    cursor: pointer;
}

/* ─── Calculadora encadenada ─────────────────────────────────────────────── */

.nt-calc__input-row {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .75rem;
}

.nt-calc__chain {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-top: .25rem;
}

.nt-chain-step {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .85rem;
    border-radius: 10px;
    border: 1px solid var(--hbs-border);
    background: var(--hbs-bg);
    animation: hbs-pop-in .2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.nt-chain-step--input {
    background: #fff;
    border-color: var(--hbs-border);
}

.nt-chain-step--final {
    background: linear-gradient(135deg, var(--hbs-primary) 0%, var(--hbs-secondary) 100%);
    border-color: transparent;
    color: #fff;
}

.nt-chain-step__label {
    font-size: .82rem;
    color: inherit;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 1;
    min-width: 0;
}

.nt-chain-step--input .nt-chain-step__label { color: var(--hbs-muted); font-weight: 600; }
.nt-chain-step:not(.nt-chain-step--input):not(.nt-chain-step--final) .nt-chain-step__label { color: var(--hbs-text); }

.nt-chain-step__label em {
    font-style: normal;
    font-size: .73rem;
    opacity: .7;
}

.nt-chain-step__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .15rem;
    flex-shrink: 0;
}

.nt-chain-step__value {
    font-size: .95rem;
    font-weight: 700;
}

.nt-chain-step--input .nt-chain-step__value { color: var(--hbs-text); }
.nt-chain-step--final .nt-chain-step__value { color: #fff; font-size: 1.05rem; }

.nt-chain-step__exact {
    font-size: .68rem;
    opacity: .8;
    font-weight: 400;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .nt-layout {
        grid-template-columns: 1fr;
    }

    .nt-panel--detail,
    .nt-panel--placeholder {
        min-height: 300px;
    }
}

@media (max-width: 600px) {
    .nt-detail-title-row {
        flex-wrap: wrap;
    }

    .nt-help-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .nt-calc__row {
        flex-direction: column;
    }

    .nt-calc__result-box {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
