/* Superfícies de formulário e seletores compartilhados pelo painel e Totem. */
:root {
  --campo-fundo: var(--trop-bg, #1c1c1c);
  --campo-texto: var(--trop-text, #fff);
  --campo-borda: var(--trop-border, #383838);
  --campo-menu: var(--trop-surface, #2a2a2a);
  --campo-realce: #393939;
  --campo-muted: var(--trop-muted, #9a9a9a);
  --campo-disabled: var(--trop-surface-2, #333);
}
[data-bs-theme="light"] {
  --campo-fundo: #fff;
  --campo-texto: #14181f;
  --campo-borda: #d3dfea;
  --campo-menu: #fff;
  --campo-realce: #e9f0f5;
  --campo-muted: #60758a;
  --campo-disabled: #eef0f3;
}
html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]), textarea, select, .trop-select-trigger) {
  background-color: var(--campo-fundo);
  color: var(--campo-texto);
  color-scheme: dark;
}
/* A borda neutra vale só em repouso. Com a especificidade desta regra, o foco
   e os estados de validação de cada tela (.input-match e .input-mismatch da
   confirmação de CPF do Totem, .input-invalido do painel) nunca venceriam. */
html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]), textarea, select, .trop-select-trigger):not(:focus):not(.input-match):not(.input-mismatch):not(.input-invalido):not([aria-invalid="true"]) {
  border-color: var(--campo-borda);
}
html[data-bs-theme="light"] body :is(input, textarea, select, .trop-select-trigger) { color-scheme: light; }
html body :is(input, textarea)::placeholder { color: var(--campo-muted); opacity: 1; }
html body :is(input, textarea, select, .trop-select-trigger):disabled {
  background-color: var(--campo-disabled);
  color: var(--campo-muted);
  cursor: not-allowed;
}
html body :is(input, textarea, .trop-select-trigger):focus-visible {
  outline: 2px solid var(--trop-gold, #dda729);
  outline-offset: 2px;
}
html body :is(.input-invalido, [aria-invalid="true"]) { border-color: var(--trop-danger, #ef4444); }
.trop-select { display: inline-grid; position: relative; min-width: 0; vertical-align: middle; }
.form-group > .trop-select, .edit-grid .trop-select,
.trop-select:has(> .form-control), .trop-select:has(> .form-select) { width: 100%; }
.trop-select:has(> .trop-semana-select) { flex: 1; min-width: 0; }
.trop-select > select.trop-select-source {
  grid-area: 1 / 1; opacity: 0; pointer-events: none; min-width: 0; max-width: 100%;
}
.trop-select-trigger {
  grid-area: 1 / 1; position: relative; width: 100%; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--campo-borda); border-radius: 6px;
  padding: 8px 12px; font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}
.trop-select-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trop-select-arrow { width: 7px; height: 7px; border: solid var(--campo-muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); flex-shrink: 0; margin: -4px 2px 0 0; }
.trop-select-menu {
  position: fixed; inset: auto; margin: 0; box-sizing: border-box;
  padding: 4px; border: 1px solid var(--campo-borda); border-radius: 6px;
  background: var(--campo-menu); color: var(--campo-texto);
  box-shadow: 0 6px 18px rgb(15 23 42 / 14%); overflow: auto; overscroll-behavior: contain;
  z-index: 20000; font: 14px/1.4 var(--bs-body-font-family, 'Outfit', system-ui, sans-serif);
}
.trop-select-menu[hidden] { display: none; }
.trop-select-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border-radius: 3px; cursor: pointer; }
.trop-select-option[aria-selected="true"], .trop-select-option.is-active, .trop-select-option:hover { background: var(--campo-realce); }
.trop-select-option[aria-disabled="true"] { color: var(--campo-muted); cursor: not-allowed; }
.trop-select-option small { display: block; color: var(--campo-muted); font-size: 12px; }
.trop-select-empty { padding: 12px 8px; color: var(--campo-muted); }
.trop-select-check { color: var(--campo-muted); }
.trop-select[hidden] { display: none; }

/* Campos de nome de unidade, setor, cargo e pessoa: a API grava em maiúsculas
   (src/shared/nome.ts), e a tela mostra assim desde a digitação. Só a
   exibição muda; o valor enviado segue como digitado. */
.campo-maiusculas { text-transform: uppercase; }
.campo-maiusculas::placeholder { text-transform: none; }
