/* ============================================================
   Farmácia hospitalar — grupo OPERAÇÕES (out/2026), prefixo fho-.
   Complementos da fundação mm-* (mc-modulo.css) para Requisições, Dispensações, Pacientes,
   Saída Externa, Unidades Externas, Inventários, Histórico do medicamento e Alertas.
   Tokens --p-* (claro/escuro) herdados de .mm / .mm-layer — nada de cor fixa aqui.
   Sem media query de largura (a escala do mc-scaled cuida de 1366–1920).
   ============================================================ */

/* ---- textos de apoio nas tabelas ---- */
.fho-sub { font-size: .66rem; font-weight: 600; color: var(--p-faint); margin-top: 1px; line-height: 1.3; }
.fho-strong { font-weight: 800; color: var(--p-ink); }
.fho-num { font-variant-numeric: tabular-nums; }
.fho-seta { color: var(--p-faint); margin: 0 4px; font-size: 13px; vertical-align: -2px; }
.fho-tbl td { vertical-align: middle; }
.fho-tbl tr.fho-urgente td:first-child { box-shadow: inset 3px 0 0 var(--p-red); }
.fho-tbl tr.fho-apagada { opacity: .62; }
.fho-tbl tr.fho-sel td { background: color-mix(in srgb, var(--p-blue-soft) 70%, var(--p-surface)); }

/* ---- barra de progresso pequena dentro da tabela ---- */
.fho-prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.fho-prog .mm-progress { flex: 1; min-width: 60px; }
.fho-prog-lbl { font-size: .66rem; font-weight: 700; color: var(--p-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- leitor de código de barras ---- */
.fho-leitor {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px;
    border: 1.5px dashed var(--p-blue-line); background: color-mix(in srgb, var(--p-blue-soft) 55%, var(--p-surface));
}
.fho-leitor > i { font-size: 18px; color: var(--p-blue); }
.fho-leitor input {
    flex: 1; border: none; outline: none; background: transparent; font: inherit; font-size: .8rem; font-weight: 600;
    color: var(--p-ink); min-width: 0;
}
.fho-leitor input::placeholder { color: var(--p-faint); font-weight: 500; }
.fho-leitor-msg { font-size: .66rem; font-weight: 700; color: var(--p-muted); white-space: nowrap; }
.fho-leitor-msg.ok { color: var(--p-green); }
.fho-leitor-msg.erro { color: var(--p-red); }

/* ---- busca com resultados (modais) ---- */
.fho-res { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.fho-res-it {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left;
    border: 1px solid var(--p-border); background: var(--p-surface); color: var(--p-text); font: inherit; width: 100%;
    transition: border-color .15s, background .15s;
}
.fho-res-it:hover { border-color: var(--p-blue-line); background: var(--p-soft); }
.fho-res-it.sem { opacity: .62; }
.fho-res-nome { font-size: .78rem; font-weight: 700; color: var(--p-ink); line-height: 1.3; }
.fho-res-sub { font-size: .64rem; font-weight: 600; color: var(--p-faint); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.fho-res-qtd { width: 82px; }
.fho-grp { border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-surface); overflow: hidden; }
.fho-grp-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--p-soft); border-bottom: 1px solid var(--p-border-soft); }
.fho-grp-body { display: flex; flex-direction: column; }
.fho-grp-lote { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-top: 1px solid var(--p-border-soft); font-size: .72rem; }
.fho-grp-lote:first-child { border-top: none; }

/* ---- itens montados (coluna de conferência) ---- */
.fho-conf {
    display: flex; flex-direction: column; gap: 5px; padding: 9px 10px; border-radius: 12px;
    background: var(--p-surface); border: 1px solid var(--p-border); border-left: 4px solid var(--tom, var(--p-green));
    animation: mmFadeUp .2s var(--p-ease);
}
.fho-conf-top { display: flex; align-items: flex-start; gap: 6px; }
.fho-conf-nome { flex: 1; font-size: .76rem; font-weight: 800; color: var(--p-ink); line-height: 1.3; }
.fho-conf-sub { font-size: .64rem; font-weight: 600; color: var(--p-faint); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.fho-conf-row { display: flex; align-items: center; gap: 6px; }
.fho-conf-row .prmd-field { width: 90px; }
.fho-total { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--p-soft2); font-size: .74rem; font-weight: 700; color: var(--p-ink); }

/* ---- atendimento da requisição: um bloco por item ---- */
.fho-item {
    border: 1px solid var(--p-border); border-radius: 14px; background: var(--p-surface); padding: 10px 12px;
    display: flex; flex-direction: column; gap: 8px; transition: box-shadow .2s, border-color .2s;
}
.fho-item.foco { border-color: var(--p-blue-light); box-shadow: 0 0 0 3px var(--p-blue-line-soft); }
.fho-item.ok { border-left: 4px solid var(--p-green); }
.fho-item.parcial { border-left: 4px solid var(--p-yellow); }
.fho-item.nada { border-left: 4px solid var(--p-red); }
.fho-item-head { display: flex; align-items: flex-start; gap: 10px; }
.fho-item-nome { font-size: .84rem; font-weight: 800; color: var(--p-ink); line-height: 1.3; letter-spacing: -.1px; }
.fho-item-nums { display: flex; gap: 14px; margin-left: auto; text-align: right; }
.fho-item-num { display: flex; flex-direction: column; align-items: flex-end; }
.fho-item-num b { font-size: .9rem; font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.fho-item-num span { font-size: .56rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--p-faint); }
.fho-aloc { display: grid; grid-template-columns: 1fr 96px 30px; gap: 6px; align-items: center; }
.fho-aloc .prmd-field { min-width: 0; }
.fho-item-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- inventário: linha em contagem ---- */
.fho-inv-in { width: 96px; text-align: right; }
.fho-tbl tr.fho-div td { background: color-mix(in srgb, var(--p-orange-soft) 75%, var(--p-surface)); }
.fho-tbl tr.fho-ok td { background: color-mix(in srgb, var(--p-green-soft) 55%, var(--p-surface)); }
.fho-tbl tr.fho-foco td { box-shadow: inset 0 0 0 2px var(--p-blue-light); }
.fho-cega { font-size: .66rem; font-weight: 700; color: var(--p-faint); letter-spacing: .3px; }
.fho-check-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; border: 1px solid var(--p-border); border-radius: 12px; padding: 6px; background: var(--p-surface); }
.fho-check-it { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: .74rem; color: var(--p-text); cursor: pointer; }
.fho-check-it:hover { background: var(--p-soft); }
.fho-check-it input { accent-color: var(--p-blue-light); width: 15px; height: 15px; }
.fho-check-it .fho-sub { margin: 0 0 0 auto; }

/* ---- linha do tempo do medicamento ---- */
.fho-tl-qtd { font-weight: 800; font-variant-numeric: tabular-nums; }
.fho-tl-qtd.mais { color: var(--p-green); }
.fho-tl-qtd.menos { color: var(--p-red); }
.fho-tl-qtd.zero { color: var(--p-purple); }
.fho-dia { font-size: .62rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--p-faint); margin: 10px 0 6px; }
.fho-dia:first-child { margin-top: 0; }

/* ---- barra de seleção em lote (alertas) ---- */
.fho-lote-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px;
    background: var(--p-blue-soft); border: 1px solid var(--p-blue-line); font-size: .76rem; font-weight: 700; color: var(--p-ink);
    animation: mmFadeUp .2s var(--p-ease);
}

/* ---- paginação ---- */
.fho-pag { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; color: var(--p-muted); }
.fho-pag button {
    min-width: 30px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--p-border);
    background: var(--p-surface); color: var(--p-text); font: inherit; font-weight: 700;
}
.fho-pag button.on { background: var(--p-blue-light); border-color: var(--p-blue-light); color: #fff; }
.fho-pag button:disabled { opacity: .45; }

/* ---- ficha do paciente / detalhes ---- */
.fho-disp { border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-surface); }
.fho-disp-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.fho-disp-head:hover { background: var(--p-soft); border-radius: 12px; }
.fho-disp-body { padding: 4px 12px 10px; border-top: 1px solid var(--p-border-soft); }
.fho-dev-form { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 8px; align-items: end; }

/* impressão: os blocos de impressão ficam escondidos na tela */
.fho-print { display: none; }
