/* ============================================================
   Farmácia hospitalar — grupo Estoque (out/2026): Controle de Estoque, Lotes, Locais de Estoque e
   os modais Fhe* (movimento, transferência, edição, kardex, reposição, baixa, lote, unitarização).
   Prefixo fhe-. Complementa mc-modulo.css (mm-*) e prescricao-modal.css (prmd-*): tokens --p-*
   herdados de .mm/.mm-layer — claro e escuro sem regra extra. Sem media query de largura.
   ============================================================ */

.fhe-mt { margin-top: 10px; }
.fhe-sub { font-size: .66rem; font-weight: 600; color: var(--p-faint); margin-top: 1px; line-height: 1.3; }
.fhe-sub i { font-size: 12px; vertical-align: -1px; }
.fhe-sub-inline { font-size: .62rem; font-weight: 600; color: var(--p-faint); }
.fhe-conc { font-weight: 600; color: var(--p-muted); margin-left: 3px; }
.fhe-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fhe-mais { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--p-border-soft); }

/* KPIs: 7 cartões numa linha em 1366–1920 (a escala cuida) */
.fhe-kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.fhe-kpis .mm-kpi { padding: 11px 12px; gap: 10px; }
.fhe-kpis .mm-kpi-ico { width: 34px; height: 34px; font-size: 17px; }

/* Tabela: faixa colorida à esquerda pela situação (tom da linha) */
.fhe-tbl tbody tr > td:first-child { box-shadow: inset 4px 0 0 var(--tom, transparent); }
.fhe-tbl td.strong .mm-chip { margin-left: 4px; }
.fhe-tbl .mm-chip i { font-size: 11px; }
.fhe-acoes { display: inline-flex; gap: 2px; justify-content: flex-end; }
.fhe-tbl-estoque td, .fhe-tbl-lotes td { padding-top: 8px; padding-bottom: 8px; }

/* Botão de spinner nos botões prmd (o mm-spin-sm do mc-modulo só vale dentro de .mm-btn) */
.prmd-btn .mm-spin-sm, .prmd-confirm-danger .mm-spin-sm {
    display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
    border-radius: 50%; animation: mmSpin .8s linear infinite; vertical-align: -2px; margin-right: 4px;
}
.prmd-btn.outline .mm-spin-sm { border-color: var(--p-blue-line-soft); border-top-color: var(--p-blue); }
.prmd-confirm-danger:disabled { opacity: .5; cursor: not-allowed; }

/* Alerta de vencidos (Lotes) */
.fhe-alerta-vencidos { align-items: flex-start; }
.fhe-alerta-vencidos .fhe-chips button.mm-chip { cursor: pointer; }
.fhe-alerta-acoes { display: flex; flex-direction: column; gap: 6px; flex: none; }
.fhe-data { width: 136px; }

/* ---- Busca de medicamento dos modais ---- */
.fhe-busca { display: flex; flex-direction: column; gap: 6px; }
.fhe-busca-sel {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px;
    border: 1.5px solid var(--p-blue-light); background: var(--p-blue-soft);
}
.fhe-busca-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--p-surface); color: var(--p-blue); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.fhe-busca-nome { font-size: .82rem; font-weight: 800; color: var(--p-ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fhe-busca-sub { font-size: .66rem; font-weight: 600; color: var(--p-muted); }
.fhe-busca-lista {
    display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto;
    padding: 4px; border: 1px solid var(--p-border); border-radius: 11px; background: var(--p-soft);
}
.fhe-busca-it {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 7px 9px;
    border: 1px solid transparent; border-radius: 9px; background: var(--p-surface); color: inherit; font: inherit; cursor: pointer;
}
.fhe-busca-it > i { color: var(--p-blue); font-size: 15px; }
.fhe-busca-it b { display: block; font-size: .78rem; font-weight: 700; color: var(--p-ink); }
.fhe-busca-it small { display: block; font-size: .64rem; font-weight: 500; color: var(--p-faint); }
.fhe-busca-it:hover, .fhe-busca-it.sel { border-color: var(--p-blue-line); background: var(--p-blue-soft); }
.fhe-busca-vazio { padding: 10px; font-size: .72rem; font-weight: 600; color: var(--p-faint); text-align: center; }

/* ---- Modal de movimento ---- */
.fhe-mov-tabs { max-width: 460px; }
.fhe-mov-tabs .prmd-ctx-tab i { font-size: 14px; vertical-align: -2px; }
.fhe-lotechips { display: flex; flex-wrap: wrap; gap: 5px; }
.fhe-lotechips .mm-chip { cursor: pointer; }
.fhe-lotes-opc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 220px; overflow-y: auto; padding: 2px; }
.fhe-lotes-opc .mm-opt:disabled { opacity: .5; cursor: not-allowed; }
.fhe-opts4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* ---- Transferência ---- */
.fhe-trf-seta { display: flex; justify-content: center; margin: 6px 0; }
.fhe-trf-add { display: flex; flex-direction: column; gap: 8px; }
.fhe-conf {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 11px;
    background: var(--p-surface); border: 1px solid var(--p-border);
}
.fhe-conf-nome { font-size: .76rem; font-weight: 700; color: var(--p-ink); line-height: 1.3; }
.fhe-conf-sub { font-size: .64rem; font-weight: 600; color: var(--p-faint); }
.fhe-conf-qtd { width: 76px; text-align: right; }
.fhe-conf-tot { flex: none; padding: 10px 14px; border-top: 1px solid var(--p-border); font-size: .74rem; font-weight: 600; color: var(--p-muted); }
.fhe-conf-tot b { color: var(--p-ink); }
.fhe-ok { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; }
.fhe-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: 34px; }
.fhe-ok-tit { font-size: 1.05rem; font-weight: 800; color: var(--p-ink); }
.fhe-ok-doc { font-size: .9rem; font-weight: 700; color: var(--p-blue); background: var(--p-blue-soft); padding: 4px 12px; border-radius: 8px; }
.fhe-ok-txt { font-size: .78rem; color: var(--p-text); }
.fhe-ok-acoes { display: flex; gap: 8px; margin-top: 8px; }

/* ---- Kardex / reposição ---- */
.fhe-kx-quem { max-width: 320px; }
.fhe-rep-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fhe-chk { width: 16px; height: 16px; accent-color: var(--p-blue-light); cursor: pointer; }

/* ---- Lote (detalhe) ---- */
.fhe-lote-tabs .prmd-ctx-tab i { font-size: 14px; vertical-align: -2px; }
.fhe-trilha {
    white-space: pre-line; font-size: .74rem; line-height: 1.55; color: var(--p-text);
    background: var(--p-soft); border: 1px solid var(--p-border-soft); border-radius: 10px; padding: 9px 11px;
}
.fhe-lote .mm-tl-dot i { font-size: 13px; }

/* ---- Locais ---- */
.fhe-locais { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.fhe-local {
    --cor: var(--p-blue-light);
    position: relative; display: flex; flex-direction: column; gap: 10px;
    background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 16px; padding: 14px 15px;
    box-shadow: var(--p-shadow-sm); transition: border-color .18s, box-shadow .18s;
}
.fhe-local::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cor); }
.fhe-local:hover { border-color: var(--p-blue-line); box-shadow: var(--p-shadow); }
.fhe-local.inativo { opacity: .68; }
.fhe-local-top { display: flex; align-items: center; gap: 11px; }
.fhe-local-ico {
    width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px;
    background: color-mix(in srgb, var(--cor, var(--p-blue-light)) 14%, var(--p-surface)); color: var(--cor, var(--p-blue-light));
}
.fhe-local-nome { font-size: .9rem; font-weight: 800; color: var(--p-ink); line-height: 1.25; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fhe-local-sub { font-size: .68rem; font-weight: 600; color: var(--p-faint); margin-top: 1px; }
.fhe-local-desc { font-size: .72rem; color: var(--p-text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fhe-local-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fhe-local-nums > div { background: var(--p-soft); border: 1px solid var(--p-border-soft); border-radius: 10px; padding: 6px 9px; }
.fhe-local-nums b { display: block; font-size: .92rem; font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.fhe-local-nums span { font-size: .6rem; font-weight: 800; letter-spacing: .7px; color: var(--p-faint); text-transform: uppercase; }
.fhe-local-rod { display: flex; gap: 12px; flex-wrap: wrap; font-size: .68rem; font-weight: 600; color: var(--p-muted); }
.fhe-local-rod i { font-size: 13px; margin-right: 3px; vertical-align: -2px; color: var(--p-faint); }
.fhe-local-acoes { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--p-border-soft); }

/* Permissões */
.fhe-perm .mm-item { gap: 9px; }
.fhe-perm .mm-mlist-body .mm-check { padding: 2px 0; }
.fhe-perm-acoes { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
