/* Klugwerk Praxis · ficha do paciente e atendimento em tela cheia (28/10/2026). Cores e tokens em tema.css. */

/* ---------- Pacientes (início do médico) ---------- */
.fx-home { display: flex; flex-direction: column; gap: 18px; padding-top: 6px; }
.fx-home-topo h1 { font-family: var(--f-nome); font-style: italic; font-weight: 600; font-size: clamp(1.9rem, 3vw, 2.5rem); color: var(--petroleo); letter-spacing: -.015em; line-height: 1.1; }
.fx-home-topo p { color: var(--aco); margin-top: 4px; font-size: 1.02rem; }
.fx-home-topo p::first-letter { text-transform: uppercase; }
#fx-busca { font-size: 1.12rem; padding: 15px 18px 15px 48px; border-radius: 16px; border: 1px solid var(--linha); box-shadow: var(--sombra-l); background: var(--sup) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f7a72' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E") no-repeat 16px center / 22px; }
#fx-busca:focus { border-color: var(--px); outline: none; box-shadow: 0 0 0 5px var(--px-suave); }
.fx-home-grade { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.fx-hoje h2, .fx-home-lado h2 { font-size: 1.02rem; color: var(--petroleo); margin-bottom: 10px; }
.fx-dia { list-style: none; margin: 0; padding: 0; position: relative; }
.fx-dia::before { content: ""; position: absolute; left: 58px; top: 8px; bottom: 8px; width: 2px; background: var(--linha); }
.fx-dia-i { display: grid; grid-template-columns: 50px 1fr; gap: 18px; align-items: center; margin-bottom: 10px; position: relative; }
.fx-dia-i time { font-family: var(--f-tit); font-weight: 700; font-size: 1.05rem; color: var(--petroleo); text-align: right; font-variant-numeric: tabular-nums; }
.fx-dia-i::after { content: ""; position: absolute; left: 53px; width: 12px; height: 12px; border-radius: 50%; background: var(--sup); border: 3px solid var(--linha); }
.fx-dia-i.st-espera::after { border-color: var(--ouro); background: var(--ouro); }
.fx-dia-i.st-em_atend::after { border-color: var(--px); background: var(--px); }
.fx-dia-i.st-atendido::after { border-color: var(--px); }
.fx-dia-i.st-falta::after, .fx-dia-i.st-faltou::after { border-color: var(--mal); }
.fx-dia-c { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--sup); border: 1px solid var(--linha); border-radius: 14px; padding: 12px 14px; cursor: pointer; box-shadow: var(--sombra-l); color: var(--tinta); }
.fx-dia-c:hover { border-color: var(--px); }
.st-espera .fx-dia-c { border-color: #f0cf6a; background: linear-gradient(90deg, #fff8e1, var(--sup) 40%); }
.st-atendido .fx-dia-c { opacity: .72; }
.fx-btn-ouro { background: var(--ouro); color: var(--ouro-t); border-color: var(--ouro); font-weight: 700; }
.fx-btn-ouro:hover { background: #ffc61a; }
.fx-feito { font-size: .82rem; color: var(--px); font-weight: 700; }
.fx-dia-vazio { background: var(--sup); border: 1px dashed var(--linha); border-radius: 14px; padding: 22px; }
.fx-dia-vazio p:first-child { font-weight: 700; }
.fx-home-lado { display: flex; flex-direction: column; gap: 14px; }
.fx-pv-l { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.fx-pv-l b { font-family: var(--f-tit); font-size: 1.25rem; margin-right: 4px; }
.fx-pv-l summary { cursor: pointer; }
.fx-pv-l > div { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.pv-espera { background: #fff4cf; }
.pv-ret { background: var(--mal-s); } .pv-ret b { color: var(--mal); }
.pv-orc { background: var(--c-cir-s); } .pv-orc b { color: var(--c-cir); }
.fx-mini { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--tinta); font-weight: 600; }
.fx-mini:hover { background: rgb(255 255 255 / .7); }
.fx-mini small { margin-left: auto; color: var(--aco); font-weight: 500; white-space: nowrap; }
.fx-recentes { display: flex; flex-direction: column; }
.fx-recentes .fx-mini:hover { background: var(--bg); }
.fx-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.fx-pac { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--sup); border: 1px solid var(--linha); border-radius: 14px; padding: 10px 12px; cursor: pointer; color: var(--tinta); }
.fx-pac:hover { border-color: var(--px); box-shadow: var(--sombra-l); }
.fx-ini { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--px-suave); color: var(--px); font-family: var(--f-tit); font-weight: 800; flex: none; font-size: .92rem; letter-spacing: .02em; }
.fx-ini-p { width: 30px; height: 30px; font-size: .74rem; }
.fx-pac-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fx-pac-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-pac-t small { color: var(--aco); }
.fx-pac-dir { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fx-vazio { padding: 10px 2px; }

/* ---------- ficha: capa do paciente ---------- */
.fx { display: flex; flex-direction: column; gap: 16px; }
.fx-capa { position: relative; background: var(--petroleo); color: #e6f2ef; border-radius: 20px; padding: 18px 22px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 22px; align-items: end; box-shadow: var(--sombra); overflow: hidden; }
.fx-capa::after { content: ""; position: absolute; inset: auto -40px -120px auto; width: 280px; height: 280px; border-radius: 50%; border: 40px solid rgb(127 214 198 / .07); pointer-events: none; }
.fx-voltar { grid-column: 1 / -1; justify-self: start; background: none; border: 0; color: #9ed7cd; font-weight: 700; cursor: pointer; padding: 0; }
.fx-voltar:hover { color: #fff; }
.fx-capa-l { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.fx-ini-g { width: 62px; height: 62px; font-size: 1.3rem; background: #e6f2ef; color: var(--petroleo); box-shadow: 0 0 0 4px rgb(242 183 5 / .9); }
.fx-id { min-width: 0; }
.fx-id h1 { font-family: var(--f-nome); font-style: italic; font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.08; color: #fff; letter-spacing: -.01em; }
.fx-id p { color: #b9d8d2; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.fx-id p b { color: #fff; }
.fx-id p span.fx-it { white-space: nowrap; }
.fx-meta { font-size: .88rem; color: #8fc2b9 !important; }
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fx-chip { font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .1); color: #e6f2ef; }
.fx-capa .fx-chip.mal { background: #e2563f; color: #fff; }
.fx-capa .fx-chip.at { background: #f7d673; color: #3d2c00; }
.fx-capa .fx-chip.ok { background: #bfe7dc; color: #0b3c35; }
.fx-cab-acoes { display: flex; flex-direction: column; align-items: stretch; gap: 8px; position: relative; z-index: 1; }
.fx-atender { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.05rem; font-weight: 800; padding: 14px 26px; border-radius: 14px; background: var(--ouro); color: var(--ouro-t); border: 0; box-shadow: 0 8px 22px rgb(242 183 5 / .32); }
.fx-atender:hover { background: #ffc61a; }
.fx-atender svg { width: 22px; height: 22px; }
.fx-rapidos { display: flex; gap: 6px; }
.fx-rapidos button { flex: 1; background: rgb(255 255 255 / .1); color: #e6f2ef; border: 1px solid rgb(255 255 255 / .16); border-radius: 10px; padding: 7px 10px; font-weight: 600; cursor: pointer; }
.fx-rapidos button:hover { background: rgb(255 255 255 / .2); }

/* ---------- ficha: corpo ---------- */
.fx-corpo { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.fx-corpo.fx-n1 { grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr); }
.fx-corpo.fx-n2 { grid-template-columns: 200px repeat(2, minmax(0, 1fr)); }
.fx-corpo.fx-n3 { grid-template-columns: 200px repeat(3, minmax(0, 1fr)); }
.fx-corpo.fx-n2 > .fx-main, .fx-corpo.fx-n3 > .fx-main { display: none; }
.fx-rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow: auto; padding: 2px; }
.fx-rail-g { display: flex; flex-direction: column; gap: 1px; }
.fx-rail h3 { font-size: .78rem; font-weight: 700; color: var(--aco); margin: 0 10px 4px; }
.fx-r { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; font-weight: 600; color: var(--tinta); }
.fx-r svg { width: 19px; height: 19px; flex: none; color: var(--aco); }
.fx-r:hover { background: var(--sup); }
.fx-r:hover svg { color: var(--px); }
.g-ver .fx-r[aria-pressed="true"] { background: var(--sup); color: var(--px); box-shadow: inset 3px 0 0 var(--px), var(--sombra-l); }
.g-ver .fx-r[aria-pressed="true"] svg { color: var(--px); }
.g-documentos .fx-r svg { color: var(--c-doc); }
.g-cirurgia .fx-r svg { color: var(--c-cir); }
.g-ver .fx-r svg { color: var(--c-exame); }
.fx-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fx-card { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sombra-l); }
.fx-card h2 { color: var(--petroleo); }
.fx-card h2 small { font-weight: 500; color: var(--aco); font-size: .84rem; margin-left: 6px; }
.fx-resumo { background: #f4fbf9; border-color: #cfe7e0; }
.fx-resumo .txt-clin { white-space: pre-line; font-family: var(--f-txt); font-weight: 500; font-size: 1.02rem; line-height: 1.6; padding-left: 14px; border-left: 3px solid var(--px); }
.fx-pend { padding: 12px 14px; }
.fx-pend h2 { font-size: .95rem; }
.fx-pend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fx-pend li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--bg); }
.fx-pend li.at { background: var(--at-s); color: #5a3600; }
.fx-pend li.mal { background: var(--mal-s); color: #7a1f12; }
.fx-pend li.ok { background: var(--ok-s); color: #114a2a; }
.fx-tl-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fx-dica { font-size: .82rem; }
.fx-ul { margin: 0; padding-left: 18px; }
.fx-painel { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--raio); display: flex; flex-direction: column; position: sticky; top: 16px; max-height: calc(100vh - 32px); min-width: 0; box-shadow: var(--sombra-l); }
.fx-painel > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--linha); }
.fx-painel > header h2 { color: var(--petroleo); }
.fx-painel-c { padding: 12px 16px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }

/* ---------- linha do tempo: uma cor por tipo ---------- */
.fx-ev { --cor: var(--c-atend); --cor-s: var(--px-suave); position: relative; padding-left: 26px; }
.fx-ev.ev-exame { --cor: var(--c-exame); --cor-s: var(--c-exame-s); }
.fx-ev.ev-doc { --cor: var(--c-doc); --cor-s: var(--c-doc-s); }
.fx-ev.ev-cir { --cor: var(--c-cir); --cor-s: var(--c-cir-s); }
.fx-ev::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--linha); }
.fx-ev::after { content: ""; position: absolute; left: 2px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--cor); box-shadow: 0 0 0 3px var(--sup); }
.fx-ev details.tl { border: 1px solid transparent; border-left: 0; border-radius: 12px; padding: 8px 12px; margin: 0 0 6px; }
.fx-ev details.tl:hover { background: var(--cor-s); }
.fx-ev details.tl[open] { background: var(--sup); border-color: var(--linha); box-shadow: inset 4px 0 0 var(--cor), var(--sombra-l); }
.fx-ev details.tl > summary .tl-cab b { color: var(--cor); font-size: 1rem; }
.fx-ev details.tl > summary::after { color: var(--cor); }
.fx-ev .tl-corpo .rot { color: var(--cor); text-transform: none; letter-spacing: 0; font-size: .82rem; }
.fx-ano { font-family: var(--f-nome); font-style: italic; font-weight: 600; font-size: 1.2rem; color: var(--petroleo); margin: 10px 0 4px; padding-left: 26px; }
.tl-filtros button[aria-pressed="true"] { background: var(--petroleo); border-color: var(--petroleo); }

/* exames */
.fx-grade table { border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.fx-grade th, .fx-grade td { padding: 5px 9px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.fx-grade thead th { position: sticky; top: 0; background: var(--sup); font-family: var(--f-tit); font-size: .82rem; color: var(--c-exame); text-transform: none; letter-spacing: 0; }
.fx-grade thead th small { display: block; color: var(--aco); font-weight: 400; }
.fx-grade .fx-fixo { position: sticky; left: 0; background: var(--sup); text-align: left; z-index: 1; }
.fx-grade tbody th { text-transform: none; letter-spacing: 0; font-family: var(--f-txt); font-size: .86rem; }
.fx-grade tbody th small { color: var(--aco); font-weight: 400; }
.fx-fora { color: var(--mal); font-weight: 700; background: var(--mal-s); }
.fx-grade td.num { border-radius: 0; }
.fx-grade tbody tr:hover td, .fx-grade tbody tr:hover th { background: var(--c-exame-s); }
.fx-seta { margin-left: 2px; }
.fx-grafs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fx-graf { margin: 0; border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px; background: var(--sup); }
.fx-graf figcaption b { color: var(--c-exame); font-family: var(--f-tit); }
.fx-graf figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: .88rem; }
.fx-graf figcaption small, .fx-graf figcaption span { color: var(--aco); font-size: .78rem; }
.fx-graf figcaption span { margin-left: auto; }
.fx-graf svg { width: 100%; height: auto; display: block; }
.fx-cons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fx-cons li { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--linha); border-radius: 8px; }
.fx-cons li small { grid-column: 1 / -1; color: var(--aco); }

/* atendimento em tela cheia */
body.fx-at-aberto { overflow: hidden; }
.fx-at { position: fixed; inset: 0; z-index: 19; background: var(--bg); display: flex; flex-direction: column; }
.fx-at-topo { display: flex; align-items: center; gap: 14px; padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 12px; background: var(--petroleo); color: #e6f2ef; }
.fx-at-topo .btn { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .2); color: #fff; }
.fx-at-topo .btn small { color: #9ed7cd; font-weight: 500; }
.fx-at-topo .fx-chip.mal { background: #e2563f; color: #fff; }
.fx-at-topo .fx-chip { background: rgb(255 255 255 / .12); color: #e6f2ef; }
.fx-at-id { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; flex: 1; min-width: 0; }
.fx-at-id h2 { font-family: var(--f-nome); font-style: italic; font-weight: 600; font-size: 1.55rem; color: #fff; }
.fx-at-id > span:not(.fx-chip) { color: #b9d8d2; }
.fx-at-tempo { font-family: var(--f-tit); font-weight: 700; font-size: .9rem; color: var(--petroleo); background: #bfe7dc; border-radius: 999px; padding: 4px 12px; }
.fx-at-corpo { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); }
.fx-at-ed { overflow: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.fx-at-lado { overflow: hidden; border-left: 1px solid var(--linha); background: var(--sup); display: flex; flex-direction: column; min-height: 0; }
.fx-at-abas { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--linha); }
.fx-at-abas button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; font-weight: 700; color: var(--aco); cursor: pointer; }
.fx-at-abas button[aria-selected="true"] { color: var(--px); border-color: var(--px); }
.fx-at-lado-c { overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fx-at-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.fx-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--bg); border: 1px solid var(--linha); border-radius: 10px; padding: 3px; }
.fx-seg button { border: 0; background: none; border-radius: 7px; padding: 7px 12px; font-weight: 600; cursor: pointer; color: var(--tinta); }
.fx-seg button[aria-checked="true"] { background: var(--px); color: var(--px-tinta); box-shadow: 0 2px 6px rgb(15 122 114 / .25); }
.fx-data { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--aco); }
.fx-data input { width: auto; }
.fx-at-texto-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fx-at-texto-cab label { margin: 0; }
.fx-at-texto { font-size: 1.02rem; line-height: 1.6; min-height: 320px; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--linha); font-family: var(--f-txt); }
.fx-at-texto:focus { border-color: var(--px); outline: none; box-shadow: 0 0 0 4px var(--px-suave); }
kbd { font-family: var(--f-mono); font-size: .7rem; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; opacity: .75; }
.fx-blocos { display: flex; flex-direction: column; gap: 10px; }
.fx-bloco { position: relative; background: var(--sup); border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px; }
.fx-bloco-t { border: 0 !important; padding: 0 28px 4px 0 !important; font-family: var(--f-tit); font-weight: 700; color: var(--px); background: none !important; }
.fx-bloco { box-shadow: inset 4px 0 0 var(--px-suave); }
.fx-bloco textarea { border: 0; padding: 0; min-height: 0; resize: vertical; line-height: 1.55; }
.fx-bloco textarea:focus, .fx-bloco-t:focus { outline: none; }
.fx-bloco:focus-within { border-color: var(--px); }
.fx-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 1.2rem; color: var(--aco); cursor: pointer; }
.fx-ex, .fx-ret { border: 1px solid var(--linha); border-radius: 12px; padding: 10px 14px 12px; background: var(--sup); display: flex; flex-direction: column; gap: 8px; }
.fx-ex legend, .fx-ret legend { font-weight: 700; padding: 0 6px; }
.fx-ex table { font-size: .9rem; }
.fx-ex td { padding: 2px 10px 2px 0; }
.fx-ret .obrig { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mal); margin-left: 4px; }
.fx-ret.fx-alerta { border-color: var(--mal); box-shadow: 0 0 0 4px var(--mal-s); }
.fx-mais summary { cursor: pointer; color: var(--px); font-weight: 600; }
.fx-chk { display: flex; gap: 8px; align-items: flex-start; color: var(--tinta); font-weight: 500; margin: 0; }
.fx-at-fim { position: sticky; bottom: -24px; z-index: 2; background: var(--bg); margin: 0 -20px; padding: 12px 20px 14px; border-top: 1px solid var(--linha); align-items: center; box-shadow: 0 -8px 16px rgb(19 35 58 / .05); }
.fx-final { font-size: 1.05rem; padding: 13px 24px; background: var(--ouro) !important; border-color: var(--ouro) !important; color: var(--ouro-t) !important; font-weight: 800; border-radius: 12px; box-shadow: 0 8px 20px rgb(242 183 5 / .28); }
.fx-at-docs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px dashed var(--linha); padding-top: 12px; }
.fx-at-docs > span { color: var(--aco); font-size: .85rem; font-weight: 600; margin-right: 4px; }
.fx-rasc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.fx-at-aberto .gaveta { z-index: 23; }
body.fx-at-aberto .veu { z-index: 22; }

/* documentos */
.fx-doc { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.fx-doc-f { display: flex; flex-direction: column; gap: 12px; }
.fx-doc-p { display: flex; flex-direction: column; gap: 14px; align-items: center; background: var(--bg); border-radius: 12px; padding: 14px; max-height: calc(100vh - 140px); overflow: auto; }
.fx-doc-p .papel-doc { width: 100%; }
.fx-doc-acoes { position: sticky; bottom: -18px; background: var(--sup); padding: 10px 0; }
.fx-chips-sel { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-chips-sel button { border: 1px solid var(--linha); background: var(--sup); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-weight: 600; font-size: .86rem; }
.fx-chips-sel button[aria-pressed="true"] { background: var(--px); border-color: var(--px); color: var(--px-tinta); }
.fx-kit { line-height: 2; font-size: 1rem; padding: 8px 0; }
.fx-doc-ident { font-size: .85rem; }
.fx-slots { display: flex; flex-direction: column; gap: 8px; }
.fx-slot-dia { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
.fx-slot-dia > div { display: flex; flex-wrap: wrap; gap: 4px; }
.fx-lanc { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 6px; }
@media print { body.imp-doc .papel-doc { box-shadow: none; max-width: none; break-after: page; min-height: 0; } body.imp-doc .papel-doc:last-child { break-after: auto; } body.imp-doc .fx-at { position: static; } }

/* celular e tablet */
@media (max-width: 1100px) {
  .fx-corpo, .fx-corpo.fx-n1, .fx-corpo.fx-n2, .fx-corpo.fx-n3 { grid-template-columns: 1fr; overflow: visible; }
  .fx-rail { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .fx-home-grade { grid-template-columns: 1fr; }
  .fx-rail-g { flex: 1 1 220px; }
  .fx-painel { position: static; max-height: 70vh; }
  .fx-at-corpo { grid-template-columns: 1fr; overflow: auto; }
  .fx-at-ed { overflow: visible; }
  .fx-at-lado { border-left: 0; border-top: 1px solid var(--linha); min-height: 60vh; }
  .fx-doc { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .fx-capa { grid-template-columns: minmax(0, 1fr); padding: 16px; border-radius: 16px; }
  .fx-ini-g { width: 48px; height: 48px; font-size: 1.05rem; }
  .fx-home-grade { grid-template-columns: 1fr; }
  .fx-id { min-width: 0; }
  .fx-voltar { justify-self: start; }
  .fx-cab-acoes .fx-atender { width: 100%; }
  .fx-lista { grid-template-columns: 1fr; }
  .fx-rail { gap: 10px; }
  .fx-rail-g { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; }
  .fx-rail h3 { flex-basis: 100%; }
  .fx-r { flex: 1 1 calc(50% - 4px); background: var(--sup); font-size: .86rem; padding: 8px; }
  .fx-at-topo { flex-wrap: wrap; }
  .fx-lanc { grid-template-columns: 1fr 1fr; }
}
/* orçamento: combinação e internação */
.oc-combo { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.oc-combo label { display: flex; align-items: center; gap: 6px; color: var(--tinta); font-weight: 500; margin: 0; }
.oc-intern { background: var(--px-suave); border-radius: 8px; padding: 6px 10px; }
.fx .tl-filtros, .fx-at .tl-filtros { flex-wrap: wrap; overflow: visible; }
.oc-combo input[type="radio"] { width: auto !important; padding: 0 !important; border: 0 !important; }

/* ---------- atendimento por quadros ---------- */
.fx-org { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px dashed var(--linha); border-radius: 10px; padding: 7px 11px; color: var(--aco); font-weight: 600; cursor: pointer; }
.fx-org:hover { border-color: var(--px); color: var(--px); }
.fx-org svg, .fx-livre summary svg { width: 18px; height: 18px; vertical-align: -4px; }
.fx-livre { background: linear-gradient(135deg, #f1faf7, #fff); border: 1px solid #cfe7e0; border-radius: 14px; padding: 10px 14px; }
.fx-livre summary { cursor: pointer; color: var(--aco); list-style: none; }
.fx-livre summary::-webkit-details-marker { display: none; }
.fx-livre summary b { color: var(--px); }
.fx-livre[open] summary { margin-bottom: 8px; }
.fx-livre textarea { border-radius: 10px; font-size: 1rem; line-height: 1.55; }
.fx-qs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fx-q { background: var(--sup); border: 1px solid var(--linha); border-radius: 14px; padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, box-shadow .15s; }
.fx-q:focus-within { border-color: var(--px); box-shadow: 0 0 0 4px var(--px-suave); }
.fx-q.cheio { border-left: 4px solid var(--px); }
.fx-q header { display: flex; align-items: center; gap: 8px; }
.fx-q h3 { font-size: .9rem; color: var(--petroleo); flex: 1; }
.fx-q textarea, .fx-q input { border: 0 !important; padding: 2px 0 !important; min-height: 0; resize: vertical; line-height: 1.55; background: none !important; font-size: .98rem; }
.fx-q textarea:focus, .fx-q input:focus { outline: none; }
.fx-q.q-resumo, .fx-q.q-cid, .fx-q.q-lab { grid-column: 1 / -1; }
.fx-q.q-resumo { background: #f4fbf9; border-color: #cfe7e0; }
.fx-q.q-resumo textarea { font-weight: 500; }
.fx-q.q-cid { background: #f6f4fb; border-color: #dcd6f0; }
.fx-q.q-cid h3 { color: var(--c-cir); }
.fx-q.q-lab { background: #f5f6fd; border-color: #dadff7; }
.fx-q.q-lab h3 { color: var(--c-exame); }
.fx-cid-in { border-top: 1px dashed var(--linha) !important; padding-top: 6px !important; font-weight: 600; color: var(--c-cir); }
.fx-q-b { background: var(--bg); border: 0; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 700; color: var(--aco); cursor: pointer; }
.fx-q-b:hover { background: var(--px-suave); color: var(--px); }
.fx-ant-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fx-ant-nav span { text-align: center; display: flex; flex-direction: column; font-family: var(--f-tit); }
.fx-ant-nav small { color: var(--aco); font-family: var(--f-txt); }
.fx-ant { border: 1px solid var(--linha); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: #fff; box-shadow: inset 4px 0 0 var(--c-atend); }
.fx-ant h4 { margin: 0; font-size: .82rem; color: var(--px); }
.fx-ant-copiar { align-self: flex-start; }
.fx-lanc2 { display: flex; flex-direction: column; gap: 10px; }
.fx-lanc2 table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fx-lanc2 th { text-align: left; font-size: .78rem; color: var(--c-exame); padding: 4px; }
.fx-lanc2 td { padding: 3px 4px; }
.fx-lanc2 td input { padding: 6px 8px; border-radius: 8px; }
.fx-lanc2 td:nth-child(2) input { font-weight: 700; color: var(--c-exame); }
.fx-lanc2 td.mut { font-size: .78rem; white-space: nowrap; }
.fx-qed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fx-qed li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 1px solid var(--linha); border-radius: 12px; padding: 8px; }
.fx-qed-l { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; flex: 1 1 420px; }
.fx-qed-b { display: flex; gap: 4px; }
/* diagnósticos */
.fx-duas { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fx-duas > :only-child { grid-column: 1 / -1; }
.fx-dg ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fx-dg li button { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 7px 8px; cursor: pointer; color: var(--tinta); }
.fx-dg li button:hover { background: var(--c-cir-s); }
.fx-dg li.res { opacity: .55; }
.fx-cid { font-family: var(--f-tit); font-weight: 800; color: #fff; background: var(--c-cir); border-radius: 8px; padding: 2px 8px; font-size: .85rem; }
.fx-dg small { color: var(--aco); }
/* documentos: saída e envio */
.fx-doc-acoes { display: flex; flex-direction: column; gap: 8px; }
.fx-saida { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-envio { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-envio .btn.pri { background: #1f9d55; border-color: #1f9d55; }
.fx-doc-pac { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.fx-doc-pac span { color: var(--aco); font-size: .88rem; }
.fx-kit-ed { display: flex; flex-direction: column; gap: 8px; }
.fx-kit-ed fieldset { border: 1px solid var(--linha); border-radius: 12px; padding: 6px 10px 10px; }
.fx-kit-t { border: 0 !important; padding: 0 !important; font-weight: 700; background: none !important; width: auto !important; min-width: 220px; }
.fx-novo-bt { border-style: dashed !important; color: var(--px); }
@media (max-width: 900px) { .fx-qs, .fx-duas { grid-template-columns: 1fr; } .fx-qed-l { grid-template-columns: 1fr; } }

/* ---------- orçamento: editor e proposta ---------- */
.oc-ed { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 18px; align-items: start; }
.oc-ed-f { display: flex; flex-direction: column; gap: 12px; }
.oc-ed-p { background: var(--bg); border-radius: 14px; padding: 14px; display: flex; justify-content: center; max-height: calc(100vh - 130px); overflow: auto; }
.oc-ed-p .papel-doc { width: 100%; max-width: 680px; }
.oc-combo-box { position: relative; }
.oc-res { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 300px; overflow: auto; }
.oc-res:empty { display: none; }
.oc-res-i { display: grid; grid-template-columns: 1fr; gap: 2px; text-align: left; background: var(--sup); border: 1px solid var(--linha); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--tinta); }
.oc-res-i:hover, .oc-res-i:focus-visible { border-color: var(--px); background: var(--px-suave); }
.oc-res-i span { font-size: .84rem; color: var(--aco); display: inline; margin-right: 12px; }
.oc-res-i span i { font-style: normal; font-weight: 700; color: var(--px); margin-right: 3px; }
.oc-res-i b + span { margin-top: 2px; }
.oc-res-i { grid-template-columns: 1fr auto auto auto; align-items: baseline; }
.oc-res-i b { grid-column: 1 / -1; }
.oc-escolhidos { display: flex; flex-direction: column; gap: 6px; }
.oc-esc { display: grid; grid-template-columns: 1fr auto 64px auto; gap: 8px; align-items: center; background: var(--sup); border: 1px solid var(--linha); border-left: 4px solid var(--c-cir); border-radius: 10px; padding: 8px 10px; }
.oc-esc small { display: block; color: var(--aco); font-size: .8rem; }
.oc-esc-v { font-family: var(--f-tit); font-weight: 700; color: var(--c-cir); white-space: nowrap; }
.oc-x { background: none; border: 0; font-size: 1.3rem; color: var(--aco); cursor: pointer; }
.oc-pct { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.oc-pct button { border: 1px solid var(--linha); background: var(--sup); border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.oc-pct button[aria-pressed="true"] { background: var(--c-cir); border-color: var(--c-cir); color: #fff; }
.oc-pct-l { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--aco); }
.oc-pct-l input { width: 80px !important; }
.oc-ed-acoes { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-p-pac { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.oc-p-pac span { color: #5b6879; font-size: .88rem; }
.oc-p-tab { width: 100%; border-collapse: collapse; }
.oc-p-tab th { text-align: left; font-size: .78rem; color: #5b6879; border-bottom: 2px solid var(--cor-doc, #0f7a72); padding: 6px 4px; }
.oc-p-tab td { padding: 8px 4px; border-bottom: 1px solid #e4e9ec; vertical-align: top; }
.oc-p-tab td small { display: block; color: #5b6879; font-size: .78rem; }
.oc-p-tab .num { text-align: right; white-space: nowrap; font-weight: 600; }
.oc-p-pag { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.oc-p-pag > div { border: 1px solid #dfe6e4; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.oc-p-pag span { font-size: .8rem; color: #5b6879; }
.oc-p-pag b { font-size: 1.15rem; color: #13262e; }
.oc-p-pag small { color: #5b6879; font-size: .76rem; }
.oc-p-dest { background: #f2faf8; border-color: var(--cor-doc, #0f7a72) !important; }
.oc-p-dest b { color: var(--cor-doc, #0f7a72) !important; }
.oc-p-cond { font-size: .84rem; color: #3c4b52; }
.oc-p-cond ul { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 1000px) { .oc-ed { grid-template-columns: 1fr; } }
