/* ============================================================
   Farmácia hospitalar — Entrada por Nota Fiscal (out/2026). Prefixo fhn-.
   Complementa mc-modulo.css (mm-*) e prescricao-modal.css (prmd-*).
   Tokens --p-* herdados de .mm (página) e .mm-layer (modais) — claro e escuro.
   Sem media query de largura: a escala (mc-scale.js) cuida de 1366–1920.
   ============================================================ */

/* ---- Página ---- */
.fhn-upload { position: relative; display: inline-flex; }
.fhn-upload input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.fhn-upload.off input[type=file] { pointer-events: none; }

.fhn-rasc { align-items: center; }
.fhn-rasc .mm-btn { flex: none; }

.fhn-nf-num { font-size: .86rem; font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.fhn-nf-sub { font-size: .64rem; font-weight: 600; color: var(--p-faint); margin-top: 1px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.fhn-tbl td { vertical-align: middle; }
.fhn-tbl tr.estornada td { opacity: .62; }
.fhn-tbl tr.estornada .fhn-nf-num { text-decoration: line-through; }
.fhn-fin-sub { font-size: .62rem; font-weight: 600; color: var(--p-faint); margin-top: 2px; white-space: nowrap; }
.fhn-mais { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--p-border-soft); }
.fhn-filtro-ativo { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Assistente (modal xl) ---- */

.fhn-wiz .mm-mbody.cols > .prmd-side { width: 278px; }
.fhn-main { gap: 14px !important; }

.fhn-steps { display: flex; flex-direction: column; gap: 4px; }
.fhn-step {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 8px 10px; border-radius: 11px; border: 1px solid transparent; background: transparent;
    color: var(--p-muted); font: inherit; transition: all .15s;
}
.fhn-step:hover { background: var(--p-surface); border-color: var(--p-border); }
.fhn-step .n {
    width: 26px; height: 26px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--p-soft2); color: var(--p-muted); font-size: .7rem; font-weight: 800;
}
.fhn-step .lbl { font-size: .76rem; font-weight: 800; color: var(--p-ink); line-height: 1.25; }
.fhn-step .sub { font-size: .62rem; font-weight: 600; color: var(--p-faint); line-height: 1.3; }
.fhn-step.on { background: var(--p-surface); border-color: var(--p-blue-line); box-shadow: var(--p-shadow-sm); }
.fhn-step.on .n { background: var(--p-blue-light); color: #fff; }
.fhn-step.ok .n { background: var(--p-green); color: #fff; }
.fhn-step.erro .n { background: var(--p-red); color: #fff; }
.fhn-step.aviso .n { background: var(--p-orange); color: #fff; }

.fhn-res { display: flex; flex-direction: column; gap: 7px; }
.fhn-res-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .7rem; }
.fhn-res-row .k { font-weight: 700; color: var(--p-faint); text-transform: uppercase; letter-spacing: .5px; font-size: .58rem; flex: none; }
.fhn-res-row .v { font-weight: 700; color: var(--p-ink); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.fhn-res-row .v.red { color: var(--p-red); }
.fhn-res-row .v.green { color: var(--p-green); }
.fhn-salvo { font-size: .62rem; font-weight: 700; color: var(--p-faint); display: flex; align-items: center; gap: 5px; }

/* zona de soltar o XML */
.fhn-xml {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; border-radius: 14px;
    border: 2px dashed var(--p-blue-line); background: var(--p-blue-soft);
    color: var(--p-blue); transition: border-color .15s, background .15s;
}
.fhn-xml:hover { border-color: var(--p-blue-light); }
.fhn-xml > i { font-size: 30px; flex: none; }
.fhn-xml-tit { font-size: .86rem; font-weight: 800; color: var(--p-ink); }
.fhn-xml-txt { font-size: .7rem; font-weight: 600; color: var(--p-muted); margin-top: 2px; line-height: 1.45; }
.fhn-xml input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.fhn-xml.lendo { opacity: .7; pointer-events: none; }
.fhn-ou { display: flex; align-items: center; gap: 10px; color: var(--p-faint); font-size: .62rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.fhn-ou::before, .fhn-ou::after { content: ""; flex: 1; height: 1px; background: var(--p-border); }
.fhn-chave { display: flex; gap: 8px; align-items: center; }
.fhn-chave input { font-family: var(--p-mono); letter-spacing: .5px; }

/* escolhido (fornecedor/medicamento) */
.fhn-escolhido {
    display: flex; align-items: center; gap: 9px; padding: 7px 8px 7px 11px; border-radius: 10px;
    border: 1.5px solid var(--p-blue-line); background: var(--p-blue-soft); min-height: 38px;
}
.fhn-escolhido > i { color: var(--p-blue); font-size: 16px; flex: none; }
.fhn-escolhido .t { flex: 1; min-width: 0; font-size: .78rem; font-weight: 700; color: var(--p-ink); line-height: 1.3; }
.fhn-escolhido .t small { display: block; font-size: .64rem; font-weight: 600; color: var(--p-muted); }
.fhn-busca-row { display: flex; gap: 8px; align-items: stretch; }
.fhn-busca-row .mm-bp { flex: 1; min-width: 0; }

/* conta a pagar */
.fhn-fin { border: 1px solid var(--p-border); border-radius: 12px; padding: 12px 14px; background: var(--p-soft); display: flex; flex-direction: column; gap: 10px; }
.fhn-parcelas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fhn-parcela { display: flex; align-items: center; gap: 6px; }
.fhn-parcela .np { min-width: 40px; text-align: center; font-size: .64rem; font-weight: 800; color: var(--p-muted); background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 7px; padding: 4px 0; }
.fhn-parcela input[type=text] { max-width: 104px; text-align: right; }
.fhn-soma { font-size: .72rem; font-weight: 700; color: var(--p-muted); }
.fhn-soma b.ok { color: var(--p-green); }
.fhn-soma b.erro { color: var(--p-red); }

/* tabelas do assistente */
.fhn-wiz .mm-tbl td { padding: 8px 10px; }
.fhn-wiz .mm-tbl th { padding: 8px 10px; }
.fhn-med { font-size: .78rem; font-weight: 700; color: var(--p-ink); line-height: 1.3; }
.fhn-med small { font-weight: 600; color: var(--p-muted); }
.fhn-nfdesc { font-size: .62rem; font-weight: 600; color: var(--p-faint); margin-top: 2px; line-height: 1.35; }
.fhn-nfdesc .mm-mono { font-size: .6rem; }
.fhn-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.fhn-qtd { font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fhn-qtd-sub { font-size: .6rem; font-weight: 700; color: var(--p-faint); white-space: nowrap; }
.fhn-cell-in { width: 100%; min-width: 0; padding: .38rem .45rem !important; border-radius: 8px !important; font-size: .74rem !important; }
.fhn-cell-in.err { border-color: var(--p-red) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.fhn-wiz tr.ignorado td { opacity: .5; }
.fhn-wiz tr.lancado td:first-child { box-shadow: inset 3px 0 0 var(--p-green); }
.fhn-wiz tr.alterado td:first-child { box-shadow: inset 3px 0 0 var(--p-orange); }
.fhn-wiz tr.semmed td:first-child { box-shadow: inset 3px 0 0 var(--p-red); }
.fhn-totais { display: flex; gap: 14px; justify-content: flex-end; align-items: center; padding: 9px 12px; border-top: 1px solid var(--p-border); font-size: .72rem; font-weight: 700; color: var(--p-muted); }
.fhn-totais b { color: var(--p-ink); }
.fhn-totais b.erro { color: var(--p-red); }
.fhn-sug-btn { border: 1px dashed var(--p-teal); background: var(--p-teal-soft); color: var(--p-teal); border-radius: 6px; font-size: .6rem; font-weight: 800; padding: 1px 6px; cursor: pointer; }
.fhn-sug-btn:hover { background: var(--p-teal); color: #fff; }

/* conferência */
.fhn-conf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.fhn-alertas { display: flex; flex-direction: column; gap: 8px; }
.fhn-alerta-item { border: 1px solid var(--p-border); border-radius: 11px; padding: 8px 10px; background: var(--p-surface); }
.fhn-alerta-item .cab { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 800; color: var(--p-ink); }
.fhn-alerta { display: flex; gap: 6px; align-items: flex-start; font-size: .68rem; font-weight: 600; line-height: 1.4; margin-top: 5px; }
.fhn-alerta i { font-size: 13px; margin-top: 1px; flex: none; }
.fhn-alerta.erro { color: var(--p-red); }
.fhn-alerta.aviso { color: var(--p-orange); }
.fhn-alerta.info { color: var(--p-muted); }
.fhn-tudo-ok { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 11px; background: var(--p-green-soft); border: 1px solid var(--p-green-line); color: var(--p-green); font-size: .76rem; font-weight: 700; }
.fhn-tudo-ok i { font-size: 18px; }

.fhn-bipar { position: relative; }
.fhn-bipar > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--p-blue); pointer-events: none; }
.fhn-bipar input {
    width: 100%; height: 46px; padding: 0 14px 0 42px; border-radius: 12px;
    border: 2px solid var(--p-blue-line); background: var(--p-surface); color: var(--p-ink);
    font-family: var(--p-mono); font-size: .92rem; font-weight: 700; letter-spacing: .5px;
}
.fhn-bipar input:focus { outline: none; border-color: var(--p-blue-light); box-shadow: var(--p-focus-ring); }
.fhn-bip-msg { font-size: .7rem; font-weight: 700; display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 9px; }
.fhn-bip-msg.ok { background: var(--p-green-soft); color: var(--p-green); }
.fhn-bip-msg.erro { background: var(--p-red-soft); color: var(--p-red); }
.fhn-bip-msg.aviso { background: var(--p-orange-soft); color: var(--p-orange); }
.fhn-conf-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--p-border); border-radius: 11px; background: var(--p-surface); }
.fhn-conf-linha.ok { border-color: var(--p-green-line); background: var(--p-green-soft); }
.fhn-conf-linha.mais { border-color: var(--p-orange-line); background: var(--p-orange-soft); }
.fhn-conf-linha .mm-progress { margin-top: 5px; }
.fhn-conf-ctl { display: flex; align-items: center; gap: 4px; }
.fhn-conf-n { min-width: 74px; text-align: center; font-size: .78rem; font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.fhn-conf-n small { color: var(--p-faint); font-weight: 700; }

/* confirmar */
.fhn-pend { display: flex; flex-direction: column; gap: 6px; }
.fhn-pend button { text-align: left; }

/* resultado */
.fhn-ok { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px 6px; text-align: center; }
.fhn-ok-ico { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--p-green-soft); color: var(--p-green); font-size: 34px; }
.fhn-ok-tit { font-size: 1.12rem; font-weight: 800; color: var(--p-ink); letter-spacing: -.3px; }
.fhn-ok-sub { font-size: .76rem; font-weight: 600; color: var(--p-muted); }
.fhn-ok-acoes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.fhn-etq-n { width: 64px; text-align: center; }

/* cadastro rápido de medicamento dentro do editor de item */
.fhn-novo-med { border: 1.5px solid var(--p-green-line); background: var(--p-green-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fhn-novo-med-tit { display: flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 800; color: var(--p-green); }
.fhn-semelhante { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px; background: var(--p-surface); border: 1px solid var(--p-border); font-size: .72rem; }
.fhn-hint-preco { font-size: .64rem; font-weight: 600; color: var(--p-faint); margin-top: 4px; }
.fhn-hint-preco b { color: var(--p-ink); }

/* estorno */
.fhn-bloqueios { margin: 6px 0 0; padding-left: 18px; font-size: .72rem; font-weight: 600; color: var(--p-text); line-height: 1.55; }
.fhn-espelho { display: none; }
