/* Camada visual "clean" (inspirada em quadros de trabalho como o monday.com): superfícies brancas,
   bordas finas, cantos arredondados, status em etiquetas sólidas e tags em pílula. Carregada por último;
   a identidade do Nimbus (amarelo e marca) permanece. Remover este arquivo volta ao visual anterior. */

/* Tokens no body (mesmo nível do workspace-layout.css, com prioridade maior): ajusta a base do workspace
   em vez de duplicar cores. Tema escuro mantém preto e cinza neutros (decisão anterior), só suaviza bordas. */
html:root body.crm-operational {
  --platform: #f6f7fb; --workspace-line: #e1e4ec; --workspace-ink: #323338; --workspace-muted: #676879;
  --workspace-hover: #f0f1f5;
  --clean-border: #d0d4e4; --clean-hover: #f0f1f5; --clean-focus: #0073ea;
  --clean-shadow: 0 4px 12px rgb(32 36 68 / 8%); --clean-shadow-hover: 0 8px 20px rgb(32 36 68 / 14%);
  --control-border: var(--clean-border); --control-focus: var(--clean-focus);
}
html:root[data-theme=dark] body.crm-operational {
  --clean-border: #4a4a4f; --clean-hover: #2d2d30; --clean-focus: #579bfc;
  --clean-shadow: 0 4px 12px rgb(0 0 0 / 35%); --clean-shadow-hover: 0 8px 20px rgb(0 0 0 / 45%);
  --control-border: var(--clean-border); --control-focus: var(--clean-focus);
}
/* Cores de status no estilo de quadro: sólidas, texto branco. */
:root {
  --st-blue: #579bfc; --st-orange: #fdab3d; --st-green: #00c875; --st-dark-green: #037f4c;
  --st-purple: #a25ddc; --st-red: #df2f4a; --st-grey: #a0a3b1; --st-dark-blue: #0086c0;
}

/* ---------- casca ---------- */
:root .crm-operational .app-shell { background: var(--bg); }
:root .crm-operational .app-shell::before, :root .crm-operational .app-shell::after { opacity: 0 !important; }
:root .crm-operational :is(.app-shell > .sidebar, .app-shell .topbar) { background: var(--side); border-color: var(--line); }
:root .crm-operational .nav-link { border-radius: 6px; font-weight: 450; }
:root .crm-operational .nav-link:hover { background: var(--clean-hover); }
:root .crm-operational .nav-link.active { background: color-mix(in srgb, var(--gold) 28%, var(--side)); color: var(--text); font-weight: 600; }
:root .crm-operational .global-search { border-radius: 8px; border: 1px solid var(--clean-border); background: var(--panel); }
:root .crm-operational .app-workspace > .content { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
:root .crm-operational .page-head h1 { font-weight: 650; letter-spacing: -.01em; }

/* ---------- superfícies ---------- */
:root .crm-operational :is(.panel, .stat, .filters, .admin-editor, .access-card, .context-panel, .card-section, .record-section) {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: none;
}
:root .crm-operational :is(.stat:hover, button.stat:hover) { border-color: var(--clean-border); box-shadow: var(--clean-shadow); }
:root .crm-operational .stat { min-height: 64px; }
:root .crm-operational .stat-icon { border-radius: 8px; }

/* ---------- botões ---------- */
:root .crm-operational :is(.btn, .button) { border-radius: 4px; border: 1px solid var(--clean-border); background: var(--panel); color: var(--text);
  font-weight: 500; box-shadow: none; transition: background .12s, border-color .12s; }
:root .crm-operational :is(.btn:hover, .button:hover) { background: var(--clean-hover); border-color: var(--clean-border); color: var(--text); }
:root .crm-operational :is(.btn-primary, .button--primary) { background: var(--gold); border-color: var(--gold); color: #1f1f1f; font-weight: 600; }
:root .crm-operational :is(.btn-primary:hover, .button--primary:hover) { background: var(--gold-hover); border-color: var(--gold-hover); color: #1f1f1f; }
:root .crm-operational .btn-outline { background: transparent; }
:root .crm-operational .icon-btn { border-radius: 4px; }
:root .crm-operational .icon-btn:hover { background: var(--clean-hover); border-color: transparent; }

/* ---------- campos ----------
   Padrão de campos do NimbusLaw: raio 8 px, 40 px de altura, texto 13,5 px, borda azul suave no hover
   e anel de 2 px no foco. Os tokens ficam aqui; as regras usam as variáveis do controls.css. */
html:root body:is(.crm-operational, .account-page) {
  --field-radius: 8px; --field-font: .84375rem; --field-label: .875rem;
  --field-hover: color-mix(in srgb, var(--clean-focus) 40%, var(--clean-border));
  --field-ring: 0 0 0 2px color-mix(in srgb, var(--clean-focus) 15%, transparent);
  --field-check-border: #c3c6d4;
}
html:root[data-theme=dark] body:is(.crm-operational, .account-page) { --field-check-border: #6b6b70; }
html body.crm-operational :is(input, select, textarea):not(:disabled):hover { --control-border: var(--field-hover) !important; }
html body.crm-operational :is(input, select, textarea):focus { --control-border: var(--clean-focus) !important; box-shadow: var(--field-ring) !important; }
html body.crm-operational .crm-form :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select) { height: 40px; font-size: var(--field-font); }
html body.crm-operational .crm-form textarea { min-height: 88px; font-size: var(--field-font); }
:root .crm-operational :is(.input, input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number],
  input[type=date], input[type=datetime-local], input[type=time], input[type=password], input[type=url], select, textarea) {
  background: var(--panel); border: 1px solid var(--clean-border); border-radius: var(--field-radius); color: var(--text); box-shadow: none;
  transition: border-color .12s, box-shadow .12s;
}
:root .crm-operational :is(input, select, textarea):hover { border-color: var(--field-hover); }
:root .crm-operational :is(.input, input, select, textarea):focus { outline: none; border-color: var(--clean-focus); box-shadow: var(--field-ring); }
:root .crm-operational :is(.field > span, .field > label, .flow-field > label, label) { font-weight: 500; }

/* ---------- abas ---------- */
:root .crm-operational .tabs { border-bottom: 1px solid var(--line); }
:root .crm-operational .tab { font-weight: 500; color: var(--muted); border-bottom-width: 2px; }
:root .crm-operational .tab.active { color: var(--text); border-color: var(--clean-focus); }

/* ---------- tabelas ---------- */
:root .crm-operational .table-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
:root .crm-operational .table th { background: var(--panel); color: var(--muted); font-weight: 500; font-size: .8125rem;
  border-bottom: 1px solid var(--line); }
:root .crm-operational .table :is(th, td) { padding: 10px 14px; border-color: var(--line); }
:root .crm-operational .table tbody tr { transition: background .1s; }
:root .crm-operational .table tbody tr:hover { background: var(--clean-hover); }
:root .crm-operational .table tbody td:first-child { box-shadow: inset 3px 0 0 var(--clean-focus); }

/* ---------- status (etiqueta sólida) ---------- */
:root .crm-operational :is(.status, .status-pill) { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 96px; padding: 4px 10px; border-radius: 4px; border: 0; color: #fff; background: var(--st-grey);
  font-size: .75rem; font-weight: 500; line-height: 1.5; white-space: nowrap; }
:root .crm-operational .status::before { display: none; }
:root .crm-operational .status.active { background: var(--st-green); color: #fff; }
:root .crm-operational .status.pending { background: var(--st-orange); color: #fff; }
:root .crm-operational .status.inactive { background: var(--st-grey); color: #fff; }
:root .crm-operational .status-new { background: var(--st-blue); }
:root .crm-operational .status-working { background: var(--st-orange); }
:root .crm-operational .status-qualified { background: var(--st-green); }
:root .crm-operational .status-nurturing { background: var(--st-purple); }
:root .crm-operational .status-disqualified { background: var(--st-red); }
:root .crm-operational .status-converted { background: var(--st-dark-green); }
:root .crm-operational .status-open { background: var(--st-blue); }
:root .crm-operational .status-won { background: var(--st-green); }
:root .crm-operational .status-lost { background: var(--st-red); }

/* Etapa: cor da etapa como etiqueta sólida. */
:root .crm-operational .badge.stage { border: 0; border-radius: 4px; color: #fff; padding: 4px 10px; min-width: 96px; justify-content: center;
  background: var(--accent, var(--st-grey)); font-weight: 500; }

/* ---------- tags e origens (pílula suave) ---------- */
:root .crm-operational .badge { border-radius: 999px; padding: 2px 10px; font-weight: 500; font-size: .75rem;
  background: color-mix(in srgb, var(--muted) 14%, var(--panel)); color: var(--text); border: 0; }
:root .crm-operational .badge.channel-badge, :root .crm-operational dialog .badge.channel-badge {
  background: color-mix(in srgb, var(--channel-color, #626972) 14%, var(--panel));
  color: color-mix(in srgb, var(--channel-color, #626972) 80%, var(--text));
  border: 1px solid color-mix(in srgb, var(--channel-color, #626972) 30%, transparent); }
:root .crm-operational :is(.lead-tag, .tag, .chip) { border-radius: 999px; }

/* ---------- Kanban ---------- */
:root .crm-operational .kanban { gap: 14px; }
:root .crm-operational .kanban-column { background: var(--panel-raised); border: 0; border-radius: 8px; padding: 0 8px 10px;
  border-top: 0; min-height: 520px; }
:root .crm-operational .kanban-column > .column-title, :root .crm-operational .kanban-column .column-title {
  margin: 0 -8px 10px; padding: 10px 12px; border-radius: 8px 8px 0 0; color: #fff; font-weight: 600;
  background: var(--accent, var(--st-grey)); }
:root .crm-operational .kanban-column .column-title { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
:root .crm-operational .kanban-column .column-title .column-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
:root .crm-operational .kanban-column .column-title .count { flex: none; margin-left: auto; background: rgb(255 255 255 / 25%); color: #fff; }
:root .crm-operational :is(.lead-card, .crm-record-card) { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; box-shadow: 0 1px 2px rgb(32 36 68 / 6%); transition: box-shadow .15s, transform .15s, border-color .15s; }
:root .crm-operational :is(.lead-card, .crm-record-card):hover { border-color: var(--clean-border); box-shadow: var(--clean-shadow-hover);
  background: var(--panel); transform: translateY(-1px); }
:root .crm-operational .lead-card-name { font-weight: 600; color: var(--text); }
:root .crm-operational .lead-card-id { color: var(--muted); }
:root .crm-operational .record-card-status { margin: 6px 0; }
:root .crm-operational .load-more { border-radius: 6px; border: 1px dashed var(--clean-border); background: transparent; color: var(--muted); }

/* ---------- diálogos e avisos ---------- */
:root .crm-operational dialog { border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgb(0 0 0 / 25%); }
:root .crm-operational .pagination .page-number { border-radius: 4px; }

/* ---------- formulários e campos (todas as telas) ----------
   Mesmo seletor do controls.css com :root a mais: vence pela especificidade, sem !important. */
html:root body:is(.crm-operational, .account-page) :is(input, select, textarea):not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=file]) {
  border-radius: var(--field-radius); font-family: inherit; font-size: var(--field-font); transition: border-color .12s, box-shadow .12s; }
html:root body:is(.crm-operational, .account-page) :is(input, select):not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=file]) {
  height: 40px; min-height: 40px; padding-inline: 12px; }
html:root body:is(.crm-operational, .account-page) textarea { min-height: 88px; height: auto; padding: 10px 12px; line-height: 1.6; field-sizing: content; max-height: 320px; }
html:root body:is(.crm-operational, .account-page) :is(input, textarea)::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
html:root body:is(.crm-operational, .account-page) select:invalid, html:root body:is(.crm-operational, .account-page) select:has(option[value=""]:checked) { color: color-mix(in srgb, var(--muted) 70%, transparent); }
/* Desabilitado como no NimbusLaw: mesmo campo, esmaecido. Somente leitura continua com o fundo neutro. */
html:root body:is(.crm-operational, .account-page) :is(input, select, textarea):disabled { opacity: .5; cursor: not-allowed; }
/* Arquivo: mesma caixa dos demais campos; o botão nativo vira texto. */
html:root body:is(.crm-operational, .account-page) input[type=file] {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--clean-border); border-radius: var(--field-radius);
  background: var(--panel); color: var(--text); font: inherit; font-size: var(--field-font); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
html:root body:is(.crm-operational, .account-page) input[type=file]::file-selector-button {
  margin-right: 10px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
/* Checkbox e radio: 16 px, borda do campo e preenchimento azul quando marcado (sem imagem, só CSS).
   [type=…][type=…] repete o atributo para vencer a regra de fundo de ".input" do theme.css no tema claro. */
html:root body:is(.crm-operational, .account-page) :is(input[type=checkbox][type=checkbox], input[type=radio][type=radio]) {
  appearance: none; -webkit-appearance: none; position: relative; display: inline-grid; place-content: center; flex: 0 0 16px;
  width: 16px; height: 16px; min-height: 0; padding: 0; border: 1px solid var(--field-check-border); border-radius: 4px;
  background: var(--panel); vertical-align: middle; cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s; }
html:root body:is(.crm-operational, .account-page) input[type=radio][type=radio] { border-radius: 50%; }
html:root body:is(.crm-operational, .account-page) :is(input[type=checkbox][type=checkbox], input[type=radio][type=radio]):checked { background: var(--clean-focus); border-color: var(--clean-focus); }
html:root body:is(.crm-operational, .account-page) input[type=checkbox][type=checkbox]:checked::after {
  content: ""; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
html:root body:is(.crm-operational, .account-page) input[type=checkbox][type=checkbox]:indeterminate { background: var(--clean-focus); border-color: var(--clean-focus); }
html:root body:is(.crm-operational, .account-page) input[type=checkbox][type=checkbox]:indeterminate::after { content: ""; width: 8px; height: 2px; background: #fff; }
html:root body:is(.crm-operational, .account-page) input[type=radio][type=radio]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
html:root body:is(.crm-operational, .account-page) :is(input[type=checkbox][type=checkbox], input[type=radio][type=radio]):focus-visible { outline: none; box-shadow: var(--field-ring); }
html:root body:is(.crm-operational, .account-page) :is(input[type=checkbox][type=checkbox], input[type=radio][type=radio]):focus:not(:focus-visible) { box-shadow: none; }
html:root body:is(.crm-operational, .account-page) :is(input[type=checkbox][type=checkbox], input[type=radio][type=radio]):disabled { opacity: .5; cursor: not-allowed; }
@supports (appearance: base-select) {
  html:root body:is(.crm-operational, .account-page) select::picker-icon {
    content: ""; position: absolute; top: 50%; right: 15px; left: auto; width: 7px; height: 7px; display: block;
    border: 0; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); border-radius: 0;
    background: none; box-shadow: none; transform: translateY(-70%) rotate(45deg); }
  html:root body:is(.crm-operational, .account-page) select::picker(select) { border-radius: 6px; border-color: var(--line); box-shadow: var(--clean-shadow-hover); padding: 4px; }
  html:root body:is(.crm-operational, .account-page) select:not([multiple]):not([size]) option { min-height: 36px; padding: 8px 32px 8px 8px; border-radius: 4px; font-size: .875rem; line-height: 1.35; }
  html:root body:is(.crm-operational, .account-page) select:not([multiple]):not([size]) option:is(:hover, :focus-visible) { background: var(--clean-hover); color: var(--text); }
  html:root body:is(.crm-operational, .account-page) select:not([multiple]):not([size]) option:checked { background: transparent; font-weight: 600; }
}
/* Rótulos, ajuda e espaçamento. */
:root .crm-operational :is(.crm-form, .card-form, dialog form) :is(label, .field > span, .form-field > label) { font-size: var(--field-label); font-weight: 500; line-height: 1.5; color: var(--text); text-transform: none; letter-spacing: normal; }
:root .crm-operational :is(.helptext, .hint, .form-help, .field-help) { font-size: .75rem; color: var(--muted); }
:root .crm-operational .crm-form :is(.form-grid, .form-fields) { gap: 18px 24px; }
:root .crm-operational .crm-form .form-field { gap: 6px; }
:root .crm-operational :is(.errorlist, .form-error) { font-size: .75rem; color: var(--st-red); }
:root .crm-operational :is(input, select, textarea)[aria-invalid=true] { --control-border: var(--st-red) !important; }
:root .crm-operational .form-actions { border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- um único card branco por página ----------
   A área principal é o card; painéis internos não repetem fundo, borda nem sombra. */
:root .crm-operational .app-workspace > .content :is(.panel, .card-section, .record-section, .admin-editor, .context-panel) {
  background: transparent; border: 0; box-shadow: none; border-radius: 0; }
:root .crm-operational .app-workspace > .content :is(.crm-form.panel, form > .panel, .panel:has(> .crm-form), .panel:has(> form)) { padding-inline: 0; }
/* Seções lado a lado continuam separadas por uma linha fina. */
:root .crm-operational .app-workspace > .content :is(.record-section + .record-section, .panel + .panel) { border-top: 1px solid var(--line); border-radius: 0; }

/* Campos com ícone (busca, senha): recuo para o ícone e ícone centralizado na altura de 40 px.
   Uma classe a mais que a regra geral de campos, para vencer o recuo de 12 px. */
html:root body:is(.crm-operational, .account-page) :is(.input-icon, .input-shell) > :is(input, .input):not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=file]) {
  padding-left: 38px; }
html:root body:is(.crm-operational, .account-page) .input-shell--password > input:not([type=hidden]) { padding-right: 48px; }
html:root body:is(.crm-operational, .account-page) :is(.input-icon, .input-shell) { position: relative; }
html:root body:is(.crm-operational, .account-page) :is(.input-icon, .input-shell) > .icon {
  position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
/* Caixa de mensagem dos chats: uma linha que cresce com o texto; a borda é a do compositor. */
html:root body:is(.crm-operational, .account-page) :is(.composer-input, .whatsapp-composer .composer-input) textarea {
  min-height: 40px; height: auto; max-height: 140px; field-sizing: content; border: 0; box-shadow: none; padding: 9px 8px; resize: none; }
html:root body.crm-operational .composer-input { border-radius: 8px; border: 1px solid var(--clean-border); background: var(--panel); align-items: center; }
html:root body.crm-operational .composer-input:focus-within { border-color: var(--clean-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clean-focus) 22%, transparent); }
html:root body.crm-operational .composer-input textarea:focus { box-shadow: none !important; }

/* Menu lateral: em telas menores o reference.css centraliza os itens (pensado para o modo só ícones);
   com o menu aberto, os itens ficam alinhados à esquerda. O modo recolhido (.collapsed) continua centralizado. */
:root .crm-operational .nav-link { justify-content: flex-start; padding: 8px 12px; }
:root .crm-operational .collapsed .nav-link { justify-content: center; padding: 9px; }

/* Campos de arquivo e foto do dicionário: miniatura e link do arquivo. */
html:root body.crm-operational .field-file-image { display: inline-block; border: 1px solid var(--clean-border); border-radius: 6px; overflow: hidden; line-height: 0; }
html:root body.crm-operational .field-file-image img { display: block; max-width: 160px; max-height: 120px; object-fit: cover; }
html:root body.crm-operational .field-file-link { display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }

/* Botão de ação destrutiva nos pop-ups de fluxo. */
html:root body.crm-operational .flow-button-danger { color: #d83a52; border-color: #d83a52; }
html:root body.crm-operational .flow-button-danger:hover { background: #fdecef; }

/* Seleção de cartões no Kanban (fluxos em lote). */
html:root body.crm-operational .kanban-selection, html:root body.crm-operational .kanban-selection.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
html:root body.crm-operational .kanban-selection [aria-pressed="true"] { background: var(--clean-focus); border-color: var(--clean-focus); color: #fff; }
html:root body.crm-operational .lead-card { position: relative; }
html:root body.crm-operational .card-select { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; padding: 2px; border-radius: 4px; background: var(--surface, #fff); }
html:root body.crm-operational .card-select[hidden] { display: none; }
html:root body.crm-operational .card-select input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
html:root body.crm-operational .kanban.is-selecting .lead-card { cursor: pointer; }
html:root body.crm-operational .kanban.is-selecting .lead-card.is-selected { outline: 2px solid var(--clean-focus); outline-offset: -2px; }

/* Processos em andamento no detalhe do registro. */
html:root body.crm-operational .record-process-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
html:root body.crm-operational .record-process-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--clean-border); border-radius: 6px; }
html:root body.crm-operational .record-process-list li > div:first-child { display: grid; gap: 2px; min-width: 0; }
html:root body.crm-operational .record-process-list li > div:first-child span { font-size: .8125rem; color: var(--muted); }
html:root body.crm-operational .record-process-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .8125rem; color: var(--muted); }
html:root body.crm-operational .record-process-sla { padding: 1px 8px; border-radius: 999px; font-weight: 600; color: #fff; background: var(--sla, #676879); }
html:root body.crm-operational .record-process-sla.sla-soon { color: #3b2a00; }
html:root body.crm-operational .sla-ok { --sla: #00a35c; }
html:root body.crm-operational .sla-soon { --sla: #f2b600; }
html:root body.crm-operational .sla-late { --sla: #d83a52; }

/* Alerta de parado no cartão do Kanban (limite de inatividade da etapa). */
html:root body.crm-operational .card-stalled { display: inline-flex; align-items: center; margin-left: 4px; padding: 1px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; color: #d83a52; background: #fdecef; border: 1px solid #f6c1ca; }

/* Filtros: o radio fica oculto e o rótulo inteiro é a opção; o padrão de checkbox/radio acima não o exibe. */
html:root body.crm-operational .crm-filter-group input[type=radio][type=radio] { position: absolute; width: 1px; height: 1px; flex-basis: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- telas de acesso (login, senha, convites) ----------
   Campos no padrão do login do NimbusLaw (44 px, cantos 6 px, texto 15 px, rótulo 13 px, anel de 3 px),
   sobre o cenário escuro aprovado; a cor de destaque continua a da marca. */
html:root body.auth-page {
  --auth-field-border: #ffffff2e; --auth-field-hover: #ffffff52;
  --auth-field-ring: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent);
}
html:root[data-theme=light] body.auth-page { --auth-field-border: #c3c6d4; --auth-field-hover: #9aa0b4; }
html:root body.auth-page :is(input, select, textarea):not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=file]) {
  border: 1px solid var(--auth-field-border); border-radius: 6px; background: var(--color-input); color: var(--color-text); font-family: inherit; font-size: .9375rem;
  box-shadow: none; transition: border-color .12s, box-shadow .12s; }
html:root body.auth-page :is(input, select):not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=file]) {
  height: 44px; min-height: 44px; padding-block: 0; padding-inline: 14px; }
html:root body.auth-page :is(input, select, textarea):not([type=hidden]):not(:disabled):hover { border-color: var(--auth-field-hover); }
html:root body.auth-page :is(input, select, textarea):not([type=hidden]):focus { outline: none; border-color: var(--color-primary); box-shadow: var(--auth-field-ring); }
html:root body.auth-page :is(input, select, textarea)[aria-invalid=true] { border-color: var(--color-danger); }
html:root body.auth-page :is(input, textarea)::placeholder { color: color-mix(in srgb, var(--color-muted) 70%, transparent); }
html:root body.auth-page .input-shell > input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=file]) { padding-left: 40px; }
html:root body.auth-page .input-shell--password > input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=file]) { padding-right: 48px; }
html:root body.auth-page .input-shell > .icon { top: 50%; left: 13px; width: 18px; height: 18px; transform: translateY(-50%); }
html:root body.auth-page .password-toggle { top: 0; right: 0; width: 44px; height: 44px; border-radius: 6px; }
html:root body.auth-page .form-field label { margin-bottom: 6px; font-size: .8125rem; font-weight: 500; }
html:root body.auth-page .form-stack { gap: 14px; }
html:root body.auth-page .auth-card .button { min-height: 44px; border-radius: 6px; font-size: .9375rem; font-weight: 500; }
html:root body.auth-page .auth-card .button:focus-visible { outline: none; box-shadow: var(--auth-field-ring); }
@media (max-width: 639px) {
  /* 16 px evita o zoom automático ao digitar no celular. */
  html:root body.auth-page :is(input, select, textarea):not([type=hidden]):not([type=checkbox]):not([type=radio]) { font-size: 1rem; }
}

/* Link de voltar: separado do conteúdo abaixo em qualquer tela (o automation-workspace.css nem sempre é carregado). */
:root .crm-operational .automation-back { display: flex; width: fit-content; align-items: center; gap: 8px; min-height: 40px; margin: 0 0 16px; color: var(--muted); }
:root .crm-operational .automation-back:hover { color: var(--text); }

/* Confirmações em pop-up (page-dialog.js): compactas, sem a moldura da página. */
:root .crm-operational dialog.page-dialog { width: min(520px, calc(100vw - 32px)); }
:root .crm-operational dialog.page-dialog .dialog-head { display: flex; align-items: center; justify-content: space-between; }
:root .crm-operational dialog.page-dialog .dialog-head h2 { font-size: 1.125rem; font-weight: 600; }
:root .crm-operational dialog.page-dialog .icon-btn { font-size: 1.5rem; line-height: 1; }
:root .crm-operational dialog.page-dialog .page-dialog-note { margin: 0 0 16px; line-height: 1.55; }
:root .crm-operational dialog.page-dialog form { padding: 0; border: 0; background: none; }
:root .crm-operational dialog.page-dialog .form-actions { margin-top: 8px; padding-top: 16px; }

/* Card do Kanban compacto, com o rodapé de volta (atividade, data, responsável e Mover etapa).
   Sem a margem dupla: o card não tem recuo próprio; cada faixa interna cuida do seu. */
:root .crm-operational .kanban :is(.lead-card, .crm-record-card) { padding: 0; min-height: 0; }
:root .crm-operational .kanban .record-card-main { gap: 5px; padding: 10px 12px 8px; border-radius: 8px 8px 0 0; }
:root .crm-operational .kanban .record-card-main .lead-card-name { font-size: .8125rem; }
:root .crm-operational .kanban .record-card-status { margin: 0; }
:root .crm-operational .kanban :is(.record-card-status .status-pill, .record-card-status .status) { min-width: 0; padding: 1px 8px; font-size: .6875rem; }
:root .crm-operational .kanban .record-card-main .lead-card-id { font-size: .6875rem; }
:root .crm-operational .kanban .record-card-activity { gap: 8px; padding: 7px 12px; font-size: .71875rem; }
:root .crm-operational .kanban .record-card-activity > .icon { width: 16px; }
:root .crm-operational .kanban .record-card-count { min-width: 20px; height: 20px; font-size: .6875rem; }
:root .crm-operational .kanban .record-card-footer { padding: 6px 12px 8px; }
:root .crm-operational .kanban .record-card-owner .icon { width: 20px; height: 20px; }
:root .crm-operational .kanban .kanban-move-link { margin: 0 12px 8px; min-height: 22px; }

/* Botões (21/11/2026): cor sólida por intenção e sem borda (pedido do usuário; nada transparente ou contornado).
   Confirmar/salvar verde, excluir/parar vermelho, pausar laranja, editar azul, criar amarelo da marca,
   navegação (Voltar/Cancelar/Etapas) cinza. Tons escolhidos para texto legível (contraste mínimo 4,5:1).
   ":root:root" vence as bordas de theme.css sem !important. */
:root {
  --btn-neutral: #e6e9ef; --btn-neutral-hover: #d5d9e2; --btn-neutral-text: #1f2430;
  --btn-success: var(--st-dark-green); --btn-success-hover: color-mix(in srgb, var(--st-dark-green) 80%, #000);
  --btn-danger: color-mix(in srgb, var(--st-red) 82%, #000); --btn-danger-hover: color-mix(in srgb, var(--st-red) 68%, #000);
  --btn-edit: #0060c2; --btn-edit-hover: #004c9a;
}
:root[data-theme="dark"] { --btn-neutral: #3a3b40; --btn-neutral-hover: #4a4b51; --btn-neutral-text: #f3f4f6; }
:root:root .crm-operational :is(.btn, .button) { border-color: transparent; box-shadow: none;
  background: var(--btn-neutral); color: var(--btn-neutral-text); }
:root:root .crm-operational :is(.btn, .button):hover { border-color: transparent; background: var(--btn-neutral-hover); color: var(--btn-neutral-text); }
:root:root .crm-operational :is(.btn, .button).btn-outline { background: var(--btn-neutral); }
:root:root .crm-operational :is(.btn, .button).btn-outline:hover { background: var(--btn-neutral-hover); }
:root:root .crm-operational :is(.btn-primary, .button--primary) { background: var(--gold); border-color: transparent; color: #1f1f1f; font-weight: 600; }
:root:root .crm-operational :is(.btn-primary, .button--primary):hover { background: var(--gold-hover); border-color: transparent; color: #1f1f1f; }
:root:root .crm-operational :is(.form-actions, .card-form-actions) button[type="submit"].btn-primary:not(.btn-danger, .btn-warning),
:root:root .crm-operational .btn.btn-success { background: var(--btn-success); color: #fff; font-weight: 600; }
:root:root .crm-operational :is(.form-actions, .card-form-actions) button[type="submit"].btn-primary:not(.btn-danger, .btn-warning):hover,
:root:root .crm-operational .btn.btn-success:hover { background: var(--btn-success-hover); color: #fff; }
:root:root .crm-operational .btn:is(.btn-danger, .btn-danger-soft) { background: var(--btn-danger); color: #fff; font-weight: 600; }
:root:root .crm-operational .btn:is(.btn-danger, .btn-danger-soft):hover { background: var(--btn-danger-hover); color: #fff; }
:root:root .crm-operational .btn.btn-warning { background: var(--st-orange); color: #1f1f1f; font-weight: 600; }
:root:root .crm-operational .btn.btn-warning:hover { background: color-mix(in srgb, var(--st-orange) 85%, #000); color: #1f1f1f; }
:root:root .crm-operational .btn.btn-edit { background: var(--btn-edit); color: #fff; }
:root:root .crm-operational .btn.btn-edit:hover { background: var(--btn-edit-hover); color: #fff; }
:root:root .crm-operational .btn .icon { color: currentColor; }
:root:root .crm-operational :is(.btn, .button):focus-visible { outline: 2px solid var(--clean-focus, #0073ea); outline-offset: 2px; }
/* Sem borda, os botões de linha precisam de respiro entre si. */
:root .crm-operational .row-actions { gap: 6px; flex-wrap: wrap; }

/* ---------- tabela em quadro (estilo monday): grade, status preenchendo a célula, pessoa com avatar ---------- */
:root .crm-operational .board-table { border-collapse: collapse; }
:root .crm-operational .board-table th, :root .crm-operational .board-table td { border-right: 1px solid var(--line); vertical-align: middle; }
:root .crm-operational .board-table th:last-child, :root .crm-operational .board-table td:last-child { border-right: 0; }
:root .crm-operational .board-table th:not([data-column="name"]):not(:first-child) { text-align: center; }
:root .crm-operational .board-table td { padding-top: 8px; padding-bottom: 8px; }
:root .crm-operational .board-table td.cell-status { padding: 0; min-width: 150px; text-align: center; color: #fff; font-weight: 500;
  font-size: .8125rem; background: var(--accent, var(--st-grey)); border-right: 1px solid var(--panel); border-bottom: 1px solid var(--panel);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
:root .crm-operational .board-table td.cell-status-empty { background: color-mix(in srgb, var(--muted) 18%, var(--panel)); color: var(--muted); }
:root .crm-operational .board-table td.cell-source { text-align: center; }
:root .crm-operational .board-table .cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; }
:root .crm-operational .board-table td.cell-person { text-align: center; }
:root .crm-operational .person-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
:root .crm-operational .person-avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--clean-focus); color: #fff; font-size: .75rem; font-weight: 600; }
:root .crm-operational .person-empty { color: var(--muted); }
:root .crm-operational .person-empty .person-avatar { background: color-mix(in srgb, var(--muted) 22%, var(--panel)); color: var(--muted); }
:root .crm-operational .person-empty .person-avatar .icon { width: 16px; height: 16px; }

/* Logo da empresa: rodapé do menu e tela Minha empresa (a imagem nunca é cortada nem deformada). */
:root .crm-operational .sidebar-footer .company-mark { display: block; max-width: 150px; max-height: 48px; width: auto; height: auto; object-fit: contain; }
:root .crm-operational .company-logo-image { display: block; max-width: 220px; max-height: 120px; object-fit: contain; margin: 0 auto; }
:root .crm-operational .company-logo-form { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -8px 0 18px; }
:root .crm-operational .company-logo-form .hint { flex-basis: 100%; margin: 0; font-size: .75rem; }

/* ---------- barra de seleção flutuante (ações em lote, como no monday): branca, com borda, só com itens marcados ---------- */
html:root body.crm-operational .selection-bar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; max-width: calc(100vw - 32px); overflow-x: auto; padding: 8px 10px 8px 8px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .16); }
html:root body.crm-operational .selection-bar[hidden] { display: none; }
html:root body.crm-operational .selection-bar .selection-count { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border-radius: 6px; background: var(--clean-focus); color: #fff; font-weight: 600; font-size: .8125rem; white-space: nowrap; }
html:root body.crm-operational .selection-bar .bulk-filter { padding: 0 6px; color: var(--text); font-size: .8125rem; }
html:root body.crm-operational .selection-bar .selection-close { margin-left: 4px; border-left: 1px solid var(--line); border-radius: 0; padding-left: 8px; }
@media (max-width: 760px) { html:root body.crm-operational .selection-bar { bottom: 12px; } }
html:root body.crm-operational .selection-bar > * { flex: none; white-space: nowrap; }

/* ---------- seletor de cor: paleta pronta + personalizada ---------- */
:root .crm-operational .color-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
:root .crm-operational .color-swatches { display: grid; grid-template-columns: repeat(10, 28px); gap: 6px; }
:root .crm-operational .color-swatch { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
:root .crm-operational .color-swatch[aria-checked="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
:root .crm-operational .color-swatch:focus-visible { outline: 2px solid var(--clean-focus); outline-offset: 2px; }
:root .crm-operational .color-custom { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; font-size: .8125rem; }
:root .crm-operational .color-custom input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
:root .crm-operational .color-preview { width: 24px; height: 24px; border-radius: 4px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .1); }
:root .crm-operational .color-code { font-family: ui-monospace, monospace; }
:root .crm-operational .color-custom::after { content: "Personalizada"; color: var(--muted); }
@media (max-width: 520px) { :root .crm-operational .color-swatches { grid-template-columns: repeat(5, 28px); } }

/* ---------- padrão monday para todas as tabelas ----------
   Grade vertical, colunas centralizadas (nome/pessoa à esquerda) e qualquer etiqueta colorida sozinha na célula
   ocupa a célula inteira, como a coluna de status. */
:root .crm-operational .table { border-collapse: collapse; }
:root .crm-operational .table :is(th, td) { border-right: 1px solid var(--line); vertical-align: middle; }
:root .crm-operational .table :is(th, td):last-child { border-right: 0; }
:root .crm-operational .table :is(th, td):not(:first-child) { text-align: center; }
:root .crm-operational .table :is(th, td)[data-column="name"],
:root .crm-operational .table td:has(.person-cell, .person-chip, .name-link) { text-align: left; }
:root .crm-operational .table .row-actions { justify-content: center; }
:root .crm-operational .table td:has(> :is(.status, .status-pill, .badge.stage, .badge.channel-badge, .flow-failures):only-child) {
  position: relative; min-width: 120px; height: 46px; padding: 0; }
:root .crm-operational .table td > :is(.status, .status-pill, .badge.stage, .badge.channel-badge, .flow-failures):only-child {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: auto; min-width: 0; max-width: none;
  margin: 0; padding: 0 10px; border: 0; border-radius: 0; font-weight: 500; text-align: center; }
/* Célula de status montada no próprio td (com uma segunda linha opcional). */
:root .crm-operational .table td.cell-status { padding: 6px 10px; min-width: 130px; text-align: center; color: #fff; font-weight: 500;
  font-size: .8125rem; background: var(--accent, var(--st-grey)); border-right: 1px solid var(--panel); border-bottom: 1px solid var(--panel); }
:root .crm-operational .table td.cell-status .cell-main { display: block; }
:root .crm-operational .table td.cell-status .cell-sub { display: block; margin-top: 2px; color: rgb(255 255 255 / .85); font-size: .72rem; font-weight: 400; }
:root .crm-operational .table td.cell-status-empty { background: color-mix(in srgb, var(--muted) 18%, var(--panel)); color: var(--muted); }
:root .crm-operational .table td.cell-channel { --accent: color-mix(in srgb, var(--channel-color, #626972) 94%, #000); }
:root .crm-operational .table td.cell-role { --accent: #579bfc; }
:root .crm-operational .table td.cell-team { --accent: #a25ddc; }

/* Áreas roláveis (tabelas, quadros, regiões): sem contorno ao clicar ou selecionar; o foco do teclado fica nos controles de dentro. */
html:root body.crm-operational :is(.table-wrap, [role="region"], .kanban, .lead-cards)[tabindex]:is(:focus, :focus-visible) { outline: none; box-shadow: none; }

/* Pedido do usuário: nenhum contorno de foco ou seleção em lugar nenhum (botões, links, cartões, tabelas, regiões).
   Campos de digitação continuam mudando só a cor da própria borda. */
html:root body:is(.crm-operational, .account-page, .auth-page) *:is(:focus, :focus-visible):not(input):not(textarea):not(select) {
  outline: none !important; box-shadow: none !important; }
html:root body:is(.crm-operational, .account-page, .auth-page) :is(input[type=checkbox], input[type=radio], input[type=color]):is(:focus, :focus-visible) {
  outline: none !important; box-shadow: none !important; }

/* Editor de opções de lista: linhas de chave + texto, sem bordas extras. */
:root .crm-operational .choice-editor { display: grid; gap: 6px; }
:root .crm-operational .choice-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 36px; gap: 8px; align-items: center; }
:root .crm-operational .choice-head span { color: var(--muted); font-size: .75rem; }
:root .crm-operational .choice-editor > .btn { justify-self: start; margin-top: 4px; }
:root .crm-operational [hidden].card-field, :root .crm-operational [hidden].form-field { display: none; }

/* ---------- avisos: contador do sino, níveis e link no alerta flutuante ---------- */
html:root body .notification-count { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #e2445c; color: #fff; font-size: .625rem; font-weight: 700; line-height: 17px; text-align: center; pointer-events: none; }
html:root body .notification-button:has(.notification-count:not([hidden]))::after { display: none; }
html:root body .flash .flash-link { color: inherit; font-weight: 600; text-decoration: underline; }
html:root body .notice-level { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: .6875rem;
  font-weight: 600; color: #fff; background: #579bfc; white-space: nowrap; }
html:root body .notice-level.level-preventive { background: #fdab3d; color: #323338; }
html:root body .notice-level.level-overdue { background: #e2445c; }
html:root body .notice-level.level-escalation { background: #bb3354; }
html:root body .notice-level .icon { width: 12px; height: 12px; }
html:root body .notice-row { border-left: 4px solid #579bfc; padding-left: 12px; }
html:root body .notice-row.level-preventive { border-left-color: #fdab3d; }
html:root body .notice-row.level-overdue { border-left-color: #e2445c; }
html:root body .notice-row.level-escalation { border-left-color: #bb3354; }
html:root body .notice-row.is-resolved { opacity: .65; }
html:root body .notice-message { margin: 2px 0 0; font-size: .8125rem; }

/* ---------- área de envio de arquivo (dropzone): cores do tema, formato da referência ---------- */
html:root body .dropzone-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
html:root body .dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 140px; padding: 24px 16px; border: 1px solid var(--clean-border, var(--line)); border-radius: 16px;
  background: var(--clean-surface-2, var(--panel)); color: var(--muted); text-align: center; cursor: pointer;
  transition: background .12s, border-color .12s; }
html:root body .dropzone:hover, html:root body .dropzone.is-over { background: var(--clean-hover, #f0f2f5); border-color: var(--muted); }
html:root body .dropzone .icon { width: 28px; height: 28px; color: var(--text); }
html:root body .dropzone-text { font-size: .875rem; }
html:root body .dropzone-text strong { color: var(--text); font-weight: 500; }
html:root body .dropzone-file { font-size: .8125rem; font-weight: 600; color: var(--text); word-break: break-all; }
html:root body .dropzone.has-file .dropzone-text { display: none; }
html:root body label.dropzone, html:root body label.dropzone .dropzone-text { font-weight: 400; color: var(--muted); }
html:root body label.dropzone .dropzone-text strong { font-weight: 500; color: var(--text); }

/* Lista de leads: mover coluna arrastando o cabeçalho. */
:root .crm-operational .board-table th[data-column-move] { cursor: grab; user-select: none; }
:root .crm-operational .board-table th.is-dragging { opacity: .45; }
:root .crm-operational .board-table th.is-drop-before { box-shadow: inset 3px 0 0 var(--clean-focus); }
:root .crm-operational .board-table th.is-drop-after { box-shadow: inset -3px 0 0 var(--clean-focus); }
