/* =====================================================================
   CRM PERSONAL — DESIGN SYSTEM PARTILHADO
   Componentes reutilizados por Alunos, Agenda, Treinos, Exercícios,
   Financeiro, Configurações, Cadastro público e painel Master.

   Regra desta folha: só usa os tokens de tokens.css. Nenhuma cor nova
   foi inventada aqui — o dourado continua a ser acento, nunca fundo.

   Ordem: 1) combobox  2) toolbar de lista  3) paginação
          4) linhas compactas  5) estados  6) drawer  7) responsivo
   ===================================================================== */

/* ============================ 1. COMBOBOX ============================
   Substitui visualmente um <select> nativo sem o remover do DOM: o
   <select> continua a ser o dono do valor (e do `name`, e do `required`),
   por isso todo o código que já lia `.value` continua a funcionar.

   O painel é `position:fixed` e é montado dentro do <dialog> quando o
   campo está num modal — elemento fora do <dialog> nunca conseguiria
   desenhar por cima do top layer.
   ==================================================================== */

/* Texto só para leitores de ecrã — rótulos de campos cujo desenho já
   comunica a função (o seletor de quantidade por página, por exemplo). */
.crm-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.crm-combobox { position: relative; display: block; width: 100%; }

/* O <select> original fica invisível mas continua no formulário.
   `display:none` impediria a validação nativa de focar o campo, por isso
   é escondido por dimensão e não por display. */
.crm-combobox > select.crm-combobox-source {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.crm-combobox-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--control-height);
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.crm-combobox-trigger:hover:not(:disabled) { border-color: var(--gold-a34); }
.crm-combobox-trigger:focus-visible,
.crm-combobox[data-open="1"] .crm-combobox-trigger {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--gold-a13);
}
.crm-combobox-trigger:disabled { opacity: .5; cursor: not-allowed; }
.crm-combobox-trigger[aria-invalid="true"] { border-color: var(--color-danger); }

.crm-combobox-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-combobox-value.is-placeholder { color: var(--color-muted); font-weight: 500; }

/* Seta desenhada em CSS: um <select> nativo dentro de um modal escuro
   herdava a seta do sistema operativo e destoava. */
.crm-combobox-caret {
  flex: none;
  width: 9px; height: 9px;
  margin-right: 2px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s, border-color .18s;
}
.crm-combobox[data-open="1"] .crm-combobox-caret {
  transform: translateY(1px) rotate(-135deg);
  border-color: var(--gold-text);
}

.crm-combobox-clear {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.07);
  color: var(--color-muted);
  font-size: 15px; line-height: 1;
}
.crm-combobox-clear:hover { background: var(--gold-a16); color: var(--gold-text); }

/* ---- painel ---- */
.crm-combobox-panel {
  position: fixed;
  z-index: 2147483000;          /* acima de toasts, savebars e do backdrop */
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
  color-scheme: dark;
  border: 1px solid var(--gold-a24);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.4);
  overflow: hidden;
}
.crm-combobox-panel[hidden] { display: none; }

.crm-combobox-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-soft);
}
.crm-combobox-search > span { color: var(--color-muted); font-size: 15px; line-height: 1; }
.crm-combobox-search input {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--color-text);
  font-size: 14px;
}

.crm-combobox-list {
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 5px;
  list-style: none;
  overflow-y: auto;
  /* Explícito de propósito: `overflow-y: auto` sozinho faz o `overflow-x`
     computar para `auto`, e bastava um nome comprido para o navegador
     desenhar uma barra horizontal dentro do dropdown. */
  overflow-x: hidden;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-a34) var(--color-bg-soft);
}
.crm-combobox-list::-webkit-scrollbar { width: 8px; }
.crm-combobox-list::-webkit-scrollbar-track { background: var(--color-bg-soft); }
.crm-combobox-list::-webkit-scrollbar-thumb { background: var(--gold-a34); border-radius: 8px; }
.crm-combobox-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.crm-combobox-option small {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.crm-combobox-option[data-active="1"] { background: var(--gold-a13); }
.crm-combobox-option[aria-selected="true"] { color: var(--gold-text); }
.crm-combobox-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.crm-combobox-option[aria-selected="true"]::after {
  content: "✓";
  margin-left: auto;
  color: var(--gold-text);
  font-size: 12px;
}
.crm-combobox-option[aria-selected="true"] small { margin-left: 0; }

.crm-combobox-status {
  padding: 16px 13px;
  color: var(--color-muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.crm-combobox-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 10.5px;
  text-align: center;
}

/* ======================= 2. TOOLBAR DE LISTA ========================= */

.crm-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid var(--color-border);
}
.crm-toolbar-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.crm-toolbar-filters .crm-combobox { width: auto; min-width: 152px; }

.crm-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: var(--control-height);
  padding: 0 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  transition: border-color .16s, box-shadow .16s;
}
.crm-search:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--gold-a13); }
.crm-search > span { color: var(--color-muted); font-size: 16px; line-height: 1; }
.crm-search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--color-text);
}
.crm-search input::-webkit-search-cancel-button { display: none; }
.crm-search button {
  flex: none;
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.07);
  color: var(--color-muted);
  font-size: 14px; line-height: 1;
}
.crm-search button:hover { background: var(--gold-a16); color: var(--gold-text); }
.crm-search.is-busy > span { color: var(--gold-text); animation: crm-pulse 1s ease-in-out infinite; }
@keyframes crm-pulse { 50% { opacity: .35; } }

/* chips de filtro ativo */
.crm-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 15px 13px;
  color: var(--color-muted);
  font-size: 11px;
}
.crm-chips > span:first-child {
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.crm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--gold-a24);
  border-radius: var(--radius-pill);
  background: var(--gold-a08);
  color: var(--gold-text);
  font-size: 10.5px;
  font-weight: 700;
}
.crm-chip:hover { border-color: var(--gold-a34); background: var(--gold-a13); }
.crm-chip-clear {
  border: 0; background: transparent;
  color: var(--color-muted);
  font-size: 10.5px; font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.crm-chip-clear:hover { color: var(--gold-text); }

/* ========================= 3. PAGINAÇÃO ============================= */
.crm-section-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 15px; border-bottom: 1px solid var(--color-border); }
.crm-section-tabs button { min-height: 42px; }

.crm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 11.5px;
  font-weight: 650;
}
.crm-pagination-count { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crm-page-size { display: block; }
.crm-pagination-count .crm-combobox { width: auto; min-width: 116px; }
.crm-pagination-count .crm-combobox-trigger { min-height: 34px; padding: 5px 10px; font-size: 11.5px; }
.crm-pagination-pages { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.crm-pagination-pages button {
  min-width: 34px; height: 34px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-nav);
  background: var(--color-bg-soft);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 750;
}
.crm-pagination-pages button:hover:not(:disabled) { border-color: var(--gold-a34); color: var(--gold-text); }
.crm-pagination-pages button.active {
  border-color: var(--gold-a34);
  background: var(--gold-a13);
  color: var(--gold-text);
}
.crm-pagination-pages button:disabled { opacity: .34; cursor: not-allowed; }
.crm-pagination-gap { padding: 0 2px; color: var(--color-muted); }

/* ==================== 4. LINHA COMPACTA DE LISTA =====================
   Substitui `.data-row` nas listagens grandes. A altura caiu de ~78px
   para 56px: com 25 registos a página deixa de exigir scroll no 1366px.
   ==================================================================== */

.crm-list { display: grid; }
.crm-row {
  display: grid;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}
.crm-list > .crm-row:last-child { border-bottom: 0; }
.crm-row:hover { background: var(--gold-a08); }
.crm-row:focus-visible { outline: 2px solid var(--gold-a34); outline-offset: -2px; }

.crm-row-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.crm-row-avatar {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--gradient-avatar);
  color: #0b1424;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .02em;
}
.crm-row-avatar.neutral {
  background: var(--color-surface-2);
  border: 1px solid var(--gold-a24);
  color: var(--gold-text);
  font-size: 14px;
}
.crm-row-text { min-width: 0; display: grid; gap: 2px; }
.crm-row-text > strong {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-row-text > small {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-row-meta {
  color: var(--color-muted);
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.crm-row-action {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-2);
  color: var(--color-muted);
  font-size: 14px;
}
.crm-row-action:hover { border-color: var(--gold-a34); color: var(--gold-text); }

/* cabeçalho de colunas — só existe onde há espaço para ele */
.crm-row-head {
  display: grid;
  gap: 14px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-soft);
  color: var(--color-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.crm-row-head button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.crm-row-head button:hover { color: var(--gold-text); }
.crm-row-head button[data-sorted] { color: var(--gold-text); }

/* badges de status — a base já tem `.badge`; aqui só os tons em falta */
.badge.draft    { background: rgba(132,148,172,.14); color: #b8c4d4; }
.badge.expired  { background: rgba(255,93,104,.13);  color: #ff9aa2; }
.badge.finished { background: rgba(132,148,172,.14); color: #b8c4d4; }

/* ========================= 5. ESTADOS =============================== */

.crm-skeleton { display: grid; }
.crm-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--color-border);
}
.crm-skeleton-row:last-child { border-bottom: 0; }
.crm-sk {
  border-radius: 7px;
  background: linear-gradient(90deg, var(--color-surface-2) 25%, #16233a 50%, var(--color-surface-2) 75%);
  background-size: 400% 100%;
  animation: crm-shimmer 1.4s ease-in-out infinite;
}
.crm-sk-avatar { flex: none; width: 34px; height: 34px; border-radius: 9px; }
.crm-sk-line { height: 11px; }
.crm-sk-stack { flex: 1; min-width: 0; display: grid; gap: 7px; }
@keyframes crm-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .crm-sk { animation: none; }
  .crm-search.is-busy > span { animation: none; }
}

.crm-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 22px;
  text-align: center;
}
.crm-empty-mark {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border: 1px solid var(--gold-a24);
  border-radius: 15px;
  background: var(--gold-a08);
  color: var(--gold-text);
  font-size: 21px;
}
.crm-empty strong { font-size: 14.5px; font-weight: 700; }
.crm-empty span { max-width: 400px; color: var(--color-muted); font-size: 12px; line-height: 1.55; }
.crm-empty .outline { margin-top: 6px; }

/* ========================== 6. DRAWER =============================== */

.crm-drawer {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  justify-content: flex-end;
}
.crm-drawer[hidden] { display: none; }
.crm-drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 18, .66);
  backdrop-filter: blur(2px);
  border: 0;
}
.crm-drawer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(470px, 100%);
  max-width: 100%;
  height: 100%;
  border-left: 1px solid var(--gold-a18);
  background: var(--color-surface);
  box-shadow: -30px 0 80px rgba(0,0,0,.5);
  animation: crm-drawer-in .22s ease-out;
}
@keyframes crm-drawer-in { from { transform: translateX(24px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .crm-drawer-panel { animation: none; } }

.crm-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}
.crm-drawer-head h3 { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); }
.crm-drawer-head p { margin: 4px 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.crm-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px calc(20px + var(--safe-bottom));
  display: grid;
  gap: 14px;
  align-content: start;
}
.crm-drawer-foot {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 14px 20px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--color-border);
}

/* ========================= 7. RESPONSIVO ============================ */

@media (max-width: 1100px) {
  .crm-toolbar { grid-template-columns: 1fr; }
  .crm-toolbar-filters { justify-content: flex-start; }
}

@media (max-width: 820px) {
  /* A linha em grelha vira cartão: nenhuma listagem passa a ter scroll
     horizontal, e as áreas de toque ficam acima dos 48px. */
  .crm-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px 12px;
    padding: 12px 14px;
    min-height: var(--touch-min);
  }
  .crm-row-head { display: none; }
  .crm-row-identity { grid-column: 1; grid-row: 1; }
  .crm-row-meta { grid-column: 1; grid-row: 2; font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
  .crm-row-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .crm-row-badge { grid-column: 1; grid-row: 3; justify-self: start; }
  .crm-row-text > strong { font-size: 13px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
  .crm-row-text > small { line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
  .dashboard-recent .crm-row-actions { grid-row: 1; }

  .crm-toolbar-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .crm-toolbar-filters .crm-combobox { width: auto; min-width: 0; }
  .crm-toolbar-filters > .outline { grid-column: 1 / -1; }

  .crm-pagination { justify-content: center; }
  .crm-pagination-count { width: 100%; justify-content: space-between; }
  .crm-pagination-pages { width: 100%; justify-content: center; }

  /* Teclado virtual: 16px evita o zoom automático do iOS. */
  .crm-combobox-search input,
  .crm-search input { font-size: 16px; }

  .crm-combobox-trigger { min-height: var(--touch-min); }
  .crm-combobox-option { padding: 12px 11px; font-size: 14px; }

  .crm-drawer-panel {
    width: 100%;
    height: auto;
    max-height: 92dvh;
    margin-top: auto;
    border-left: 0;
    border-top: 1px solid var(--gold-a18);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: crm-drawer-up .24s ease-out;
  }
  .crm-drawer { align-items: flex-end; }
  @keyframes crm-drawer-up { from { transform: translateY(26px); opacity: .5; } }
}

@media (max-width: 430px) {
  .crm-toolbar-filters { grid-template-columns: 1fr; }
  .crm-pagination-pages button { min-width: 38px; height: 38px; }
  .crm-row { padding: 11px 12px; }
}

/* ==================== 8. GRELHAS DAS LISTAGENS =======================
   Cada página declara só as suas colunas; tudo o resto vem de .crm-row.
   As larguras são fixas nas colunas curtas e `minmax(0,…)` nas longas —
   é o `minmax(0,…)` que impede um nome comprido de esticar a linha e
   criar scroll horizontal.
   ==================================================================== */

.crm-students-row,
.crm-plans-row {
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr) 108px 44px;
}

.crm-row-meta i {
  display: block;
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 10px;
  font-style: normal;
  opacity: .8;
}
.crm-row-meta.is-late { color: #ff9aa2; }

/* ==================== 9. MODAL PADRÃO ================================
   `dialog` já tem `max-height:90vh` na base, mas sem contexto de flex o
   conteúdo simplesmente transbordava e o rodapé saía da viewport. Aqui o
   corpo é a única parte rolável e os botões ficam sempre visíveis.
   ==================================================================== */

dialog.crm-dialog {
  display: flex;
  flex-direction: column;
  width: min(620px, 94vw);
  padding: 0;
}
dialog.crm-dialog:not([open]) { display: none; }

.crm-dialog-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.crm-field-group { display: grid; gap: 12px; }
.crm-field-group-title {
  margin: 0;
  color: var(--color-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.crm-field-group + .crm-field-group { padding-top: 20px; border-top: 1px solid var(--color-border); }

.crm-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.crm-field-grid .full { grid-column: 1 / -1; }
.crm-field-grid label { gap: 7px; color: var(--color-text); font-size: var(--text-sm); font-weight: 700; }
.crm-field-hint { color: var(--color-muted); font-size: 10.5px; font-weight: 500; line-height: 1.45; }
.crm-drawer-note { margin: 0; color: var(--color-muted); font-size: 11.5px; line-height: 1.5; }

/* Campo monetário: o símbolo faz parte do controlo, não flutua ao lado. */
.crm-money {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  overflow: hidden;
  transition: border-color .16s, box-shadow .16s;
}
.crm-money:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--gold-a13); }
.crm-money > i {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--gold-text);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .02em;
}
.crm-money > input {
  flex: 1;
  min-width: 0;
  min-height: var(--control-height);
  padding: 10px 12px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  dialog.crm-dialog {
    width: 100vw; max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .crm-dialog-body { padding: 16px; gap: 18px; }
  .crm-field-grid { grid-template-columns: 1fr; }
  .crm-field-grid .full { grid-column: auto; }
  /* 16px em qualquer campo do modal: abaixo disso o iOS dá zoom ao focar,
     o modal sai do enquadramento e os botões deixam de estar acessíveis. */
  .crm-dialog input:not([type="checkbox"]),
  .crm-dialog select,
  .crm-dialog textarea { font-size: 16px; }
  dialog .dialog-actions:where(:not(.dialog-actions--page):not(.dialog-actions--admin):not(.dialog-actions--checklist)) { position: sticky; bottom: 0; background: var(--color-surface); }
}

/* V2.9.1 — um nome comprido é truncado em vez de forçar a largura da lista
   e criar scroll horizontal. */
.crm-combobox-option > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* V3.1.1: links de texto, sem aparência nativa de botão. */
.personal-table .text-btn, .master-muted .text-btn { appearance:none; background:transparent; border:0; box-shadow:none; padding:0; margin:2px 0 0; color:var(--text, #e8eef7); font:inherit; line-height:1.5; text-align:left; cursor:pointer; }
.personal-table .text-btn:hover, .master-muted .text-btn:hover { color:var(--gold-text, #e3c05a); text-decoration:underline; }
.personal-table .text-btn:focus-visible, .master-muted .text-btn:focus-visible { outline:2px solid var(--gold-text, #e3c05a); outline-offset:3px; border-radius:2px; }
@keyframes crm-search-autofill { from { opacity:.999; } to { opacity:1; } }
input[data-crm-search]:-webkit-autofill { animation-name:crm-search-autofill; animation-duration:.01s; }
input[data-crm-search]:autofill { animation-name:crm-search-autofill; animation-duration:.01s; }

.plans-filters { min-width: 0; }
.plans-filters > summary {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.plans-filters[open] > summary { color: var(--gold-text); border-color: var(--gold-a34); }
.plans-filters > .crm-toolbar-filters { padding-top: 10px; }
.plans-filters > summary:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; }
