/*
  ProntSync 451 — padrão institucional único das listas clínicas.

  Esta folha é carregada depois de app.css e é a ÚNICA autoridade para:
  - altura das linhas clínicas;
  - tamanho do texto das linhas;
  - tamanho/peso do nome do paciente;
  - truncamento seguro do nome do paciente.

  Referência aprovada: fila atual do Pronto-Socorro = 42 px.
  Cores de risco, larguras de colunas, botões e ícones continuam pertencendo
  aos respectivos fluxos e não são redefinidos aqui.
*/

body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
){
  --cl-text:14px;
  --cl-patient:15px;
  --cl-row:42px;
}

/* Uma única altura para TODAS as linhas clínicas. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody tr,
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody tr.ps-risk-row{
  height:var(--cl-row)!important;
  min-height:var(--cl-row)!important;
  max-height:var(--cl-row)!important;
}

/* A célula não pode rebaixar a linha para 28 px nem impor outro padrão. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody td,
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody tr.ps-risk-row > td{
  height:var(--cl-row)!important;
  min-height:var(--cl-row)!important;
  max-height:var(--cl-row)!important;
  padding-top:4px!important;
  padding-bottom:4px!important;
  vertical-align:middle!important;
  line-height:1.15!important;
  font-size:var(--cl-text)!important;
}

/* Texto clínico: o editor antigo do PS não pode mais alterar o tamanho. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody :is(
  .ps-row-info,
  .ps-status-waiting,
  .ps-status-in-care,
  .ps-status-triage,
  .ps-status-closed
){
  font-size:var(--cl-text)!important;
  line-height:1.15!important;
}

/* Nome do paciente: regra exclusiva e realmente editável pelo editor geral. */
body:not(.login-page) .content .prontsync-patient-cell,
body:not(.login-page) .content .ps-patient-cell{
  min-width:0!important;
  overflow:hidden!important;
}
body:not(.login-page) .content .prontsync-patient-name,
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody td .prontsync-patient-name{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:var(--cl-patient)!important;
  font-weight:700!important;
  line-height:1.15!important;
}

/* Antes de applyPatientNameEllipsis() marcar o <strong>, mantém o mesmo
   padrão pelo contêiner já usado nas filas do PS. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody .ps-patient-cell > strong{
  font-size:var(--cl-patient)!important;
  font-weight:700!important;
  line-height:1.15!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}


/* ProntSync 452 — normalização final da coluna Paciente.
   O nome do paciente deve ter exatamente a mesma tipografia em todas as filas. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody td .ps-patient-cell > strong.ps-row-info,
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody td .ps-patient-cell > strong {
  font-family:Inter,"Segoe UI",Arial,sans-serif!important;
  font-size:var(--cl-patient,15px)!important;
  font-weight:700!important;
  line-height:1.15!important;
  letter-spacing:0!important;
}

/* Demais dados clínicos seguem uma única referência de 13 px. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody td > :is(.ps-row-info,.ps-status-waiting,.ps-status-in-care,.ps-status-triage,.ps-status-closed) {
  font-family:Inter,"Segoe UI",Arial,sans-serif!important;
  font-size:var(--cl-text,14px)!important;
}

/* ProntSync 453 — a Classificação de Risco usa o mesmo contêiner de paciente
   do Pronto-Socorro. Esta regra também protege o componente contra estilos
   inline salvos pelo editor visual antigo. */
body:not(.login-page) .content .triage-table tbody td .ps-patient-cell > strong.ps-row-info {
  font-family:Inter,"Segoe UI",Arial,sans-serif!important;
  font-size:var(--cl-patient,15px)!important;
  font-weight:700!important;
  line-height:1.15!important;
  letter-spacing:0!important;
}

/* ProntSync 454 — padrão institucional de cor e peso das informações clínicas.
   Dados secundários = cinza médio + seminegrito. Nome do paciente continua
   como informação principal, escuro e em negrito. Badges e botões preservam
   suas próprias cores funcionais. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
){
  --cl-info-color:#667788;
  --cl-info-weight:600;
  --cl-patient-color:#0d3557;
}

/* Todas as informações secundárias das linhas seguem o mesmo tom/peso. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody td{
  color:var(--cl-info-color)!important;
  font-weight:var(--cl-info-weight)!important;
}

body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody :is(
  .ps-row-info,
  .ps-status-waiting,
  .ps-status-in-care,
  .ps-status-triage,
  .ps-status-closed,
  .muted
){
  color:var(--cl-info-color)!important;
  font-weight:var(--cl-info-weight)!important;
}

/* O nome do paciente é a única informação textual principal da linha. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody :is(.ps-patient-cell,.prontsync-patient-cell) > strong,
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody .prontsync-patient-name{
  color:var(--cl-patient-color)!important;
  font-weight:700!important;
}

/* Classificação e ações são elementos funcionais e não recebem o cinza. */
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody .badge,
body:not(.login-page) .content :is(
  .clinical-list-table,
  .ps-queue-table,
  .triage-table,
  .dashboard-recent-table,
  .patient-list-table,
  .reception-patient-table,
  .calls-list-table
) tbody button{
  font-weight:inherit;
}

/* ProntSync 455 — nomes longos nunca invadem a coluna seguinte.
   A abreviação é SOMENTE visual: o texto completo permanece no DOM/banco e
   continua sendo usado nos modais de Triagem/PS e na chamada por voz. */
body:not(.login-page) .content :is(
  .patient-list-table,
  .reception-patient-table,
  .triage-table,
  .ps-queue-table,
  .dashboard-recent-table,
  .calls-list-table
) tbody td:has(> .ps-patient-cell),
body:not(.login-page) .content :is(
  .patient-list-table,
  .reception-patient-table,
  .triage-table,
  .ps-queue-table,
  .dashboard-recent-table,
  .calls-list-table
) tbody td:has(> .prontsync-patient-cell){
  min-width:0!important;
  overflow:hidden!important;
}

body:not(.login-page) .content :is(
  .patient-list-table,
  .reception-patient-table,
  .triage-table,
  .ps-queue-table,
  .dashboard-recent-table,
  .calls-list-table
) tbody :is(.ps-patient-cell,.prontsync-patient-cell,.clinical-patient-name-cell){
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}

body:not(.login-page) .content :is(
  .patient-list-table,
  .reception-patient-table,
  .triage-table,
  .ps-queue-table,
  .dashboard-recent-table,
  .calls-list-table
) tbody :is(.ps-patient-cell,.prontsync-patient-cell,.clinical-patient-name-cell) > strong,
body:not(.login-page) .content :is(
  .patient-list-table,
  .reception-patient-table,
  .triage-table,
  .ps-queue-table,
  .dashboard-recent-table,
  .calls-list-table
) tbody .clinical-patient-name{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}


/* ProntSync 456 — a classificação de risco é um elemento funcional colorido.
   O padrão cinza das informações secundárias nunca pode alterar o texto do badge. */
body:not(.login-page) .content :is(
  .triage-table,
  .ps-queue-table,
  .dashboard-recent-table,
  .clinical-list-table
) :is(.badge[class*="risk-"], .risk-blue, .risk-green, .risk-yellow, .risk-orange, .risk-red){
  color:#fff!important;
  font-weight:700!important;
}
