/* ============================================================
   Farmácia hospitalar — grupo PRESCRIÇÕES + RECEITUÁRIO (out/2026). Prefixo fhp-.
   Telas: /farmacia/prescricoes (fila), /farmacia/envios-prescricao, /farmacia/movimentacoes,
   /farmacia/leitura-receituario e o modal de dispensação (Components/Farmacia/DispensarPrescricaoModal).
   Só complementa o mc-modulo.css (mm-*) e o prescricao-modal.css (prmd-*); tokens --p-* herdados de
   .mm / .mm-layer (claro e escuro). Sem media query de largura (a escala do mc-scale.js cuida).
   ============================================================ */

/* ---- cabeçalho ---- */
.fhp-atualizado { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 9px; border-radius: 50px;
    background: var(--p-soft2); color: var(--p-muted); font-size: .68rem; font-weight: 700; }
.fhp-atualizado .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--p-faint); }
.fhp-atualizado.auto { background: var(--p-green-soft); color: var(--p-green); }
.fhp-atualizado.auto .dot { background: var(--p-green); animation: mmPulse 1.6s ease-in-out infinite; }
.mm-btn.fhp-auto.on { border-color: var(--p-green-line); color: var(--p-green); background: var(--p-green-soft); }

/* ---- faixa do leitor (folha / etiqueta) ---- */
.fhp-scan {
    display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
    background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 14px;
    padding: 12px 14px; box-shadow: var(--p-shadow-sm);
}
.fhp-scan.on { border-color: var(--p-blue-line); box-shadow: 0 0 0 3px var(--p-blue-line-soft); }
.fhp-scan-ico { width: 40px; height: 40px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
    background: var(--p-grad-primary); color: #fff; font-size: 20px; box-shadow: 0 8px 18px -10px rgba(37,99,235,.7); }
.fhp-scan-campo { flex: 0 1 460px; min-width: 260px; }
.fhp-scan-lbl { font-size: .62rem; font-weight: 800; letter-spacing: .9px; color: var(--p-faint); text-transform: uppercase; margin-bottom: 4px; }
.fhp-scan-busca { max-width: none; }
.fhp-scan-busca input { font-family: var(--p-mono); font-weight: 700; letter-spacing: .3px; }
.fhp-scan-msg { flex: 1 1 260px; display: flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--p-text); min-height: 36px; line-height: 1.4; }
.fhp-scan-msg > i { font-size: 16px; color: var(--p-blue); flex: none; }
.fhp-scan-msg b { color: var(--p-ink); }

/* ---- barra de filtros da fila: cabe numa linha em 1600 ---- */
.fhp-toolbar .mm-search.fhp-busca-paciente { min-width: 180px; flex: 0 1 220px; }
.fhp-toolbar .mm-select { max-width: 185px; }
.fhp-toolbar .mm-input[type="date"] { width: 132px; }

/* ---- KPIs: 5 na fila ---- */
.fhp-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---- tabela da fila ---- */
.fhp-tbl td { vertical-align: middle; }
.fhp-tbl .fhp-col-chev { width: 26px; padding-right: 0; color: var(--p-faint); font-size: 17px; }
.fhp-row.urgente td:first-child { box-shadow: inset 4px 0 0 var(--p-red); }
.fhp-row.match td { background: var(--p-blue-soft); }
.fhp-codigo { display: inline-block; padding: 2px 8px; border-radius: 7px; background: var(--p-soft2); border: 1px solid var(--p-border);
    color: var(--p-ink); font-size: .74rem; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
a.fhp-codigo:hover { border-color: var(--p-blue-line); color: var(--p-blue); }
.fhp-leito { display: inline-block; padding: 1px 8px; border-radius: 7px; background: var(--p-teal-soft); color: var(--p-teal);
    border: 1px solid var(--p-teal-line); font-size: .74rem; font-weight: 800; }
.fhp-sub { font-size: .66rem; color: var(--p-faint); font-weight: 600; max-width: 170px; }
.fhp-hora { font-size: .8rem; font-weight: 800; color: var(--p-ink); }
.fhp-hora .mm-faint { font-weight: 600; font-size: .7rem; }
.fhp-sla { margin-top: 3px; }
.fhp-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.fhp-medico { max-width: 170px; }
.fhp-grupo td { background: var(--p-soft2) !important; color: var(--p-ink); font-size: .76rem; font-weight: 800; padding: 7px 12px; }
.fhp-grupo td i { color: var(--p-blue); margin-right: 6px; }
.fhp-det-row > td { padding: 0 !important; background: var(--p-soft) !important; }
.fhp-det-row:hover > td { background: var(--p-soft) !important; }
.fhp-det { padding: 12px 16px 14px 42px; border-bottom: 1px solid var(--p-border); }
.fhp-det-head { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--p-ink); margin-bottom: 8px; }
.fhp-det-head i { color: var(--p-blue); font-size: 15px; }
.fhp-det-head .mm-faint { font-size: .68rem; font-weight: 600; }
.fhp-det-tbl { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 10px; overflow: hidden; }
.fhp-det-tbl th { font-size: .6rem; }
.fhp-det-tbl td { padding: 7px 10px; }
.fhp-suspenso td { opacity: .5; }
.fhp-item-nome { color: var(--p-ink); margin-right: 4px; }
.fhp-obs { font-size: .68rem; color: var(--p-muted); margin-top: 3px; }
.fhp-just { font-size: .68rem; color: var(--p-purple); margin-top: 3px; display: flex; gap: 4px; align-items: baseline; }
.fhp-obs-presc { margin-top: 10px; font-size: .72rem; color: var(--p-text); white-space: pre-wrap; }

/* ---- lista de separação ---- */
.fhp-sep-grupo .mm-tbl td { padding: 7px 12px; }
.fhp-sep-urg td { background: var(--p-red-soft) !important; }
.fhp-sep-urg i { margin-right: 4px; }
.fhp-sep-totais { padding: 10px 14px 12px; border-top: 1px solid var(--p-border-soft); }
.fhp-sep-tot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fhp-sep-tot { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 8px; background: var(--p-soft); border: 1px solid var(--p-border-soft);
    font-size: .72rem; color: var(--p-text); }
.fhp-sep-tot span { flex: 1; min-width: 0; }
.fhp-sep-tot b { color: var(--p-ink); font-variant-numeric: tabular-nums; }

/* ---- envios ---- */
.fhp-envio.erro td { background: color-mix(in srgb, var(--p-red-soft) 80%, transparent); }
.fhp-envio.tentando td { background: color-mix(in srgb, var(--p-yellow-soft) 80%, transparent); }
.fhp-erro-pre { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--p-soft2); border: 1px solid var(--p-border);
    color: var(--p-ink); font: 600 .74rem/1.5 var(--p-mono); white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; }

/* ---- movimentações ---- */
.fhp-estornada td { opacity: .62; }
.fhp-entra { color: var(--p-green) !important; }
.fhp-sai { color: var(--p-red) !important; }
.fhp-pag { padding: 0 6px; font-weight: 800; color: var(--p-ink); }
.fhp-est-nome { font-size: .86rem; font-weight: 800; color: var(--p-ink); }

/* ---- leitura de receituário ---- */
.fhp-leitor { display: flex; gap: 14px; align-items: flex-start; background: var(--p-surface); border: 1px solid var(--p-border);
    border-radius: 16px; padding: 18px; box-shadow: var(--p-shadow); }
.fhp-leitor-ico { width: 54px; height: 54px; border-radius: 15px; flex: none; display: flex; align-items: center; justify-content: center;
    background: var(--p-grad-primary); color: #fff; font-size: 27px; box-shadow: 0 12px 26px -12px rgba(37,99,235,.75); }
.fhp-leitor-lbl { font-size: .66rem; font-weight: 800; letter-spacing: 1px; color: var(--p-faint); text-transform: uppercase; margin-bottom: 6px; }
.fhp-leitor-linha { display: flex; gap: 8px; }
.fhp-leitor-input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--p-border-strong);
    background: var(--p-soft); color: var(--p-ink); font: 700 1.05rem var(--p-mono); letter-spacing: .3px; }
.fhp-leitor-input:focus { outline: none; border-color: var(--p-blue-light); box-shadow: var(--p-focus-ring); background: var(--p-surface); }
.mm-btn.fhp-leitor-btn { height: 50px; padding: 0 20px; border-radius: 12px; font-size: .84rem; }
.fhp-leitor-dica { margin-top: 7px; font-size: .7rem; color: var(--p-faint); font-weight: 600; display: flex; gap: 5px; align-items: center; }
.fhp-video { width: 100%; max-height: 340px; border-radius: 12px; background: #000; object-fit: cover; }
.fhp-resultado { border-radius: 16px; border: 1.5px solid var(--tom-line); background: var(--tom-soft); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
    animation: mmFadeUp .25s var(--p-ease); }
.fhp-res-top { display: flex; align-items: center; gap: 14px; }
.fhp-res-ico { width: 52px; height: 52px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
    background: var(--tom); color: #fff; font-size: 28px; }
.fhp-res-tit { font-size: 1.12rem; font-weight: 800; color: var(--tom); letter-spacing: -.2px; line-height: 1.2; }
.fhp-res-msg { font-size: .82rem; font-weight: 600; color: var(--p-ink); margin-top: 3px; }
.fhp-res-alerta { display: flex; gap: 7px; align-items: flex-start; padding: 7px 10px; border-radius: 9px; background: var(--p-surface);
    border: 1px solid var(--p-orange-line); color: var(--p-orange); font-size: .74rem; font-weight: 700; }
.fhp-res-alerta i { font-size: 15px; flex: none; }
.fhp-res-qr { font-size: .7rem; font-weight: 600; color: var(--p-muted); display: flex; gap: 6px; align-items: center; }
.fhp-candidata { width: 100%; text-align: left; cursor: pointer; }
.fhp-hist { width: 100%; text-align: left; cursor: pointer; }

/* ============================================================
   MODAL DE DISPENSAÇÃO (camada .mm-layer — irmã do container)
   ============================================================ */
.fhp-disp .prmd-btn .mm-spin-sm { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: mmSpin .8s linear infinite; display: inline-block; }
.fhp-disp .mm-mbody.cols > .mm-mlist { width: 340px; }
.fhp-pac-nome { font-size: .86rem; }
.fhp-vval { font-size: .82rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fhp-sem-alergia { font-size: .72rem; font-weight: 700; color: var(--p-green); display: flex; align-items: center; gap: 6px; padding: 10px 12px; }
.fhp-and { display: flex; flex-direction: column; gap: 4px; margin-top: 9px; font-size: .72rem; font-weight: 600; color: var(--p-text); }
.fhp-and span { display: flex; align-items: center; gap: 6px; }
.fhp-tabs .prmd-ctx-tab { font-size: .76rem; padding: .5rem .3rem; }
.fhp-lbl-dica { text-transform: none; letter-spacing: 0; font-weight: 600; }
.fhp-disp .prmd-busca input.fhp-disp-bip { font-size: .9rem; font-weight: 700; height: 44px; }
.fhp-bip-aviso { margin-top: 7px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px;
    background: var(--tom-soft); border: 1px solid var(--tom-line); color: var(--tom); font-size: .74rem; font-weight: 700; animation: mmFadeUp .2s var(--p-ease); }
.fhp-bip-aviso i { font-size: 16px; }

.fhp-linha { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border-radius: 12px; background: var(--p-surface);
    border: 1px solid var(--p-border); transition: border-color .15s, box-shadow .15s; }
.fhp-linha.sel { border-color: var(--p-blue-light); box-shadow: 0 0 0 3px var(--p-blue-line-soft); }
.fhp-linha.feito:not(.sel) { background: var(--p-soft); }
.fhp-linha.na { background: var(--p-soft); border-style: dashed; }
.fhp-linha.avulso { border-color: var(--p-orange-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-orange-soft) 80%, transparent); }
.fhp-linha-check { width: 24px; height: 24px; flex: none; margin-top: 1px; border-radius: 7px; border: 2px solid var(--p-border-strong);
    background: var(--p-surface); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; padding: 0; }
.fhp-linha.sel .fhp-linha-check, .fhp-linha-check.on { background: var(--p-blue-light); border-color: var(--p-blue-light); }
.fhp-linha.avulso .fhp-linha-check { background: var(--p-orange); border-color: var(--p-orange); }
.fhp-linha-check:disabled { opacity: .4; }
.fhp-linha-tit { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.fhp-linha-nome { font-size: .84rem; font-weight: 800; color: var(--p-ink); margin-right: 3px; }
.fhp-linha-sub { font-size: .7rem; font-weight: 600; color: var(--p-muted); margin-top: 3px; }
.fhp-na-motivo { margin-top: 6px; display: flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 600; color: var(--p-red); }
.fhp-na-motivo .mm-btn { margin-left: auto; }
.fhp-linha-campos { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; }
.fhp-linha-campos .prmd-flabel { font-size: .6rem; margin-bottom: 3px; }
.fhp-qtd { width: 96px; font-size: .9rem !important; font-weight: 800 !important; text-align: right; }
.fhp-lote { width: 100%; }
.fhp-lote-fixo { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 8px; background: var(--p-soft); border: 1px solid var(--p-border-soft);
    font-size: .72rem; font-weight: 600; color: var(--p-text); }
.fhp-lote-fixo.erro { background: var(--p-red-soft); border-color: var(--p-red-line); color: var(--p-red); }
.fhp-kit { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--p-teal-soft); border: 1px solid var(--p-teal-line); }
.fhp-kit-tit { font-size: .68rem; font-weight: 800; color: var(--p-teal); letter-spacing: .3px; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; text-transform: uppercase; }
.fhp-kit-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: .74rem; color: var(--p-ink); font-weight: 600; }
.fhp-kit-qtd { width: 70px; text-align: right; }
.fhp-kit-extra { display: flex; gap: 6px; margin-top: 7px; }
.fhp-kit-extra input { max-width: 300px; }
.fhp-kit-res { margin-top: 6px; }
.fhp-kit-abrir { margin-top: 8px; }
.fhp-entregar { margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--p-border); }
.fhp-tl .mm-tl-item { grid-template-columns: 28px 1fr auto; align-items: start; }
.fhp-tl-corpo { min-width: 0; }
.fhp-tl-acao { font-weight: 600; color: var(--p-text); }

.fhp-conf { padding: 9px 11px; border-radius: 10px; background: var(--p-surface); border: 1px solid var(--p-border); border-left: 4px solid var(--tom, var(--p-blue)); }
.fhp-conf-top { display: flex; align-items: flex-start; gap: 8px; }
.fhp-conf-nome { flex: 1; min-width: 0; font-size: .76rem; font-weight: 800; color: var(--p-ink); line-height: 1.3; }
.fhp-conf-qtd { font-size: .95rem; font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.fhp-conf-sub { font-size: .66rem; font-weight: 600; color: var(--p-faint); margin-top: 2px; }
.fhp-conf-alerta { display: flex; align-items: flex-start; gap: 5px; margin-top: 5px; font-size: .66rem; font-weight: 700; color: var(--tom); line-height: 1.35; }
.fhp-conf-alerta i { font-size: 13px; flex: none; margin-top: 1px; }
.fhp-conf.kit { margin: -4px 0 0 14px; padding: 5px 9px; border-left-width: 3px; background: var(--p-soft); }
.fhp-conf.kit .fhp-conf-nome { font-size: .68rem; font-weight: 700; }
.fhp-conf.kit .fhp-conf-qtd { font-size: .78rem; }
.fhp-conf.kit .fhp-conf-sub { font-size: .6rem; }
.fhp-conf-vazio div { font-size: .72rem; font-weight: 600; margin-top: 6px; line-height: 1.45; }

.fhp-ok { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 26px; text-align: center; }
.fhp-ok-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--p-green-soft); color: var(--p-green); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.fhp-ok-tit { font-size: 1.15rem; font-weight: 800; color: var(--p-ink); }
.fhp-ok-sub { font-size: .8rem; font-weight: 600; color: var(--p-muted); }
.fhp-ok-tbl { width: 100%; max-width: 900px; border: 1px solid var(--p-border); border-radius: 12px; text-align: left; }
.fhp-ok-falha { max-width: 900px; text-align: left; }
