/* ProntoFlow — abas internas da ficha do paciente (reforma do layout D094/D098). Só var(--...) de tokens.css; carregado depois de layout.css. */
/* Cartão único: o painel das abas só tem seções separadas por divisória. O menu "…" das linhas não pode ser cortado. */
.ficha-conteudo { overflow: visible; min-width: 0; max-width: 100%; }
/* Celular/tablet: uma coluna que NÃO cresce com o conteúdo (1fr sozinho vale minmax(auto, 1fr) e abria a ficha até caber as 7 abas). */
.ficha-grade > * { min-width: 0; }
@media (max-width: 1023px) { .ficha-grade { grid-template-columns: minmax(0, 1fr); } }
.ficha-conteudo .abas { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.ficha-conteudo .aba { flex: none; }
.ficha-topo, .ficha-topo .ficha-identidade > div, .ficha-topo h1 { min-width: 0; }
.ficha-topo h1 { overflow-wrap: anywhere; }
.perfil-dado, .perfil-etiquetas { min-width: 0; overflow-wrap: anywhere; }
.ficha-conteudo .abas { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.ficha-conteudo [role="tabpanel"] { padding: 0; min-width: 0; }
.fc-secao { padding: var(--s5); display: grid; gap: var(--s4); min-width: 0; }
.fc-secao + .fc-secao { border-top: 1px solid var(--border); }
.fc-secao-topo { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.fc-secao-topo h2 { margin: 0; font-size: var(--fs-16); }
.fc-ajuda { margin: 0; }
.fc-secao .campo, .fc-secao .acoes { margin: 0; }
.fc-secao .aviso { margin: 0; }

/* Dados: grade de 2 colunas, rótulo acima do valor */
.fc-dados { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s6); margin: 0; }
.fc-dados .dado-par { display: grid; gap: 2px; min-width: 0; }
.fc-dados .dado-largo { grid-column: 1 / -1; }
.fc-dados dt { font-size: var(--fs-12); font-weight: 600; color: var(--text-secondary); }
.fc-dados dd { margin: 0; font-size: var(--fs-15); overflow-wrap: anywhere; }

/* Linhas de 56 px: ícone/avatar, texto em 2 linhas, selos suaves e menu */
.fc-lista { list-style: none; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--border); }
.fc-linha { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s2) 0; border-bottom: 1px solid var(--border); position: relative; min-width: 0; }
.fc-linha:last-child { border-bottom: 0; }
.fc-linha:hover { background: var(--linha-hover); }
.fc-icone { width: 36px; height: 36px; }
.fc-texto { display: grid; flex: 1; min-width: 0; }
.fc-texto strong { font-size: var(--fs-14); overflow-wrap: anywhere; }
.fc-texto span { font-size: var(--fs-13); color: var(--text-secondary); overflow-wrap: anywhere; }
.fc-selos { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.fc-selos .selo { margin: 0; }
.fc-linha .menu-mais { top: 40px; }

/* Documentos: área de soltar. O input fica escondido (sr-only) e ligado ao label; o foco do teclado aparece na área. */
.fc-drop { display: grid; justify-items: center; gap: var(--s2); padding: var(--s6) var(--s4); text-align: center; cursor: pointer;
  border: 2px dashed var(--border-control); border-radius: var(--radius-card); background: var(--gray-50); min-height: 44px; }
.fc-drop:hover, .fc-drop-sobre { border-color: var(--primary); background: var(--primary-soft); }
.fc-drop-foco { outline: 3px solid var(--focus); outline-offset: 2px; }
.fc-drop strong { font-size: var(--fs-15); overflow-wrap: anywhere; max-width: 100%; }
.fc-drop-dica { font-size: var(--fs-13); color: var(--text-secondary); }
.fc-drop-cheio { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }

/* Consultas: tabela sem borda própria (o cartão é a caixa) */
.tabela.fc-tabela { border: 0; border-radius: 0; box-shadow: none; }
.fc-dia { display: grid; line-height: 1.25; }
.fc-dia span { font-size: var(--fs-12); color: var(--text-secondary); }
.fc-prof { display: inline-flex; align-items: center; gap: var(--s2); }
.fc-ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: none; }
.fc-ponto.prof-cor-1 { background: var(--prof-1); } .fc-ponto.prof-cor-2 { background: var(--prof-2); } .fc-ponto.prof-cor-3 { background: var(--prof-3); }
.fc-ponto.prof-cor-4 { background: var(--prof-4); } .fc-ponto.prof-cor-5 { background: var(--prof-5); } .fc-ponto.prof-cor-6 { background: var(--prof-6); }

/* Histórico: linha do tempo com pontos ligados por uma linha */
.fc-tempo { list-style: none; margin: 0; padding: 0; }
.fc-tempo li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: var(--s3); position: relative; padding-bottom: var(--s4); }
.fc-tempo li:last-child { padding-bottom: 0; }
.fc-tempo li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.fc-tempo li:last-child::before { display: none; }
.fc-tempo-ponto { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); margin-top: 3px; position: relative; z-index: 1; box-sizing: border-box; }
.fc-tempo li > div { display: grid; min-width: 0; }
.fc-tempo strong { font-size: var(--fs-14); overflow-wrap: anywhere; }
.fc-tempo li > div > span { font-size: var(--fs-13); color: var(--text-secondary); }

@media (max-width: 767px) {
  .fc-secao { padding: var(--s4); }
  .fc-dados { grid-template-columns: 1fr; gap: var(--s3); }
  .fc-linha { flex-wrap: wrap; }
  .fc-selos { order: 3; flex-basis: 100%; justify-content: flex-start; padding-left: 48px; }
  .fc-linha .mais-acoes { margin-left: auto; }
  .fc-secao:has(.fc-tabela) { overflow-x: auto; }
}
@media (pointer: coarse) { .fc-drop { min-height: 96px; } .fc-linha .btn-mais { min-height: 44px; min-width: 44px; } }

/* Aba Prontuário: um cartão por registro, no mesmo desenho das demais abas (seção da ficha + cartões com borda). */
.fc-registros { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.fc-registro { display: grid; gap: var(--s4); min-width: 0; padding: var(--s5); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.fc-registro-rascunho { border-style: dashed; }
.fc-registro-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.fc-registro-titulo { min-width: 0; }
.fc-registro-titulo h3 { margin: 0; font-size: var(--fs-16); overflow-wrap: anywhere; }
.fc-registro-titulo p { margin: 2px 0 0; font-size: var(--fs-13); }
.fc-registro-selos { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.fc-registro-selos .selo { margin: 0; }
.fc-registro .acoes { margin: 0; display: flex; justify-content: flex-end; }
.fc-registro .acoes .btn { min-height: 44px; }
@media (max-width: 767px) {
  .fc-registro { padding: var(--s4); }
  .fc-registro .acoes .btn { width: 100%; justify-content: center; }
}
