/* Self-hosted variable fonts. Files are served by the application and comply
   with the existing CSP `font-src 'self'`. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-ext-variable.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-title: "Inter", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
  --background-system: #ffffff;
  --background-surface: #ffffff;
  --background-soft: #f8fafc;
  --border-surface: #dce5f0;
  --gm-font-ui: var(--font-body);
  --gm-font-size-xs: .75rem;
  --gm-font-size-sm: .8125rem;
  --gm-font-size-base: .9375rem;
  --gm-font-size-md: 1rem;
  --gm-font-size-lg: 1.25rem;
  --gm-font-size-xl: clamp(1.5rem, 2vw, 1.75rem);
  --gm-font-size-kpi: clamp(1.625rem, 2.5vw, 2rem);
  --text-primary: #13263f;
  --text-title: #102e54;
  --text-secondary: #60738b;
  --text-muted: #718198;
  --text-placeholder: #64748b;
  --text-link: #1b609f;
  --text-success: #117a57;
  --text-warning: #a96716;
  --text-danger: #b42318;
  --text-on-accent: #fff;
  --border-default: #c8d5e3;
  --border-soft: #dce5f0;
  --border-hover: #9eb6ce;
  --border-focus: #2b6da9;
  --border-success: #63ad91;
  --border-warning: #d59a52;
  --border-danger: #d97066;
  --focus-ring: rgba(43, 109, 169, .13);
  --success-ring: rgba(17, 122, 87, .10);
  --danger-ring: rgba(180, 35, 24, .10);
  --border-subtle: var(--border-soft);
  --border-strong: var(--border-default);
  --surface: var(--background-surface);
  --surface-muted: var(--background-soft);
  --focus-ring-shadow: var(--focus-ring);
  --radius-field: 10px;
  --radius-button: 10px;
  --radius-card: 16px;
  --radius-small: 8px;
  --radius-sm: var(--radius-small);
  --radius-md: var(--radius-field);
  --radius-lg: var(--radius-card);
  --gm-text-secondary: var(--text-secondary);
  --gm-text-muted: var(--text-muted);
}

html {
  font-family: var(--gm-font-ui);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body,
.app,
.main,
.main-content {
  background: var(--background-system);
}

body {
  margin: 0;
  font-family: var(--gm-font-ui);
  color: var(--text-primary);
  font-kerning: normal;
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Superfícies brancas com separação por bordas e sombras discretas. */
body :where(.topbar, .app-header, .top-header, .site-header, .legal-header) {
  background: var(--background-surface);
  border-color: var(--border-surface);
}

body .topbar {
  padding: 12px 16px;
  border: 1px solid var(--border-surface);
  border-radius: 12px;
  background: var(--background-surface);
}

body .legal-header {
  background: var(--background-surface);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-surface);
}

body .legal-header a {
  color: #0d3b70;
}

body .legal-header p {
  color: var(--text-secondary);
}

body :where(.sidebar, form, fieldset, table) {
  background-color: var(--background-surface);
}

body :is(.fiscal-sheet, .managerial-sheet, .lc-page, .monthly-report-page) {
  background-color: var(--background-surface);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-kerning: normal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  color: var(--text-title);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.015em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

/* Contrato visual: títulos da interface são exibidos em caixa alta sem
   modificar o conteúdo original, os dados informados ou a acessibilidade. */
body :where(
  legend,
  .brand-name,
  .side-brand .name,
  .clients-label,
  .users-title,
  .dash-title,
  .ac-tit,
  .idr-titulo,
  .ext-prev-titulo,
  .company-agenda-form-title > strong,
  .company-agenda-calendar-head > strong,
  .notas-import-competencies-head > strong,
  .support-float-title,
  .em-audit-title,
  .maintenance-control-title > strong,
  .isolation-head strong,
  .portfolio-section-title > div:first-child > strong
) {
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

/* Estes headings exibem conteúdo cadastrado pelo usuário, não títulos fixos. */
body :where(
  .detail-head h2,
  .em-profile > header h3,
  .support-detail-top h3,
  [data-user-content],
  .user-content,
  .client-item .nome,
  .company-name,
  .portfolio-priority strong,
  .portfolio-ranking-table td:first-child strong
) {
  font-family: var(--font-body);
  text-transform: none;
}

p,
li,
dd,
dt,
label,
small {
  line-height: 1.5;
}

strong,
b {
  font-weight: 700;
}

table,
input,
.money,
.valor,
.num,
.um-value,
.dash-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

body :where(
  .dash-value,
  .um-value,
  .portfolio-kpi__copy > strong,
  .portfolio-money-grid strong,
  .fat-total,
  .metric-value,
  .kpi-value,
  [data-kpi-value]
) {
  font-family: var(--font-title);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Painel principal e área gerencial */
.side-brand .name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.side-brand .name span {
  color: var(--gm-text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.search-side input {
  font-size: 14px;
}

.clients-label {
  color: var(--gm-text-secondary);
  font-size: 11.5px;
  letter-spacing: .055em;
}

.client-item .nome {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
}

.client-item .meta,
.client-status {
  font-size: 11.5px;
  line-height: 1.35;
}

.empty-list {
  color: var(--gm-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.topbar h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.users-bread {
  color: var(--gm-text-secondary);
  font-size: 13.5px;
}

.users-title {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.users-sub {
  color: var(--gm-text-secondary);
  font-size: 14.5px;
  line-height: 1.5;
}

.users-new-btn,
.maintenance-control-button,
.isolation-actions button,
.dash-info {
  font-weight: 700;
}

.maintenance-control-title strong,
.isolation-head strong {
  font-size: 16px;
  font-weight: 700;
}

.maintenance-control-title span {
  font-size: 11px;
  font-weight: 700;
}

.maintenance-control-copy p,
.isolation-head p {
  color: var(--gm-text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

.maintenance-control-copy small,
.isolation-head small {
  color: var(--gm-text-muted);
  font-size: 12px;
}

.maintenance-control-button,
.isolation-actions button {
  font-size: 13px;
}

.users-dashboard-head h2 {
  font-size: 21px;
  font-weight: 700;
}

.users-dashboard-head p {
  color: var(--gm-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.dash-title {
  color: #526176;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .045em;
}

.dash-value {
  font-weight: 700;
  letter-spacing: -.02em;
}

.dash-desc {
  color: var(--gm-text-secondary);
  font-size: 12.5px;
  line-height: 1.4;
}

.dash-footer {
  color: var(--gm-text-secondary);
  font-size: 11.5px;
  line-height: 1.4;
}

.dash-footer strong {
  font-size: 12.5px;
  font-weight: 700;
}

.dash-panel-head h3 {
  font-size: 16px;
  font-weight: 700;
}

.dash-panel-head span,
.dash-legend {
  color: var(--gm-text-secondary);
  font-size: 12.5px;
}

.dash-chart-labels text {
  font-size: 11px;
  font-weight: 600;
}

.dh-info h2,
.fat-head .title h3,
.sc-card h3 {
  font-weight: 700;
  letter-spacing: -.01em;
}

.dh-line {
  font-size: 14.5px;
  line-height: 1.5;
}

.dh-line .dh-k,
.fat-head .title small,
.fat-cnae,
.fat-head .year label {
  color: var(--gm-text-secondary);
}

.fat-head .title small,
.fat-cnae,
.fat-head .year label {
  font-size: 12px;
}

.mes-card .mes-nome,
.mes-card .actions button {
  font-size: 12.5px;
}

.ac-tit {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .005em;
}

.ac-sub {
  color: var(--gm-text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.ac-ind {
  font-size: 12px;
}

/* Formulários, tabelas e suporte */
.modal label,
.support-field label,
.support-cleanup-modal label {
  font-size: 13px;
  font-weight: 600;
}

.modal input,
.modal select,
.modal textarea,
.support-field input,
.support-field select,
.support-field textarea,
.support-toolbar input,
.support-toolbar select,
.support-reply textarea {
  font-size: 14px;
  line-height: 1.45;
}

.support-modal-head h2 {
  font-size: 21px;
  font-weight: 700;
}

.support-modal-head p {
  color: var(--gm-text-secondary);
  font-size: 14px;
}

.support-counter,
.support-help {
  color: var(--gm-text-secondary);
  font-size: 12px;
}

.support-table th {
  color: var(--gm-text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.support-table td {
  font-size: 13px;
  line-height: 1.45;
}

.support-message-meta {
  color: var(--gm-text-secondary);
  font-size: 11px;
}

.support-message-text {
  font-size: 14px;
  line-height: 1.55;
}

/* Login, cadastro e documentos legais */
.card label,
.legal-main {
  line-height: 1.55;
}

.legal-main {
  font-size: 15.5px;
}

.legal-header p,
.legal-footer {
  line-height: 1.5;
}

@media (max-width: 720px) {
  .users-title {
    font-size: 23px;
  }

  .dash-title,
  .client-item .meta,
  .client-status {
    font-size: 11px;
  }
}

/* Functional UI remains compact and readable at every zoom. */
body,
body button,
body input,
body select,
body textarea {
  font-family: var(--font-body);
}

body {
  font-size: var(--gm-font-size-base);
}

body :where(button, input, select, textarea) {
  font-size: var(--gm-font-size-base);
}

body :where(small, time, .meta, [class*="-meta"], [class$="-help"], [class$="-hint"], [class$="-sub"]) {
  font-size: var(--gm-font-size-xs);
  line-height: 1.4;
}

body :where(th, .table-head, .table-header) {
  font-size: var(--gm-font-size-xs);
  text-transform: uppercase;
}

body :where(.clients-label, .client-item .meta, .client-status, .dash-title, .dash-desc, .dash-footer, .dash-chart-labels text, .support-table th, .support-counter, .support-help, .support-message-meta, .support-attachment, .legal-consent p) {
  font-size: var(--gm-font-size-xs);
}

@media (max-width: 720px) {
  body :where(input, select, textarea) {
    font-size: var(--gm-font-size-md);
  }
}

/* Global interaction contract. Low-specificity selectors preserve component
   layout while the shared tokens keep every state visually consistent. */
body :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"]),
  select,
  textarea
) {
  min-height: 50px;
  max-width: 100%;
  padding: 0 14px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-field);
  background-color: var(--surface);
  color: #182e48;
  font: 400 14px/1.4 var(--font-body);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

body :where(textarea) {
  min-height: 90px;
  padding-top: 13px;
  padding-bottom: 13px;
  resize: vertical;
}

body :where(input, select, textarea)::placeholder {
  color: var(--text-placeholder);
  opacity: 1;
}

@media (hover: hover) {
  body :where(input:not(:disabled):not([readonly]), select:not(:disabled), textarea:not(:disabled):not([readonly])):hover {
    border-color: var(--border-hover);
  }
}

body :where(button, [role="button"], a):focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

body :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--focus-ring);
  outline: none;
}

body :where(input, select, textarea)[aria-invalid="true"],
body :where(input, select, textarea).is-invalid,
body :where(input, select, textarea):user-invalid {
  border-color: var(--border-danger);
  box-shadow: 0 0 0 3px var(--danger-ring);
}

body :where(input, select, textarea)[aria-invalid="false"]:not(:placeholder-shown),
body :where(input, select, textarea)[data-valid="true"] {
  border-color: var(--border-success);
  box-shadow: 0 0 0 3px var(--success-ring);
}

body .field {
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-field);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

body .field > :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  min-height: 48px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  outline: none;
}

body .field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

body .field:has(> [aria-invalid="true"]),
body .field:has(> :user-invalid),
body .field.is-invalid {
  border-color: var(--border-danger);
  box-shadow: 0 0 0 3px var(--danger-ring);
}

body .field:has(> [aria-invalid="false"]:not(:placeholder-shown)),
body .field:has(> [data-valid="true"]) {
  border-color: var(--border-success);
  box-shadow: 0 0 0 3px var(--success-ring);
}

body .field:has(> [readonly]) {
  border-color: var(--border-surface);
  background: var(--background-soft);
}

body :where(.field-error, .input-error, [data-field-error]) {
  color: var(--text-danger);
  font-size: 12px;
  line-height: 1.45;
}

body :where(input, textarea)[readonly] {
  border-color: var(--border-surface);
  background: var(--background-soft);
  color: #53677e;
  cursor: default;
}

body :where(button, [role="button"], a[class*="btn"], input[type="button"], input[type="submit"], input[type="reset"]) {
  min-height: 44px;
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body :is(.btn-primary, button.primary, a.primary, .btn.primary, .support-btn.primary, .em-button.primary) {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #0d3b70;
  border-radius: var(--radius-button);
  background: #0d3b70;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(13, 59, 112, .20);
}

body :is(.btn-secondary, button.secondary, a.secondary, .btn.secondary) {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #c5d8eb;
  border-radius: 9px;
  background: #fff;
  color: #0d3b70;
  font-weight: 700;
}

body :is(.btn-ghost, button.ghost, a.ghost, .btn.ghost) {
  min-height: 40px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-link);
  box-shadow: none;
}

body :is(.btn-danger, button.danger, a.danger, .btn.danger) {
  border: 1px solid var(--border-danger);
  background: #fff;
  color: var(--text-danger);
  box-shadow: none;
}

@media (hover: hover) {
  body :is(.btn-primary, button.primary, a.primary, .btn.primary, .support-btn.primary, .em-button.primary):not(:disabled):not([aria-disabled="true"]):hover {
    border-color: #082d58;
    background: #082d58;
    transform: translateY(-1px);
  }

  body :is(.btn-secondary, button.secondary, a.secondary, .btn.secondary):not(:disabled):not([aria-disabled="true"]):hover {
    border-color: #8eafd0;
    background: #eaf2fb;
  }

  body :is(.btn-ghost, button.ghost, a.ghost, .btn.ghost):not(:disabled):not([aria-disabled="true"]):hover {
    background: #eef5fc;
  }

  body :is(.btn-danger, button.danger, a.danger, .btn.danger):not(:disabled):not([aria-disabled="true"]):hover {
    background: #fff1f0;
  }
}

body :is(button, input, select, textarea)[disabled]:disabled,
body [role="button"][aria-disabled="true"] {
  cursor: not-allowed;
  border-color: #d1dbe6;
  background: #e8edf3;
  color: #66788a;
  box-shadow: none;
  opacity: 1;
  transform: none;
}

body :where(input[type="checkbox"], input[type="radio"]) {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: #1763d4;
}

body :where(input[type="file"]) {
  max-width: 100%;
  color: var(--text-secondary);
}

body :where(input[type="file"])::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--text-title);
  font: 700 13px/1.2 var(--font-body);
  cursor: pointer;
}

body :where(.card, [class$="-card"], [class*="-panel"], .modal-content) {
  border-color: var(--border-soft);
  border-radius: var(--radius-card);
  background-color: var(--background-surface);
}

body :where(.card, .dash-card, .support-card, .splash-card, .legal-main, .modal-content, .users-dashboard, .admin-dashboard, .portfolio-dashboard) {
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

body :is(.card, .dash-card, .support-card, .splash-card, .legal-main, .modal, .modal-content, .users-dashboard, .admin-dashboard, .portfolio-dashboard) {
  border-color: var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

body :where(.card, [class$="-card"], [class*="-panel"], .modal-content)
  :where([class$="-card"], [class*="-panel"]) {
  border-color: #dfe7f0;
  border-radius: 12px;
  box-shadow: none;
}

body :where(table) {
  background-color: var(--background-surface);
  color: var(--text-primary);
  border-color: var(--border-soft);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

body :where(th) {
  background: var(--background-soft);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.3;
  text-transform: uppercase;
}

body :is(
  .card-footer,
  .table-head,
  .table-header,
  .empty-list,
  .u-empty,
  .dash-empty-analytics,
  .portfolio-empty,
  .portfolio-zero,
  .isolation-empty,
  .em-empty,
  .support-empty,
  .company-agenda-empty,
  .company-import-review-empty,
  .payment-list-empty,
  .lanc-empty,
  .hist-empty,
  .notas-import-empty,
  .bank-review-empty,
  [data-empty-state]
) {
  background-color: var(--background-soft);
}

body :where(td, th) {
  border-inline: 0;
  border-bottom-color: var(--border-soft);
}

@media (hover: hover) {
  body :where(tbody tr):hover {
    background-color: var(--surface-muted);
  }
}

body :where(.dropzone, .upload-zone, [data-upload-zone], [class*="upload-area"], [class*="drop-area"]) {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #f7faff;
  outline: 1px dashed var(--border-hover);
  outline-offset: -8px;
}

body :where(.dropzone, .upload-zone, [data-upload-zone], [class*="upload-area"], [class*="drop-area"])[data-uploaded="true"],
body :where(.dropzone, .upload-zone, [data-upload-zone], [class*="upload-area"], [class*="drop-area"]).is-loaded {
  border-color: var(--border-success);
  background: #effaf4;
  outline-color: var(--border-success);
}

/* Structural title scale. Text is transformed visually only; stored values,
   accessible names and user-entered content are never rewritten. */
body :where(h1, .page-title) {
  font-size: clamp(30px, 2.35vw, 32px);
  font-weight: 800;
  line-height: 1.2;
}

body :where(h2, .card-title, .modal-title, .panel-title, .form-title) {
  font-size: clamp(18px, 1.55vw, 20px);
  font-weight: 700;
  line-height: 1.25;
}

body :where(h3, .section-title, .timeline-title) {
  font-size: clamp(16px, 1.25vw, 18px);
  font-weight: 800;
  line-height: 1.3;
}

body h1:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-size: clamp(30px, 2.35vw, 32px) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

body h2:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-size: clamp(18px, 1.55vw, 20px) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

body h3:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-size: clamp(16px, 1.25vw, 18px) !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

body h4:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)),
body h5:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)),
body h6:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-size: max(13px, .8125rem) !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

body :where(.summary-title) {
  font-size: clamp(20px, 1.7vw, 22px);
  font-weight: 800;
  line-height: 1.2;
}

body :where(.step-title, .document-title, .metric-title) {
  font-size: max(14px, .875rem);
  font-weight: 700;
  line-height: 1.35;
}

/* Componentes estruturais que não usam headings semânticos devem preservar a
   mesma hierarquia visual dos títulos de seção. */
body :is(
  .company-agenda-form-title > strong,
  .company-agenda-calendar-head > strong,
  .notas-import-competencies-head > strong,
  .support-float-title,
  .em-audit-title,
  .idr-titulo,
  .ext-prev-titulo,
  .maintenance-control-title > strong,
  .isolation-head strong,
  .portfolio-section-title > div:first-child > strong
):where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-size: clamp(16px, 1.25vw, 18px) !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

body :is(h1, h2, h3, h4, h5, h6):where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)),
body :is(
  .page-title,
  .card-title,
  .section-title,
  .modal-title,
  .summary-title,
  .timeline-title,
  .step-title,
  .panel-title,
  .form-title,
  .document-title,
  .metric-title,
  legend,
  .brand-name,
  .side-brand .name,
  .clients-label,
  .users-title,
  .dash-title,
  .ac-tit,
  .idr-titulo,
  .ext-prev-titulo,
  .company-agenda-form-title > strong,
  .company-agenda-calendar-head > strong,
  .notas-import-competencies-head > strong,
  .support-float-title,
  .em-audit-title,
  .maintenance-control-title > strong,
  .isolation-head strong,
  .portfolio-section-title > div:first-child > strong
):where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  color: var(--text-title);
  font-family: var(--font-title) !important;
  letter-spacing: -.012em !important;
  text-transform: uppercase !important;
  overflow-wrap: anywhere;
}

body :is(
  .detail-head h2,
  .em-profile > header h3,
  .support-detail-top h3,
  [data-user-content],
  .user-content,
  .client-item .nome,
  .company-name,
  .portfolio-priority strong,
  .portfolio-ranking-table td:first-child strong
) {
  color: inherit;
  font-family: var(--font-body) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body :is(.dash-title, .ac-tit, .metric-title, .step-title, .document-title) {
  font-size: clamp(16px, 1.25vw, 18px) !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

body .clients-label {
  font-size: 13px !important;
}

body label:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1.35;
}

body td:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-size: clamp(11.5px, .78vw, 12.5px) !important;
  line-height: 1.45;
}

/* Cabeçalhos são títulos funcionais. O mínimo de 13px impede que tabelas
   compactas reduzam informações essenciais a 7–11px. */
body table th:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
  font-family: var(--font-title) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: .02em !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body .portfolio-ranking-table th {
  padding: 11px 12px !important;
}

/* Em telas estreitas algumas tabelas viram cartões e o título da coluna passa
   a ser renderizado por data-label. Ele segue o mesmo mínimo legível. */
body td[data-label]:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *))::before {
  font-family: var(--font-title) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: .02em !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
}

body :is(small, .meta, [class*="-meta"], [class$="-help"], [class$="-hint"]) {
  font-size: 12px !important;
  line-height: 1.5;
}

/* .sc-company-status is a layout container. It must keep the same body scale
   as the adjacent Simples Nacional and SIMEI columns, not the compact badge
   scale used by true status labels. */
body :is(time, .portfolio-freshness, [class*="badge"], [class$="-status"]:not(:where(.sc-company-status))) {
  font-size: 11px !important;
  line-height: 1.3;
}

body :where(.metric-value, .kpi-value, [data-kpi-value], .dash-value, .um-value, .annual-metric-card__amount) {
  font-family: var(--font-title);
  font-size: clamp(26px, 2.25vw, 30px);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  :root {
    --gm-font-size-lg: 1.125rem;
    --gm-font-size-xl: 1.375rem;
    --gm-font-size-kpi: 1.625rem;
  }

  body :where(h1, .page-title) {
    font-size: clamp(24px, 7vw, 26px);
  }

  body :where(h2, .card-title, .modal-title, .panel-title, .form-title) {
    font-size: clamp(16px, 5vw, 18px);
  }


  body h1:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
    font-size: clamp(24px, 7vw, 26px) !important;
  }

  body h2:where(:not(.fiscal-sheet *):not(.managerial-sheet *):not(.lc-page *):not(.monthly-report-page *)) {
    font-size: clamp(16px, 5vw, 18px) !important;
  }

  body :where(button.primary, .btn-primary, input[type="submit"]) {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body :where(button, [role="button"], input, select, textarea) {
    scroll-behavior: auto;
    transition-duration: .01ms;
  }
}

/* White structural surfaces; dimensions and branded action states stay intact. */
body .sidebar { background: #ffffff; border-right-color: #e5e7eb; }
body .sidebar-content,
body #content,
body .admin-portfolio,
body .admin-portfolio--reference { background: #ffffff; }

body :is(.portfolio-assistants, .portfolio-overview, .portfolio-attention,
  .portfolio-actions, .portfolio-ranking, .portfolio-chart-card,
  .stat, .users-metric, .detail) {
  background: #ffffff;
  border-color: #dce5f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
body .admin-portfolio--reference .portfolio-kpi {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
body .admin-portfolio--reference .portfolio-shortcuts .portfolio-section-title > div:first-child > strong {
  text-transform: none !important;
}
body .portfolio-money-grid > div,
body .admin-portfolio--reference .portfolio-money-grid > div {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
body .meses-grid .mes-card {
  background: #ffffff;
  border-color: #dce5f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
body .meses-grid .mes-card:hover { border-color: #9eb6ce; }
