/* Praxis Dialyse · Documentos do SUS (janela KwDialiseSUS). Prefixo hu-. */

/* ---------- janela ---------- */
.hu-janela { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hu-janela h2 { margin: 0; }
.hu-pac { margin: 0; font-weight: 600; }
.hu-pac small { display: block; font-weight: 400; }
#hu-raiz { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hu-tela { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hu-subs { position: sticky; top: -16px; z-index: 2; background: var(--sup); padding: 6px 0; }
.hu-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hu-grade .campo, .hu-tela > .campo { min-width: 0; }
.hu-tela select, .hu-tela input:not([type="checkbox"]), .hu-tela textarea { width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; }
.hu-h3 { font-size: 1rem; margin: 6px 0 0; }
.hu-peq { font-size: .85rem; margin: 0; }
.hu-chk { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.hu-chk input { width: 18px; height: 18px; flex: none; }
.hu-aviso { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fff4dc; border: 1px solid #f1d08a; color: #5c3b00; font-size: .9rem; }
.hu-okmsg { margin: 0; color: #157347; font-size: .9rem; }
.hu-falta { padding: 8px 10px; border-radius: 8px; background: #fdecea; border: 1px solid #f4b8b0; color: #6b1a12; font-size: .9rem; }
.hu-falta ul { margin: 4px 0 0; padding-left: 18px; }
.hu-falta p { margin: 4px 0; }
.hu-renov { margin: 0; padding: 8px 10px; border-radius: 8px; background: #e8f4ec; border: 1px solid #b7dcc3; font-size: .9rem; }
.hu-renov.hu-at { background: #fff4dc; border-color: #f1d08a; }
.hu-renov.hu-mal { background: #fdecea; border-color: #f4b8b0; }
.hu-acoes { position: sticky; bottom: -18px; background: var(--sup); padding: 8px 0; border-top: 1px solid var(--linha); }

/* remédios */
.hu-meds { display: flex; flex-direction: column; gap: 8px; }
.hu-med { border: 1px solid var(--linha); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.hu-med.hu-on { border-color: var(--px); background: color-mix(in srgb, var(--px) 5%, var(--sup)); }
.hu-med small { font-size: .8rem; }
.hu-chkl { border: 1px solid var(--linha); border-radius: 10px; padding: 8px 10px; }
.hu-chkl ul { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hu-chkl li { padding-left: 22px; position: relative; font-size: .9rem; line-height: 1.35; }
.hu-chkl li::before { position: absolute; left: 0; top: 0; width: 18px; text-align: center; font-weight: 700; }
.hu-chkl li.hu-ok::before { content: "✓"; color: #157347; }
.hu-chkl li.hu-at::before { content: "!"; color: #9a6400; }
.hu-chkl li.hu-mal::before { content: "✕"; color: #b42318; }
.hu-chkl li.hu-nd::before { content: "?"; color: var(--aco); }
.hu-chkl li .btn { margin-left: 4px; padding: 1px 8px; font-size: .78rem; }

/* APAC */
.hu-secs { display: flex; flex-direction: column; gap: 6px; }
.hu-sec { display: grid; grid-template-columns: 1fr 64px auto; gap: 6px; align-items: center; font-size: .9rem; }
.hu-sec span { min-width: 0; overflow-wrap: anywhere; }
.hu-det summary { cursor: pointer; font-weight: 600; padding: 4px 0; }

/* exames */
.hu-exs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.hu-ex { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--linha); border-radius: 8px; padding: 6px 8px; cursor: pointer; min-width: 0; }
.hu-ex input { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.hu-ex span { display: flex; flex-direction: column; min-width: 0; }
.hu-ex small { font-size: .72rem; color: var(--aco); overflow-wrap: anywhere; }

/* emitidos */
.hu-emit { display: flex; flex-direction: column; gap: 8px; }
.hu-emi { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border: 1px solid var(--linha); border-radius: 10px; padding: 8px 10px; }
.hu-emi > div { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.hu-emi small { color: var(--aco); font-size: .8rem; overflow-wrap: anywhere; }

/* prévia (A4 encolhido para caber na janela) */
.hu-prev-cx { border: 1px solid var(--linha); border-radius: 10px; padding: 8px; background: #f3f3f3; }
.hu-prev-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.hu-prev { overflow: hidden; position: relative; }
.hu-prev-in { width: 760px; transform-origin: top left; background: #fff; padding: 14px; box-sizing: border-box; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* ---------- impressos em formulário (caixas, como o papel do SUS) ---------- */
.hu-f { font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 8.4pt; line-height: 1.25; display: flex; flex-direction: column; gap: 0; }
.hu-f * { box-sizing: border-box; }
.hu-fcab { display: flex; align-items: center; gap: 10px; border: 1.5px solid #000; padding: 6px 8px; margin-bottom: 3px; }
.hu-fsus { display: flex; align-items: center; gap: 4px; flex: none; }
.hu-fsus b { font-size: 16pt; letter-spacing: 1px; border: 2px solid #000; padding: 0 4px; line-height: 1.1; }
.hu-fsus small { font-size: 6.5pt; line-height: 1.1; }
.hu-ftit { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.hu-ftit b { font-size: 10pt; }
.hu-ftit small { font-size: 8.4pt; font-weight: 700; }
.hu-fms { flex: none; text-align: right; font-size: 7pt; }
.hu-faixa { background: #e6e6e6; border: 1px solid #000; border-bottom: 0; font-weight: 700; font-size: 7.6pt; padding: 2px 6px; margin-top: 3px; text-align: center; }
.hu-fl { display: flex; width: 100%; }
.hu-cx { border: 1px solid #000; margin: 0 -1px -1px 0; padding: 1px 4px 2px; min-height: 8.2mm; display: flex; flex-direction: column; overflow: hidden; }
.hu-cx small { font-size: 6.4pt; text-transform: uppercase; color: #000; line-height: 1.15; }
.hu-cx span { font-size: 9pt; font-weight: 600; padding-top: 1px; overflow-wrap: anywhere; }
.hu-cx.hu-alto { min-height: 18mm; } .hu-cx.hu-alto span { font-weight: 400; font-size: 8.4pt; }
.hu-cx.hu-medio { min-height: 14mm; } .hu-cx.hu-medio span { font-weight: 400; }
.hu-cx.hu-ass { min-height: 12mm; }
.hu-w10 { width: 10%; } .hu-w15 { width: 15%; } .hu-w16 { width: 16%; } .hu-w20 { width: 20%; } .hu-w25 { width: 25%; } .hu-w30 { width: 30%; } .hu-w35 { width: 35%; }
.hu-w40 { width: 40%; } .hu-w45 { width: 45%; } .hu-w50 { width: 50%; } .hu-w52 { width: 52%; } .hu-w60 { width: 60%; } .hu-w65 { width: 65%; } .hu-w70 { width: 70%; }
.hu-w75 { width: 75%; } .hu-w80 { width: 80%; } .hu-w100 { width: 100%; }
.hu-mk { display: inline-block; width: 3.4mm; height: 3.4mm; border: 1px solid #000; text-align: center; line-height: 3.2mm; font-style: normal; font-size: 7pt; font-weight: 700; vertical-align: -1px; }
.hu-ft { width: 100%; border-collapse: collapse; margin: 3px 0 0; }
.hu-ft th, .hu-ft td { border: 1px solid #000; padding: 2px 4px; text-align: left; font-size: 8pt; height: 6.2mm; }
.hu-ft th { background: #f0f0f0; font-size: 6.8pt; text-transform: uppercase; height: auto; }
.hu-ft .hu-tq { width: 9%; text-align: center; } .hu-ft .hu-tn { width: 4%; text-align: center; } .hu-ft .hu-tc { width: 18%; }
.hu-fgrid { display: grid; grid-template-columns: repeat(3, 1fr); }
.hu-fnota { font-size: 7pt; margin: 4px 0 0; }
.hu-conf { border: 2px dashed #b42318; color: #b42318; font-weight: 700; text-align: center; padding: 3px; margin-bottom: 4px; font-size: 8.5pt; }

/* documentos no papel timbrado (receita, termo, orientações, procedimento) */
.hu-via { text-align: right; font-size: .8rem; font-weight: 700; text-transform: uppercase; margin: 0 0 6px; }
.hu-rx li { margin-bottom: 10px; line-height: 1.4; }
.hu-rx span { font-size: .92em; }
.hu-just { text-align: justify; }
.hu-lista-chk { list-style: none; padding-left: 0; }
.hu-lista-chk li { margin-bottom: 3px; }
.hu-destaque { border: 1.5px solid #000; padding: 6px 8px; }
.hu-dt { width: 100%; border-collapse: collapse; }
.hu-dt th, .hu-dt td { border: 1px solid #000; padding: 4px 6px; text-align: left; vertical-align: top; font-size: .9em; }
.hu-dt th { background: #f0f0f0; width: 18%; font-weight: 600; }
.hu-caixa { border: 1px solid #000; min-height: 40mm; padding: 6px 8px; line-height: 1.45; }
.hu-caixa-b { min-height: 16mm; }

@media (max-width: 600px) {
  .hu-sec { grid-template-columns: 1fr 56px; }
  .hu-sec .btn { grid-column: 1 / -1; justify-self: start; }
  .hu-acoes { position: static; }
  .hu-acoes .btn { flex: 1 1 40%; }
  .hu-acoes .btn.pri { flex: 1 1 100%; }
  .hu-exs { grid-template-columns: 1fr; }
}
@media print {
  .hu-f { font-size: 8.2pt; }
  .hu-faixa, .hu-ft th, .hu-dt th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hu-f, .hu-dt, .hu-caixa { break-inside: auto; }
  .hu-fl, .hu-ft tr { break-inside: avoid; }
}
.hu-subs { flex-wrap: wrap; overflow: visible; }

/* remédios agrupados por protocolo (um laudo com todos) */
.hu-grupo { display: flex; flex-direction: column; gap: 6px; }
.hu-grupo-t { font-size: .78rem; color: var(--aco); text-transform: uppercase; letter-spacing: .02em; margin-top: 4px; }
.hu-poso { font-size: .82rem; overflow-wrap: anywhere; }
.hu-med .hu-grade { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.hu-med .hu-chk { flex-wrap: wrap; }
.hu-ftmed td:nth-child(2) { font-size: 8pt; }
.hu-corte { border: 0; border-top: 2px dashed #999; margin: 18px 0; }
.hu-or-med { margin: 6px 0 2px; }

/* receita para a CEMA (formato do papel real, sem caixas) */
.hu-rxf { font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 10pt; line-height: 1.3; min-height: 250mm; display: flex; flex-direction: column; }
.hu-rxf * { box-sizing: border-box; }
.hu-rxf-cab { display: flex; flex-direction: column; font-style: italic; font-size: 8pt; }
.hu-rxf-cab b { font-size: 8.5pt; }
.hu-rxf-via { text-align: right; font-size: 7.5pt; margin: 0; color: #444; }
.hu-rxf-tit { font-family: "Times New Roman", Times, serif; font-style: italic; font-size: 14pt; text-align: center; margin: 2px 0 10px; }
.hu-rxf-pac { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #000; padding-bottom: 4px; margin-bottom: 4px; }
.hu-rxf-pac span:last-child { text-align: left; white-space: nowrap; }
.hu-rxf-med { border-bottom: 1px solid #000; padding: 4px 0 2px; }
.hu-rxf-med > b { display: block; }
.hu-rxf-tot { padding-left: 55%; }
.hu-rxf-obs { text-transform: uppercase; margin: 6px 0; }
.hu-rxf-ass { margin-top: auto; padding-top: 30mm; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hu-rxf-carimbo { font-weight: 700; font-size: 9pt; margin-bottom: 14px; }
.hu-rxf-linha { display: block; width: 60%; border-top: 1px solid #000; margin-top: 10px; }
.hu-rxf-ass p { margin: 4px 0; }

/* receituário SUS de insumos e vitaminas */
.hu-ins { font-size: 10.5pt; max-width: 150mm; margin: 0 auto; width: 100%; }
.hu-ins-cab { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 6px; margin-bottom: 4px; }
.hu-ins-cab > div { border: 2px solid #000; border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 16mm; padding: 4px; }
.hu-ins-un { font-family: "Times New Roman", Times, serif; font-weight: 700; font-size: 8pt; text-transform: uppercase; }
.hu-ins-tit { font-weight: 700; font-size: 14pt; letter-spacing: 1px; }
.hu-ins-sus b { font-size: 20pt; font-weight: 900; letter-spacing: 1px; }
.hu-ins-corpo { border: 2px solid #000; border-radius: 8px; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 14px; }
.hu-ins-nome { font-weight: 700; }
.hu-ins-nome u { font-weight: 400; }
.hu-ins-it { position: relative; }
.hu-ins-l { display: flex; align-items: flex-end; gap: 6px; text-transform: uppercase; }
.hu-ins-l b:first-child { flex: none; }
.hu-ins-l b:last-child { flex: none; }
.hu-ins-fio { flex: 1; border-bottom: 1px solid #000; margin-bottom: 3px; min-width: 20px; }
.hu-ins-d { font-weight: 700; font-size: 9.5pt; padding-left: 22px; }
.hu-risc { color: #333; }
.hu-risc::after { content: ""; position: absolute; left: 4%; right: 60%; top: 0; bottom: 0; background: linear-gradient(to bottom right, transparent calc(50% - 1px), #000 calc(50% - 1px), #000 calc(50% + 1px), transparent calc(50% + 1px)); }
.hu-ins-pe { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 18px; font-weight: 700; }
.hu-ins-ass { display: flex; flex-direction: column; align-items: center; min-width: 45%; }
.hu-ins-ass i { display: block; width: 100%; border-top: 1.5px solid #000; margin: 22px 0 2px; }
.hu-ins-ass small { font-weight: 400; font-size: 8pt; }
@media print { .hu-risc::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
