/* SGQIA - acabamento final de interface / 2026-10-29
 * Aplica apenas na area autenticada de laboratorios e do Super Master.
 * Preserve regras, textos, status e campos de negocio existentes.
 */
:root { --sgqf-field-height: 40px; --sgqf-control-radius: 9px; --sgqf-gap: 14px; }
.platform-content, .owner-content { min-width: 0; }
.platform-content *, .owner-content * { box-sizing: border-box; }
.platform-content :is(h1,h2,h3,p), .owner-content :is(h1,h2,h3,p) { overflow-wrap: break-word; }
.platform-content :is(.panel,.lean-space,.sgqrd-pane,.sgqp-pane,.sgqe-panel,.sgqf-panel,.sgq45-panel,.sgq41-team-panel,.sgq-center-panel),
.owner-content :is(.panel,.owner-card,.owner-org-card) { min-width:0; }

/* Hierarquia: separacao discreta dos grupos e cabecalhos, sem novas caixas internas. */
.platform-content :is(.page-head,.lean-header,.sgqe-heading,.sgqr-heading,.sgq41-heading,.sgqa-heading,.sgqrd-head,.sgq45-title,.sgqcat-head,.sgqrev-header,.sgqo-head),
.owner-content :is(.page-head,.owner-page-head) { gap: clamp(12px, 2vw, 22px); align-items: flex-start; }
.platform-content :is(.page-head,.lean-header,.sgqe-heading,.sgqr-heading,.sgq41-heading,.sgqa-heading,.sgqrd-head,.sgq45-title,.sgqcat-head,.sgqrev-header,.sgqo-head) h1,
.owner-content :is(.page-head,.owner-page-head) h1 { line-height:1.18; letter-spacing:-.025em; text-wrap: balance; }
.platform-content :is(.panel-head,.sgqe-panel-heading,.sgq45-panel .panel-head,.sgqa-section-head),
.owner-content .panel-head { gap:12px; align-items:center; }
.platform-content :is(.panel-head,.sgqe-panel-heading) h2,
.owner-content .panel-head h2 { line-height:1.3; }

/* Controles: altura minima coerente, bom foco e nenhum corte de rotulo. */
.platform-content :is(button,.btn,[role="button"],input[type="submit"],input[type="button"]),
.owner-content :is(button,.btn,[role="button"],input[type="submit"],input[type="button"]) {
  max-width:100%; min-width:0; line-height:1.35; white-space:normal;
  overflow-wrap:break-word; text-align:center;
}
.platform-content :is(button,.btn,[role="button"],input[type="submit"],input[type="button"]):not(.small),
.owner-content :is(button,.btn,[role="button"],input[type="submit"],input[type="button"]):not(.small) { min-height: 36px; }
.platform-content :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible,
.owner-content :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
  outline: 3px solid #1a7c69; outline-offset: 3px;
}
.platform-content :is(a,button),.owner-content :is(a,button) { -webkit-tap-highlight-color:transparent; }

/* Formularios de operacao: campos inteiros, sem sair dos paineis. */
.platform-content :is(.form-grid,.sgqe-form,.sgqa-form-grid,.sgqr-fields,.sgq45-form,.sgqo-form,.sgqp-pane form,.sgqrd-pane form),
.owner-content :is(.form-grid,.owner-form) { min-width:0; }
.platform-content :is(.form-grid,.sgqe-form,.sgqa-form-grid,.sgqr-fields,.sgq45-form,.sgqo-form) > *,
.owner-content :is(.form-grid,.owner-form) > * { min-width:0; }
.platform-content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),select,textarea),
.owner-content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),select,textarea) {
  max-width:100%; min-width:0; font:inherit;
}
.platform-content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]),select),
.owner-content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]),select) {
  min-height:var(--sgqf-field-height);
}
.platform-content :is(textarea),.owner-content :is(textarea) { line-height:1.45; resize:vertical; }
.platform-content label,.owner-content label { min-width:0; }
.platform-content :is(.sgqr-step-nav,.sgqe-actions,.sgq45-form-foot,.page-actions,.sgq45-head-buttons,.sgqrd-actions),
.owner-content :is(.page-actions,.owner-actions) { gap:10px; flex-wrap:wrap; }

/* Tabelas e listas: leitura e estabilidade em nomes/codigos compridos. */
.platform-content :is(.table-wrap,.sgq8-audit-table,.sgqr-table-wrap),
.owner-content :is(.table-wrap,.owner-table-wrap) {
  max-width:100%; overflow-x:auto; overscroll-behavior-x:contain;
}
.platform-content table,.owner-content table { border-collapse:separate; border-spacing:0; }
.platform-content :is(.table-wrap,.sgq8-audit-table) table :is(th,td),
.owner-content .table-wrap table :is(th,td) { vertical-align:middle; }
.platform-content :is(.table-wrap,.sgq8-audit-table) table th,
.owner-content .table-wrap table th { white-space:nowrap; font-weight:700; }
.platform-content :is(.table-wrap,.sgq8-audit-table) table tbody tr:hover,
.owner-content .table-wrap table tbody tr:hover { background-color:rgba(22,95,73,.035); }
.platform-content :is(.lean-task,.sgq45-line,.sgqe-equipment,.sgq41-person,.sgqrd-list-row,.sgqrev-item,.sgqcat-card),
.owner-content :is(.owner-task,.owner-org-row,.master-card) { min-width:0; }
.platform-content :is(.lean-task,.sgq45-line,.sgqe-equipment,.sgqrev-item,.sgqcat-card) :is(strong,small),
.owner-content :is(.owner-task,.master-card) :is(strong,small) { overflow-wrap:anywhere; }

/* Expansiveis: foco consistente e texto alinhado sem impor padding aos details antigos. */
.platform-content details > summary,
.owner-content details > summary { cursor:pointer; }
.platform-content details > summary::marker,
.owner-content details > summary::marker { color:#307b66; }
.platform-content :is(.sgqe-advanced,.sgqr-disclosure,.sgqa-detail,.sgq45-panel,.sgq47-pending-details,.sgqrd-disclosure) > summary,
.owner-content details > summary { min-height:42px; align-content:center; }
.platform-content :is(.sgqe-advanced,.sgqr-disclosure,.sgqa-detail) > summary {
  overflow-wrap:anywhere;
}
.platform-content details[open] > summary,
.owner-content details[open] > summary { scroll-margin-top:90px; }

/* Indicadores: numeros legiveis, espacos contidos. */
.platform-content :is(.sgqe-metrics,.sgq41-metrics,.sgq45-stats,.sgqr-summary,.sgqo-metrics,.sgqa-stats,.sgq8-metrics),
.owner-content :is(.owner-stats,.sgq-center-stats) { gap:12px; min-width:0; }
.platform-content :is(.sgqe-metrics,.sgq41-metrics,.sgq45-stats,.sgqr-summary,.sgqo-metrics,.sgqa-stats,.sgq8-metrics) > *,
.owner-content :is(.owner-stats,.sgq-center-stats) > * { min-width:0; }

/* Atalhos discretos para paginas longas: nao alteram formularios. */
.sgqf-top-button {
  position:fixed; z-index:80; right:20px; bottom:20px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  min-height:40px; padding:8px 13px; border:1px solid #bbd6c9;
  border-radius:999px; background:#fff; color:#145f46;
  font:600 12px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif;
  box-shadow:0 5px 18px rgba(15,48,34,.14); cursor:pointer;
  transition:opacity .16s ease,transform .16s ease;
}
.sgqf-top-button[hidden] { display:none !important; }
.sgqf-top-button:focus-visible { outline:3px solid #1a7c69; outline-offset:3px; }
.sgqf-top-button:hover { background:#f1f8f4; }

/* Telas estreitas: evitar dois botoes espremidos ao lado do titulo. */
@media (max-width:780px) {
  .platform-content :is(.page-head,.lean-header,.sgqe-heading,.sgqr-heading,.sgq41-heading,.sgqa-heading,.sgqrd-head,.sgq45-title,.sgqcat-head,.sgqrev-header,.sgqo-head),
  .owner-content :is(.page-head,.owner-page-head) { align-items:stretch; }
  .platform-content :is(.page-actions,.sgq45-head-buttons,.sgqe-actions-row,.sgqrd-actions,.sgqr-step-nav),
  .owner-content .page-actions { display:flex; flex-wrap:wrap; align-items:stretch; gap:9px; }
  .platform-content :is(.form-grid.two,.sgq45-form .form-grid,.sgqe-form,.sgqa-form-grid),
  .owner-content .form-grid.two { min-width:0; }
  .platform-content :is(.sgqe-filters,.sgq41-toolbar,.sgqr-form-step),
  .owner-content :is(.owner-toolbar) { max-width:100%; }
  .platform-content :is(.lean-task,.sgq45-line) > form { max-width:100%; }
  .sgqf-top-button { right:12px; bottom:12px; }
}
@media (max-width:540px) {
  .platform-content :is(.page-actions,.sgq45-head-buttons,.sgqr-step-nav) > :is(a,button),
  .owner-content .page-actions > :is(a,button) { flex-grow:1; }
  .platform-content :is(.sgqe-metrics,.sgq41-metrics,.sgq45-stats,.sgqr-summary,.sgqo-metrics,.sgqa-stats,.sgq8-metrics) > *,
  .owner-content :is(.owner-stats,.sgq-center-stats) > * { min-width:0; }
  .sgqf-top-button { padding:11px; }
  .sgqf-top-button .sgqf-top-label { display:none; }
}
@media (prefers-reduced-motion:reduce) {
  .sgqf-top-button { transition:none; }
}
@media print { .sgqf-top-button { display:none !important; } }
