﻿@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --line: #c7ccd5;
  --line-soft: #e4e8ef;
  --text: #101418;
  --muted: #596171;
  --blue: #075bc5;
  --blue-2: #2874e3;
  --blue-soft: #e7f0ff;
  --green: #009f68;
  --green-soft: #c9f8df;
  --red: #c91414;
  --red-soft: #ffd8d8;
  --dark: #111b2d;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --warning: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 42px rgba(15, 23, 42, 0.09);
  --radius: 12px;
  --radius-sm: 9px;
  --tap-size: 44px;
  --topbar-height: 58px;
}

/* ==========================================================================
   TEMA CLARO / ESCURO — Lote 15
   ==========================================================================
   Tokens sensiveis a tema. O prefixo --theme- e' deliberado: separa o que muda
   com o tema dos 33 tokens legados acima, que continuam valendo como estao.

   REGRA DURA: os valores CLAROS abaixo sao EXATAMENTE os que a tela ja renderiza
   hoje. Tokenizar e' trocar o hex pela variavel, nunca mudar o valor. O harness
   (tools/tema-harness.js) prova isso a cada lote — diff vazio ou o lote nao sobe.

   Alguns tokens sao de COMPONENTE (--theme-topbar-bg) e nao de paleta. Nao e'
   inconsistencia: o cabecalho usa rgba(255,255,255,.96), um valor que nao existe
   na paleta do guia. Forcar ele num token de paleta mudaria o claro.

   Paleta escura derivada da identidade do sistema (o mesmo marinho da sidebar,
   que ja era escura). Aprovada em 27/08. */
:root {
  /* neutros */
  --theme-bg: #f3f6fa;
  --theme-bg-elev: #eef2f7;
  --theme-surface: #ffffff;
  --theme-surface-muted: #f8fafc;
  --theme-line: #e7eaf0;
  --theme-line-soft: #eef2f7;
  --theme-text-strong: #101828;
  --theme-text: #172033;
  --theme-text-muted: #475467;
  --theme-text-faint: #8a93a3;

  /* acao */
  --theme-primary: #2563eb;
  --theme-primary-hover: #1d4ed8;
  --theme-primary-ink: #2563eb;      /* icone/texto em cima de superficie */

  /* semanticos — tinta */
  --theme-danger-ink: #ef4444;
  --theme-success-ink: #17c964;

  /* componentes do Lote 15 */
  --theme-topbar-bg: rgba(255, 255, 255, 0.96);
  --theme-topbar-line: rgba(148, 163, 184, 0.28);
  --theme-menu-bg: #ffffff;
  --theme-menu-line: #d8e0ea;
  --theme-menu-hover: #f8fafc;
  --theme-menu-shadow: 0 18px 45px rgba(15, 23, 42, .16);
  --theme-avatar-ring: #e6efff;
  --theme-avatar-halo: #f8fbff;
  --theme-icon-neutral: #667085;
  --theme-topbar-label: #344054;
  --theme-text-soft: #667085;
  --theme-text-dim: #9aa1ac;
  --theme-topbar-hover: #f2f6fb;
  --theme-switch-track: #f8fafc;
  --theme-switch-on: #ffffff;

  /* --- Barra lateral (redesenho) ------------------------------------------
     Valores do mockup. Nenhum hex vai para o componente: tudo passa por aqui,
     com par claro/escuro, para a barra trocar de tema inteira. */
  --theme-nav-bg: #ffffff;
  --theme-nav-ink: #334155;          /* rotulo de 1o nivel */
  --theme-nav-ink-soft: #475569;     /* subitem */
  --theme-nav-hover: rgba(15, 23, 42, 0.045);
  --theme-nav-group-bg: #f5f8fc;     /* cartao do grupo aberto */
  --theme-nav-guide: #dbe3ee;        /* linha-guia do submenu */
  --theme-nav-divider: #e7eaf0;
  --theme-nav-accent: #2563eb;       /* pilula do item ativo */
  --theme-nav-accent-ink: #ffffff;
  --theme-nav-accent-soft: #e8f0fe;  /* quadradinho do icone do grupo */
  --theme-nav-accent-icon: #2563eb;
  --theme-nav-accent-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);

  /* Sidebar no tema CLARO — o desenho que ja existia no arquivo antes de ela
     escurecer, mais as tintas da paleta do guia. Ver a nota no bloco .sidebar. */
  --theme-sidebar-de: #f8fafc;
  --theme-sidebar-ate: #eef4fb;
  --theme-sidebar-line: rgba(148, 163, 184, 0.38);
  --theme-sidebar-shadow: 12px 0 28px rgba(15, 23, 42, 0.04);
  --theme-sidebar-ink: #334155;
  --theme-sidebar-ink-strong: #1b2536;
  --theme-sidebar-hover-bg: rgba(15, 23, 42, 0.05);
  --theme-sidebar-hover-line: rgba(148, 163, 184, 0.35);
  --theme-sidebar-submenu-ink: #5a6472;
  --theme-sidebar-subitem-ink: #475569;

  /* --- Consultar Contratos (screen-contracts) ------------------------------
     Nenhum hex vai para o componente: a tela inteira le daqui.

     POR QUE NAO HA BLOCO ESCURO AINDA (25/09/2026, decisao do Andre)
     Hoje so cabecalho, menu e barra lateral escurecem — TODA a area de conteudo
     segue clara no tema escuro. Dar valores escuros so a estes tokens faria
     esta tela virar uma ILHA escura numa pagina clara. A medicao que sustenta
     isso esta no branch feat/tema-conteudo-escuro: 173 regressoes de contraste
     em 98 causas, ou seja, escurecer o conteudo e' projeto, nao lote.
     Quando esse projeto acontecer, esta tela vira junto redefinindo estes
     tokens em UM bloco `:root[data-theme="dark"]` — nada muda no componente.

     Todos os valores saem da paleta do GUIA_DE_PADROES.md (secao 1.2). */
  --ctr-surface: #ffffff;
  --ctr-surface-bar: #f7f8fa;
  --ctr-line: #e7eaf0;
  --ctr-line-soft: #f1f4f8;
  --ctr-ink-strong: #1b2536;
  --ctr-ink: #334155;
  --ctr-ink-soft: #5a6472;
  --ctr-ink-faint: #8a93a3;
  --ctr-accent: #2563eb;
  --ctr-field-line: #d8dde6;
  --ctr-row-hover: #fafbfc;
  /* pares semanticos — tom claro / tinta escura */
  --ctr-success-tint: #e1f5ee;
  --ctr-success-ink: #0f6e56;
  --ctr-warning-tint: #faeeda;
  --ctr-warning-ink: #854f0b;
  --ctr-danger-tint: #fbeaf0;
  --ctr-danger-ink: #993556;
  --ctr-neutral-tint: #eef2f7;
  --ctr-neutral-ink: #475569;
  /* faixa da linha inteira — bem mais suave que o badge, para tingir sem gritar */
  --ctr-row-danger: #fdf6f8;
  --ctr-row-warning: #fdfbf5;
}

:root[data-theme="dark"] {
  --theme-bg: #101d31;
  --theme-bg-elev: #16233a;
  --theme-surface: #1b2c47;
  --theme-surface-muted: #24344f;
  --theme-line: #2e4160;
  --theme-line-soft: #243350;
  --theme-text-strong: #eaf0f9;
  --theme-text: #d3dfee;
  --theme-text-muted: #b4c3d8;
  --theme-text-faint: #9fb1cc;

  /* no escuro o hover CLAREIA: escurecer some com o botao no fundo escuro */
  --theme-primary: #2563eb;
  --theme-primary-hover: #3b82f6;
  --theme-primary-ink: #7fb6ec;

  --theme-danger-ink: #f093af;
  --theme-success-ink: #6fd3b0;

  --theme-topbar-bg: rgba(22, 35, 58, 0.96);
  --theme-topbar-line: rgba(46, 65, 96, 0.9);
  --theme-menu-bg: #1b2c47;
  --theme-menu-line: #2e4160;
  --theme-menu-hover: #24344f;
  /* sombra clara e' invisivel no escuro: precisa de preto de verdade */
  --theme-menu-shadow: 0 18px 45px rgba(0, 0, 0, .55);
  --theme-avatar-ring: #24344f;
  --theme-avatar-halo: #16233a;
  /* no escuro a selecionada precisa ficar MAIS CLARA que o trilho, senao ela
     afunda em vez de elevar — o inverso do que o olho espera. */
  --theme-icon-neutral: #9fb1cc;
  --theme-topbar-label: #b4c3d8;
  --theme-text-soft: #9fb1cc;
  --theme-text-dim: #9fb1cc;
  --theme-topbar-hover: #24344f;
  --theme-switch-track: #16233a;
  --theme-switch-on: #2e4160;

  /* --- Barra lateral (redesenho), valores escuros do mockup --------------- */
  --theme-nav-bg: #131f33;
  --theme-nav-ink: #c9d6e8;
  --theme-nav-ink-soft: #a9bbd6;
  --theme-nav-hover: rgba(255, 255, 255, 0.05);
  --theme-nav-group-bg: rgba(255, 255, 255, 0.05);
  --theme-nav-guide: #2a3b58;
  --theme-nav-divider: #2a3b58;
  /* O azul do acento e o MESMO nos dois temas, de proposito: e a cor da marca e
     o unico ponto de cor forte da barra. */
  --theme-nav-accent: #2563eb;
  --theme-nav-accent-ink: #ffffff;
  --theme-nav-accent-soft: rgba(37, 99, 235, 0.22);
  --theme-nav-accent-icon: #7fb6ec;
  --theme-nav-accent-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);

  /* Sidebar no ESCURO: os valores que estavam chumbados ate 27/08. */
  --theme-sidebar-de: #061827;
  --theme-sidebar-ate: #0b2035;
  --theme-sidebar-line: rgba(148, 163, 184, 0.18);
  --theme-sidebar-shadow: 12px 0 32px rgba(15, 23, 42, 0.16);
  --theme-sidebar-ink: #c7d3e4;
  --theme-sidebar-ink-strong: #ffffff;
  --theme-sidebar-hover-bg: rgba(255, 255, 255, 0.08);
  --theme-sidebar-hover-line: rgba(148, 163, 184, 0.24);
  --theme-sidebar-submenu-ink: #9fb2c8;
  --theme-sidebar-subitem-ink: #b7c5d8;
}

.modal-card.service-order-detail-card {
  display: flex;
  flex-direction: column;
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border-color: #d8e1ee;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.service-order-detail-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px 10px;
  overflow: auto;
}

.service-order-detail-card .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #ffffff;
}

.service-order-detail-card .modal-header > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 12px;
  min-width: 0;
}

.service-order-detail-card .modal-header > div::before {
  content: "";
  grid-row: 1 / 4;
  width: 34px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background:
    linear-gradient(#2563eb, #2563eb) 50% 10px / 12px 2px no-repeat,
    linear-gradient(#2563eb, #2563eb) 50% 16px / 14px 2px no-repeat,
    linear-gradient(#2563eb, #2563eb) 50% 22px / 10px 2px no-repeat,
    #eff6ff;
}

.service-order-detail-card .modal-header .eyebrow,
.service-order-detail-card .modal-header h2,
.service-order-detail-card .modal-header p {
  grid-column: 2;
}

.service-order-detail-card .modal-header .eyebrow {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.service-order-detail-card .modal-header h2 {
  margin-top: 1px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.12;
}

.service-order-detail-card .modal-header p {
  margin-top: 2px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.service-order-detail-card .modal-header .icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #64748b;
}

.service-order-detail-card .modal-header .icon-button:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #0f172a;
}

.service-order-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-order-detail-section {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
}

.service-order-detail-summary-item {
  display: grid;
  align-content: center;
  min-height: 70px;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
}

.service-order-detail-summary-item:nth-child(3n) {
  border-right: 1px solid #dbe3ef;
}

.service-order-detail-summary-item:nth-last-child(-n + 3) {
  border-bottom: 1px solid #dbe3ef;
}

.service-order-detail-summary small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.service-order-detail-summary strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-detail-section {
  padding: 15px 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.service-order-detail-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.25;
}

.service-order-detail-section h3::before {
  content: "";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background:
    linear-gradient(#2563eb, #2563eb) 50% 50% / 10px 2px no-repeat,
    #eff6ff;
}

.service-order-detail-description h3::before {
  background:
    linear-gradient(#2563eb, #2563eb) 50% 8px / 10px 2px no-repeat,
    linear-gradient(#2563eb, #2563eb) 50% 14px / 12px 2px no-repeat,
    #eff6ff;
}

.service-order-detail-attachments h3::before {
  background:
    radial-gradient(circle at 8px 9px, #2563eb 0 2px, transparent 2.5px),
    linear-gradient(135deg, transparent 52%, #2563eb 53% 59%, transparent 60%),
    #eff6ff;
}

.service-order-detail-section p {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.service-order-detail-description-content {
  display: grid;
  gap: 4px;
}

.service-order-detail-description-content strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-detail-list {
  display: grid;
  gap: 8px;
}

.service-order-media-grid {
  display: grid;
  gap: 10px;
}

.service-order-media-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 88px;
  padding: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.service-order-media-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.service-order-media-card.is-unavailable {
  cursor: default;
}

.service-order-media-card.is-unavailable:hover {
  border-color: #dbe3ef;
  box-shadow: none;
  transform: none;
}

.service-order-media-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.service-order-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-order-media-loading {
  padding: 0 8px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.service-order-media-info {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.service-order-media-info strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-media-info small {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.service-order-detail-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.service-order-detail-list-item strong {
  min-width: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-detail-list-item span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.service-order-detail-section .empty-table-message {
  display: grid;
  min-height: 62px;
  place-items: center;
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.service-order-detail-card .modal-actions {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line-soft);
  background: #ffffff;
}

.service-order-image-preview-backdrop {
  z-index: 260;
  background: rgba(15, 23, 42, 0.68);
}

.service-order-image-preview-card {
  width: min(940px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border-color: #d8e1ee;
  background: #ffffff;
}

.service-order-image-preview-card .modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.service-order-image-preview-stage {
  display: grid;
  place-items: center;
  min-height: min(62vh, 620px);
  padding: 18px;
  background: #0f172a;
}

.service-order-image-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  border-radius: 8px;
  object-fit: contain;
}

@media (max-width: 760px) {
  .service-order-detail-backdrop {
    padding: 12px;
  }

  .service-order-detail-card {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .service-order-detail-body {
    padding: 14px;
  }

  .service-order-detail-summary {
    grid-template-columns: 1fr;
  }

  .service-order-detail-summary-item,
  .service-order-detail-summary-item:nth-child(3n),
  .service-order-detail-summary-item:nth-last-child(-n + 3) {
    border: 1px solid #dbe3ef;
  }

  .service-order-detail-list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-order-detail-list-item span {
    flex: initial;
  }

  .service-order-media-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .service-order-media-thumb {
    width: 56px;
    height: 56px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 246, 250, 0.48);
  backdrop-filter: blur(9px) saturate(1.08);
  -webkit-backdrop-filter: blur(9px) saturate(1.08);
}

.loading-card {
  display: grid;
  min-width: min(330px, 86vw);
  gap: 10px;
  justify-items: center;
  padding: 28px 30px;
  border: 1px solid rgba(199, 204, 213, 0.84);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  color: var(--text);
  text-align: center;
}

.loading-card strong {
  font-size: 22px;
  line-height: 1.2;
}

.loading-card span:last-child {
  color: var(--muted);
  font-size: 15px;
}

.loading-coreflow-logo {
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(7, 91, 197, 0.22));
  transform-origin: 50% 50%;
  animation: coreflow-loader-spin 1.15s linear infinite;
}

@keyframes coreflow-loader-spin {
  from {
    transform: rotate(0deg) scale(0.98);
  }
  50% {
    transform: rotate(180deg) scale(1.04);
  }
  to {
    transform: rotate(360deg) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-coreflow-logo {
    animation: none;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: var(--tap-size);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(40, 116, 227, 0.28);
  outline-offset: 2px;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(480px, 1.15fr) minmax(520px, 1fr);
  min-height: 100vh;
  background: #f4f7fb;
}

.login-visual {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 100vh;
  padding: 54px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(8, 15, 28, 0.88), rgba(8, 15, 28, 0.78)),
    linear-gradient(135deg, #0d1a2b, #213247);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 25% 0 0;
  background:
    linear-gradient(90deg, transparent 0 15%, rgba(190, 207, 222, 0.12) 15% 16%, transparent 16% 28%, rgba(190, 207, 222, 0.16) 28% 29%, transparent 29% 48%, rgba(190, 207, 222, 0.14) 48% 49%, transparent 49% 76%, rgba(190, 207, 222, 0.12) 76% 77%, transparent 77%),
    linear-gradient(180deg, rgba(214, 225, 235, 0.10), rgba(11, 20, 34, 0.84)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 128px);
  border-top: 8px solid rgba(5, 12, 22, 0.55);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: fit-content;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.brand-logo-login {
  height: 68px;
  max-width: 340px;
  filter: none;
}

.brand-logo-sidebar {
  height: 58px;
  max-width: 210px;
}

.office-visual {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 22%;
  height: 210px;
  opacity: 0.45;
}

.office-visual span {
  position: absolute;
  bottom: 0;
  border: 2px solid rgba(189, 208, 226, 0.3);
  background: rgba(10, 21, 36, 0.18);
}

.office-visual span:nth-child(1) { left: 18%; width: 18%; height: 120px; }
.office-visual span:nth-child(2) { left: 42%; width: 16%; height: 160px; }
.office-visual span:nth-child(3) { right: 18%; width: 15%; height: 132px; }
.office-visual span:nth-child(4) { left: 31%; width: 22%; height: 18px; }
.office-visual span:nth-child(5) { right: 31%; width: 18%; height: 18px; }

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin-bottom: 120px;
}

.login-copy h1 {
  max-width: 620px;
  margin: 0 0 28px;
  font-size: 30px;
  line-height: 1.32;
}

.login-copy p {
  max-width: 540px;
  margin: 0;
  color: #8f9aad;
  font-size: 20px;
  line-height: 1.45;
}

.login-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  color: #8f9aad;
  font-size: 14px;
  font-weight: 700;
}

.login-footer a {
  color: inherit;
  text-decoration: none;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px;
}

.login-card {
  display: grid;
  gap: 28px;
  width: min(500px, 100%);
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-card h2 {
  margin: 0 0 14px;
  font-size: 30px;
}

.login-card p {
  margin: 0;
  color: #303744;
  font-size: 16px;
  line-height: 1.5;
}

.login-card label {
  display: grid;
  gap: 12px;
  font-weight: 600;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.label-row a,
.login-help a {
  color: var(--blue);
  text-decoration: none;
}

.login-input {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: #7a828f;
}

.login-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}

.login-submit,
.sso-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 64px;
  border-radius: 5px;
  font-size: 20px;
}

.login-submit {
  border: 1px solid #0149ad;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.sso-button {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  color: #111;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.login-status {
  min-height: 24px;
  color: var(--red) !important;
}

.login-status[data-state="success"] {
  color: var(--green) !important;
}

.login-help {
  text-align: center;
}

.app-mfa-card {
  gap: 22px;
}

.app-mfa-card .eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-mfa-card form,
.app-mfa-setup {
  display: grid;
  gap: 16px;
}

.app-mfa-setup {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.app-mfa-setup img {
  justify-self: center;
  width: min(100%, 220px);
  aspect-ratio: 1;
  border: 8px solid #fff;
  border-radius: 8px;
  background: #fff;
}

.app-mfa-setup p {
  color: var(--muted);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: var(--topbar-height);
  z-index: 80;
  width: 300px;
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #eef2f7;
  overflow: hidden;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 24px 26px 18px;
}

.brand small {
  display: block;
  margin-top: 0;
  color: #2f3540;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
  align-content: start;
  padding: 18px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b8c2d1 transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #b8c2d1;
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav-item,
.plain-action {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #202631;
  text-align: left;
  text-decoration: none;
}

.nav-item {
  min-height: 56px;
  padding: 10px 22px;
  border-radius: 5px;
  font-size: 18px;
  line-height: 1.25;
}

.nav-item.is-active {
  background: var(--blue-2);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.nav-parent-item {
  position: relative;
  margin-bottom: 2px;
}

.nav-parent-item::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .18s ease;
  opacity: .72;
}

.nav-parent-item.is-expanded::after {
  transform: rotate(45deg);
}

.nav-subitem {
  display: none;
  min-height: 42px;
  margin-top: -6px;
  margin-left: 42px;
  padding: 8px 14px;
  font-size: 15px;
}

.nav-subitem.is-expanded {
  display: flex;
}

.nav-subitem::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: .42;
}

.nav-subitem.is-active::before {
  opacity: 1;
}

.plain-action {
  padding: 12px 22px;
  font-size: 17px;
}

.sidebar-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #eef2f7;
}

.main-area {
  position: relative;
  z-index: 1;
  min-width: 0;
  margin-left: 300px;
  padding-top: var(--topbar-height);
  overflow-x: hidden;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--topbar-height);
  padding: 8px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-license {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.topbar-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.topbar-license-text {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  gap: 4px;
  color: var(--theme-text-strong);
  white-space: nowrap;
}

.topbar-license-text span {
  color: var(--theme-topbar-label);
  font-size: 13px;
}

.topbar-license-text strong {
  overflow: hidden;
  max-width: 340px;
  color: var(--theme-text-strong);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 28vw);
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #0b5ed7;
}

/* ===== Sino de notificacoes (cabecalho) ===== */
.notif-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-bell {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e8f1fd;
  color: #2563eb;
  cursor: pointer;
  transition: background .15s ease;
}
.notif-bell:hover { background: #dcebfc; }
.notif-bell.is-open { background: #d3e4fb; }

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #c93b3b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 440px;
  max-width: 92vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  z-index: 4000;
  overflow: hidden;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 12px;
}
.notif-panel-title { font-size: 17px; font-weight: 700; color: var(--text); }
.notif-panel-period { margin-left: auto; font-size: 12px; color: var(--theme-text-dim); white-space: nowrap; }
.notif-count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fce7ee;
  color: #b0355a;
  font-size: 12px;
  font-weight: 700;
}

.notif-panel-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 2px 0 4px; }

.notif-section-label {
  padding: 12px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #9aa1ac;
  text-transform: uppercase;
}

.notif-item {
  display: flex;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid #f3f4f7;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.notif-item:hover { background: #f7f9fc; }
.notif-section-label + .notif-item { border-top: 0; }

.notif-item-ico {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.notif-item-ico svg { width: 18px; height: 18px; }
.notif-ico-agenda { background: #e1f5ee; color: #0f6e56; }
.notif-ico-overdue { background: #fbeaf0; color: #993556; }
.notif-ico-today { background: #faeeda; color: #854f0b; }

.notif-item-main { min-width: 0; flex: 1; }
.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-client {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-time {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}
.notif-item-time.is-overdue { color: #993556; }
.notif-item-time.is-today { color: #854f0b; }
.notif-item-time svg { width: 13px; height: 13px; flex: 0 0 auto; }

.notif-empty { padding: 30px 18px; text-align: center; color: #9aa1ac; font-size: 13px; }
.notif-loading { padding: 24px 18px; text-align: center; color: #9aa1ac; font-size: 13px; }

.notif-panel-footer {
  flex: 0 0 auto;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-top: 1px solid #eef0f3;
  background: #fff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notif-panel-footer:hover { background: #f7f9fc; }

/* ===== Tarefas internas (Agenda + Tarefas lado a lado) ===== */
.internal-tasks-filters { align-items: flex-end; }
.internal-tasks-period {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}
.internal-tasks-period select {
  min-width: 168px;
  padding: 9px 12px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.internal-tasks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.internal-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #e6e9ee;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.internal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
}
.internal-panel-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.internal-panel-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px;
}
.internal-panel-icon.agenda {
  background-color: #e1f5ee;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f6e56' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
.internal-panel-icon.tasks {
  background-color: #faeeda;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23854f0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E");
}
.internal-panel-add {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 9px;
}
.internal-panel-body {
  flex: 1;
  padding: 4px 18px 8px;
  min-height: 120px;
}
.internal-panel-foot {
  border-top: 1px solid #eef0f3;
  padding: 12px 18px;
  text-align: center;
}
.internal-panel-foot .ghost-link {
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}
.internal-panel-empty {
  padding: 34px 8px;
  text-align: center;
  color: #9aa1ac;
  font-size: 13px;
}

/* Agenda (painel esquerdo) */
.internal-day-label {
  margin: 14px 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa1ac;
}
.internal-day-label:first-child { margin-top: 6px; }
.internal-appt {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 10px;
  cursor: pointer;
}
.internal-appt-time {
  flex: 0 0 40px;
  padding-top: 9px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}
.internal-appt-card {
  flex: 1;
  min-width: 0;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  background: #f5f7fa;
  padding: 9px 12px;
  transition: background 0.15s ease;
}
.internal-appt:hover .internal-appt-card { background: #eef2f8; }
.internal-appt-card.type-technical { border-left-color: #0f6e56; }
.internal-appt-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}
.internal-appt-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  color: #6b7280;
}
.internal-appt-meta svg { width: 12px; height: 12px; flex: 0 0 auto; }

/* Tarefas (painel direito) */
/* A linha inteira abre a tarefa para edicao (23/09/2026) — o modal de editar
   ja existia, so nao havia por onde chegar nele a partir desta tela. O clique
   na caixa de marcar continua sendo so concluir/reabrir. */
.internal-task {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 12px;
  margin: 0 -12px;
  border-top: 1px solid #f1f3f6;
  cursor: pointer;
  border-radius: 10px;
}
.internal-task:hover { background: #f7f9fc; }
.internal-task.is-overdue:hover { background: #fbeef2; }
.internal-panel-body > .internal-task:first-child { border-top: 0; }
.internal-task.is-overdue {
  background: #fdf6f8;
  border-radius: 10px;
  border-top: 0;
  margin-bottom: 6px;
}
/* Caixa de marcar da tarefa. `min-height: 0` e OBRIGATORIO: o reset global
   (`button, a, input… { min-height: var(--tap-size) }`, 44px de alvo de toque)
   vence a altura declarada e transformava a caixa num retangulo de 17x44 —
   medido em 23/09, e e' o que o Andre viu na tela. A area de toque de 40px
   volta pela camada invisivel do ::after, sem esticar o desenho. */
.internal-task-check {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-width: 0;
  min-height: 0;
  margin-top: 1px;
  border: 2px solid #c3cad4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .12s ease, background-color .12s ease;
}
.internal-task-check::after {
  content: '';
  position: absolute;
  inset: -11px;
  border-radius: 10px;
}
.internal-task-check:hover { border-color: #1d9e75; background: #f0fbf7; }
.internal-task-check:focus-visible { border-color: #1d9e75; }
.internal-task.is-done .internal-task-check:hover { background: #17855f; }
.internal-task.is-done .internal-task-check {
  background: #1d9e75;
  border-color: #1d9e75;
}
.internal-task-check svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.internal-task.is-done .internal-task-check svg { opacity: 1; }
.internal-task-main { flex: 1; min-width: 0; }
.internal-task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.internal-task.is-done .internal-task-title {
  text-decoration: line-through;
  color: #9aa1ac;
  font-weight: 500;
}
.internal-task-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #6b7280;
}
.internal-task.is-overdue .internal-task-sub { color: #993556; font-weight: 600; }
.internal-task-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.internal-task-badge.alta { background: #fbeaf0; color: #993556; }
.internal-task-badge.media { background: #faeeda; color: #854f0b; }
.internal-task-badge.baixa { background: #eef0f3; color: #6b7280; }

.internal-task-modal-card {
  width: 460px;
  max-width: calc(100vw - 32px);
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}
.internal-task-modal-card form { display: flex; flex-direction: column; }

/* Cabecalho */
.internal-task-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid #eef0f3;
}
.internal-task-modal-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: #faeeda;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23854f0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E");
}
.internal-task-modal-heading { flex: 1; min-width: 0; }
.internal-task-modal-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa1ac;
}
.internal-task-modal-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}
.internal-task-modal-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #9aa1ac;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.internal-task-modal-close:hover { color: #4b5563; }

/* Corpo */
.internal-task-modal-body { padding: 20px 24px 18px; }
.internal-task-field { margin-bottom: 14px; }
.internal-task-field:last-of-type { margin-bottom: 0; }
.internal-task-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.internal-task-label .req { color: #c93b3b; }
.internal-task-label .opt { font-weight: 400; color: #aeb4bd; }
.internal-task-modal-body input[type="text"],
.internal-task-modal-body input[type="date"],
.internal-task-modal-body input[type="time"],
.internal-task-modal-body select,
.internal-task-modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  background: #fff;
}
.internal-task-modal-body select { cursor: pointer; }
.internal-task-modal-body textarea { min-height: 64px; resize: vertical; }
.internal-task-modal-body input:focus,
.internal-task-modal-body select:focus,
.internal-task-modal-body textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Prioridade (pilulas) */
.internal-task-priority {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.internal-priority-pill {
  padding: 11px 8px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.internal-priority-pill:hover { border-color: #b6bdc7; }
.internal-priority-pill.is-selected { border-width: 2px; padding: 10px 7px; }
.internal-priority-pill[data-priority="baixa"].is-selected {
  border-color: #9aa1ac; background: #f1f3f6; color: #4b5563;
}
.internal-priority-pill[data-priority="media"].is-selected {
  border-color: #b98418; background: #faeeda; color: #854f0b;
}
.internal-priority-pill[data-priority="alta"].is-selected {
  border-color: #c25b7c; background: #fbeaf0; color: #993556;
}

/* Prazo (data + hora) */
.internal-task-due {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
.internal-task-due-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.internal-due-chip {
  padding: 4px 12px;
  border: 1px solid #e0e4ea;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
}
.internal-due-chip:hover { background: #f5f7fa; border-color: #cfd5de; }

.internal-task-required-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: #9aa1ac;
}
#internalTaskFormStatus:empty { display: none; }
#internalTaskFormStatus { margin: 10px 0 0; font-size: 12px; color: #c93b3b; }

/* Rodape */
.internal-task-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #f7f8fa;
  border-top: 1px solid #eef0f3;
}
/* Botao "Concluir tarefa" (edicao): fica a esquerda e com tom verde. */
.internal-task-conclude {
  margin-right: auto;
  color: #16a34a;
  border-color: #86efac;
}
.internal-task-conclude:hover { background: #f0fdf4; }
.internal-task-conclude[hidden] { display: none; }
.internal-task-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.internal-task-submit-check {
  width: 15px;
  height: 15px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

@media (max-width: 1100px) {
  .internal-tasks-grid { grid-template-columns: 1fr; }
}

/* Badge CPF/CNPJ ao lado do rotulo do documento no cadastro de cliente */
.doc-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.doc-kind-badge {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #e8f1fd;
  color: #2563eb;
}
.doc-kind-badge[data-kind="cpf"] { background: #e1f5ee; color: #0f6e56; }
.doc-kind-badge[data-kind="cnpj"] { background: #e8f1fd; color: #2563eb; }

/* Agenda compartilhada (modal de compromisso) */
.appointment-share-hint {
  margin: 8px 0 10px;
  font-size: 12px;
  color: #6b7280;
}
.appointment-share-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 12px;
  max-height: 190px;
  overflow-y: auto;
}
.appointment-share-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.appointment-share-item:hover { background: #f5f7fa; }
.appointment-share-item input { width: 16px; height: 16px; flex: 0 0 auto; }
.appointment-share-name { display: flex; flex-direction: column; line-height: 1.25; color: var(--text); min-width: 0; }
.appointment-share-name small { color: #9aa1ac; font-size: 11px; }
.appointment-share-empty { font-size: 13px; color: #9aa1ac; padding: 6px 2px; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 6px 3px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.user-menu:hover,
.user-menu.is-open {
  background: var(--theme-topbar-hover);
}

.topbar-user-copy {
  min-width: 0;
}

.topbar-profile-menu {
  position: absolute;
  right: 94px;
  top: calc(100% + 10px);
  z-index: 150;
  width: min(324px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--theme-menu-line);
  border-radius: 14px;
  background: var(--theme-menu-bg);
  box-shadow: var(--theme-menu-shadow);
}

.topbar-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--theme-line-soft);
}

.profile-menu-avatar {
  width: 52px;
  height: 52px;
  border: 2px solid var(--theme-avatar-ring);
  box-shadow: 0 0 0 3px var(--theme-avatar-halo);
}

.topbar-profile-card strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: var(--theme-text-strong);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile-card small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--theme-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-success-ink);
}

.topbar-profile-actions {
  display: grid;
  padding: 6px 0;
}

.topbar-profile-actions > button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 55px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--theme-line-soft);
  background: var(--theme-menu-bg);
  color: var(--theme-text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.topbar-profile-actions > button:hover {
  background: var(--theme-menu-hover);
}

/* Agrupamento visual do menu. Era nth-child(1), (4) e (7) — posicional, e por
   isso quebrava ao inserir QUALQUER linha nova: com a linha "Tema" entrando na
   3a posicao, o separador cairia no meio de um grupo e o Logout perderia o
   espaco de cima. Agora a marcacao e explicita no markup e sobrevive a insercao.
   Resultado renderizado identico ao de antes (medido). */
.topbar-profile-actions > .profile-menu-group-start {
  margin-top: 6px;
}

/* ---- Linha "Tema" (Lote 15) ----------------------------------------------
   Mesma geometria das linhas de acao do menu (28px de icone, altura 55, padding
   0 18px, divisoria embaixo), com uma terceira coluna para o seletor. Nao e' um
   <button> porque nao executa acao: contem dois radios. */
.profile-menu-theme {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 55px;
  padding: 0 18px;
  border-bottom: 1px solid var(--theme-line-soft);
  background: var(--theme-menu-bg);
  color: var(--theme-text);
  font-size: 15px;
  font-weight: 700;
}

/* Lua: circulo com um segundo circulo por cima na COR DO MENU, formando o
   crescente. Como o recorte usa o token do fundo, ele acompanha o tema — com
   hex chumbado a lua ganharia um caroco claro no modo escuro. */
.profile-menu-icon-theme::before {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-theme::after {
  width: 13px;
  height: 17px;
  border-radius: 50%;
  background: var(--theme-menu-bg);
  transform: translateX(6px);
}

.profile-menu-theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  background: var(--theme-switch-track);
}

.profile-menu-theme-switch button {
  min-height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--theme-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.profile-menu-theme-switch button[aria-checked="true"] {
  background: var(--theme-switch-on);
  color: var(--theme-text-strong);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* ---- Painel de notificacoes no escuro ------------------------------------
   Aqui a tecnica muda, de proposito.

   Nos outros componentes do lote a regra CLARA passou a ler um token
   (`color: var(--theme-text-strong)`). Neste painel isso sairia caro: ele tem
   uma duzia de hex proprios (#f3f4f7, #6b7280, #9aa1ac, #f7f9fc...) e ainda usa
   os tokens LEGADOS (--text, --muted), que nao mudam com o tema. Tokenizar tudo
   exigiria um token novo por valor, so para reescrever o mesmo numero.

   Entao o CLARO fica INTOCADO e o escuro entra como camada por cima. Vantagem
   que importa num sistema em producao: o modo claro fica identico POR
   CONSTRUCAO — nao ha como eu errar um valor, porque nao encosto nele.

   Custo assumido: dois lugares para manter. Vale enquanto o componente tiver
   cor demais escrita na regra; quando ele passar por um lote de padronizacao e
   perder os hex, vira token como o resto.

   O `--text` e redefinido no ESCOPO do painel: os filhos que leem var(--text)
   passam a receber o valor claro sem que eu precise achar cada um. */
:root[data-theme="dark"] .notif-panel {
  --text: #eaf0f9;
  --muted: #b4c3d8;
  border-color: var(--theme-menu-line);
  background: var(--theme-menu-bg);
  box-shadow: var(--theme-menu-shadow);
}

:root[data-theme="dark"] .notif-section-label {
  color: var(--theme-text-faint);
}

:root[data-theme="dark"] .notif-item {
  border-top-color: var(--theme-line-soft);
}

:root[data-theme="dark"] .notif-item:hover {
  background: var(--theme-surface-muted);
}

:root[data-theme="dark"] .notif-item-client,
:root[data-theme="dark"] .notif-item-time {
  color: var(--theme-text-muted);
}

:root[data-theme="dark"] .notif-bell {
  background: var(--theme-surface-muted);
  color: var(--theme-primary-ink);
}

:root[data-theme="dark"] .notif-bell:hover,
:root[data-theme="dark"] .notif-bell.is-open {
  background: var(--theme-line);
}

:root[data-theme="dark"] .notif-panel-footer {
  border-top-color: var(--theme-line-soft);
  background: var(--theme-surface-muted);
  color: var(--theme-primary-ink);
}

/* ---- Busca e Logoff no escuro --------------------------------------------
   Nao eram problema de LEGIBILIDADE (o auditor de contraste passou nos dois):
   eram duas ilhas brancas sobre a barra escura. Legivel e coerente sao coisas
   diferentes, e so a captura de tela mostra a segunda.

   Mesma tecnica do painel de notificacoes: o claro nao e' tocado. Ambos leem
   tokens LEGADOS (--panel, --line, --text), que nao mudam com o tema; o
   redefinicao no escopo resolve os filhos de uma vez. */
:root[data-theme="dark"] .topbar .search-box {
  --text: #eaf0f9;
  --muted: #9fb1cc;
  border-color: var(--theme-line);
  background: var(--theme-surface-muted);
}

/* O campo tem fundo BRANCO proprio, vindo da regra ampla que pinta todo input
   do sistema (`input:not([type=checkbox]):not([type=radio])`, ~linha 19640).
   Sem zerar aqui, o contorno escurece e sobra um retangulo branco no meio —
   defeito que so a captura mostra, porque de contraste ele passa. */
:root[data-theme="dark"] .topbar .search-box input {
  background: transparent;
  color: var(--theme-text-strong);
}

:root[data-theme="dark"] .topbar .search-box input::placeholder {
  color: var(--theme-text-faint);
}

:root[data-theme="dark"] .logout-button {
  --panel: #24344f;
  --line: #2e4160;
  --text: #eaf0f9;
}

.topbar-profile-actions > button:last-child {
  border-bottom: 0;
  color: var(--theme-danger-ink);
}

.profile-menu-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--theme-primary-ink);
}

.profile-menu-icon::before,
.profile-menu-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.profile-menu-icon-pause {
  color: #f59e0b;
}

.profile-menu-icon-pause::before {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-pause::after {
  width: 7px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.profile-menu-icon-user::before {
  top: 3px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-user::after {
  bottom: 3px;
  width: 15px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.profile-menu-icon-shield {
  color: #6d5dfc;
}

.profile-menu-icon-shield::before {
  width: 16px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 10px 10px;
  clip-path: polygon(50% 0, 100% 20%, 88% 78%, 50% 100%, 12% 78%, 0 20%);
}

.profile-menu-icon-key {
  color: #16a34a;
}

.profile-menu-icon-key::before {
  left: 2px;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-key::after {
  left: 10px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 5px 4px 0 -1px currentColor;
}

.profile-menu-icon-support {
  color: #7c3aed;
}

.profile-menu-icon-support::before {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-support::after {
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 8px 0 0 -1px #ffffff, -8px 0 0 -1px #ffffff;
}

.profile-menu-icon-terms {
  color: var(--theme-icon-neutral);
}

.profile-menu-icon-terms::before {
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.profile-menu-icon-terms::after {
  width: 7px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.profile-menu-icon-logout {
  color: #ef4444;
}

.profile-menu-icon-logout::before {
  left: 2px;
  width: 12px;
  height: 15px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}

.profile-menu-icon-logout::after {
  right: 1px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px -4px 0 -1px currentColor, 4px 4px 0 -1px currentColor;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

.user-menu strong,
.user-menu small {
  display: block;
  text-align: right;
}

.user-menu strong {
  max-width: 180px;
  overflow: hidden;
  color: var(--theme-text-strong);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu small {
  color: var(--theme-text-soft);
  font-size: 11px;
  line-height: 1.15;
}

.avatar,
.mini-avatar,
.letter-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
}

.avatar {
  width: 38px;
  height: 38px;
  color: #fff;
  background: #237083;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen {
  display: none;
  padding: 44px 40px 64px;
}

.connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 40px 0;
  padding: 16px 18px;
  border: 1px solid #f1c96b;
  border-radius: 8px;
  background: #fff7df;
}

.connection-panel[data-state="success"] {
  border-color: #91dfbd;
  background: #e9fff3;
}

.connection-panel strong,
.connection-panel p {
  margin: 0;
}

.connection-panel p {
  margin-top: 4px;
  color: #4b5563;
}

.admin-login-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-login-form input {
  width: 180px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.admin-login-form .primary-button,
.connection-panel > .secondary-button {
  min-height: 42px;
  padding: 0 18px;
  font-size: 15px;
}

.screen.is-visible {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.page-heading h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.page-heading p {
  margin: 8px 0 0;
  color: #2f3540;
  font-size: 20px;
}

.compact-heading {
  align-items: center;
  margin-bottom: 26px;
}

.heading-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: var(--radius-sm);
  font-size: 19px;
}

.primary-button {
  border: 1px solid #0149ad;
  background: var(--blue);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

/* Acoes do POP: tres botoes na mesma linha sem quebrar o texto, com espacamento
   confortavel e quebra de linha graciosa em telas estreitas. */
.email-pop-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.email-pop-actions .primary-button,
.email-pop-actions .secondary-button {
  flex: 1 1 auto;
  min-height: 50px;
  padding: 0 20px;
  font-size: 16px;
  white-space: nowrap;
}

.email-pop-actions #savePopButton {
  flex: 1 1 140px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.metrics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2.3fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(280px, 2.3fr);
  gap: 30px;
  margin-bottom: 40px;
}

.status-card,
.compact-metric,
.latency-card {
  min-height: 264px;
  padding: 32px;
}

.status-card {
  position: relative;
  display: grid;
  align-content: space-between;
}

.eyebrow {
  display: block;
  color: #252b35;
  font-size: 20px;
  line-height: 1.4;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.success-ring {
  position: absolute;
  right: 30px;
  top: 30px;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--green-soft);
}

.success-ring::after {
  content: "\2713";
  position: absolute;
  inset: 9px;
  display: grid;
  place-items: center;
  border: 3px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font-weight: 700;
}

.uptime-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.uptime-row small {
  color: #39404b;
  text-transform: uppercase;
}

.uptime-row span {
  color: var(--blue);
  font-family: Consolas, monospace;
  font-size: 22px;
}

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #dce6f5;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.compact-metric {
  display: grid;
  align-content: center;
  gap: 20px;
}

.compact-metric strong,
.latency-card strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.compact-metric small,
.latency-card small {
  color: #404754;
  line-height: 1.5;
}

.positive {
  color: var(--green) !important;
}

.mini-lines {
  display: flex;
  gap: 6px;
}

.mini-lines span {
  width: 36px;
  height: 5px;
  border-radius: 20px;
  background: var(--blue);
}

.mini-lines span:last-child {
  background: #b7d3f7;
}

.latency-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 72px;
}

.bars span {
  width: 10px;
  border-radius: 3px 3px 0 0;
  background: #b9d7f4;
}

.bars span:nth-child(1) { height: 34px; }
.bars span:nth-child(2) { height: 48px; }
.bars span:nth-child(3) { height: 42px; }
.bars span:nth-child(4) { height: 64px; background: #357bd8; }
.bars span:nth-child(5) { height: 39px; }
.bars span:nth-child(6) { height: 44px; background: var(--blue); }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 386px;
  gap: 30px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
}

.card-header h2,
.right-stack h2,
.permissions-card h2,
.smtp-card h2,
.webhook-card h2,
.integrations-card h2,
.general-card h2,
.placeholder-card h2 {
  margin: 0;
  font-size: 23px;
}

.card-header a,
.ghost-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 18px;
  text-decoration: none;
}

.client-demands-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.client-demands-filter {
  border: 1px solid var(--primary-soft);
  background: #fff;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.client-demands-filter:hover {
  background: var(--primary-soft);
}

.client-demands-filter.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th {
  padding: 20px 30px;
  background: var(--panel-soft);
  color: #2c3340;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

td {
  padding: 28px 30px;
  border-top: 1px solid var(--line-soft);
  font-size: 18px;
  vertical-align: middle;
}

.activity-card td:first-child,
.activity-card td:nth-child(2),
.users-table td:first-child {
  display: flex;
  align-items: center;
  gap: 18px;
}

.row-icon {
  color: var(--blue);
}

.mini-avatar {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  color: #fff;
  background: #153b48;
  font-size: 9px;
}

.mini-avatar.muted {
  color: #111;
  background: #d9dee7;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pill.success {
  background: var(--green-soft);
  color: #00784e;
}

.pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.pill.neutral {
  background: #e5e8eb;
  color: #252b35;
}

.pill.admin {
  background: #d8e8ff;
  color: var(--blue);
}

.right-stack {
  display: grid;
  gap: 30px;
}

.insights-card,
.nodes-card {
  padding: 30px;
}

.timeline {
  display: grid;
  gap: 28px;
  margin: 28px 0 0;
  padding-left: 24px;
  border-left: 3px solid #d7dce5;
}

.timeline li {
  position: relative;
  padding-left: 4px;
  font-size: 18px;
}

.timeline li::marker {
  color: var(--blue);
}

.timeline small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.timeline .danger strong {
  color: var(--red);
}

.node-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
}

.node-row div {
  flex: 1;
}

.node-row strong,
.node-row small {
  display: block;
}

.node-row small {
  margin-top: 4px;
  color: #2f3540;
}

.node-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #76d4b0;
}

.dashboard-calendar-card {
  margin-bottom: 28px;
  overflow: hidden;
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr)) minmax(260px, 0.85fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 28px;
}

.dashboard-summary-card,
.dashboard-calendar-compact-card {
  min-height: 272px;
  overflow: hidden;
}

.dashboard-summary-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0;
  background: #ffffff;
}

.dashboard-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
}

.dashboard-summary-header h2 {
  margin: 0;
  color: #12213a;
  font-size: 17px;
}

.dashboard-summary-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0 20px 14px;
}

.dashboard-summary-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f7;
}

.dashboard-summary-item:last-child {
  border-bottom: 0;
}

.dashboard-summary-dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--blue);
  font-size: 10px;
}

.dashboard-summary-dot.contract {
  color: #f08d2f;
}

.dashboard-summary-dot.implementation {
  color: #08775a;
}

.dashboard-summary-dot.request {
  color: #0b66d8;
}

.dashboard-summary-copy {
  min-width: 0;
}

.dashboard-summary-copy strong,
.dashboard-summary-copy span,
.dashboard-summary-copy small {
  display: block;
}

.dashboard-summary-copy strong {
  overflow: hidden;
  color: #182233;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary-copy span,
.dashboard-summary-copy small,
.dashboard-summary-meta {
  color: #5f6b7d;
  font-size: 12px;
}

.dashboard-summary-meta {
  text-align: right;
  white-space: nowrap;
}

.dashboard-summary-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-summary-progress span {
  width: 88px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf2;
}

.dashboard-summary-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.dashboard-summary-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-top: 1px solid #edf1f7;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-summary-footer::after {
  content: '?';
  margin-left: 8px;
  font-size: 18px;
}

.dashboard-summary-list .empty-state {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-calendar-compact-card {
  margin: 0;
  cursor: pointer;
}

.dashboard-charts-grid .dashboard-calendar-compact-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}

.dashboard-calendar-compact-card .dashboard-calendar-header {
  padding: 16px 16px 10px;
}

.dashboard-calendar-compact-card .dashboard-calendar-header h2 {
  font-size: 16px;
}

.dashboard-calendar-compact-card .dashboard-calendar-actions {
  gap: 5px;
}

.dashboard-calendar-compact-card .dashboard-calendar-actions .primary-button,
.dashboard-calendar-compact-card .dashboard-calendar-actions .secondary-button,
.dashboard-calendar-compact-card .dashboard-calendar-actions .icon-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.dashboard-calendar-compact-card .dashboard-calendar-weekdays span {
  padding: 7px 3px;
  font-size: 10px;
}

.dashboard-calendar-compact-card .calendar-day {
  min-height: 30px;
  padding: 4px;
}

.dashboard-calendar-compact-card .calendar-day strong {
  font-size: 11px;
}

.dashboard-calendar-compact-card .calendar-day.is-today > strong {
  width: 18px;
  height: 18px;
}

.dashboard-calendar-compact-card .calendar-day ul,
.dashboard-calendar-compact-card .calendar-day small {
  display: none;
}

.dashboard-calendar-compact-card .calendar-day.has-events::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--blue);
}

.dashboard-calendar-compact-card .dashboard-calendar-legend {
  justify-content: center;
  padding: 9px 12px;
  font-size: 11px;
}

.dashboard-calendar-full-card {
  display: none;
}

.dashboard-calendar-modal {
  place-items: center;
  padding: 12px;
  backdrop-filter: blur(8px);
}

.dashboard-calendar-modal-card {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 24px));
  height: min(820px, calc(100dvh - 24px));
  max-height: none;
  overflow: hidden;
  padding: 0;
}

.dashboard-calendar-modal-header {
  padding: 14px 24px 8px;
}

.dashboard-calendar-modal-header .eyebrow {
  font-size: 13px;
}

.dashboard-calendar-modal-header h2 {
  margin-top: 2px;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.05;
}

.dashboard-calendar-modal-header p {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.25;
}

.dashboard-calendar-modal-actions {
  justify-content: flex-end;
  padding: 0 24px 8px;
}

.dashboard-calendar-modal .dashboard-calendar-weekdays,
.dashboard-calendar-modal .dashboard-calendar-grid {
  flex-shrink: 0;
  /* Respiro nas laterais para os dias/grade nao encostarem nas bordas do modal
     (mesma margem lateral dos filtros/legenda). Aplicado nos dois para as 7
     colunas continuarem alinhadas. */
  margin-left: 24px;
  margin-right: 24px;
}
.dashboard-calendar-modal .dashboard-calendar-grid {
  margin-bottom: 10px;
}

.dashboard-calendar-modal .dashboard-calendar-grid {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: repeat(6, minmax(0, 1fr));
}

.dashboard-calendar-modal .calendar-day {
  min-height: 0;
  padding: 6px 7px;
  overflow: hidden;
}

.dashboard-calendar-modal .calendar-day ul {
  gap: 3px;
  margin-top: 5px;
}

.dashboard-calendar-modal .calendar-event {
  min-height: 25px;
  padding: 4px 5px;
  font-size: 10px;
}

.dashboard-calendar-modal .calendar-day small {
  margin-top: 3px;
  font-size: 10px;
}

.dashboard-presentation-card {
  margin-bottom: 28px;
  overflow: hidden;
}

.dashboard-presentation-card .card-header {
  padding-bottom: 18px;
}

.dashboard-presentation-card h2 {
  margin: 5px 0 0;
}

.dashboard-presentation-table {
  min-width: 780px;
}

.dashboard-presentation-table td {
  padding-top: 18px;
  padding-bottom: 18px;
}

.dashboard-presentation-table td:first-child strong,
.dashboard-presentation-table td:first-child small {
  display: block;
}

.dashboard-presentation-table td:first-child small {
  margin-top: 4px;
  color: var(--muted);
}

#screen-dashboard > .metrics-grid,
#screen-dashboard > .dashboard-layout {
  display: none;
}

.dashboard-calendar-header,
.dashboard-calendar-actions,
.dashboard-calendar-filters,
.dashboard-calendar-legend {
  display: flex;
  align-items: center;
}

.dashboard-calendar-header {
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 14px;
}

.dashboard-calendar-header h2 {
  margin: 5px 0 0;
  text-transform: capitalize;
}

.dashboard-calendar-actions {
  gap: 8px;
}

.dashboard-calendar-actions .primary-button,
.dashboard-calendar-actions .secondary-button {
  min-height: 40px;
  padding: 0 15px;
  font-size: 15px;
}

.dashboard-calendar-filters {
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 16px;
}

.calendar-filter {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.calendar-filter.is-active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.calendar-filter-field {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-filter-field select,
.calendar-filter-field input {
  min-height: 35px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
}

.calendar-search-field {
  margin-left: auto;
}

.calendar-search-field input {
  width: min(240px, 100%);
}

.dashboard-calendar-weekdays,
.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dashboard-calendar-weekdays {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.dashboard-calendar-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 126px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-outside {
  background: #f8fafc;
  color: #a3adba;
}

.calendar-day.is-today > strong {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
}

.calendar-day ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.calendar-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  width: 100%;
  padding: 5px 6px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 3px solid currentColor;
  border-radius: 3px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.calendar-event.technical {
  color: #075eb5;
  background: #e8f2ff;
}

.calendar-event.commercial {
  color: #08775a;
  background: #e8f8f1;
}

.calendar-event.overdue {
  color: #b91c1c;
  background: #fee2e2;
}

.calendar-event.cancelled {
  opacity: 0.58;
  text-decoration: line-through;
}

.calendar-event time {
  font-weight: 700;
}

.calendar-event span {
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-calendar-legend {
  justify-content: flex-end;
  gap: 18px;
  padding: 13px 24px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-calendar-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dashboard-calendar-legend .technical {
  background: #075eb5;
}

.dashboard-calendar-legend .commercial {
  background: #08775a;
}

.breadcrumb {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.breadcrumb span {
  color: #111;
  margin: 0 6px;
}

.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 306px)) 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.user-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.small-stat {
  min-height: 118px;
  padding: 24px;
}

.small-stat strong {
  display: block;
  margin: 10px 0;
  font-size: 26px;
}

.small-stat small {
  color: var(--muted);
}

.users-table-card {
  margin-bottom: 30px;
}

.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
}

.tabs,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.tabs button,
.table-actions button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #111;
}

.tabs button.is-selected {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}

.letter-avatar {
  width: 34px;
  height: 34px;
  margin-right: 16px;
  border-radius: 12px;
}

.letter-avatar.blue {
  background: #dce5ff;
}

.letter-avatar.red {
  color: var(--red);
  background: #ffdcdc;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
}

.status-dot.active { background: #13b879; }
.status-dot.inactive { background: #aaaeb7; }
.status-dot.flagged { background: var(--red); }

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
  color: #313844;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
}

.pagination button.current {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.permissions-card {
  margin-bottom: 30px;
}

.permissions-card h2 {
  padding: 22px 24px 0;
}

/* ===== Perfis de acesso (Equipe & Acessos) =====
   Edicao por perfil: lista a esquerda, permissoes do perfil a direita.
   ATENCAO: o reset global aplica min-height 44px em TODO <button> — os
   controles compactos daqui (toggle, atalho "Marcar todos") precisam de
   min-height explicito, senao esticam. Ver GOTCHA 1 em docs/GOTCHAS.md. */
.access-profiles {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: stretch;
}

.access-profiles-aside {
  padding: 18px 12px;
  border-right: 1px solid var(--line-soft);
  background: #FCFDFE;
}

.access-profiles-aside-label {
  margin: 0 0 10px;
  padding-left: 10px;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.access-profiles-nav {
  display: grid;
  gap: 4px;
}

.access-profile-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.access-profile-item:hover {
  background: #F1F5F9;
}

.access-profile-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.access-profile-item-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.access-profile-item-text strong {
  overflow: hidden;
  color: #0F172A;
  font-size: 13.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-profile-item-text small {
  overflow: hidden;
  color: #64748B;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-profile-item.is-active {
  background: #2563EB;
}

.access-profile-item.is-active:hover {
  background: #1D4ED8;
}

.access-profile-item.is-active .access-profile-item-text strong {
  color: #fff;
}

.access-profile-item.is-active .access-profile-item-text small {
  color: rgba(255, 255, 255, 0.82);
}

.access-profiles-main {
  min-width: 0;
  padding: 18px 20px 20px;
}

.access-profiles-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.access-profiles-heading h2 {
  margin: 0;
  padding: 0;
  color: #0F172A;
  font-size: 16px;
  font-weight: 700;
}

.access-profiles-heading p {
  margin: 3px 0 0;
  color: #64748B;
  font-size: 12.5px;
}

.access-profiles-search {
  position: relative;
  flex: 0 1 260px;
}

.access-profiles-search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 14px;
  height: 14px;
  border: 1.7px solid #94A3B8;
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.access-profiles-search-icon::after {
  position: absolute;
  top: 10px;
  left: 9px;
  width: 6px;
  height: 1.7px;
  background: #94A3B8;
  border-radius: 2px;
  transform: rotate(45deg);
  content: '';
}

.access-profiles-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px 8px 33px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
}

.access-profiles-search input:focus {
  border-color: #2563EB;
  outline: none;
}

.access-profiles-note,
.access-profiles-empty {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
  color: #475569;
  font-size: 12.5px;
}

.access-profiles-modules {
  display: grid;
  gap: 12px;
}

.access-module {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.access-module-head {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  background: #F8FAFC;
}

.access-module-icon {
  display: grid;
  place-items: center;
  color: #64748B;
}

.access-module-head strong {
  color: #0F172A;
  font-size: 13px;
  font-weight: 700;
}

.access-module-count {
  color: #94A3B8;
  font-size: 12px;
  font-weight: 600;
}

.access-module-bulk {
  min-height: 0;
  margin-left: auto;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: #2563EB;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.access-module-bulk:hover {
  text-decoration: underline;
}

.access-permission-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-top: 1px solid var(--line-soft);
}

.access-permission-name {
  display: grid;
  gap: 1px;
  min-width: 0;
  color: #0F172A;
  font-size: 13.5px;
}

.access-permission-row.is-off .access-permission-name {
  color: #94A3B8;
}

.access-permission-hint {
  color: #94A3B8;
  font-size: 11px;
}

.access-permission-row.is-dirty {
  background: #FFFBEB;
}

.access-toggle {
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 42px;
  min-width: 42px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #CBD5E1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.access-toggle.is-on {
  background: #2563EB;
}

.access-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.access-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.access-toggle.is-on .access-toggle-knob {
  transform: translateX(18px);
}

.access-profiles-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
}

.access-profiles-footer .form-status {
  margin: 0;
}

.access-profiles-footer .form-status:not(:empty) {
  padding: 7px 12px;
  border-radius: 8px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 12.5px;
  font-weight: 600;
}

.access-profiles-footer .form-status[data-state='success']:not(:empty) {
  background: #DCFCE7;
  color: #166534;
}

.access-profiles-footer .form-actions {
  gap: 10px;
  margin-left: auto;
  padding: 0;
  border: 0;
}

/* Abaixo de 800px a lista de perfis vira um seletor horizontal acima das
   permissoes. */
@media (max-width: 800px) {
  .access-profiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .access-profiles-aside {
    padding: 14px 14px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .access-profiles-aside-label {
    padding-left: 0;
  }

  .access-profiles-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(178px, max-content);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .access-profile-item {
    border: 1px solid var(--line-soft);
    background: #fff;
  }

  .access-profile-item.is-active {
    border-color: #2563EB;
    background: #2563EB;
  }

  .access-profiles-main {
    padding: 16px 14px 18px;
  }

  .access-profiles-search {
    flex: 1 1 100%;
  }
}

.utility-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dashed-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 230px;
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.dashed-card h2,
.dashed-card p {
  margin: 0;
}

.dashed-card p {
  max-width: 440px;
  color: #404754;
}

.sales-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.sales-metric {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 230px;
  padding: 28px;
}

.sales-metric > .icon {
  position: absolute;
  right: 26px;
  top: 28px;
  color: var(--blue);
}

.sales-metric .eyebrow {
  max-width: 170px;
  font-size: 14px;
  font-weight: 700;
}

.sales-metric strong {
  font-size: 34px;
  line-height: 1.28;
}

.sales-metric small {
  color: var(--blue);
  font-size: 15px;
  line-height: 1.35;
}

.pipeline-card {
  margin-bottom: 32px;
  padding: 34px;
}

.pipeline-card h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 34px;
  font-size: 22px;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 134px;
}

.pipeline-step {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 22px 18px;
  color: #0c1625;
  text-align: center;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}

.pipeline-step:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.pipeline-step:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%);
}

.pipeline-step.muted { background: #e5e7ea; }
.pipeline-step.soft { background: #dce6ff; }
.pipeline-step.mid { background: #d0e0f4; }
.pipeline-step.active {
  background: var(--blue-2);
  color: #fff;
}

.pipeline-step small {
  color: inherit;
  font-size: 11px;
  text-transform: uppercase;
}

.pipeline-step strong {
  font-size: 28px;
  line-height: 1;
}

.pipeline-step span {
  font-size: 13px;
}

.proposal-clients-card {
  margin-bottom: 32px;
}

.proposal-clients-table {
  width: 100%;
  border-collapse: collapse;
}

.proposal-clients-table th,
.proposal-clients-table td {
  padding: 18px 22px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.proposal-clients-table th {
  background: var(--panel-soft);
  color: #273244;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.proposal-clients-table td strong,
.proposal-clients-table td small {
  display: block;
}

.proposal-clients-table td small {
  margin-top: 5px;
  color: var(--muted);
}

.proposal-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  max-width: 220px;
}

.proposal-row-actions .ghost-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.proposal-row-actions .danger-action {
  color: #dc2626;
}

.service-requests-panel,
.service-request-form-panel,
.service-request-detail-panel,
.conversations-panel {
  margin-bottom: 28px;
}

.screen.requests-chat-screen {
  height: calc(100dvh - 78px);
  min-height: 0;
  overflow: hidden;
  padding-block: 14px;
}

.screen.requests-chat-screen .conversations-panel {
  height: var(--conversation-panel-height, 100%);
  margin-bottom: 0;
}

.conversations-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  height: var(--conversation-panel-height, clamp(560px, calc(100dvh - 205px), 860px));
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  padding: 0;
  margin-bottom: 24px;
  background: #fff;
}

.conversations-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 22px;
  background: #eef2f7;
}

.conversation-panel-resize {
  position: absolute;
  left: 50%;
  bottom: -20px;
  z-index: 9;
  width: 140px;
  height: 18px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: ns-resize;
}

.conversation-panel-resize::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  top: 7px;
  height: 3px;
  border-radius: 999px;
  background: rgba(100, 116, 139, .38);
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.conversation-panel-resize:hover,
.conversation-panel-resize:focus-visible {
  outline: none;
}

.conversation-panel-resize:hover::before,
.conversation-panel-resize:focus-visible::before {
  background: rgba(21, 91, 199, .68);
  box-shadow: 0 0 0 5px rgba(21, 91, 199, .08);
  transform: scaleX(1.12);
}

.conversations-panel.is-resizing {
  user-select: none;
}

.conversation-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 10px;
  border-right: 1px solid var(--line-soft);
  background: #f8fafc;
}

.conversation-search {
  position: relative;
}

.conversation-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 42px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.conversation-search .icon {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
}

.conversation-channel-tabs,
.conversation-filter-row {
  display: grid;
  gap: 5px;
  width: 100%;
}

.conversation-channel-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.conversation-filter-row {
  grid-template-columns: minmax(56px, .85fr) minmax(92px, 1.25fr) minmax(62px, .9fr) 34px 34px;
}

.conversation-channel-tabs button,
.conversation-filter,
.conversation-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 27px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #273244;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.conversation-channel-tabs button {
  width: 100%;
}

.conversation-channel-tabs button span {
  display: inline-grid;
  place-items: center;
  min-width: 12px;
  font-size: 12px;
  line-height: 1;
}

.conversation-channel-tabs button b,
.conversation-filter b {
  font-size: 10px;
  line-height: 1;
}

.conversation-tool {
  width: 34px;
  height: 27px;
  padding: 0;
  font-size: 13px;
}

.conversation-channel-tabs button.is-active,
.conversation-filter.is-active,
.conversation-tool.is-active {
  border-color: #8b5cf6;
  color: #6d28d9;
  background: #f3e8ff;
}

.conversation-channel-tabs .channel-facebook span { color: #1877f2; }
.conversation-channel-tabs .channel-instagram span { color: #c026d3; }
.conversation-channel-tabs .channel-telegram span { color: #229ed9; }
.conversation-channel-tabs .channel-web span { color: #0ea5e9; }
.conversation-channel-tabs .channel-dashboard span { color: #ef476f; }

.conversation-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 0 2px 84px 0;
}

.conversation-new-button {
  position: absolute;
  left: 24px;
  bottom: 20px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #b586ce;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(111, 70, 155, .28);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.conversation-new-button:hover {
  background: #9a6fbe;
  box-shadow: 0 18px 38px rgba(111, 70, 155, .36);
  transform: translateY(-2px);
}

.conversation-new-button span {
  display: block;
  width: 28px;
  height: 28px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5C4 4.12 5.12 3 6.5 3h11C18.88 3 20 4.12 20 5.5v8c0 1.38-1.12 2.5-2.5 2.5H9.2L4 21V5.5zM6.5 5C6.22 5 6 5.22 6 5.5v10.86L8.42 14H17.5c.28 0 .5-.22.5-.5v-8c0-.28-.22-.5-.5-.5h-11z'/%3E%3C/svg%3E") center / 28px 28px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5C4 4.12 5.12 3 6.5 3h11C18.88 3 20 4.12 20 5.5v8c0 1.38-1.12 2.5-2.5 2.5H9.2L4 21V5.5zM6.5 5C6.22 5 6 5.22 6 5.5v10.86L8.42 14H17.5c.28 0 .5-.22.5-.5v-8c0-.28-.22-.5-.5-.5h-11z'/%3E%3C/svg%3E") center / 28px 28px no-repeat;
}

.conversation-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.conversation-item.is-active,
.conversation-item:hover {
  border-color: #8b5cf6;
  box-shadow: 0 10px 24px rgba(109, 40, 217, .12);
}

.conversation-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-weight: 900;
}

.conversation-avatar img,
.client-contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conversation-item-body,
.conversation-item-body span {
  display: grid;
  min-width: 0;
}

.conversation-item-body > span:first-child {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.conversation-item-body strong,
.conversation-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item-body em,
.conversation-item-body small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.conversation-unread {
  position: absolute;
  right: 42px;
  bottom: 10px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: #7c3aed;
  font-size: 11px;
}

.conversation-archive-button {
  position: absolute;
  right: 9px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  opacity: .78;
  transition: background .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}

.conversation-archive-button::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 13h4'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 13h4'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.conversation-item:hover .conversation-archive-button,
.conversation-archive-button:focus-visible {
  opacity: 1;
}

.conversation-archive-button:hover,
.conversation-archive-button:focus-visible {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #2563eb;
}

.conversation-status-badge {
  width: fit-content;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #155bc7;
  background: #dbeafe;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.conversation-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 5px;
}

.conversation-badge-row .conversation-status-badge,
.conversation-badge-row .conversation-department-badge {
  margin-top: 0;
}

.conversation-department-badge {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.conversation-status-badge.active {
  color: #5b21b6;
  background: #ede9fe;
}

.conversation-status-badge.automated {
  color: #075985;
  background: #e0f2fe;
}

.conversation-status-badge.waiting {
  color: #b45309;
  background: #fef3c7;
}

.conversation-status-badge.resolved {
  color: #047857;
  background: #dcfce7;
}

.conversation-list-empty,
.conversation-empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  min-height: 420px;
  color: var(--muted);
  text-align: center;
}

.conversation-list-empty strong,
.conversation-empty-state h2 {
  margin: 0;
  color: var(--ink);
}

.conversation-empty-bubble,
.conversation-empty-icon {
  position: relative;
  width: 74px;
  height: 54px;
  border-radius: 50%;
  background: #8b5cf6;
  opacity: .86;
}

.conversation-empty-bubble::after,
.conversation-empty-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: -9px;
  width: 22px;
  height: 18px;
  border-radius: 0 0 0 18px;
  background: inherit;
  transform: rotate(-18deg);
}

.conversation-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  background: #eef2f7;
}

.conversation-chat {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.conversation-chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.conversation-chat-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.conversation-chat-header strong,
.conversation-chat-header span {
  display: block;
}

.conversation-header-avatar {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  overflow: hidden;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-weight: 900;
}

.conversation-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conversation-chat-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.conversation-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.conversation-action-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: #cfe0f6;
  color: #155bc7;
  background: #ffffff;
}

.conversation-action-icon:hover {
  border-color: #155bc7;
  background: #edf5ff;
}

.conversation-action-primary {
  border-color: #155bc7;
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .24);
}

.conversation-action-primary:hover {
  color: #ffffff;
  background: #1d4ed8;
}

.conversation-action-icon .icon {
  width: 24px;
  height: 24px;
  background: currentColor;
}

.conversation-action-icon .satisfaction-mark-icon {
  color: #f59e0b;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 2a9 9 0 1 0 9 9h-2a7 7 0 1 1-7-7V2zm7 1h2v3h3v2h-3v3h-2V8h-3V6h3V3zM7.8 9.2a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zm6.4 0a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zM6.8 12.8h8.4a4.5 4.5 0 0 1-8.4 0z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 2a9 9 0 1 0 9 9h-2a7 7 0 1 1-7-7V2zm7 1h2v3h3v2h-3v3h-2V8h-3V6h3V3zM7.8 9.2a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zm6.4 0a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zM6.8 12.8h8.4a4.5 4.5 0 0 1-8.4 0z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

.conversation-action-icon .create-request-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7V4zm6.5 1.5h4v2h-4v-2zm0 4h4v2h-4v-2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7V4zm6.5 1.5h4v2h-4v-2zm0 4h4v2h-4v-2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

.conversation-action-icon .link-client-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 14a4.5 4.5 0 1 1 3.18-7.68l1.06 1.06-1.42 1.42-1.06-1.06A2.5 2.5 0 1 0 7.5 12h3v2h-3zm6-4h3a4.5 4.5 0 1 1-3.18 7.68l-1.06-1.06 1.42-1.42 1.06 1.06A2.5 2.5 0 1 0 16.5 12h-3v-2zM8 11h8v2H8v-2z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 14a4.5 4.5 0 1 1 3.18-7.68l1.06 1.06-1.42 1.42-1.06-1.06A2.5 2.5 0 1 0 7.5 12h3v2h-3zm6-4h3a4.5 4.5 0 1 1-3.18 7.68l-1.06-1.06 1.42-1.42 1.06 1.06A2.5 2.5 0 1 0 16.5 12h-3v-2zM8 11h8v2H8v-2z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
}

/* Telefone: por ora e' so o lugar reservado da ligacao, ainda em
   desenvolvimento (ver o botao desabilitado no cabecalho do chat). */
.conversation-action-icon .call-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.2.2 2.4.6 3.6.1.3 0 .7-.2 1l-2.3 2.2z'/%3E%3C/svg%3E") center / 19px 19px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.2.2 2.4.6 3.6.1.3 0 .7-.2 1l-2.3 2.2z'/%3E%3C/svg%3E") center / 19px 19px no-repeat;
}

/* Acao ainda nao disponivel: fica visivel e apagada, e o cursor avisa que nao
   ha o que clicar. O `title` no botao e' o que mostra "Em desenvolvimento" ao
   passar o mouse. */
.conversation-action-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.conversation-action-icon .transfer-attendance-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h9.2l-2.6-2.6L15 3l5 5-5 5-1.4-1.4L16.2 9H7V7zm10 10H7.8l2.6 2.6L9 21l-5-5 5-5 1.4 1.4L7.8 15H17v2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h9.2l-2.6-2.6L15 3l5 5-5 5-1.4-1.4L16.2 9H7V7zm10 10H7.8l2.6 2.6L9 21l-5-5 5-5 1.4 1.4L7.8 15H17v2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

.conversation-action-icon .start-attendance-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7L8 5z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7L8 5z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

.conversation-action-icon .finish-attendance-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.2 16.6-4.1-4.1L3.7 14l5.5 5.5L20.7 8 19.3 6.6 9.2 16.6z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.2 16.6-4.1-4.1L3.7 14l5.5 5.5L20.7 8 19.3 6.6 9.2 16.6z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
}

.conversation-satisfaction-panel {
  position: absolute;
  top: 62px;
  right: 18px;
  z-index: 5;
  width: min(390px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .18);
}

.conversation-satisfaction-panel[hidden] {
  display: none;
}

.conversation-transfer-panel {
  position: absolute;
  top: 62px;
  right: 18px;
  z-index: 6;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .18);
}

.conversation-transfer-panel[hidden] {
  display: none;
}

.conversation-transfer-header,
.conversation-transfer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-transfer-header strong {
  font-size: 14px;
}

.conversation-transfer-header .icon-button {
  width: 30px;
  height: 30px;
}

.conversation-transfer-panel label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 12px;
  font-weight: 900;
}

.conversation-transfer-panel select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.conversation-transfer-status {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.conversation-transfer-status.is-error {
  color: #b91c1c;
}

.conversation-transfer-status.is-success {
  color: #15803d;
}

.conversation-transfer-actions {
  justify-content: flex-end;
}

.conversation-transfer-actions button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.conversation-link-modal {
  z-index: 260;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px);
}

.conversation-link-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(520px, calc(100vw - 32px));
  max-height: none;
  overflow: visible;
  padding: 28px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.conversation-link-card h2,
.conversation-link-card p {
  margin: 0;
}

.conversation-link-card h2 {
  color: #142039;
  font-size: 28px;
  line-height: 1.1;
}

.conversation-link-card p {
  color: var(--muted);
}

.conversation-link-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.conversation-link-card label {
  position: relative;
  display: grid;
  gap: 8px;
  color: #142039;
  font-weight: 900;
}

.conversation-link-card input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.conversation-linked-client {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
}

.conversation-linked-client small {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.conversation-linked-client strong {
  color: #142039;
  font-size: 16px;
  line-height: 1.25;
}

.conversation-link-card .client-search-results {
  position: static;
  z-index: auto;
  max-height: none;
  overflow: visible;
  margin-top: -4px;
  box-shadow: none;
}

.conversation-link-card .client-search-results button {
  border-radius: 10px;
}

.conversation-link-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.conversation-link-status.is-error {
  color: #b91c1c;
}

.conversation-link-status.is-success {
  color: #15803d;
}

.conversation-link-submit {
  justify-self: stretch;
  min-height: 50px;
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.conversation-link-submit:hover {
  border-color: #15803d;
  background: #15803d;
}

.service-request-link-client-backdrop {
  z-index: 270;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(9px);
}

.service-request-link-client-card {
  width: min(640px, calc(100vw - 32px));
  max-height: min(88vh, 620px);
  overflow: visible;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.service-request-link-client-card .modal-header {
  align-items: flex-start;
  gap: 18px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.service-request-link-client-card .modal-header > div {
  display: grid;
  gap: 6px;
}

.service-request-link-client-card .eyebrow {
  color: #64748b;
  font-size: 13px;
  letter-spacing: .08em;
}

.service-request-link-client-card h2,
.service-request-link-client-card p {
  margin: 0;
}

.service-request-link-client-card h2 {
  color: #142039;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.08;
}

.service-request-link-client-card .modal-header p {
  max-width: 52ch;
  color: #64748b;
  font-size: 15px;
  line-height: 1.35;
}

.service-request-link-client-card .icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 28px;
}

#serviceRequestLinkClientForm {
  display: grid;
  gap: 14px;
  padding: 22px 28px 28px;
}

.service-request-link-field {
  position: relative;
  display: grid;
  gap: 8px;
  color: #142039;
  font-size: 14px;
  font-weight: 900;
}

.service-request-link-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  background: #ffffff;
  color: #142039;
  font: inherit;
  font-weight: 700;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.service-request-link-field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.service-request-link-client-results {
  position: static;
  max-height: 190px;
  overflow: auto;
  border-radius: 12px;
  box-shadow: none;
}

.service-request-link-client-results button {
  padding: 12px 14px;
  border-radius: 0;
}

#serviceRequestLinkClientStatus {
  min-height: 20px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8e6;
  color: #b45309;
  font-size: 14px;
  font-weight: 800;
}

#serviceRequestLinkClientStatus:empty {
  display: none;
}

#serviceRequestLinkClientStatus.is-success,
#serviceRequestLinkClientStatus.success,
#serviceRequestLinkClientStatus[data-state="success"] {
  background: #ecfdf5;
  color: #047857;
}

#serviceRequestLinkClientStatus.is-error,
#serviceRequestLinkClientStatus.error,
#serviceRequestLinkClientStatus[data-state="error"] {
  background: #fef2f2;
  color: #b91c1c;
}

#confirmServiceRequestLinkClientButton {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 900;
}

.conversation-satisfaction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.conversation-satisfaction-header strong {
  font-size: 14px;
}

.conversation-satisfaction-header .icon-button {
  width: 30px;
  height: 30px;
}

.conversation-satisfaction-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.conversation-satisfaction-options button {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.conversation-satisfaction-options button:hover,
.conversation-satisfaction-options button.is-selected {
  border-color: #8b5cf6;
  background: #f8f5ff;
}

.conversation-satisfaction-options button:nth-child(1) { color: #16a34a; }
.conversation-satisfaction-options button:nth-child(2) { color: #65a30d; }
.conversation-satisfaction-options button:nth-child(3) { color: #ca8a04; }
.conversation-satisfaction-options button:nth-child(4) { color: #ea580c; }
.conversation-satisfaction-options button:nth-child(5) { color: #dc2626; }

.satisfaction-face {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fbbf24;
}

.satisfaction-face::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1f2937;
  box-shadow: 8px 0 0 #1f2937;
}

.satisfaction-face::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 15px;
  width: 12px;
  height: 5px;
  border: 2px solid #1f2937;
  border-top: 0;
  border-radius: 0 0 14px 14px;
}

.satisfaction-face.neutral::after {
  top: 17px;
  height: 2px;
  border: 0;
  border-radius: 2px;
  background: #1f2937;
}

.satisfaction-face.sad::after,
.satisfaction-face.very-sad::after {
  top: 17px;
  border: 2px solid #1f2937;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}

.satisfaction-face.very-sad {
  background: #f87171;
}

.conversation-satisfaction-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.conversation-satisfaction-panel p {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

.conversation-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 22px;
}

.conversation-message {
  width: fit-content;
  max-width: min(640px, 78%);
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.conversation-message.outgoing {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #e8f1ff;
}

.conversation-message p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
  white-space: pre-line;
}

.conversation-media {
  display: grid;
  gap: 8px;
  margin: 0;
}

.conversation-media img,
.conversation-media video {
  display: block;
  max-width: min(360px, 72vw);
  max-height: 360px;
  border-radius: 10px;
  object-fit: contain;
  background: #0f172a;
}

.conversation-media-image a {
  cursor: zoom-in;
}

.conversation-media audio {
  width: min(320px, 68vw);
}

.conversation-media figcaption p,
.conversation-media p,
.conversation-media-file p {
  margin-top: 4px;
}

.conversation-media-file a {
  color: #155bc7;
  font-weight: 800;
}

.conversation-media-error {
  display: none;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 9px;
  background: #eff6ff;
  color: #1d4ed8;
  line-height: 1.35;
  font-weight: 800;
}

/* Altura reservada por tipo: quando a previa entra no lugar do texto, o balao
   ja ocupa quase o espaco final e a conversa nao e empurrada. Audio fica na
   altura padrao — o player e baixo. */
.conversation-media-placeholder[data-kind="image"],
.conversation-media-placeholder[data-kind="video"] {
  min-height: 180px;
}
.floating-whatsapp-message .conversation-media-placeholder[data-kind="image"],
.floating-whatsapp-message .conversation-media-placeholder[data-kind="video"] {
  min-height: 150px;
}
.conversation-media-placeholder {
  min-width: 220px;
  max-width: 260px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 9px;
  background: #eff6ff;
  color: #1d4ed8;
  line-height: 1.35;
  font-weight: 800;
}

.conversation-media.is-media-error a {
  display: none;
}

.conversation-media.is-media-error .conversation-media-error {
  display: block;
}

.conversation-message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

/* Status de envio da mensagem (otimista): enviando / falha-reenviar. */
.conversation-message.is-sending { opacity: 0.7; }
.conversation-message-status {
  display: inline;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
}
.conversation-message-status.is-sending { color: var(--muted); font-style: italic; }
.conversation-message-status.is-error {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  color: #b42318;
  text-decoration: underline;
}
.conversation-message-status.is-error:hover { color: #8a1b12; }

/* Marca de mensagem editada pelo contato. Fica antes do horario, no mesmo
   <small>, e herda a cor discreta dele: e informacao de contexto, nao alerta. */
.conversation-message-edited {
  display: inline;
  margin-right: 6px;
  font-size: 11px;
  font-style: italic;
  color: var(--muted);
}

/* Reacoes (23/09/2026): pastilha discreta pendurada na bolha reagida, como no
   WhatsApp. Serve os DOIS desenhos de bolha (janela flutuante e painel
   central), por isso a classe nao e' escopada a nenhum dos dois. */
.conversation-message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.conversation-message-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  padding: 2px 6px;
  border: 1px solid var(--line, #E7EAF0);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  line-height: 1.2;
}

.conversation-message-reaction b {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* Editada, mas o texto novo veio cifrado e nao foi lido: o texto da bolha e o
   ANTIGO. Sai da cor discreta e usa o ambar ja usado no chat (chat-sla-chip
   --warning) porque aqui e' aviso, nao contexto — quem atende precisa ver. */
.conversation-message-edited.is-unavailable {
  color: #854F0B;
  font-style: normal;
  font-weight: 600;
}

.conversation-composer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.conversation-send-status { grid-column: 1 / -1; }

.conversation-composer input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
}

.conversation-attach-button {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 42px;
  padding: 0;
  cursor: pointer;
}

.conversation-attach-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.conversation-attach-button span {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

/* Menu de anexos do botão "+": Foto / Vídeo / Áudio */
.conversation-attach-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.conversation-attach-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  padding: 8px;
  display: grid;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.conversation-attach-menu[hidden] { display: none; }

.conversation-attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.conversation-attach-item:hover { background: #f1f5f9; }

.conversation-attach-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.conversation-attach-ico.is-photo {
  background-color: #ede9fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='m21 17-5-5L5 21'/%3E%3C/svg%3E");
}

.conversation-attach-ico.is-video {
  background-color: #e0f2fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='13' height='12' rx='2'/%3E%3Cpath d='m22 8-6 4 6 4V8Z'/%3E%3C/svg%3E");
}

.conversation-attach-ico.is-audio {
  background-color: #fee2e2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v3'/%3E%3C/svg%3E");
}

.conversation-attach-ico.is-document {
  background-color: #e0e7ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E");
}

/* Card de documento no chat (sem prévia: nome + tamanho + download) */
.wa-doc {
  max-width: 300px;
}

.wa-doc-link {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.wa-doc-link:hover:not(.is-pending) {
  border-color: #c7d2fe;
  background: #f8faff;
}

.wa-doc-link.is-pending {
  opacity: 0.75;
}

.wa-doc-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.wa-doc-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.wa-doc-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-doc-size {
  color: var(--muted, #64748b);
  font-size: 11.5px;
}

/* Cartão de contato compartilhado no chat (1 contato ou lista) — 17/09/2026 */
.wa-contact {
  display: grid;
  gap: 8px;
  width: 300px;
  max-width: 100%;
}

.wa-contact-card,
.wa-contact-row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft, #E7EAF0);
  border-radius: 12px;
  background: #fff;
}

.wa-contact-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #E6F1FB;
  color: #185FA5;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wa-contact-avatar.is-icon {
  color: #185FA5;
}

.wa-contact-body {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.wa-contact-name {
  overflow: hidden;
  color: #0F172A;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-contact-phone {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
  color: #5A6472;
  font-size: 12px;
}

.wa-contact-phone > svg {
  flex: none;
  align-self: center;
  color: #0F6E56;
}

.wa-contact-phone > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-contact-more {
  flex: none;
  color: #8A93A3;
  font-size: 11px;
}

.wa-contact-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wa-contact-btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-soft, #E7EAF0);
  border-radius: 12px;
  background: #fff;
  color: #2563EB;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.wa-contact-btn:hover:not(:disabled) {
  border-color: #BFDBFE;
  background: #F8FAFC;
}

.wa-contact-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.wa-contact-btn.is-flashing,
.wa-contact-icon-btn.is-flashing {
  color: #0F6E56;
}

.wa-contact-btn > svg {
  flex: none;
}

/* Lista (vários contatos numa mensagem): linhas compactas, copiar por linha */
.wa-contact-list {
  gap: 6px;
}

.wa-contact-row {
  position: relative;
  padding: 8px 10px;
}

.wa-contact-row .wa-contact-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.wa-contact-icon-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #8A93A3;
  cursor: pointer;
}

.wa-contact-icon-btn:hover {
  border-color: var(--line-soft, #E7EAF0);
  background: #F8FAFC;
  color: #2563EB;
}

/* Menu de escolha do número (contato com 2+ telefones) */
.wa-contact-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  display: grid;
  min-width: 180px;
  padding: 4px;
  border: 1px solid var(--line-soft, #E7EAF0);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.wa-contact-row > .wa-contact-menu {
  left: auto;
  right: 0;
}

.wa-contact-menu-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  min-height: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0F172A;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.wa-contact-menu-item:hover {
  background: #F8FAFC;
}

.wa-contact-menu-item > small {
  color: #8A93A3;
  font-size: 11px;
}

/* Barra de progresso do upload de mídia (áudio/vídeo enviando) */
.conversation-media-progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.conversation-media-progress::after {
  content: attr(data-progress-label);
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.conversation-media-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #2563eb;
  transition: width 0.15s ease;
}

/* Player de áudio inline (recebido/enviado) */
.wa-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: min(340px, 72vw);
  padding: 8px 12px;
  border-radius: 12px;
  background: #eef2f7;
}

.wa-audio .wa-audio-el { display: none; }

.wa-audio-toggle {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.wa-audio-toggle .wa-audio-ico {
  width: 0;
  height: 0;
  border-left: 12px solid #fff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 3px;
}

.wa-audio.is-playing .wa-audio-toggle .wa-audio-ico {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-left: 4px solid #fff;
  border-right: 4px solid #fff;
}

.wa-audio-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.wa-audio-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  cursor: pointer;
}

.wa-audio-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #2563eb;
}

.wa-audio-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Vídeo: miniatura com duração + botão de play */
.wa-video-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.wa-video-frame .wa-video-el {
  display: block;
  max-width: min(360px, 72vw);
  max-height: 360px;
  border-radius: 10px;
  object-fit: contain;
  background: #0f172a;
}

.wa-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.wa-video-play::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 18px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 4px;
}

.wa-video-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.wa-video-duration:empty { display: none; }

.wa-video.is-playing .wa-video-play,
.wa-video.is-playing .wa-video-duration { display: none; }

/* Botão de microfone (gravação de voz) */
.conversation-mic-button {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.conversation-mic-button:hover { background: #f1f5f9; }

.conversation-mic-ico {
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v3'/%3E%3C/svg%3E");
}

/* Barra de gravação em andamento (overlay do composer) */
.conversation-recording-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  z-index: 5;
}

.conversation-recording-bar[hidden] { display: none; }

.conversation-recording-cancel {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E");
}

.conversation-recording-cancel:hover { background-color: #fecaca; }

.conversation-recording-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dc2626;
  animation: recordingPulse 1s ease-in-out infinite;
}

@keyframes recordingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.conversation-recording-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text, #0f172a);
  min-width: 44px;
}

.conversation-recording-hint {
  flex: 1;
  color: var(--muted);
  font-weight: 600;
}

.conversation-recording-send { flex: none; }

/* ---- Janela flutuante: menu de anexos, microfone e barra de gravação ---- */
.floating-whatsapp-attach-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.floating-whatsapp-composer .floating-attach-toggle {
  width: 44px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-composer .floating-attach-toggle:hover { background: #eaf2ff; }

.floating-whatsapp-composer .floating-whatsapp-mic {
  width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.floating-whatsapp-composer .floating-whatsapp-mic:hover { background: #f1f5f9; }

.floating-attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  display: grid;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.floating-attach-menu[hidden] { display: none; }

.floating-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.floating-attach-item:hover { background: #f1f5f9; }
.floating-attach-item input { display: none; }

.floating-whatsapp-recording-bar {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
}

.floating-whatsapp-composer .floating-recording-cancel {
  flex: none;
  width: 40px;
  min-height: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E");
}

.floating-whatsapp-composer .floating-recording-cancel:hover { background-color: #fecaca; }

.floating-whatsapp-composer .floating-recording-send {
  flex: none;
  width: auto;
  min-width: 76px;
  padding: 0 16px;
}

.conversation-send-status {
  grid-column: 2 / 4;
  min-height: 16px;
  margin: -4px 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.conversation-send-status:empty {
  display: none;
}

.conversation-send-status.is-loading {
  color: #2563eb;
}

.conversation-send-status.is-success {
  color: #15803d;
}

.conversation-send-status.is-error {
  color: #b91c1c;
}

.floating-image-preview {
  position: fixed;
  z-index: 2200;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 260px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  resize: both;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .32);
}

.floating-image-preview.is-dragging {
  user-select: none;
}

.floating-image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .3);
  background: #fff;
  color: var(--ink);
  cursor: grab;
}

.floating-image-preview-header:active {
  cursor: grabbing;
}

.floating-image-preview-header strong,
.floating-image-preview-header span {
  display: block;
  max-width: min(520px, 68vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-image-preview-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.close-floating-image-preview {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.close-floating-image-preview:hover {
  background: #eef4ff;
  color: var(--blue);
}

.floating-image-preview-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.floating-image-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #eef2f9;
}

.floating-image-zoom-controls button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.floating-image-zoom-controls button:hover {
  background: #fff;
  color: var(--blue);
}

.floating-image-zoom-value {
  min-width: 52px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}

.floating-image-preview-body {
  display: grid;
  /* Célula de tamanho DEFINIDO (nao 'auto') para que o max-height:100% do <img>
     tenha contra o que resolver — senao uma imagem em retrato estoura a altura
     e fica cortada pelo overflow. */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}

.floating-image-preview-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #0f172a;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
}

.floating-whatsapp-dock {
  position: fixed;
  left: calc(var(--sidebar-collapsed-width, 84px) + 24px);
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  overflow-x: auto;
  padding-top: 8px;
  transition: left 220ms ease;
  pointer-events: none;
}

.sidebar:hover ~ .floating-whatsapp-dock {
  left: calc(var(--sidebar-expanded-width, 300px) + 24px);
}

.floating-whatsapp-dock[hidden] {
  display: none;
}

.floating-whatsapp-window {
  flex: 0 0 auto;
  width: min(560px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 58px));
  height: min(620px, calc(100vh - var(--topbar-height, 58px) - 108px));
  min-width: min(420px, calc(100vw - 36px));
  min-height: 360px;
  max-width: calc(100vw - var(--sidebar-collapsed-width, 84px) - 58px);
  max-height: calc(100vh - var(--topbar-height, 58px) - 108px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  resize: both;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  pointer-events: auto;
  container-type: inline-size;
}

.floating-whatsapp-window.is-minimized {
  flex-basis: min(360px, calc(100vw - 36px));
  width: min(360px, calc(100vw - 36px));
  height: 76px;
  min-height: 76px;
  resize: none;
}

.floating-whatsapp-window.is-positioned {
  position: fixed;
  right: auto;
  bottom: auto;
  z-index: 120;
}

.floating-whatsapp-window.is-dragging {
  opacity: .96;
  cursor: grabbing;
  user-select: none;
}

.floating-whatsapp-window.is-minimized.has-new-message {
  animation: floating-whatsapp-new-message 0.8s steps(2, end) infinite;
}

.floating-whatsapp-window.is-minimized.has-new-message .floating-whatsapp-header {
  animation: floating-whatsapp-new-message-header 0.8s steps(2, end) infinite;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-body {
  display: none;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-details {
  display: none;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-summary {
  display: none;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-actions {
  display: none;
}

/* Header minimizado: nome ocupa o espaco e os controles (- [] x) ficam alinhados
   e organizados a direita, sem colunas vazias. */
.floating-whatsapp-window.is-minimized .floating-whatsapp-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-control {
  flex: 0 0 auto;
}

@keyframes floating-whatsapp-new-message {
  0%,
  100% {
    border-color: var(--line-soft);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
  }
  50% {
    border-color: #2563eb;
    box-shadow:
      0 0 0 4px rgba(37, 99, 235, .38),
      0 18px 45px rgba(37, 99, 235, .42);
  }
}

@keyframes floating-whatsapp-new-message-header {
  0%,
  100% {
    background: #fff;
  }
  50% {
    background: #dbeafe;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-whatsapp-window.is-minimized.has-new-message {
    animation: none;
    border-color: #2563eb;
    box-shadow:
      0 0 0 3px rgba(37, 99, 235, .22),
      0 18px 45px rgba(37, 99, 235, .28);
  }

  .floating-whatsapp-window.is-minimized.has-new-message .floating-whatsapp-header {
    animation: none;
    background: #dbeafe;
  }
}

.floating-whatsapp-header {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  cursor: grab;
}

.floating-whatsapp-header:active {
  cursor: grabbing;
}

.floating-whatsapp-header button {
  cursor: pointer;
}

.floating-whatsapp-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.floating-whatsapp-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 12px;
  font-weight: 900;
}

.floating-whatsapp-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.floating-whatsapp-title strong,
.floating-whatsapp-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-title strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.floating-whatsapp-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.floating-whatsapp-heading .floating-whatsapp-title small + small {
  display: none;
}

.floating-whatsapp-header > .floating-whatsapp-status {
  display: none;
}

.floating-whatsapp-summary {
  min-width: 0;
  max-width: 170px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
  color: #475569;
}

.floating-whatsapp-summary div {
  min-width: 0;
  max-width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
}

.floating-whatsapp-summary .conversation-status-badge,
.floating-whatsapp-summary .conversation-department-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  height: 24px;
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  line-height: 1;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-summary small {
  max-width: 260px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.floating-whatsapp-actions .conversation-action-icon {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 8px;
}

.floating-whatsapp-actions .conversation-action-icon .icon {
  width: 21px;
  height: 21px;
}

@container (max-width: 760px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(230px, 1fr) auto auto auto auto;
    gap: 8px;
  }

  .floating-whatsapp-summary {
    justify-content: flex-end;
  }

  .floating-whatsapp-heading {
    gap: 10px;
  }

  .floating-whatsapp-title strong {
    font-size: 16px;
  }
}

@container (max-width: 680px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(220px, 1fr) auto auto auto auto;
    gap: 6px;
  }

  .floating-whatsapp-summary .conversation-status-badge {
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .floating-whatsapp-actions {
    gap: 4px;
  }

  .floating-whatsapp-actions .conversation-action-icon {
    width: 31px;
    height: 31px;
    min-height: 31px;
  }

  .floating-whatsapp-control {
    width: 26px;
    height: 28px;
  }
}

@container (max-width: 590px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(210px, 1fr) auto auto auto auto;
  }

  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 58px;
  }

  .floating-whatsapp-summary .conversation-status-badge {
    max-width: 64px;
  }
}

@container (max-width: 520px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(200px, 1fr) auto auto auto auto;
  }

  .floating-whatsapp-summary .conversation-status-badge,
  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 44px;
  }

  .floating-whatsapp-actions .conversation-action-icon {
    width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .floating-whatsapp-actions .conversation-action-icon .icon {
    width: 18px;
    height: 18px;
  }
}

@container (max-width: 455px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(190px, 1fr) minmax(0, 90px) auto auto auto;
    gap: 4px;
    padding-inline: 10px;
  }

  .floating-whatsapp-actions {
    gap: 2px;
    overflow: hidden;
  }

  .floating-whatsapp-summary .conversation-status-badge,
  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 36px;
  }

  .floating-whatsapp-actions .conversation-action-icon {
    width: 25px;
    height: 25px;
    min-height: 25px;
  }

  .floating-whatsapp-control {
    width: 24px;
    height: 26px;
  }
}

.floating-whatsapp-details .floating-whatsapp-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.4fr .9fr 1fr;
  gap: 8px;
}

.floating-whatsapp-details span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.floating-whatsapp-details small {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.floating-whatsapp-details strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Faixa de etiquetas (tags) na janela flutuante ===== */
.floating-whatsapp-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-tags {
  display: none;
}

/* O container de chips usa display:contents para que chips e botao "+ Tag"
   fluam e quebrem juntos na mesma faixa (flex-wrap). */
.floating-tags-chips {
  display: contents;
}

.floating-tags-icon {
  flex: none;
  width: 15px;
  height: 15px;
  background-color: #94a3b8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.floating-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.floating-tag-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: .65;
}

.floating-tag-chip-remove:hover {
  opacity: 1;
  background: rgba(15, 23, 42, .1);
}

.floating-tag-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px dashed #93c5fd;
  border-radius: 999px;
  background: transparent;
  color: var(--blue, #2563eb);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.floating-tag-add-btn:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

/* ===== Seletor de etiquetas (popover) ===== */
.floating-tag-popover {
  position: fixed;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  max-height: 340px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
  overflow: hidden;
}

.floating-tag-search {
  padding: 10px;
  border-bottom: 1px solid #eef2f7;
}

.floating-tag-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}

.floating-tag-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  overflow-y: auto;
}

.floating-tag-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
}

.floating-tag-row:hover {
  background: #f1f5f9;
}

.floating-tag-row.is-applied {
  background: #f0fdf4;
}

.floating-tag-option {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.floating-tag-edit {
  flex: none;
  width: 28px;
  height: 28px;
  min-height: 0;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background-color: transparent;
  cursor: pointer;
  opacity: .55;
  -webkit-mask: none;
}

.floating-tag-edit::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: #475569;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

.floating-tag-edit:hover {
  opacity: 1;
  background-color: #e2e8f0;
}

.floating-tag-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.floating-tag-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-tag-check {
  flex: none;
  width: 16px;
  height: 16px;
  background-color: #16a34a;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.floating-tag-empty {
  padding: 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.floating-tag-create {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #eef2f7;
}

.floating-tag-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.floating-tag-color {
  flex: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.floating-tag-color.is-selected {
  border-color: #0f172a;
  box-shadow: inset 0 0 0 2px #fff;
}

.floating-tag-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #eef2f7;
}

.floating-tag-edit-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.floating-tag-edit-label input {
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
}

.floating-tag-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.floating-tag-cancel-btn,
.floating-tag-save-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.floating-tag-cancel-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
}

.floating-tag-cancel-btn:hover {
  background: #f1f5f9;
}

.floating-tag-save-btn {
  border: 0;
  background: var(--blue, #2563eb);
  color: #fff;
}

.floating-tag-save-btn:hover {
  filter: brightness(.95);
}

.floating-tag-save-btn:disabled {
  opacity: .6;
  cursor: default;
}

.floating-tag-create-btn {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--blue, #2563eb);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.floating-tag-create-btn:hover {
  background: #dbeafe;
}

.floating-tag-create-btn:disabled {
  opacity: .6;
  cursor: default;
}

.floating-tag-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4100;
  max-width: 300px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #b91c1c;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.floating-tag-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.floating-whatsapp-control {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-control:hover {
  background: #eef4ff;
  color: var(--blue);
}

.floating-whatsapp-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #f3f7fb;
}

.floating-whatsapp-avatar,
.floating-whatsapp-avatar .conversation-avatar-fallback {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-size: 12px;
  font-weight: 900;
}

.floating-instagram-avatar {
  background: linear-gradient(135deg, #f97316 0%, #db2777 46%, #7c3aed 100%);
  color: #fff;
}

.floating-whatsapp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-whatsapp-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 18px;
}

/* Separador de dia na linha do tempo (janela do chat e historico) — 21/09/2026 */
.conversation-day-divider {
  display: flex;
  justify-content: center;
  margin: 10px 0 6px;
}

.conversation-day-divider span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #EEF2F7;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.floating-whatsapp-message {
  width: fit-content;
  max-width: 82%;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, .05);
}

.floating-whatsapp-message.is-outgoing {
  align-self: flex-end;
  border-color: #bbf7d0;
  background: #dcfce7;
}

.floating-whatsapp-message p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.floating-whatsapp-message small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.floating-whatsapp-message .conversation-media img,
.floating-whatsapp-message .conversation-media video {
  max-width: 240px;
  max-height: 150px;
}

.floating-whatsapp-message .conversation-media audio {
  width: min(230px, 62vw);
}

.floating-whatsapp-empty {
  margin: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.floating-whatsapp-empty.is-error {
  color: #b91c1c;
}

.floating-whatsapp-composer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.floating-whatsapp-readonly {
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

/* Monitor (wallboard): coluna de acoes vazia mostra so um traco discreto. */
.service-request-readonly-dash {
  color: #94a3b8;
  font-weight: 700;
}

/* Aviso quando falta vincular cliente para conversar (WhatsApp). */
.floating-whatsapp-needs-client {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--line-soft);
  background: #fff8ef;
  text-align: center;
}

.floating-whatsapp-needs-client p {
  margin: 0;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.floating-whatsapp-needs-client-icon {
  width: 26px;
  height: 26px;
  background-color: #d97706;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cline x1='19' y1='8' x2='19' y2='14'/%3E%3Cline x1='22' y1='11' x2='16' y2='11'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cline x1='19' y1='8' x2='19' y2='14'/%3E%3Cline x1='22' y1='11' x2='16' y2='11'/%3E%3C/svg%3E") center / contain no-repeat;
}

.floating-whatsapp-link-client-cta {
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--blue, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.floating-whatsapp-link-client-cta:hover {
  filter: brightness(.96);
}

.floating-whatsapp-attach {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-attach:hover {
  background: #eaf2ff;
}

.floating-whatsapp-attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.floating-whatsapp-composer input {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
}

.floating-whatsapp-composer button {
  width: 48px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-composer button:disabled {
  opacity: .65;
  cursor: wait;
}

.floating-whatsapp-send-status {
  grid-column: 1 / -1;
  margin: -2px 2px 0;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
}

.floating-whatsapp-send-status:empty {
  display: none;
}

@media (max-width: 900px) {
  .floating-whatsapp-dock {
    left: 10px;
    right: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar:hover ~ .floating-whatsapp-dock {
    left: 10px;
  }

  .floating-whatsapp-window {
    flex: 0 0 auto;
    width: min(520px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 90px));
    min-width: min(360px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 90px);
  }

  .floating-whatsapp-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    padding: 10px;
  }

  .floating-whatsapp-title strong {
    font-size: 14px;
  }

  .floating-whatsapp-details {
    grid-template-columns: 1fr;
  }

  .floating-whatsapp-window {
    width: calc(100vw - 20px);
    min-width: calc(100vw - 20px);
    resize: vertical;
  }
}

.whatsapp-history-card {
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.whatsapp-history-summary {
  display: grid;
  /* Uma coluna POR ITEM, em vez de 4 fixas: o historico aberto pelo CHAT
     tem 4 campos e o aberto por um CHAMADO tem 5 (entrou o Codigo). Com
     repeat(4, ...) o quinto quebrava para a linha de baixo sozinho — a
     mesma armadilha da grade de Perfis de acesso, que tinha 5 colunas no
     CSS quando o JS passou a emitir 6. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.whatsapp-history-summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.whatsapp-history-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.whatsapp-history-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatsapp-history-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 18px 20px;
  background: #edf2f8;
}

.whatsapp-history-message {
  width: fit-content;
  max-width: min(620px, 78%);
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.whatsapp-history-message.is-outgoing {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #e8f1ff;
}

.whatsapp-history-message p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.whatsapp-history-message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.service-request-modal-open {
  overflow: hidden;
}

.service-request-form-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1790;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(10px);
}

.service-request-form-panel:not([hidden]) {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1800;
  width: min(980px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  margin: 0;
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.service-request-form-panel .card-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.service-request-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.service-request-metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

/* Acento semântico por situação (cor = estado; ícone da marca fica nos canais) */
.service-request-metric-card[data-request-quick-filter="new"] {
  border-left: 3px solid #94a3b8;
}

.service-request-metric-card[data-request-quick-filter="in_service"],
.service-request-metric-card[data-request-quick-filter="instagram_service"] {
  border-left: 3px solid #2563eb;
}

.service-request-metric-card[data-request-quick-filter="waiting_customer"] {
  border-left: 3px solid #d97706;
}

.service-request-metric-card[data-request-quick-filter="support"] {
  border-left: 3px solid #1faf5e;
}

.service-request-metric-card[data-request-quick-filter="whatsapp_queue"],
.service-request-metric-card[data-request-quick-filter="instagram_queue"] {
  border-left: 3px solid #94a3b8;
}

/* Cards de canal consolidados (WhatsApp / Instagram / Web Chat). */
.service-request-metric-card[data-request-quick-filter="whatsapp"] {
  border-left: 3px solid #1faf5e;
}
.service-request-metric-card[data-request-quick-filter="instagram"] {
  border-left: 3px solid #d6249f;
}
.service-request-metric-card[data-request-quick-filter="web_chat"] {
  border-left: 3px solid #2c58e8;
}

.service-request-metric-card:hover,
.service-request-metric-card.is-active {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(13, 99, 212, .13);
  transform: translateY(-1px);
}

.service-request-metric-card.is-active::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: inset 0 0 0 4px #fff;
}

.service-request-metric-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  line-height: 1.2;
}

.service-request-metric-card b {
  display: block;
  font-size: 23px;
  line-height: 1;
}

.service-request-metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.metric-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eaf2ff;
}

.metric-icon::before,
.metric-icon::after {
  content: "";
  position: absolute;
  border-color: currentColor;
}

.support-icon {
  color: #7c3aed;
  background: #f2e9ff;
}

.support-icon::before {
  width: 9px;
  height: 9px;
  left: 13px;
  top: 12px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 11px 3px 0 -1px currentColor;
}

.support-icon::after {
  width: 24px;
  height: 12px;
  left: 10px;
  top: 25px;
  border-radius: 12px 12px 5px 5px;
  background: currentColor;
}

.document-icon {
  color: #64748b;
  background: #eef2f6;
}

.document-icon::before {
  width: 18px;
  height: 23px;
  left: 13px;
  top: 10px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.document-icon::after {
  width: 10px;
  height: 2px;
  left: 17px;
  top: 18px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor;
}

.headset-icon {
  color: var(--blue);
  background: #eaf2ff;
}

.headset-icon::before {
  width: 22px;
  height: 18px;
  left: 10px;
  top: 12px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
}

.headset-icon::after {
  width: 7px;
  height: 12px;
  left: 11px;
  top: 23px;
  border-radius: 5px;
  background: currentColor;
  box-shadow: 16px 0 0 currentColor;
}

.search-icon {
  color: #d97706;
  background: #fff7e6;
}

.search-icon::before {
  width: 17px;
  height: 17px;
  left: 11px;
  top: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  width: 12px;
  height: 3px;
  left: 25px;
  top: 27px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.clock-icon {
  color: #f97316;
  background: #fff0e8;
}

.clock-icon::before {
  width: 22px;
  height: 22px;
  left: 10px;
  top: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.clock-icon::after {
  width: 10px;
  height: 8px;
  left: 22px;
  top: 17px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
}

.check-icon {
  color: #16a34a;
  background: #e8fbef;
}

.check-icon::before {
  width: 22px;
  height: 22px;
  left: 10px;
  top: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.check-icon::after {
  width: 14px;
  height: 8px;
  left: 16px;
  top: 18px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
}

.service-request-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.service-request-advanced-filters {
  border-top: 1px solid var(--line-soft);
  background: #fbfdff;
}

.service-request-advanced-filters summary {
  padding: 14px 24px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.service-request-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 14px;
  padding: 0 24px 22px;
}

.service-request-filters label,
.service-request-form label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.service-request-filters input,
.service-request-filters select,
.service-request-form input,
.service-request-form select,
.service-request-form textarea {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

.service-request-table-wrap {
  overflow-x: auto;
}

.service-request-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line-soft);
}

.service-request-table-footer.pagination-row {
  justify-content: space-between;
}

.pagination-gap {
  color: var(--muted);
  font-weight: 800;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.service-requests-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.service-requests-table th,
.service-requests-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  box-sizing: border-box;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
}

.service-requests-table th {
  background: var(--panel-soft);
  color: #273244;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  user-select: none;
}

.service-requests-table td {
  font-size: 13px;
  line-height: 1.35;
}

.service-requests-table th:nth-child(1),
.service-requests-table td:nth-child(1) {
  width: 11%;
}

.service-requests-table th:nth-child(2),
.service-requests-table td:nth-child(2) {
  width: 18%;
}

.service-requests-table th:nth-child(3),
.service-requests-table td:nth-child(3) {
  width: 24%;
}

.service-requests-table th:nth-child(4),
.service-requests-table td:nth-child(4) {
  width: 11%;
}

.service-requests-table th:nth-child(5),
.service-requests-table td:nth-child(5) {
  width: 17%;
}

.service-requests-table th:nth-child(6),
.service-requests-table td:nth-child(6) {
  width: 9%;
}

.service-requests-table th:nth-child(7),
.service-requests-table td:nth-child(7) {
  width: 10%;
}

.service-requests-table th:nth-child(8),
.service-requests-table td:nth-child(8) {
  width: 10%;
}

.service-requests-table th:nth-child(9),
.service-requests-table td:nth-child(9),
.service-requests-table th:nth-child(10),
.service-requests-table td:nth-child(10) {
  width: 7%;
}

.service-requests-table th:nth-child(11),
.service-requests-table td:nth-child(11) {
  width: 8%;
}

.service-requests-table .compact-date {
  white-space: nowrap;
}

.resizable-th-content {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.column-resizer {
  position: absolute;
  top: -12px;
  right: -10px;
  z-index: 20;
  width: 10px;
  height: calc(100% + 24px);
  cursor: col-resize;
}

.column-resizer:hover {
  background: rgba(0, 91, 215, 0.16);
}

.resizable-table th {
  position: relative;
}

.resizable-table .resizable-th-content {
  padding-right: 10px;
}

.resizable-table .generic-column-resizer {
  right: -6px;
}

.service-requests-table .compact-date small {
  color: var(--muted);
  font-size: 11px;
}

.service-request-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  /* Botoes alinhados a direita da coluna Acoes (da direita para a esquerda). */
  justify-content: flex-end;
  gap: 6px;
}

.service-request-primary {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-request-neutral-button {
  border-color: var(--line);
  background: #fff;
  color: #475569;
}

.service-request-neutral-button:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #1f2937;
}

/* Menu "⋯" das ações */
.sr-action-menu {
  position: relative;
  flex: 0 0 auto;
}

/* Com o menu aberto, a célula de ações vira um stacking context elevado para o
   dropdown (fixed) ficar ACIMA das linhas seguintes (senão fica por baixo, pois
   .main-area cria um stacking context). */
.sr-action-menu.is-open {
  z-index: 1500;
}

.sr-action-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}

.sr-action-menu-toggle:hover,
.sr-action-menu-toggle[aria-expanded="true"] {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #1f2937;
}

.sr-action-menu-list {
  position: fixed;
  z-index: 1400;
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-action-menu-list[hidden] {
  display: none;
}

.sr-action-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.sr-action-menu-item:hover {
  background: #f1f5f9;
}

.sr-action-menu-item-danger {
  color: #dc2626;
}

.sr-action-menu-item-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.service-request-code {
  color: inherit;
  font-size: inherit;
  font-weight: 700;
  padding: 0;
  line-height: 1.25;
  text-align: left;
}

/* Codigo com dot de "resposta nova nao lida" alinhado a esquerda. */
.sr-code-cell { display: inline-flex; align-items: center; gap: 6px; }
.sr-unread-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .16);
}

.service-request-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
/* Assunto clicavel: abre a solicitacao como o codigo, mantendo aparencia de titulo. */
.service-request-title-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.service-request-title-link:hover { text-decoration: underline; }
.service-request-title-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 4px; }

.service-request-responsible {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  min-width: 0;
}

.service-request-responsible-name {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.service-request-action-button {
  min-height: 30px;
  padding: 6px 10px;
  min-width: 72px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
}

.service-request-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.service-request-start-button {
  border-color: var(--green);
  background: #ecfff6;
  color: var(--green);
}

.service-request-start-button:hover {
  background: var(--green);
  color: #fff;
}

.service-request-transfer-button {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.service-request-transfer-button:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.service-request-pause-button {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #b45309;
}

.service-request-pause-button:hover {
  background: #f59e0b;
  color: #fff;
}

.service-request-close-button {
  border-color: var(--blue);
  background: #edf5ff;
  color: var(--blue);
}

.service-request-close-button:hover {
  background: var(--blue);
  color: #fff;
}

.service-request-delete-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.service-request-delete-button:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.request-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: normal;
}

.request-badge.priority-critical,
.request-badge.status-cancelled,
.request-badge.status-not_applicable {
  background: #ffe1df;
  color: #b42318;
}

.request-badge.priority-high,
.request-badge.status-waiting_customer {
  background: #fff2c7;
  color: #945f00;
}

.request-badge.status-automated_service {
  background: #dff6ff;
  color: #075985;
}

.request-badge.status-completed {
  background: #d8f8e8;
  color: #027a48;
}

.request-badge.status-in_service,
.request-badge.status-analysis,
.request-badge.status-development,
.request-badge.status-testing {
  background: #e4efff;
  color: #0759c7;
}

.service-request-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px 18px;
  padding: 24px;
}

.service-request-form .full-field,
.module-checkboxes.full-field {
  grid-column: 1 / -1;
}

.service-client-search {
  position: relative;
}

.module-checkboxes {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.module-checkboxes legend {
  padding: 0 6px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.module-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.module-checkboxes input {
  width: 16px;
  min-height: auto;
  accent-color: var(--blue);
}

.service-request-detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  padding: 0 24px 24px;
}

.service-request-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
}

.service-request-sidebar > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.service-request-sidebar small {
  color: var(--muted);
  text-transform: uppercase;
}

.service-request-treatment-form {
  padding: 0;
}

.service-request-history-card {
  margin: 0 24px 24px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.service-request-history-card h3 {
  margin: 0 0 16px;
}

.service-request-history {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.service-request-history li {
  padding-left: 6px;
  line-height: 1.45;
}

.service-request-history small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .service-request-filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .service-request-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .service-request-filters,
  .service-request-form,
  .module-checkboxes {
    grid-template-columns: 1fr;
  }

  .service-request-filters,
  .service-request-form,
  .service-request-detail-grid,
  .service-request-history-card {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ===== Detalhe do chamado — layout estilo GLPI (conversa + propriedades) ===== */
.sr-detail-head { align-items: flex-start; }
.sr-detail-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
}
.sr-detail-code { color: var(--muted); font-weight: 600; font-size: 14px; }

.sr-detail-props-toggle { display: none; }

.sr-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  padding: 0 24px 24px;
  align-items: start;
}

.sr-conversation { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sr-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sr-timeline-empty { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }

.sr-msg {
  border: 1px solid var(--line-soft);
  border-left: 3px solid #93b4d8;
  border-radius: 10px;
  background: #fff;
  padding: 10px 14px;
}
.sr-msg-incoming { border-left-color: #378add; }
.sr-msg-reply { border-left-color: #16a34a; background: #f6fdf9; }
.sr-msg-internal { border-left-color: #ef9f27; background: #fdf8ec; }

.sr-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.sr-msg-author { font-weight: 700; font-size: 12.5px; color: #172033; }
.sr-msg-when { margin-left: auto; font-size: 11px; color: var(--muted); }
.sr-msg-email { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.sr-msg-tag { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; }
.sr-msg-tag-internal { background: #fdecc8; color: #8a5a0b; }
.sr-msg-tag-reply { background: #dcfce7; color: #15803d; }

.sr-msg-text { font-size: 13px; color: #2b3444; line-height: 1.5; overflow-wrap: anywhere; }
.sr-msg-html { font-size: 13px; color: #2b3444; line-height: 1.5; overflow-x: auto; }
.sr-msg-html img { max-width: 100%; height: auto; }
.sr-msg-html table { max-width: 100%; }
.sr-inline-img { border-radius: 4px; }
.sr-blocked-img, .sr-missing-inline { display: inline-block; min-width: 32px; min-height: 18px; }

.sr-msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.sr-msg-att-label { font-size: 10.5px; color: var(--muted); }
.sr-att-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; text-decoration: none; max-width: 220px; }
.sr-att-chip:hover { border-color: #94a3b8; background: #f8fafc; }
.sr-att-thumb { width: 34px; height: 26px; flex: 0 0 auto; border-radius: 4px; background: #e2e8f0 center/cover no-repeat; }
.sr-att-icon { width: 34px; height: 26px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; background: #fee2e2; color: #b91c1c; font-size: 9px; font-weight: 800; }
.sr-att-meta { display: flex; flex-direction: column; min-width: 0; }
.sr-att-name { font-size: 11px; font-weight: 600; color: #172033; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-att-size { font-size: 9.5px; color: var(--muted); }

.sr-event { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 10px; font-size: 11.5px; color: var(--muted); }
.sr-event-dot { width: 6px; height: 6px; border-radius: 999px; background: #cbd5e1; flex: 0 0 auto; }
.sr-event-text { color: #475569; }
.sr-event-when { margin-left: auto; font-size: 10.5px; }

.sr-reply-box { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px; }
.sr-reply-tabs { display: flex; gap: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.sr-reply-tab { border: 0; background: none; padding: 4px 0 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.sr-reply-tab.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.sr-reply-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12.5px; resize: vertical; min-height: 60px; }
.sr-reply-box.is-internal .sr-reply-input { background: #fffdf6; }
.sr-reply-hint { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); }
.sr-reply-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.sr-reply-actions .primary-button[disabled] { opacity: .55; cursor: not-allowed; }

.sr-properties { border: 1px solid var(--line-soft); border-radius: 10px; background: #f8fafc; padding: 14px; align-self: start; display: flex; flex-direction: column; gap: 8px; }
.sr-properties-title { margin: 0 0 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sr-prop { display: flex; flex-direction: column; gap: 1px; }
.sr-prop small { font-size: 10px; color: var(--muted); }
.sr-prop strong, .sr-prop span { font-size: 12px; color: #172033; }
.sr-prop .ghost-link { padding: 0; font-size: 12px; font-weight: 700; text-align: left; }

/* Linha do cliente + botao pequeno "alterar" ao lado (mesmo tamanho da fonte). */
.sr-prop-client-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sr-prop-edit-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue, #2563eb);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: underline;
}
.sr-prop-edit-btn:hover { color: #1d4ed8; }

/* Modal de alterar a empresa vinculada. */
.sr-client-change-card { width: min(480px, 92vw); display: flex; flex-direction: column; gap: 12px; }
.sr-client-change-search { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #334155; }
.sr-client-change-search input {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.sr-client-change-card .client-search-results { position: static; max-height: 260px; overflow-y: auto; }
.sr-properties-form { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.sr-properties-form label { display: flex; flex-direction: column; gap: 3px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sr-properties-form select { font-size: 12px; padding: 6px 8px; }
.sr-properties-form .form-actions { margin-top: 2px; }

@media (max-width: 960px) {
  .sr-detail-layout { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .sr-detail-props-toggle { display: inline-flex; margin: 0 16px 8px; }
  .sr-properties { display: none; }
  .sr-properties.is-open { display: flex; }
}

.proposal-builder-form {
  display: grid;
  gap: 18px;
}

.proposal-template-panel {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.contract-template-selector {
  display: grid;
  gap: 22px;
  margin-inline: 0;
  padding: 28px;
  overflow: hidden;
}

.contract-template-selector .proposal-template-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 20px;
}

.contract-template-selector .proposal-template-card {
  min-width: 0;
}

.proposal-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.proposal-customization-panel {
  display: grid;
  gap: 24px;
  width: min(100%, 980px);
  max-width: 980px;
  padding: 28px;
  overflow: hidden;
}

.proposal-customization-copy {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.proposal-customization-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #eaf2ff;
  color: var(--primary);
  font-size: 26px;
  font-weight: 800;
}

.proposal-customization-copy h2,
.proposal-customization-copy p,
.proposal-customization-progress p {
  margin: 0;
}

.proposal-customization-copy h2 {
  margin-bottom: 7px;
  font-size: 26px;
}

.proposal-customization-copy p,
.proposal-customization-progress p {
  color: var(--muted);
  line-height: 1.45;
}

.proposal-customization-request {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.proposal-customization-request label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.proposal-customization-request input,
.proposal-customization-request textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #182238;
  background: #fff;
  font: inherit;
}

.proposal-customization-request textarea {
  min-height: 130px;
  resize: vertical;
}

.proposal-customization-progress {
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.proposal-customization-progress strong {
  display: block;
  margin-bottom: 6px;
  color: #075ec8;
  font-size: 18px;
}

.proposal-template-card {
  display: grid;
  justify-items: start;
  gap: 12px;
  min-height: 156px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.proposal-template-card:hover,
.proposal-template-card:focus-visible {
  border-color: var(--blue);
  background: #eef5ff;
  outline: none;
  box-shadow: 0 14px 26px rgba(8, 91, 197, 0.1);
}

.proposal-template-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
}

.proposal-template-card strong,
.proposal-template-card small {
  display: block;
}

.proposal-template-card strong {
  font-size: 20px;
}

.proposal-template-card small {
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 980px) {
  .proposal-template-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .contract-template-selector .proposal-template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .proposal-template-grid {
    grid-template-columns: 1fr;
  }
}

.proposal-builder-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.proposal-builder-actions button {
  white-space: nowrap;
}

.proposal-builder-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.proposal-send-status {
  min-height: 20px;
  margin: -13px 0 16px;
  color: var(--red);
}

#screen-proposal-builder > .proposal-send-status {
  margin: 0 0 18px;
}

#proposalCustomizationPanel .proposal-send-status {
  margin: 0;
}

.proposal-send-status[data-state="success"] {
  color: var(--green);
}

.proposal-builder-section {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.proposal-builder-section h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.proposal-manual-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.proposal-model-selector-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  /* Garante nivelamento pela base mesmo se os rotulos tiverem alturas diferentes. */
  align-items: end;
}

.proposal-model-selector label {
  display: grid;
  gap: 6px;
  max-width: 460px;
  margin: 0;
  font-weight: 600;
}

/* Rotulo em bloco: o texto e o asterisco de obrigatorio (*) fluem inline na
   MESMA linha, e o select cai logo abaixo. Isso evita a linha extra que
   empurrava o "Tipo de proposta" para baixo e desalinhava os campos. */
.proposal-model-selector-row label {
  display: block;
  max-width: none;
  width: auto;
}

.proposal-model-selector-row label > select {
  display: block;
  width: 100%;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .proposal-model-selector-row {
    grid-template-columns: 1fr;
  }
}

.proposal-model-selector select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.proposal-model-selector-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.85;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Icone de informacao discreto antes do texto de apoio. */
.proposal-model-selector-help::before {
  content: "\24D8"; /* ⓘ */
  font-size: 13px;
  line-height: 1;
  opacity: 0.7;
}

.contract-client-picker-card p {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* O bloco Endereco+CEP mora em UMA celula do grid de 2 colunas do formulario,
   que pode ficar mais estreita que os 260px+140px que este grid exigia — o CEP
   escapava do cartao. minmax(0,1fr) deixa o Endereco encolher; min-width:0 e
   preciso porque <input> tem largura intrinseca propria e ignora o encolhimento. */
.contract-address-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 14px 18px;
}

.contract-address-fields > label {
  min-width: 0;
}

.contract-address-fields input {
  width: 100%;
  min-width: 0;
}

.proposal-builder-grid,
.proposal-modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px 18px;
}

.proposal-custom-items-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.proposal-custom-items-heading h2,
.proposal-custom-items-heading p {
  margin: 0;
}

.proposal-custom-items-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.proposal-custom-items-list {
  display: grid;
  gap: 12px;
}

.proposal-custom-item-row {
  display: grid;
  grid-template-columns: 110px minmax(220px, .9fr) minmax(360px, 1.45fr) 180px 34px;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

/* Descricao do item gerada por IA (22/09/2026) */
.proposal-custom-description-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Escopo `.proposal-custom-item-row` pelo MESMO motivo do dropdown de produtos
   (ver comentario mais abaixo): a regra antiga `.proposal-custom-item-row
   button` (o "x" de remover, 34x42px, centralizado) tem especificidade maior
   que a classe e esmagava este botao para 34px de largura — o texto quebrava
   em 3 linhas e vazava por cima da coluna "Valor unit." (visto em 22/09). */
.proposal-custom-item-row .proposal-item-ia-button {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  align-self: center;
  gap: 5px;
  min-width: 0;
  width: auto;
  min-height: 0;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #BFDBFE;
  border-radius: 999px;
  background: #E6F1FB;
  color: #185FA5;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.proposal-custom-item-row .proposal-item-ia-button:hover:not(:disabled) {
  background: #D7E8F8;
}

.proposal-custom-item-row .proposal-item-ia-button:disabled {
  opacity: .75;
  cursor: default;
}

.proposal-custom-item-row label {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.proposal-custom-item-row button {
  align-self: end;
  justify-self: center;
  min-width: 34px;
  width: 34px;
  height: 42px;
  padding: 0;
}

.proposal-custom-item-row input,
.proposal-custom-item-row textarea {
  width: 100%;
}

.proposal-custom-item-row textarea {
  min-height: 54px;
  resize: vertical;
}

.proposal-custom-quantity-field input,
.proposal-custom-value-field input {
  text-align: left;
}

.proposal-custom-extra-fields {
  margin-top: 16px;
}

@media (max-width: 980px) {
  .proposal-custom-items-heading {
    grid-template-columns: 1fr;
  }

  .proposal-custom-items-heading {
    display: grid;
  }

  .proposal-custom-item-row {
    grid-template-columns: minmax(92px, .35fr) minmax(160px, .65fr);
  }

  .proposal-custom-description-field,
  .proposal-custom-value-field {
    grid-column: 1 / -1;
  }

  .proposal-custom-item-row button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* ===== Autocomplete de produtos no campo "Item" da proposta personalizada ===== */
.proposal-item-search {
  position: relative;
  display: block;
}
.proposal-item-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.proposal-custom-name-field .proposal-item-search input {
  padding-left: 32px;
}
.proposal-product-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  width: 420px;
  min-width: 100%;
  max-width: min(520px, 90vw);
  z-index: 60;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  text-align: left;
}
.proposal-product-dropdown[hidden] {
  display: none;
}
.proposal-product-dropdown-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 8px 10px 6px;
}
/* Escopo `.proposal-product-dropdown` p/ vencer a regra antiga
   `.proposal-custom-item-row button` (botao "x" de remover, 34x42px) que
   senao encolhe estes botoes de opcao e corta o nome. */
.proposal-product-dropdown .proposal-product-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  height: auto;
  justify-self: stretch;
  align-self: auto;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.proposal-product-dropdown .proposal-product-option:hover,
.proposal-product-dropdown .proposal-product-option.is-active {
  background: #f1f5f9;
}
.proposal-product-option-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #dbeafe;
}
.proposal-product-option-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #0f172a;
}
.proposal-product-option-name mark {
  background: #fde68a;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.proposal-product-dropdown .proposal-product-option-avulso {
  color: #2563eb;
  font-weight: 500;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-top: 4px;
}
.proposal-product-dropdown .proposal-product-option-avulso:hover {
  background: #eff6ff;
}
.proposal-item-catalog-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 11px;
  color: #94a3b8;
}
.proposal-item-catalog-note[hidden] {
  display: none;
}

.proposal-builder-form label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.proposal-builder-form input,
.proposal-builder-form select,
.proposal-builder-form textarea {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

.proposal-builder-form textarea {
  min-height: 80px;
  resize: vertical;
}

.proposal-module-option {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px !important;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.proposal-module-option:has(input:checked) {
  border-color: var(--blue);
  background: #eef6ff;
}

.proposal-module-option input {
  min-height: auto;
}

.proposal-module-option span,
.proposal-module-option small {
  display: block;
}

.proposal-module-option small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}

.proposal-values-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.proposal-values-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-radius: 7px;
  background: #f4f2ea;
}

.proposal-values-summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.proposal-values-summary strong {
  font-size: 20px;
  text-align: right;
}

.proposal-values-summary strong small {
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
}

.proposal-modal[hidden] {
  display: none;
}

.proposal-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: auto;
  padding: 28px;
  background: rgba(7, 20, 42, .72);
}

.proposal-modal-card {
  display: grid;
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
}

.proposal-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(7, 20, 42, .18);
}

.proposal-modal-header h2,
.proposal-modal-header p {
  margin: 0;
}

.proposal-modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.proposal-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.proposal-pages.is-generating-pdf .proposal-a4-page {
  width: 794px;
  height: 1123px;
}

.proposal-pdf-capture {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: -1;
  display: grid;
  width: 794px;
  pointer-events: none;
}

.proposal-a4-page {
  position: relative;
  /* Largura EXPLICITA (nao percentual): a tabela interna usa table-layout:fixed +
     width:100% e so resolve corretamente se o container tiver largura definida.
     Com width:min(100%,...) o Chromium trata como indefinida e a tabela colapsa
     (1 caractere por coluna). max-width mantem responsivo em telas estreitas. */
  width: 794px;
  max-width: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}

/* Neutraliza o `table { min-width: 720px }` global dentro do A4 (aplicavel a
   tabelas de dados do app, mas nocivo no documento da proposta). */
.proposal-a4-page table {
  min-width: 0;
}

.contract-a4-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 16mm 20mm 12mm;
  color: #000;
  background: #fff;
  font-family: "Times New Roman", Times, serif;
}

.word-contract-page main {
  flex: 1;
}

.contract-title-block {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  text-align: center;
}

.contract-title-block h2,
.contract-title-block h3 {
  margin: 0;
  color: #000;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.contract-title-block h2 {
  font-size: 17px;
}

.contract-title-block h3 {
  font-size: 15px;
}

.contract-a4-page h2 {
  color: #000;
}

.contract-clause {
  margin-top: 9px;
}

.contract-clause h3 {
  margin: 0 0 4px;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  text-transform: uppercase;
}

.contract-a4-page p {
  margin: 0 0 4px;
  font-size: 13.6px;
  line-height: 1.32;
  text-align: justify;
}

.contract-a4-page footer {
  color: #000;
  font-size: 10px;
  text-align: center;
}

.contract-signatures {
  margin-top: 28px;
}

.contract-signatures > p {
  margin-bottom: 52px;
  text-align: center;
}

.contract-signatures > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
}

.contract-signatures span {
  display: grid;
  gap: 5px;
  text-align: center;
}

.contract-signatures i {
  display: block;
  border-top: 1px solid #000;
}

.contract-signatures small {
  color: #000;
  font-size: 9.5px;
  line-height: 1.35;
}

.proposal-html-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 58px 56px 42px;
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.megaup-proposal-page {
  box-sizing: border-box;
  padding: 52px 38px 48px;
  color: #111827;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}

.megaup-proposal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
}

.megaup-proposal-client {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.megaup-proposal-client h2 {
  margin: 0;
  color: #0b0f18;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
}

.megaup-proposal-client strong,
.megaup-proposal-client p {
  margin: 0;
  color: #0b0f18;
  font-size: 14px;
}

.megaup-proposal-brand {
  display: flex;
  justify-content: flex-end;
  min-width: 230px;
}

.megaup-proposal-brand img {
  display: block;
  width: 190px;
  height: auto;
  object-fit: contain;
}

.megaup-proposal-table {
  /* Largura EXPLICITA em px (nao 100%): o table-layout:fixed so engata com uma
     largura especificada (nao-auto). Com 100% o Chromium trata como indefinida
     dentro do A4 e as colunas colapsam. 718px = area util do A4 (794 - 76 pad). */
  width: 718px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #111827;
  font-size: 12px;
}

/* Larguras em PX (nao %): com table-layout:fixed, colunas em pixel independem da
   resolucao de largura do container. O documento e um A4 fixo (~718px de area
   util), entao px e apropriado e elimina o colapso das colunas no preview. */
.megaup-col-quantity {
  width: 57px;
}

.megaup-col-item {
  width: 130px;
}

.megaup-col-description {
  width: 416px;
}

.megaup-col-value {
  width: 115px;
}

.megaup-proposal-table th {
  padding: 6px 4px;
  border: 1px solid #000;
  background: #05b957;
  color: #000;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
}

.megaup-proposal-table td {
  padding: 9px 7px;
  border: 1px solid #000;
  vertical-align: middle;
  line-height: 1.18;
  overflow-wrap: anywhere;
  text-align: center;
}

.megaup-proposal-description {
  text-align: left !important;
}

.megaup-proposal-description ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.megaup-proposal-description li {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.megaup-proposal-value-cell {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  white-space: normal;
}

.megaup-proposal-value-cell.is-tight {
  font-size: 10.5px;
}

.megaup-proposal-value-cell.is-extra-tight {
  font-size: 9px;
}

.megaup-proposal-value-cell span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.megaup-proposal-observation td {
  padding: 5px 8px;
  text-align: left;
}

.megaup-proposal-observation td:last-child {
  text-align: center;
}

.megaup-proposal-total-row td {
  padding: 4px 8px;
}

/* TOTAL como selo verde compacto, alinhado a direita (perto do valor), em vez
   de pintar a celula inteira de verde. Seletor especifico para vencer o
   text-align:center de `.megaup-proposal-table td`. */
.megaup-proposal-total-row td.megaup-proposal-total-label {
  text-align: right;
  background: transparent;
}

.megaup-proposal-total-label span {
  display: inline-block;
  min-width: 92px;
  padding: 3px 16px;
  background: #05b957;
  color: #05261a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-align: center;
}

.megaup-proposal-footer {
  display: grid;
  gap: 14px;
  margin-top: 62px;
  color: #111827;
  font-size: 14px;
}

.megaup-proposal-footer p {
  margin: 0;
}

.megaup-proposal-footer p:nth-child(2) {
  margin-left: 118px;
}

.sisinfra-proposal-page {
  box-sizing: border-box;
  width: 794px;
  max-width: 794px;
  padding: 34px 36px 96px;
  color: #05070d;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.sisinfra-proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 128px;
}

.sisinfra-proposal-header img {
  width: 250px;
  height: auto;
  object-fit: contain;
}

.sisinfra-proposal-recipient {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 56px;
}

.sisinfra-proposal-recipient p,
.sisinfra-proposal-recipient h2,
.sisinfra-proposal-recipient strong,
.sisinfra-proposal-reference {
  margin: 0;
}

.sisinfra-proposal-recipient p {
  font-size: 16px;
  font-weight: 800;
}

.sisinfra-proposal-recipient h2,
.sisinfra-proposal-recipient strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.sisinfra-proposal-reference {
  margin-bottom: 42px;
  font-size: 16px;
}

.sisinfra-services-grid {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
  color: #05070d;
  font-size: 14px;
}

.sisinfra-services-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 76px 190px;
  min-width: 0;
}

.sisinfra-services-row > *,
.sisinfra-observation-row > *,
.sisinfra-total-row > * {
  min-width: 0;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

.sisinfra-services-header > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 6px;
  background: #dce9f4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.sisinfra-services-item > span,
.sisinfra-services-item > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.sisinfra-service-cell {
  display: block !important;
  text-align: left !important;
}

.sisinfra-service-cell > strong {
  display: block;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 400;
}

.sisinfra-service-cell ul {
  display: grid;
  gap: 8px;
  margin: 0 0 0 28px;
  padding: 0 0 0 18px;
}

.sisinfra-service-cell li {
  padding-left: 10px;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.sisinfra-observation-row {
  display: grid;
  grid-template-columns: 1fr;
}

.sisinfra-observation-row > span {
  min-height: 32px;
  padding: 6px 8px;
  text-align: left;
}

.sisinfra-total-row {
  display: grid;
  grid-template-columns: 1fr 132px 190px;
}

.sisinfra-total-row > span,
.sisinfra-total-row > strong {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
}

.sisinfra-total-row > strong {
  justify-content: center;
  background: #dce9f4;
  font-weight: 800;
}

.sisinfra-total-row > span:last-child {
  justify-content: center;
}

.sisinfra-commercial {
  position: relative;
  z-index: 2;
  margin-top: 28px;
}

.sisinfra-commercial h3 {
  margin: 0 0 10px;
  font-size: 9px;
  font-weight: 800;
}

.sisinfra-commercial table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.sisinfra-commercial th,
.sisinfra-commercial td {
  border: 1px solid #000;
  padding: 7px 10px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.sisinfra-commercial th {
  width: 15%;
  font-weight: 800;
  text-align: center;
}

.sisinfra-commercial td {
  font-weight: 700;
  word-break: normal;
}

.sisinfra-billing {
  width: 32%;
  text-align: center;
  font-weight: 800 !important;
}

.sisinfra-acceptance {
  font-weight: 400 !important;
}

.sisinfra-acceptance strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.sisinfra-acceptance p {
  margin: 0;
  font-weight: 400;
  line-height: 1.45;
}

.sisinfra-proposal-watermark {
  position: absolute;
  left: 42px;
  bottom: 250px;
  z-index: 1;
  width: 680px;
  max-width: calc(100% - 84px);
  opacity: .14;
  pointer-events: none;
}

.sisinfra-proposal-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  min-height: 78px;
  padding: 16px 88px 14px;
  background: #6ea8ca;
  color: #fff;
  font-size: 9px;
  line-height: 1.35;
}

.sisinfra-proposal-footer p {
  margin: 0 0 5px;
}

/* ===== Modelo NARTE - Produto (reusa a estrutura .sisinfra-*, paleta NARTE) ===== */
.sisinfra-proposal-page.narte-produto .sisinfra-services-header > span {
  background: #1f3864;
  color: #fff;
}
.sisinfra-proposal-page.narte-produto .sisinfra-total-row > strong {
  background: #dce9f4;
  color: #1f3864;
}
.sisinfra-proposal-page.narte-produto .sisinfra-commercial th {
  background: #dce9f4;
  color: #1f3864;
}
.sisinfra-proposal-page.narte-produto .sisinfra-billing {
  background: #fff;
  color: #1f3864 !important;
}
.sisinfra-proposal-page.narte-produto .sisinfra-acceptance strong {
  color: #3f7cb3;
}
.sisinfra-proposal-page.narte-produto .sisinfra-proposal-footer {
  background: #1f3864;
}
/* Sem marca d'agua no modelo Produto (mantem o <img> no DOM apenas como ancora
   do insertBefore da paginacao; oculto visualmente). */
.sisinfra-proposal-page.narte-produto .sisinfra-proposal-watermark {
  display: none;
}

/* ===== Modelo SISINFRA v2 (navy #07111F + ciano #22D3EE) ===== */
.sisinfra-v2-page {
  box-sizing: border-box;
  width: 794px;
  max-width: 794px;
  padding: 0 0 96px;
  color: #0F1B2D;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.sisinfra-v2-header--full {
  background: #07111F;
  padding: 26px 36px 18px;
}

.sisinfra-v2-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.sisinfra-v2-logo-plate {
  display: inline-block;
  flex: 0 0 auto;
  padding: 12px 22px;
  background: #fff;
  border-radius: 10px;
  line-height: 0;
  overflow: visible;
}

.sisinfra-v2-logo-plate img {
  display: block;
  width: auto;
  max-width: none;
  height: 46px;
}

.sisinfra-v2-header-meta {
  text-align: right;
}

.sisinfra-v2-header-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: .16em;
  color: #7B8CA6;
}

.sisinfra-v2-header-number {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: #22D3EE;
}

.sisinfra-v2-header-tagline {
  margin: 12px 0 0;
  font-size: 12px;
  color: #7B8CA6;
}

.sisinfra-v2-accent-bar {
  height: 4px;
  background: #22D3EE;
}

.sisinfra-v2-header--compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #07111F;
  padding: 12px 36px;
}

.sisinfra-v2-header--compact .sisinfra-v2-logo-plate {
  padding: 7px 14px;
  border-radius: 8px;
}

.sisinfra-v2-header--compact .sisinfra-v2-logo-plate img {
  height: 30px;
}

.sisinfra-v2-header-compact-info {
  font-size: 12px;
  color: #7B8CA6;
  text-align: right;
}

.sisinfra-v2-data {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 36px 0;
}

.sisinfra-v2-eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: .12em;
  color: #94A3B8;
}

.sisinfra-v2-client-name {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: #0F1B2D;
}

.sisinfra-v2-client-contact {
  margin: 3px 0 0;
  font-size: 12px;
  color: #64748B;
}

.sisinfra-v2-data-dates {
  flex-shrink: 0;
  text-align: right;
}

.sisinfra-v2-date-value {
  margin: 3px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0F1B2D;
}

.sisinfra-v2-data-dates .sisinfra-v2-date-value:last-child {
  margin-bottom: 0;
}

.sisinfra-v2-intro {
  margin: 16px 36px 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #334155;
}

.sisinfra-v2-grid {
  position: relative;
  z-index: 2;
  display: grid;
  margin: 16px 36px 0;
  border: 1px solid #E3E9F1;
  border-radius: 8px;
  overflow: hidden;
  color: #0F1B2D;
  font-size: 12px;
}

.sisinfra-v2-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 60px 120px;
  min-width: 0;
}

.sisinfra-v2-head-row > span {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 9px 12px;
  background: #0F1B2D;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.15;
}

.sisinfra-v2-item {
  border-top: 1px solid #F0F3F8;
}

.sisinfra-v2-item:nth-child(even) {
  background: #FAFBFD;
}

.sisinfra-v2-item > span,
.sisinfra-v2-item > div {
  min-width: 0;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
}

.sisinfra-v2-col-num {
  color: #94A3B8;
  text-align: center;
}

.sisinfra-v2-col-qtd {
  text-align: center;
  color: #334155;
}

.sisinfra-v2-col-val {
  text-align: right;
  font-weight: 700;
  color: #0F1B2D;
}

.sisinfra-v2-cell > strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #0F1B2D;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sisinfra-v2-desc-text {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: #64748B;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sisinfra-v2-cell ul {
  display: grid;
  gap: 3px;
  margin: 4px 0 0;
  padding: 0 0 0 16px;
}

.sisinfra-v2-cell li {
  font-size: 10px;
  line-height: 1.5;
  color: #64748B;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sisinfra-v2-observation-row {
  border-top: 1px solid #F0F3F8;
}

.sisinfra-v2-observation-row > span {
  display: block;
  padding: 9px 12px;
  font-size: 10px;
  line-height: 1.5;
  color: #64748B;
}

.sisinfra-v2-total-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #EAF7FB;
}

.sisinfra-v2-total-label {
  padding: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #0F1B2D;
}

.sisinfra-v2-total-value {
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 800;
  color: #0E7490;
  text-align: right;
}

.sisinfra-v2-conditions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 36px 0;
}

.sisinfra-v2-cond-card {
  padding: 10px 14px;
  background: #F7F9FC;
  border-left: 3px solid #22D3EE;
  border-radius: 0 8px 8px 0;
}

.sisinfra-v2-cond-text {
  margin: 3px 0 0;
  font-size: 12px;
  color: #334155;
}

.sisinfra-v2-watermark {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 1;
  width: 440px;
  max-width: calc(100% - 120px);
  transform: translate(-50%, -50%) rotate(-16deg);
  opacity: .05;
  pointer-events: none;
}

.sisinfra-v2-page-number {
  position: absolute;
  right: 36px;
  bottom: 74px;
  z-index: 2;
  margin: 0;
  font-size: 9px;
  color: #94A3B8;
}

.sisinfra-v2-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-height: 60px;
  padding: 14px 36px;
  background: #07111F;
  color: #7B8CA6;
  font-size: 9px;
  line-height: 1.6;
}

.sisinfra-v2-footer > div:last-child {
  text-align: right;
}

.sisinfra-v2-footer p {
  margin: 0 0 3px;
}

.proposal-cover-page {
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.proposal-company-page {
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.proposal-company-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.proposal-company-top h2,
.proposal-company-top p {
  margin: 0;
}

.proposal-company-top h2 {
  font-size: 42px;
  line-height: 1.05;
}

.proposal-company-top p {
  margin-top: 8px;
  color: #80d9ff;
  font-size: 23px;
  font-weight: 700;
}

.proposal-company-top img {
  width: 112px;
  max-height: 96px;
  object-fit: contain;
  object-position: right center;
}

.proposal-company-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 30px;
  margin-top: 42px;
}

.proposal-company-about {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.proposal-company-rule {
  width: 86px;
  height: 3px;
  margin-bottom: 18px;
  background: #69d5ff;
}

.proposal-company-about p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, .92);
  font-size: 15px;
  line-height: 1.52;
}

.proposal-company-about strong {
  max-width: 250px;
  color: #80d9ff;
  font-size: 18px;
  line-height: 1.35;
}

.proposal-company-devices {
  width: calc(100% + 32px);
  height: 230px;
  margin: 38px 0 0 -32px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center;
}

.proposal-company-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.proposal-company-benefits {
  display: grid;
  gap: 12px;
}

.proposal-company-benefit {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(105, 213, 255, .62);
  border-radius: 7px;
  background: rgba(2, 35, 88, .48);
}

.proposal-company-benefit-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid #69d5ff;
  border-radius: 50%;
  color: #fff;
  background: #0878d1;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 700;
}

.proposal-company-benefit h3,
.proposal-company-benefit p {
  margin: 0;
}

.proposal-company-benefit h3 {
  color: #80d9ff;
  font-size: 14px;
  text-transform: uppercase;
}

.proposal-company-benefit p {
  margin-top: 4px;
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  line-height: 1.36;
}

.proposal-company-contact {
  margin-top: 26px;
}

.proposal-company-contact h3 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #69d5ff;
  font-size: 22px;
  text-transform: uppercase;
}

.proposal-company-contact dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.proposal-company-contact dl div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(105, 213, 255, .45);
  font-size: 13px;
  line-height: 1.35;
}

.proposal-company-contact dt {
  color: #80d9ff;
  font-weight: 700;
}

.proposal-company-contact dd {
  margin: 0;
  color: rgba(255, 255, 255, .96);
}

.proposal-html-brand {
  display: grid;
  gap: 2px;
  align-content: start;
}

.proposal-html-brand img {
  width: 158px;
  max-height: 132px;
  object-fit: contain;
  object-position: left center;
}

.proposal-cover-copy {
  display: grid;
  gap: 14px;
  margin-top: 58px;
}

.proposal-cover-copy p,
.proposal-cover-copy h2 {
  margin: 0;
}

.proposal-cover-copy p {
  color: #80d9ff;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}

.proposal-cover-copy h2 {
  max-width: 620px;
  font-size: 47px;
  line-height: 1.05;
}

.proposal-cover-copy span {
  max-width: 590px;
  font-size: 18px;
  line-height: 1.45;
}

.proposal-cover-devices {
  display: block;
  width: 100%;
  max-height: 340px;
  margin: 22px 0 16px;
  border-radius: 7px;
  object-fit: cover;
  object-position: center;
}

.proposal-cover-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: auto 0 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 8px;
  background: rgba(2, 28, 78, .5);
}

.proposal-cover-data div:last-child {
  grid-column: 1 / -1;
}

.proposal-cover-data dt {
  margin-bottom: 5px;
  color: #80d9ff;
  font-size: 12px;
  text-transform: uppercase;
}

.proposal-cover-data dd {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.proposal-html-page footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid currentColor;
  font-size: 13px;
  opacity: .8;
}

.proposal-html-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #69d5ff;
  color: #80d9ff;
}

.proposal-html-header img {
  width: 84px;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}

.proposal-html-header strong {
  font-size: 16px;
  text-transform: uppercase;
}

.proposal-document-section {
  margin-top: 34px;
}

.proposal-document-section h2 {
  margin: 8px 0 18px;
  color: #fff;
  font-size: 28px;
}

.proposal-document-eyebrow {
  margin: 0;
  color: #80d9ff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.proposal-modules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proposal-modules-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 6px;
}

.proposal-module-card.is-included {
  border: 1px solid #75b6ed;
  background: #eef7ff;
  color: #10203c;
}

.proposal-module-card.is-not-included {
  border: 1px solid #dedede;
  background: #fafafa;
  color: #919191;
}

.proposal-module-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: transparent;
}

.proposal-module-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.proposal-module-card.is-not-included .proposal-module-icon {
  filter: grayscale(1);
  opacity: .62;
}

.proposal-module-card strong,
.proposal-module-card small,
.proposal-module-card em {
  display: block;
}

.proposal-module-card small {
  margin-top: 3px;
  color: inherit;
  font-size: 12px;
}

.proposal-module-card em {
  margin-top: 6px;
  color: #008357;
  font-size: 12px;
}

.proposal-module-card.is-not-included em {
  color: #8b8b8b;
}

.proposal-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.proposal-price-grid div {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid rgba(105, 213, 255, .62);
  border-radius: 6px;
  background: rgba(2, 35, 88, .48);
}

.proposal-implementation-intro {
  max-width: 680px;
  margin: -5px 0 26px;
  color: rgba(255, 255, 255, .9);
  font-size: 16px;
  line-height: 1.45;
}

.proposal-implementation-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.proposal-implementation-step {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 0 8px;
  text-align: center;
}

.proposal-implementation-step::before {
  position: absolute;
  top: 17px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #75b6ed;
  content: "";
}

.proposal-implementation-step:first-child::before {
  left: 50%;
  width: 50%;
}

.proposal-implementation-step:last-child::before {
  width: 50%;
}

.proposal-implementation-step strong {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #75b6ed;
  border-radius: 50%;
  color: #fff;
  background: #075eb5;
  font-size: 18px;
}

.proposal-implementation-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 15px 0 11px;
  border: 2px solid #75b6ed;
  border-radius: 50%;
  color: #fff;
  background: rgba(2, 35, 88, .48);
  font-family: Arial, sans-serif;
  font-size: 31px;
  line-height: 1;
}

.proposal-implementation-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #8be7ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(91, 209, 255, .35));
}

.proposal-implementation-step h3 {
  min-height: 38px;
  margin: 0 0 7px;
  color: #fff;
  font-size: 14px;
  line-height: 1.28;
}

.proposal-implementation-step p {
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
  line-height: 1.4;
}

.proposal-price-grid span {
  color: #80d9ff;
  font-size: 13px;
}

.proposal-price-grid strong {
  font-size: 18px;
}

.proposal-document-note {
  margin-top: auto;
  padding: 18px;
  border-left: 4px solid #69d5ff;
  background: rgba(2, 35, 88, .48);
  line-height: 1.55;
}

.proposal-acceptance {
  margin-top: auto;
}

.proposal-acceptance div {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 20px;
}

.proposal-acceptance i {
  display: block;
  min-height: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .72);
}

.client-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
}

.inline-client-form-card {
  width: min(100%, 1240px);
  max-width: 1240px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.inline-client-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 30px;
  padding: 34px;
}

.inline-client-form label {
  gap: 10px;
}

.inline-client-form input,
.inline-client-form select,
.inline-client-form textarea {
  min-height: 56px;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .08);
}

.inline-client-form .form-status {
  margin: 0;
}

.inline-client-form .modal-actions {
  margin: 8px -34px -34px;
  padding: 24px 34px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .96);
}

#screen-clients:has(#inlineClientFormCard:not([hidden])) .page-heading {
  width: min(100%, 1240px);
  max-width: 1240px;
  margin-inline: auto;
}

.screen.is-visible#screen-clients:has(#inlineClientFormCard:not([hidden])) {
  display: grid;
  justify-items: center;
}

#screen-clients:has(#inlineClientFormCard:not([hidden])) > .page-heading,
#screen-clients:has(#inlineClientFormCard:not([hidden])) > .inline-client-form-card {
  justify-self: center;
}

#screen-clients:has(#inlineClientFormCard:not([hidden])) > .clients-table-card {
  width: 100%;
  justify-self: stretch;
}

.client-stat {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 132px;
  padding: 28px;
}

.client-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 36px;
}

@media (max-width: 1180px) {
  .inline-client-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.clients-table-card {
  overflow: hidden;
}

.clients-table-card .table-wrap {
  /* Antes era overflow-x:hidden, o que cortava as colunas da direita (incl.
     Acoes) no celular/tablet sem permitir rolagem. Volta a rolar na horizontal
     com a mesma indicacao visual das demais tabelas. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.clients-agenda-view {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.clients-agenda-view[hidden] {
  display: none;
}

.clients-agenda-sidebar {
  display: grid;
  gap: 14px;
}

.clients-agenda-create {
  justify-content: center;
  width: 100%;
  min-height: 56px;
  box-shadow: var(--shadow-sm);
}

.clients-mini-calendar-card,
.clients-agenda-filters-card {
  padding: 18px;
}

.clients-mini-calendar-header,
.clients-agenda-toolbar,
.clients-agenda-titlebar,
.clients-agenda-tools {
  display: flex;
  align-items: center;
}

.clients-mini-calendar-header {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.clients-mini-calendar-header strong {
  font-size: 16px;
}

.clients-mini-calendar-weekdays,
.clients-mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.clients-mini-calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.clients-mini-calendar-day {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.clients-mini-calendar-day.is-outside {
  color: #a3adba;
}

.clients-mini-calendar-day.is-today {
  background: #dbeafe;
  color: var(--blue);
  font-weight: 800;
}

.clients-mini-calendar-day.is-selected {
  background: var(--blue);
  color: #fff;
}

.clients-agenda-filters-card {
  display: grid;
  gap: 12px;
}

.clients-agenda-filters-card h2 {
  margin: 0;
  font-size: 18px;
}

.clients-agenda-filters-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.clients-agenda-filters-card input,
.clients-agenda-filters-card select,
.clients-agenda-search input,
#clientsAgendaViewMode {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.clients-agenda-main {
  overflow: hidden;
}

.clients-agenda-toolbar {
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.clients-agenda-titlebar {
  min-width: 0;
  gap: 8px;
}

.clients-agenda-titlebar h2 {
  margin: 0 0 0 8px;
  font-size: 26px;
  text-transform: capitalize;
}

.clients-agenda-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.clients-agenda-search {
  display: flex;
  align-items: center;
  min-width: min(280px, 42vw);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.clients-agenda-search input {
  min-height: 40px;
  padding-inline: 8px;
  border: 0;
  background: transparent;
}

.clients-agenda-search input:focus,
.clients-agenda-filters-card input:focus,
.clients-agenda-filters-card select:focus,
#clientsAgendaViewMode:focus {
  outline: 2px solid rgba(0, 88, 190, .18);
}

#clientsAgendaViewMode {
  width: auto;
  min-width: 118px;
}

.clients-agenda-weekdays,
.clients-agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.clients-agenda-weekdays {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.clients-agenda-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.clients-agenda-day {
  min-height: 132px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.clients-agenda-day:nth-child(7n) {
  border-right: 0;
}

.clients-agenda-day.is-outside {
  background: #f8fafc;
}

.clients-agenda-day.is-selected {
  box-shadow: inset 0 0 0 2px rgba(0, 88, 190, .25);
}

.clients-agenda-day-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.clients-agenda-day.is-today .clients-agenda-day-number {
  background: var(--blue);
  color: #fff;
}

.clients-agenda-day ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.clients-agenda-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  width: 100%;
  min-height: 26px;
  padding: 5px 6px;
  border: 0;
  border-left: 3px solid currentColor;
  border-radius: 6px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.clients-agenda-event.technical {
  color: #075eb5;
  background: #e8f2ff;
}

.clients-agenda-event.commercial {
  color: #08775a;
  background: #e8f8f1;
}

.clients-agenda-event.overdue {
  color: #b91c1c;
  background: #fee2e2;
}

.clients-agenda-event.cancelled {
  opacity: .6;
  text-decoration: line-through;
}

.clients-agenda-event time {
  font-weight: 800;
}

.clients-agenda-event span {
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-agenda-day small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

/* ===== Agenda responsiva ===== */
/* Elementos que so aparecem em largura reduzida ficam OCULTOS no desktop, para
   que em >=1281px a tela permaneca identica ao layout atual. */
.clients-agenda-backdrop,
.clients-agenda-drawer-close,
.clients-agenda-compact-btn,
.clients-agenda-chips {
  display: none;
}
.clients-agenda-compact-btn {
  align-items: center;
  gap: 6px;
  min-height: 40px;
  white-space: nowrap;
}
.clients-agenda-chips {
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.clients-agenda-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.clients-agenda-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.clients-agenda-chip button:hover {
  color: var(--text);
}

@media (max-width: 1280px) {
  /* uma coluna; a sidebar sai do fluxo e vira drawer deslizante */
  .clients-agenda-view {
    grid-template-columns: 1fr;
  }
  .clients-agenda-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 60;
    width: min(360px, 90vw);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 16px;
    background: var(--bg);
    box-shadow: -12px 0 32px rgba(15, 23, 42, .18);
    overflow-y: auto;
    align-content: start;
    transform: translateX(100%);
    transition: transform .22s ease;
  }
  .clients-agenda-sidebar.is-open {
    transform: translateX(0);
  }
  .clients-agenda-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 23, 42, .4);
  }
  .clients-agenda-backdrop[hidden] {
    display: none;
  }
  .clients-agenda-drawer-close {
    display: inline-flex;
    align-self: flex-end;
    margin-bottom: 4px;
  }

  /* botoes compactos (Filtros/Criar) aparecem na toolbar */
  .clients-agenda-compact-btn {
    display: inline-flex;
  }

  /* toolbar em linha unica: titulo nunca quebra nem e sobreposto pela busca */
  .clients-agenda-toolbar {
    gap: 10px;
  }
  .clients-agenda-titlebar {
    flex: 1 1 auto;
  }
  .clients-agenda-titlebar h2 {
    font-size: clamp(16px, 2.4vw, 22px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .clients-agenda-tools {
    flex-wrap: nowrap;
    gap: 8px;
  }
  /* busca colapsa em lupa e expande no foco (mesmo campo #clientsAgendaSearch) */
  .clients-agenda-search {
    width: 40px;
    min-width: 0;
    overflow: hidden;
    transition: width .2s ease;
  }
  .clients-agenda-search:focus-within {
    width: min(260px, 56vw);
  }
  #clientsAgendaViewMode {
    min-width: 92px;
  }

  /* faixa de chips de filtros ativos */
  .clients-agenda-chips:not([hidden]) {
    display: flex;
  }

  /* dias da semana abreviados */
  .clients-agenda-weekdays span {
    font-size: 0;
  }
  .clients-agenda-weekdays span::after {
    content: attr(data-short);
    font-size: 12px;
  }

  .clients-agenda-day {
    min-height: 116px;
  }
}

@media (max-width: 768px) {
  .clients-agenda-day {
    min-height: 92px;
    padding: 6px;
  }
  .clients-agenda-day-number {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .clients-agenda-event {
    min-height: 22px;
    padding: 3px 5px;
    font-size: 11px;
  }
  .clients-agenda-compact-create span:last-child {
    display: none;
  }
}

/* Header global em largura reduzida: evita textos cortados (avatar sem nome,
   busca mais estreita, nome da org com reticencias). AFETA todas as telas. */
@media (max-width: 1280px) {
  .topbar-user-copy {
    display: none;
  }
  .topbar .search-box {
    width: min(240px, 26vw);
  }
  .topbar-license-text strong {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.client-management-search {
  display: grid;
  min-width: min(360px, 48vw);
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-management-search input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.client-management-search input:focus {
  outline: 2px solid rgba(0, 88, 190, .18);
  border-color: var(--secondary);
}

.clients-table {
  min-width: 0;
  table-layout: fixed;
}

.clients-table th,
.clients-table td {
  height: auto;
  padding: 18px 14px;
  font-size: 15px;
  line-height: 1.32;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.clients-table th {
  font-size: 11px;
}

.clients-table th:nth-child(1),
.clients-table td:nth-child(1) {
  width: 20%;
}

.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
  width: 10%;
}

.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
  width: 13%;
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
  width: 10%;
}

.clients-table th:nth-child(5),
.clients-table td:nth-child(5) {
  width: 10%;
}

.clients-table th:nth-child(6),
.clients-table td:nth-child(6) {
  width: 10%;
}

.clients-table th:nth-child(7),
.clients-table td:nth-child(7) {
  width: 17%;
}

.clients-table th:nth-child(8),
.clients-table td:nth-child(8) {
  width: 10%;
}

.clients-table td strong,
.clients-table td small {
  display: block;
}

.clients-table td strong {
  font-size: 16px;
  line-height: 1.25;
}

.clients-table td small {
  max-width: none;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.32;
}

.clients-table td:nth-child(8) {
  padding-right: 10px;
}

.clients-table td:nth-child(8) .ghost-link {
  display: block;
  width: fit-content;
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.2;
}

.clients-table tbody tr,
.commercial-client-card,
.process-table tbody tr {
  cursor: pointer;
}

.client-detail-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.client-profile-panel {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 18px;
  padding: 26px;
}

.client-profile-panel h1 {
  margin: 0;
  font-size: 24px;
  text-align: center;
}

.client-profile-panel > strong {
  color: var(--muted);
  text-align: center;
}

.client-photo-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.client-photo-placeholder .icon,
.client-default-avatar {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #9aa6b7;
}

.client-default-avatar {
  border: 0;
  background: linear-gradient(135deg, #0f5fc7, #23a6f2);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 16px 34px rgba(15, 95, 199, 0.24);
}

.client-data-section {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.client-data-section h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-data-section dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px 12px;
  margin: 0;
}

.client-data-section dt {
  color: var(--muted);
  font-size: 13px;
}

.client-data-section dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.client-activity-panel {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.client-detail-tabs {
  order: 0;
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.client-detail-tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5565;
  white-space: nowrap;
  font-weight: 700;
}

.client-detail-tabs button.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.interaction-card {
  order: 2;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.interaction-card[hidden],
.client-detail-metrics[hidden] {
  display: none;
}

.interaction-tabs,
.interaction-actions,
.interaction-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.interaction-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #4b5564;
}

.interaction-tabs button.is-active {
  color: var(--blue);
  font-weight: 700;
}

.interaction-actions {
  color: #667386;
}

.interaction-card > textarea:not(#clientInteractionNote) {
  display: none;
}

.interaction-card textarea {
  min-height: 86px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.interaction-footer {
  justify-content: space-between;
}

.client-detail-metrics {
  order: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
}

.client-detail-metrics.client-process-context {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-process-context-heading,
.client-process-context-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.client-process-context h2,
.client-process-context p {
  margin: 0;
}

.client-process-context h2 {
  margin-top: 6px;
  font-size: 26px;
}

.client-process-context p {
  max-width: 760px;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.client-process-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(94px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.client-process-progress span {
  min-width: 94px;
  padding: 11px 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #f6f8fb;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.client-process-progress span:last-child {
  border-right: 0;
}

.client-process-progress .is-complete {
  color: #08775a;
  background: #e8f8f1;
}

.client-process-progress .is-current {
  color: #fff;
  background: var(--blue);
}

.client-process-context-footer strong,
.client-process-context-footer small {
  display: block;
}

.client-process-context-footer small {
  max-width: 680px;
  margin-top: 6px;
  color: var(--muted);
}

.client-process-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.process-stage-action-button {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.process-stage-primary-action {
  border-color: #b8c7dc;
  background: #fff;
  color: var(--ink);
}

.process-stage-primary-action:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.process-stage-advance-action {
  border-color: #cad5e4;
  background: #fff;
  color: #334155;
}

.process-stage-advance-action:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #f7fbff;
}

@media (max-width: 860px) {
  .client-process-context-heading,
  .client-process-context-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-process-actions {
    justify-content: flex-start;
  }

  .process-stage-action-button {
    width: 100%;
  }
}

.client-timeline-card {
  order: 3;
  padding: 24px;
}

.client-rdv-card,
.client-service-orders-card,
.client-proposals-card,
.client-contracts-card,
.client-contacts-card,
.client-demands-card,
.client-attachments-card {
  order: 3;
  overflow: hidden;
}

.client-rdv-card .card-header,
.client-service-orders-card .card-header,
.client-proposals-card .card-header,
.client-contracts-card .card-header,
.client-contacts-card .card-header,
.client-demands-card .card-header,
.client-attachments-card .card-header {
  padding: 22px 24px;
}

.client-rdv-card h2,
.client-service-orders-card h2,
.client-proposals-card h2,
.client-contracts-card h2,
.client-contacts-card h2,
.client-demands-card h2,
.client-attachments-card h2 {
  margin: 5px 0 0;
}

.client-rdv-table,
.client-service-orders-table,
.client-proposals-table,
.client-contracts-table,
.client-contacts-table,
.client-demands-table,
.client-attachments-table {
  min-width: 760px;
}

.client-rdv-table td,
.client-service-orders-table td,
.client-proposals-table td,
.client-contracts-table td,
.client-contacts-table td,
.client-demands-table td,
.client-attachments-table td {
  height: 72px;
}

.client-rdv-table td strong,
.client-rdv-table td small,
.client-service-orders-table td strong,
.client-service-orders-table td small,
.client-proposals-table td strong,
.client-proposals-table td small,
.client-contracts-table td strong,
.client-contracts-table td small,
.client-contacts-table td strong,
.client-contacts-table td small,
.client-demands-table td strong,
.client-demands-table td small,
.client-attachments-table td strong,
.client-attachments-table td small {
  display: block;
}

.client-rdv-table td small,
.client-service-orders-table td small,
.client-proposals-table td small,
.client-contracts-table td small,
.client-contacts-table td small,
.client-demands-table td small,
.client-attachments-table td small {
  margin-top: 4px;
  color: var(--muted);
}

/* ===== Aba "Negociações" do cliente (visão CRM) ===== */
.client-negotiations-card { padding: 18px; }

.client-neg-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.client-neg-subtabs {
  display: inline-flex; background: #eef2f7; border-radius: 999px; padding: 4px; gap: 2px;
}
.client-neg-subtab {
  border: none; background: transparent; cursor: pointer;
  padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #64748b;
}
.client-neg-subtab.is-active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.client-neg-new-button { border-radius: 10px; }

.client-neg-view[hidden] { display: none; }

.client-neg-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
}
.cn-card {
  border-radius: 10px; padding: 13px 14px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid transparent;
}
.cn-card-title { font-size: 12px; font-weight: 600; }
.cn-card-value { font-size: 20px; font-weight: 600; line-height: 1.1; }
.cn-card-value .cn-cur { font-size: 12px; font-weight: 700; }
.cn-card-value .cn-unit { font-size: 12px; font-weight: 600; opacity: 0.8; }
.cn-card-andamento { background: #E4F5FA; }
.cn-card-andamento .cn-card-title { color: #14556B; }
.cn-card-andamento .cn-card-value { color: #0E3E4F; }
.cn-card-vendido { background: #E1F5EE; }
.cn-card-vendido .cn-card-title { color: #0F6E56; }
.cn-card-vendido .cn-card-value { color: #085041; }
.cn-card-perdido { background: #FBEAF0; }
.cn-card-perdido .cn-card-title { color: #993556; }
.cn-card-perdido .cn-card-value { color: #6E2440; }
.cn-card-neutral { background: #f8fafc; border-color: #e6eaf0; }
.cn-card-neutral .cn-card-title { color: #64748b; }
.cn-card-neutral .cn-card-value { color: #0f172a; }

.client-neg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cn-chip {
  border: none; cursor: pointer; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: #eef2f7; color: #475569;
}
.cn-chip.is-active.cn-chip-todas { background: #1B2A3A; color: #fff; }
.cn-chip.is-active.cn-chip-andamento { background: #E4F5FA; color: #14556B; }
.cn-chip.is-active.cn-chip-vendido { background: #E1F5EE; color: #0F6E56; }
.cn-chip.is-active.cn-chip-perdido { background: #FBEAF0; color: #993556; }

.client-neg-table-wrap { border: 1px solid #e6eaf0; border-radius: 12px; overflow: hidden; }
.client-neg-table { width: 100%; border-collapse: collapse; }
.client-neg-table thead th {
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; color: #94a3b8;
  font-weight: 700; text-align: left; padding: 12px 16px; background: #f8fafc;
  border-bottom: 1px solid #e6eaf0;
}
.client-neg-table tbody td {
  padding: 14px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: 14px;
}
.client-neg-table tbody tr:last-child td { border-bottom: none; }
.client-neg-table .col-neg { width: 42%; }
.client-neg-table .col-resp { width: 12%; }
.client-neg-table .col-status { width: 16%; }
.client-neg-table .col-valor { width: 15%; }
.client-neg-table .col-tarefa { width: 20%; }

.cn-open {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #2563EB; font-weight: 700; font-size: 14px; text-align: left;
}
.cn-open:hover { text-decoration: underline; }
.client-neg-table .col-neg small { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }

.cn-avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: #e2e8f0; color: #475569; font-size: 12px; font-weight: 700;
}
.cn-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.cn-badge.is-andamento { background: #E4F5FA; color: #14556B; }
.cn-badge.is-vendido { background: #E1F5EE; color: #0F6E56; }
.cn-badge.is-perdido { background: #FBEAF0; color: #993556; }
.client-neg-table .col-valor strong { font-weight: 600; color: #0f172a; }

.cn-task { display: inline-flex; align-items: center; gap: 6px; color: #475569; }
.cn-task-ico {
  width: 15px; height: 15px; flex: none;
  background-repeat: no-repeat; background-position: center; background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}
.cn-task-empty { color: #94a3b8; }
.client-neg-hint { margin-top: 12px; font-size: 12px; color: #94a3b8; }

@media (max-width: 760px) {
  .client-neg-cards { grid-template-columns: 1fr; }
  .client-neg-table thead { display: none; }
  .client-neg-table tbody td { display: block; width: auto; padding: 8px 14px; border: none; }
  .client-neg-table tbody tr { display: block; border-bottom: 1px solid #eef2f7; padding: 8px 0; }
}

/* Popup rapido de novo cliente (aberto por cima do modal de criar negociacao). */
.quick-client-modal { z-index: 220; }
.quick-client-card {
  max-width: 480px; width: calc(100% - 32px);
  border-radius: 16px; overflow: hidden; padding: 0;
}
.quick-client-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.quick-client-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #E6F1FB; color: #185FA5;
}
.quick-client-heading { flex: 1 1 auto; min-width: 0; }
.quick-client-heading .eyebrow {
  display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 2px;
}
.quick-client-heading h2 { font-size: 17px; font-weight: 500; margin: 0; line-height: 1.3; }
.quick-client-header .icon-button { flex: 0 0 auto; margin: -4px -4px 0 0; }

.quick-client-body { padding: 20px 24px; display: grid; gap: 12px; }
.quick-client-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.quick-client-note-icon { flex: 0 0 auto; color: #D97706; margin-top: 1px; }
.quick-client-note p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.quick-client-field { display: grid; gap: 4px; }
.quick-client-field > label { font-size: 12px; font-weight: 500; color: var(--muted); }
.quick-client-field .req-mark { color: #DC2626; }
.quick-client-body input {
  min-height: 42px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; font-size: 14px; color: var(--text); width: 100%;
}
.quick-client-body input:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.quick-client-cnpj-row { display: flex; gap: 8px; align-items: stretch; }
.quick-client-cnpj-row input { flex: 1 1 auto; min-width: 0; }
.quick-client-lookup {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.quick-client-lookup[disabled] { opacity: .6; cursor: progress; }
.quick-client-legend { font-size: 12px; color: var(--muted); }
.quick-client-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-client-required { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.quick-client-required .req-mark { color: #DC2626; }

.quick-client-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; background: #F8FAFC; border-top: 1px solid var(--line);
}
.quick-client-footer .ghost-link { margin-right: auto; }
.quick-client-submit { display: inline-flex; align-items: center; gap: 8px; background: #2563EB; }
.quick-client-submit:hover:not([disabled]) { background: #1D4FD7; }
.quick-client-submit[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 560px) { .quick-client-grid2 { grid-template-columns: 1fr; } }

.proposal-link-card {
  max-width: 480px; width: calc(100% - 32px);
  border-radius: 16px; overflow: hidden; padding: 0;
}
.proposal-link-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.proposal-link-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #E6F1FB; color: #185FA5;
}
.proposal-link-heading { flex: 1 1 auto; min-width: 0; }
.proposal-link-heading .eyebrow {
  display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 2px;
}
.proposal-link-heading h2 { font-size: 17px; font-weight: 500; margin: 0; line-height: 1.3; }
.proposal-link-header .icon-button { flex: 0 0 auto; margin: -4px -4px 0 0; }

.proposal-link-body { padding: 20px 24px; display: grid; gap: 16px; }
.proposal-link-intro { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.proposal-link-intro strong { color: var(--text); font-weight: 600; }

.proposal-link-options { display: grid; gap: 10px; }
.proposal-link-option {
  position: relative; display: flex; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s;
}
.proposal-link-option input { position: absolute; opacity: 0; pointer-events: none; }
.proposal-link-option.is-active { border: 2px solid #2563EB; background: #EFF5FE; padding: 13px; }
.proposal-link-radio {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff; transition: border-color .12s;
}
.proposal-link-option.is-active .proposal-link-radio {
  border-color: #2563EB; box-shadow: inset 0 0 0 4px #2563EB;
}
.proposal-link-option-body { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.proposal-link-option-title { font-size: 14px; font-weight: 500; color: var(--text); }
.proposal-link-option-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.proposal-link-existing-fields { display: grid; gap: 6px; margin-top: 8px; }
.proposal-link-existing-fields select {
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 14px; color: var(--text);
}
.proposal-link-existing-fields select:disabled { background: #F3F4F6; color: var(--muted); cursor: not-allowed; }
.proposal-link-count { font-size: 12px; color: var(--muted); }

.proposal-link-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; background: #F8FAFC; border-top: 1px solid var(--line);
}
.proposal-link-footer .ghost-link { margin-right: auto; }
.proposal-link-submit { display: inline-flex; align-items: center; gap: 8px; background: #2563EB; }
.proposal-link-submit:hover { background: #1D4FD7; }

.client-contacts-card .card-header {
  padding: 16px 20px;
}

.client-new-contact-button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

.client-contacts-card .eyebrow {
  font-size: 12px;
}

.client-contacts-card h2 {
  font-size: 22px;
}

.client-contacts-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.client-contacts-table th,
.client-contacts-table td {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.2;
  vertical-align: middle;
}

.client-contacts-table th {
  font-size: 11px;
}

.client-contacts-table td {
  height: 54px;
}

.client-contacts-table td strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.client-contacts-table th:nth-child(1),
.client-contacts-table td:nth-child(1) {
  width: 21%;
}

.client-contacts-table th:nth-child(2),
.client-contacts-table td:nth-child(2) {
  width: 15%;
}

.client-contacts-table th:nth-child(3),
.client-contacts-table td:nth-child(3) {
  width: 24%;
}

.client-contacts-table th:nth-child(4),
.client-contacts-table td:nth-child(4) {
  width: 16%;
}

.client-contacts-table th:nth-child(5),
.client-contacts-table td:nth-child(5) {
  width: 10%;
}

.client-contacts-table th:nth-child(6),
.client-contacts-table td:nth-child(6) {
  width: 14%;
  text-align: right;
}

.client-contacts-table td:nth-child(3),
.client-contacts-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-contacts-table .pill {
  padding: 4px 8px;
  font-size: 9px;
  white-space: nowrap;
}

.client-contacts-table .ghost-link {
  min-height: 28px;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
}

.client-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.client-row-actions .ghost-link {
  min-height: 28px;
  padding: 0;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.client-row-actions .danger-action,
.commercial-demand-actions .ghost-link.danger-action {
  color: var(--red);
}

.client-rdv-table th:last-child,
.client-rdv-table td:last-child,
.client-service-orders-table th:last-child,
.client-service-orders-table td:last-child,
.client-demands-table th:last-child,
.client-demands-table td:last-child {
  text-align: right;
}

.client-rdv-table td:last-child .client-row-actions,
.client-service-orders-table td:last-child .client-row-actions {
  justify-content: flex-end;
}

.client-contact-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.client-contact-avatar {
  display: inline-grid;
  flex: 0 0 30px;
  place-items: center;
  overflow: hidden;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-size: 11px;
  font-weight: 900;
}

.empty-table-message {
  margin: 0;
  padding: 16px 0;
  color: var(--muted);
  text-align: center;
}

.client-timeline {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 28px;
  border-left: 2px solid var(--line);
}

.client-timeline li {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.client-timeline li::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 18px;
  width: 18px;
  height: 18px;
  border: 4px solid #dce6f4;
  border-radius: 999px;
  background: var(--blue);
}

.client-timeline span {
  color: #303848;
}

.client-timeline small {
  color: var(--muted);
}

.sales-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 32px;
  margin-bottom: 32px;
}

.opportunities-card .card-header {
  padding: 24px 28px;
}

.opportunities-table {
  min-width: 720px;
}

.opportunities-table td {
  height: 84px;
}

.pill.solid {
  background: var(--blue);
  color: #fff;
}

.probability {
  display: inline-block;
  width: 52px;
  height: 6px;
  margin-right: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe3ea;
  vertical-align: middle;
}

.probability i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.goals-card {
  padding: 28px;
}

.goals-card h2 {
  margin: 0 0 32px;
  font-size: 22px;
}

.goal-row {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.goal-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.goal-row small {
  color: #2f3540;
}

.goal-row strong {
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
}

.goal-bar {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe0e7;
}

.goal-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.forecast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.opportunities-table td:last-child {
  white-space: nowrap;
}

.opportunities-table td:last-child .ghost-link + .ghost-link {
  margin-left: 10px;
  color: var(--red);
}

.commercial-demands-card {
  overflow: hidden;
}

.commercial-demands-card .card-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.commercial-demands-table {
  min-width: 980px;
}

.commercial-demands-table td strong,
.commercial-demands-table td small {
  display: block;
}

.commercial-demands-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.demand-report-modal-card {
  width: min(880px, 100%);
}

.demand-report {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.demand-report-document {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.demand-report-document header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 14px;
}

.demand-report-document header span {
  color: var(--primary);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.demand-report-document header strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

.demand-report-document header small {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.demand-report-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demand-report-summary div,
.demand-report-document dl div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.demand-report-summary small,
.demand-report-document dt {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.demand-report-summary strong,
.demand-report-document dd {
  display: block;
  font-size: 15px;
  line-height: 1.45;
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.demand-report-document dl {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.demand-report-document dl div:nth-child(7) {
  grid-column: 1 / -1;
}

.implementation-report-document {
  gap: 22px;
}

.implementation-report-section {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.implementation-report-section h3 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}

.implementation-report-section p {
  margin: 0;
  color: var(--muted);
}

.implementation-report-section dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.implementation-report-section dl div {
  break-inside: avoid;
}

.commercial-demand-client-search {
  position: relative;
}

.client-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.client-search-results[hidden] {
  display: none;
}

.client-search-results button {
  justify-content: flex-start;
  min-height: auto;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.client-search-results button:last-child {
  border-bottom: 0;
}

.client-search-results button:not(:disabled):hover {
  background: #eef5ff;
}

.client-search-results strong,
.client-search-results small {
  display: block;
}

.client-search-results small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.client-search-empty-action {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.client-search-empty-action p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.client-search-empty-action .secondary-button {
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.client-hours-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
}

.client-hours-grid article {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fafc;
}

.client-hours-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-hours-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-hours-grid input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.client-hours-grid strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.client-hours-grid strong.is-negative {
  color: var(--red);
}

.client-hours-grid small {
  color: var(--muted);
  font-size: 13px;
}

.client-hours-breakdown-head {
  padding: 0 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.client-hours-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 12px 24px 4px;
}
.client-hours-breakdown:empty { display: none; }
.client-hours-channel {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}
.client-hours-channel[data-channel="whatsapp"] { border-left-color: #22c55e; }
.client-hours-channel[data-channel="instagram"] { border-left-color: #d6249f; }
.client-hours-channel[data-channel="email"] { border-left-color: #ef4444; }
.client-hours-channel[data-channel="web_chat"] { border-left-color: #2c58e8; }
.client-hours-channel[data-channel="avulso"] { border-left-color: #94a3b8; }
.client-hours-channel .chc-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.client-hours-channel .chc-hours {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.client-hours-channel .chc-count {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 900px) {
  .client-hours-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.client-hours-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 24px 24px;
}

.client-hours-actions .form-status {
  margin: 0;
}

.contract-stage-notice {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #f2b8b5;
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: #fff7f7;
  color: var(--text);
}

.contract-stage-notice:not([hidden]) {
  display: flex;
}

.contract-stage-notice strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.contract-stage-notice p,
.contract-stage-notice small {
  display: block;
  margin: 0;
}

.contract-stage-notice p {
  color: #7f1d1d;
  line-height: 1.45;
}

.contract-stage-notice small {
  margin-top: 8px;
  color: var(--muted);
}

.contract-stage-notice > span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 8px 12px;
  text-transform: uppercase;
}

.commercial-demand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: flex-end;
  align-items: center;
}

.commercial-demand-actions .ghost-link {
  font-size: 0.78rem;
  line-height: 1.1;
  white-space: nowrap;
}

.commercial-demand-actions .ghost-link.danger-action {
  color: var(--red);
}

.demand-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.demand-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.demand-status.closed {
  background: #d7f8e7;
  color: #047857;
}

.demand-status.in-progress {
  background: #fff4d8;
  color: #a16207;
}

.demand-status.cancelled {
  background: #ffe1df;
  color: #b91c1c;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#clientModal .modal-card {
  width: min(940px, calc(100vw - 28px));
}

.client-contact-modal-card {
  width: min(720px, calc(100vw - 28px));
  overflow: hidden;
}

.client-contact-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  padding: 24px 28px 12px;
}

.client-contact-modal-header {
  align-items: flex-start;
  padding: 26px 30px 22px;
}

.client-contact-modal-header .eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.client-contact-modal-header h2 {
  color: #0f172a;
  font-size: 30px;
  line-height: 1.08;
}

.client-contact-modal-header p {
  max-width: 440px;
  margin-top: 8px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.4;
}

.client-contact-form-grid label {
  gap: 8px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.client-contact-form-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.client-contact-form-grid input {
  height: 52px;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 16px;
}

.client-contact-form-grid input:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, 0.14);
}

#clientContactFormStatus {
  min-height: 0;
  margin: 8px 28px 0;
  padding: 0;
  color: #b45309;
  font-size: 14px;
}

#clientContactFormStatus:empty {
  display: none;
}

#clientContactForm .modal-actions {
  margin-top: 20px;
  padding: 18px 28px 0;
  border-top: 1px solid var(--line-soft);
  background: #f8fafc;
}

#clientContactForm .modal-actions button {
  min-width: 180px;
  min-height: 54px;
  border-radius: 10px;
  font-size: 16px;
}

.client-contact-form-grid input:disabled {
  color: #64748b;
  background: #f1f5f9;
  cursor: not-allowed;
}

@media (max-width: 680px) {
  .client-contact-form-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .client-contact-form-grid label:nth-child(3) {
    grid-column: auto;
  }

  .client-contact-modal-header {
    padding: 22px 20px 18px;
  }

  #clientContactForm .modal-actions {
    padding-inline: 20px;
  }

  #clientContactForm .modal-actions button {
    width: 100%;
  }
}

.success-modal-backdrop {
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

.service-request-link-client-card {
  max-width: 760px;
  width: min(760px, calc(100vw - 40px));
}

.service-request-link-client-card label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.service-request-link-client-card input {
  min-height: 52px;
}

.service-request-link-client-results {
  position: static;
  margin-top: 10px;
  max-height: 230px;
  overflow: auto;
}

.service-request-link-client-results button {
  text-align: left;
}

.service-request-link-client-card .conversation-link-submit {
  width: 100%;
  margin-top: 14px;
}

.service-request-transfer-backdrop {
  z-index: 320;
}

.service-request-transfer-card {
  width: min(520px, calc(100vw - 32px));
  padding-bottom: 18px;
  overflow: hidden;
}

.service-request-transfer-field {
  display: grid;
  gap: 8px;
  padding: 0 28px 14px;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.service-request-transfer-field select {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.service-request-transfer-card .form-status {
  margin: 0 28px 14px;
}

.service-request-transfer-card .modal-actions {
  padding: 0 28px;
}

.success-modal-card {
  width: min(440px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px 32px;
  text-align: center;
}

.success-modal-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #dcfce7;
  color: #047857;
  font-size: 28px;
  font-weight: 800;
}

.success-modal-card h2,
.success-modal-card p {
  margin: 0;
}

.success-modal-card p {
  color: var(--muted);
  line-height: 1.5;
}

.delete-confirm-backdrop {
  z-index: 1200;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.delete-confirm-card {
  width: min(430px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: 34px 32px 30px;
  text-align: center;
}

.delete-confirm-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 28px;
  font-weight: 900;
}

.delete-confirm-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.delete-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.delete-confirm-actions button {
  min-width: 112px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.delete-confirm-yes {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.22);
}

.delete-confirm-no {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header p {
  margin-top: 6px;
  color: var(--muted);
}

.modal-header .icon-button {
  font-size: 30px;
}

.opportunity-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px;
}

.opportunity-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.opportunity-form input,
.opportunity-form select,
.opportunity-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.opportunity-form textarea {
  resize: vertical;
}

/* Cabecalho do modal de usuario: avatar + titulo + e-mail */
.user-modal-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.user-modal-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
}

.user-modal-heading h2 { margin: 0; }

.user-modal-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  word-break: break-word;
}

/* Titulo de secao dentro do form (Dados do usuario / Seguranca) */
.form-section-title {
  margin: 4px 0 -8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Caixa de MFA: rotulo/descricao a esquerda, botao Redefinir a direita */
.user-mfa-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.user-mfa-box .user-mfa-toggle {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.user-mfa-reset {
  flex: 0 0 auto;
  white-space: nowrap;
}

#userModal #deleteUserButton {
  margin-right: auto;
}

.secondary-button.danger-button {
  color: var(--red);
  border-color: #fecaca;
}

.secondary-button.danger-button:hover {
  background: #fef2f2;
  border-color: var(--red);
}

.user-mfa-toggle {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px !important;
}

.user-mfa-toggle input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.user-mfa-toggle span {
  display: grid;
  gap: 4px;
}

.user-mfa-toggle strong {
  color: var(--text);
}

.user-mfa-toggle small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.user-status-stack {
  display: inline-grid;
  gap: 6px;
}

.user-mfa-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.user-mfa-pill.is-disabled {
  background: #f1f5f9;
  color: #64748b;
}

.appointment-online-section {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.appointment-online-section legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.appointment-online-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 30px;
  font-size: 14px;
  font-weight: 700;
}

.appointment-online-toggle input {
  width: 16px;
  min-height: auto;
  padding: 0;
  accent-color: var(--blue);
}

.appointment-online-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr);
  gap: 12px;
}

.appointment-meeting-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.appointment-meeting-link-row input {
  min-width: 0;
  color: var(--muted);
}

.appointment-meeting-link-row .compact-button {
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
}

.presentation-appointment-card {
  width: min(920px, 100%);
}

.presentation-appointment-card .modal-header {
  padding: 18px 22px;
}

.presentation-appointment-card .modal-header h2 {
  font-size: 26px;
}

.presentation-appointment-card .modal-header p {
  font-size: 16px;
}

.presentation-appointment-form {
  gap: 12px 18px;
  padding: 18px 22px;
}

.presentation-appointment-form label {
  gap: 5px;
  font-size: 15px;
}

.presentation-appointment-form input,
.presentation-appointment-form textarea {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 15px;
}

.presentation-appointment-form textarea {
  min-height: 76px;
}

.presentation-modules-field {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  grid-column: 1 / -1;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.presentation-modules-field legend {
  padding: 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.presentation-modules-field label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.presentation-modules-field input {
  width: 14px;
  min-height: auto;
  padding: 0;
  accent-color: var(--blue);
}

.presentation-appointment-form .modal-actions {
  align-items: center;
}

.full-field,
.form-status,
.modal-actions {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--red);
}

.form-status[data-state="success"] {
  color: var(--green);
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #6b7280);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.appointment-modal-actions span {
  flex: 1;
}

.danger-button {
  min-height: 54px;
  padding: 0 20px;
  border: 1px solid #ef4444;
  border-radius: 5px;
  color: #b91c1c;
  background: #fff;
}

.process-fields-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.crm-flow-summary {
  display: grid;
  grid-template-columns: 1.35fr .75fr .75fr .9fr 1.15fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.crm-flow-summary > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.crm-flow-summary small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-flow-summary strong {
  overflow: hidden;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-summary-badge,
.crm-field-badge {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-summary-badge.current {
  color: #155bc7;
  background: #dbeafe;
}

.crm-summary-badge.next,
.crm-field-badge.is-filled {
  color: #047857;
  background: #dcfce7;
}

.crm-summary-pending,
.crm-field-badge {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #b45309;
  background: #fef3c7;
  font-size: 11px;
  font-weight: 900;
}

.crm-summary-progress {
  display: grid;
  gap: 5px;
}

.crm-summary-progress span {
  color: #0f172a;
  font-size: 12px;
}

.crm-summary-progress div {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
}

.crm-summary-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width .2s ease;
}

.crm-summary-progress em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.process-fields-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.process-fields-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #155bc7;
  background: #dbeafe;
  font-weight: 900;
}

.process-fields-panel h3,
.process-fields-panel h4,
.process-fields-panel p {
  margin: 0;
}

.process-fields-panel p {
  color: var(--muted);
}

.process-fields-panel section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.process-fields-panel h4 {
  grid-column: 1 / -1;
  font-size: 16px;
}

.process-checkbox-group {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.process-checkbox-group strong {
  color: #172033;
}

.process-checkbox-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.process-checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.process-checkbox-group input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.crm-flow-field {
  position: relative;
  gap: 7px !important;
  min-height: auto;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.crm-flow-field.is-pending,
.crm-flow-field.field-missing {
  border-color: #f97316;
  background: #fff7ed;
}

.crm-flow-field.is-filled {
  border-color: #bbf7d0;
  background: #fff;
}

.crm-flow-field.is-filled input {
  border-color: #cbd5e1;
}

.crm-flow-field input {
  min-height: 42px;
  padding: 9px 11px;
}

.crm-flow-field:has([data-process-field="financial_responsible_cpf"]) {
  align-self: start;
  min-height: 0;
  padding: 10px 12px;
}

.crm-flow-field:has([data-process-field="financial_responsible_cpf"]) input {
  min-height: 42px;
}

.crm-flow-field .crm-field-badge {
  position: absolute;
  top: 10px;
  right: 12px;
}

.crm-flow-field small,
.crm-plan-field small {
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}

.crm-flow-field small[hidden],
.crm-plan-field small[hidden] {
  display: none;
}

.crm-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-plan-field > div:last-of-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.crm-plan-field label {
  justify-content: flex-start;
  width: 100%;
  min-height: 32px;
  border-radius: 7px;
}

.crm-flow-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #92400e;
  background: #fff7ed;
}

.crm-flow-alert span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: #f59e0b;
  font-size: 13px;
  font-weight: 900;
}

.crm-flow-alert p {
  margin: 0;
  line-height: 1.4;
}

.process-other-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.implementation-checklist-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
}

.implementation-checklist-group h5 {
  margin: 0;
  color: #172033;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.implementation-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 16px;
}

.implementation-checklist-grid label {
  margin: 0;
}

.field-missing {
  padding: 8px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: #fff5f3;
}

.crm-flow-field.field-missing,
.crm-flow-field.is-pending {
  padding: 12px;
  border-color: #f97316;
  background: #fff7ed;
}

#clientForm.is-focused-requirements .process-fields-panel {
  border-color: var(--blue);
  background: #f2f7ff;
}

#clientForm.is-focused-requirements .process-fields-panel section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-activity-card,
.team-timeline {
  display: none !important;
}

/* ----- Representante legal para contratos (Config > Empresa) -----
   Le os mesmos tokens da tela de contratos: e' o mesmo assunto, e assim o dia
   do tema escuro alcanca os dois de uma vez. */
/* Mesma caixa do cartao de marca, que e' o vizinho no mesmo painel: sem estes
   dois valores o cartao herdava padding ZERO e os campos encostavam na borda —
   medido em 25/09 (primeiro campo em x=1 contra x=21 do vizinho). */
.legal-rep-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  margin: 14px 0 18px;
  border-radius: 12px;
}

.legal-rep-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ctr-ink-strong);
}

.legal-rep-header p {
  margin: 0;
  font-size: 12px;
  color: var(--ctr-ink-soft);
}

.legal-rep-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 12px;
}

.legal-rep-field-full { grid-column: 1 / -1; }

.legal-rep-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ctr-ink-soft);
}

/* Escopado por #id: o reset global de `input` pesa (0,2,1) e vencia a regra de
   classe — o campo saia com raio 12px e outra borda. Armadilha ja documentada
   no guia (Lote 6). */
#legalRepCard .legal-rep-grid input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ctr-field-line);
  border-radius: 10px;
  background: var(--ctr-surface);
  color: var(--ctr-ink-strong);
  font-size: 14px;
}

#legalRepCard .legal-rep-grid input:disabled {
  background: var(--ctr-surface-bar);
  color: var(--ctr-ink-faint);
}

.legal-rep-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.legal-rep-note {
  font-size: 12px;
  color: var(--ctr-ink-faint);
}

@media (max-width: 720px) {
  .legal-rep-grid { grid-template-columns: 1fr; }
}

/* ===================== Consultar Contratos (screen-contracts) =====================
   Migrada para o padrao em 25/09/2026. Cores: so tokens --ctr-* (ver :root).

   O titulo desta tela e' o PRIMEIRO em 19px/600: a regra global
   `.page-heading h1` ainda e' 40px/800 nas outras 17 telas, porque a Decisao E
   do guia segue em aberto e merece lote proprio. Por isso o tamanho entra
   escopado aqui, sem tocar na regra global. */
#screen-contracts .page-heading h1 {
  font-size: 19px;
  font-weight: 600;
  color: var(--ctr-ink-strong);
}

#screen-contracts .page-heading p {
  font-size: 12px;
  color: var(--ctr-ink-soft);
}

.contract-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

/* KPI no padrao dos relatorios (.sla-rep-kpi): rotulo, valor grande, sublinha. */
.contract-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid var(--ctr-line);
  border-radius: 12px;
  background: var(--ctr-surface);
}

.contract-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ctr-ink-soft);
}

.contract-stat strong {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ctr-ink-strong);
}

.contract-stat small {
  font-size: 10px;
  color: var(--ctr-ink-faint);
}

.contract-stat.is-signed {
  border-color: transparent;
  background: var(--ctr-success-tint);
}

.contract-stat.is-pending {
  border-color: transparent;
  background: var(--ctr-warning-tint);
}

/* Expirados: so ganha cor quando existe expirado (ver #expiredContractsCard). */
.contract-stat.is-expired {
  border-color: transparent;
  background: var(--ctr-danger-tint);
}

.contract-stat.is-signed .contract-stat-label,
.contract-stat.is-signed strong,
.contract-stat.is-signed small { color: var(--ctr-success-ink); }

.contract-stat.is-pending .contract-stat-label,
.contract-stat.is-pending strong,
.contract-stat.is-pending small { color: var(--ctr-warning-ink); }

.contract-stat.is-expired .contract-stat-label,
.contract-stat.is-expired strong,
.contract-stat.is-expired small { color: var(--ctr-danger-ink); }

.danger-text {
  color: var(--red) !important;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.stat-icon.blue {
  color: var(--blue);
  background: #dce5ff;
}

.stat-icon.red {
  color: var(--red);
  background: #ffd7d1;
}

.stat-icon.soft {
  color: #12324d;
  background: #d5e7fb;
}

.contracts-table-card {
  margin-bottom: 20px;
  padding: 14px;
  /* O `.card` global e' 16px (Decisao F em aberto, 102 usos). Corrigido POR
     TELA durante a migracao, como manda a Decisao D para o `td`. */
  border-radius: 12px;
}

/* Barra de filtros — Variante A do guia (secao 2.2). */
.contract-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--ctr-line);
  border-radius: 12px;
  background: var(--ctr-surface-bar);
}

.contract-filters-icon {
  display: flex;
  align-items: center;
  align-self: center;
  color: var(--ctr-ink-faint);
}

.contract-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.contract-field-search {
  flex: 1 1 220px;
}

.contract-field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint);
}

.contract-field select,
.contract-field input {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--ctr-field-line);
  border-radius: 8px;
  background: var(--ctr-surface);
  color: var(--ctr-ink-strong);
  font-size: 12px;
}

.contract-field select {
  padding-right: 26px;
}

.contract-field input::placeholder {
  color: var(--ctr-ink-faint);
}

/* O reset global de `button` impoe min-height 44px (armadilha no 1 do
   inventario): sem o zero aqui, "Limpar" estica a barra inteira. */
.contract-filters-clear {
  margin-left: auto;
  align-self: center;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ctr-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.contracts-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.contracts-filter-note {
  margin: 0;
  font-size: 12px;
  color: var(--ctr-ink-soft);
}

.contracts-count {
  font-size: 12px;
  color: var(--ctr-ink-faint);
  white-space: nowrap;
}

.filter-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #222936;
  font-size: 17px;
}

#screen-contracts .table-wrap {
  border: 1px solid var(--ctr-line);
  border-radius: 12px;
  background: var(--ctr-surface);
  overflow-x: auto;
}

.contracts-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

#screen-contracts .contracts-table th {
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint);
  background: var(--ctr-surface-bar);
  border-bottom: 1px solid var(--ctr-line);
  white-space: nowrap;
}

/* Decisao D: o `td` que herda 18px e' corrigido POR TABELA, nunca por regra
   global nova. Esta tabela vinha com `height: 112px` e fonte 18px. */
#screen-contracts .contracts-table td {
  height: auto;
  padding: 11px 12px;
  font-size: 12.5px;
  color: var(--ctr-ink-strong);
  border-bottom: 1px solid var(--ctr-line-soft);
  vertical-align: middle;
}

#screen-contracts .contracts-table tbody tr:last-child td {
  border-bottom: 0;
}

#screen-contracts .contracts-table tbody tr:hover {
  background: var(--ctr-row-hover);
}

/* Nome da empresa em UMA linha. O corte vai num elemento interno com
   `max-width`, e nao em `colgroup`/largura de coluna, porque um
   MutationObserver global torna TODA tabela redimensionavel e sobrescreve
   largura de coluna com valor inline. */
.contract-client-name {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ctr-ink-strong);
}

.contract-client-doc {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ctr-ink-faint);
}

.contract-code {
  font-size: 12.5px;
  color: var(--ctr-accent);
}

/* Codigo clicavel: so onde JA existe a acao de abrir o PDF congelado. */
button.contract-code {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

button.contract-code:hover {
  text-decoration: underline;
}

.contract-code.is-empty {
  color: var(--ctr-ink-faint);
}

.contract-date-expired {
  font-weight: 600;
  color: var(--ctr-danger-ink);
}

.contract-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--ctr-neutral-tint);
  color: var(--ctr-neutral-ink);
}

.contract-badge.is-signed { background: var(--ctr-success-tint); color: var(--ctr-success-ink); }
.contract-badge.is-pending { background: var(--ctr-warning-tint); color: var(--ctr-warning-ink); }
.contract-badge.is-expired { background: var(--ctr-danger-tint); color: var(--ctr-danger-ink); }

.contract-badge-note {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ctr-warning-ink);
}

/* A linha inteira tingida, bem mais suave que o badge. */
#screen-contracts .contracts-table tr.is-row-expired { background: var(--ctr-row-danger); }
#screen-contracts .contracts-table tr.is-row-pending { background: var(--ctr-row-warning); }

.contract-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Armadilha no 1 do inventario: o reset global `button { min-height: 44px }`
   vence uma regra de classe unica e estica o botao de icone, esparramando a
   linha. O min-height: 0 e a geometria fixa tem de vir juntos. */
.contract-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ctr-ink-soft);
  cursor: pointer;
}

.contract-icon-button:hover {
  background: var(--ctr-neutral-tint);
  color: var(--ctr-ink-strong);
}

.contract-icon-button.is-pdf { color: var(--ctr-danger-ink); }
.contract-icon-button.is-resend { color: var(--ctr-accent); }

/* ----- Linha expandida: as partes que assinam ----- */
#screen-contracts .contracts-table tr.is-expanded { background: var(--ctr-surface-bar); }

#screen-contracts .contracts-table tr.contract-parts-row:hover { background: transparent; }

#screen-contracts .contracts-table .contract-parts-row > td {
  padding: 4px 12px 14px;
  background: var(--ctr-surface-bar);
  border-bottom: 1px solid var(--ctr-line);
}

.contract-parts-title {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint);
}

.contract-parts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 8px;
}

.contract-part {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ctr-line);
  border-radius: 10px;
  background: var(--ctr-surface);
}

.contract-part-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ctr-neutral-tint);
  color: var(--ctr-neutral-ink);
}

.contract-part.is-signed { border-color: transparent; }
.contract-part.is-signed .contract-part-mark { background: var(--ctr-success-tint); color: var(--ctr-success-ink); }
.contract-part.is-signed .contract-part-state { color: var(--ctr-success-ink); }

.contract-part.is-pending { border-color: var(--ctr-warning-tint); }
.contract-part.is-pending .contract-part-mark { background: var(--ctr-warning-tint); color: var(--ctr-warning-ink); }
.contract-part.is-pending .contract-part-state { color: var(--ctr-warning-ink); }

.contract-part-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.contract-part-body strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ctr-ink-strong);
}

.contract-part-who {
  font-size: 12.5px;
  color: var(--ctr-ink-soft);
}

.contract-part-body > strong,
.contract-part-who {
  display: inline;
}

.contract-part-state {
  font-size: 11px;
  color: var(--ctr-ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Escopado por #id de proposito. `.secondary-button` tem a MESMA
   especificidade e vem depois no arquivo, entao venceria — o botao saia com os
   38px do padrao e descolava o cartao. Medido, nao deduzido.
   32px e' a altura de controle do guia (a mesma da barra de filtros), que e' o
   tamanho certo para um botao dentro de um cartao denso. */
#screen-contracts .contract-part-action {
  flex: 0 0 auto;
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 11.5px;
}

/* Lapis de trocar a pessoa da parte: discreto ao lado da acao principal. */
#screen-contracts .contract-part-edit {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--ctr-ink-faint);
}

.contract-part-action:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.contract-parts-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ctr-ink-faint);
}

.contract-parts-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--ctr-ink-faint);
}

@media (max-width: 900px) {
  .contract-parts-grid { grid-template-columns: 1fr; }
}

.contracts-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 0;
  font-size: 12px;
  color: var(--ctr-ink-faint);
}

.pill.waiting {
  max-width: 150px;
  background: #dceaff;
  color: var(--blue);
  white-space: normal;
}

.pill.process-pill {
  background: #e7f0ff;
  color: var(--blue);
}

.process-summary-grid {
  display: none;
}

.process-stat {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 138px;
  padding: 24px;
}

.process-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 34px;
  line-height: 1;
}

.process-stat small {
  display: block;
  color: var(--muted);
}

.process-flow-card {
  padding: 28px;
  margin-bottom: 32px;
}

.process-flow-card .card-header {
  margin-bottom: 24px;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
}

.process-flow article {
  position: relative;
  min-height: 132px;
  padding: 22px;
  background: #eef3fb;
  border: 1px solid #d5ddea;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}

.process-flow article:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.process-flow article.is-complete {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.process-flow small {
  display: block;
  color: inherit;
  font-size: 12px;
  text-transform: uppercase;
}

.process-flow strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.process-flow span {
  color: inherit;
  font-size: 14px;
}

.process-content-grid {
  display: block;
}

.process-kanban-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.process-kanban-card .card-header {
  padding: 28px 30px 18px;
}

.process-kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 14px;
  padding: 0 30px 30px;
  overflow-x: auto;
}

.kanban-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.kanban-column.is-drop-target {
  border-color: var(--blue);
  background: #eef5ff;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.kanban-column header strong {
  font-size: 13px;
  text-transform: uppercase;
}

.kanban-column header span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: var(--blue);
  font-weight: 800;
}

.kanban-column > div {
  display: grid;
  gap: 10px;
}

.kanban-client-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(29, 41, 57, 0.06);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.kanban-client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(29, 41, 57, 0.1);
}

.kanban-client-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.98);
  cursor: grabbing;
}

.kanban-client-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.kanban-client-card span {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.kanban-client-card small,
.kanban-empty {
  color: var(--muted);
  font-size: 13px;
}

.kanban-card-actions {
  display: flex;
  gap: 10px;
  padding-top: 6px;
}

.kanban-card-actions .ghost-link {
  font-size: 13px;
}

.process-table-card {
  display: none;
}

.process-table {
  min-width: 880px;
}

.process-table td {
  height: 92px;
}

.process-table td strong,
.process-table td small {
  display: block;
}

.process-table td small {
  margin-top: 6px;
  color: var(--muted);
}

.process-checklist-card {
  display: none;
  align-content: start;
  gap: 18px;
  padding: 28px;
}

.process-checklist-card h2 {
  margin: 0 0 6px;
}

.process-checklist-card label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.process-checklist-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.process-sla-box {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 18px;
  background: var(--panel);
  border-radius: 6px;
}

.process-sla-box strong {
  font-size: 30px;
}

.process-subflow-card {
  padding: 28px;
}

.process-subflow-card .card-header {
  margin-bottom: 24px;
}

.process-subflow-card .card-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.implementation-clients-list {
  display: grid;
  gap: 22px;
}

.implementation-table-wrap {
  margin-top: 6px;
}

.implementation-clients-table td {
  vertical-align: middle;
}

.implementation-clients-table .primary-button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  white-space: nowrap;
}

.table-progress {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.table-progress strong {
  font-size: 18px;
}

.table-progress .goal-bar {
  height: 7px;
  margin: 0;
}

.table-progress small {
  color: var(--muted);
}

.implementation-editor {
  display: grid;
  gap: 20px;
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.implementation-editor[hidden] {
  display: none;
}

.implementation-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.implementation-editor-header h2,
.implementation-editor-header p {
  margin: 0;
}

.implementation-editor-header h2 {
  margin-top: 12px;
}

.implementation-editor-header p {
  margin-top: 6px;
  color: var(--muted);
}

.implementation-client-heading {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.implementation-client-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.implementation-client-heading strong {
  font-size: 26px;
}

.implementation-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.implementation-editor-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.implementation-editor-summary .implementation-progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.implementation-client-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.implementation-client-card > header,
.implementation-client-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.implementation-client-card h3,
.implementation-client-card p {
  margin: 0;
}

.implementation-client-card p {
  color: var(--muted);
}

.implementation-progress {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
}

.implementation-progress strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.implementation-accordion {
  display: grid;
  gap: 12px;
}

.implementation-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.implementation-step[data-blocked="true"] {
  opacity: .58;
}

.implementation-step summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 800;
}

.implementation-step summary small {
  color: var(--blue);
  font-weight: 800;
}

.implementation-step-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 18px 18px;
}

.implementation-step-fields label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.implementation-step-fields input,
.implementation-step-fields select,
.implementation-step-fields textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.implementation-step-fields textarea {
  resize: vertical;
  min-height: 96px;
}

.implementation-field-wide,
.implementation-choice-group {
  grid-column: 1 / -1;
}

.implementation-choice-group {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.implementation-choice-group legend {
  padding: 0 8px;
  font-weight: 800;
}

.implementation-choice-group > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.implementation-choice {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  font-weight: 700;
}

.implementation-choice input {
  width: auto;
  min-height: auto;
  padding: 0;
}

.contracts-bottom-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 0.9fr);
  gap: 36px;
}

.recent-contracts-card {
  padding: 30px;
}

.recent-contracts-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  font-size: 24px;
}

.contract-timeline {
  display: grid;
  gap: 28px;
  margin: 0;
  padding-left: 42px;
  border-left: 3px solid #d0d6df;
}

.contract-timeline li {
  position: relative;
  font-size: 16px;
  line-height: 1.45;
}

.contract-timeline li::before {
  content: "\2022";
  position: absolute;
  left: -52px;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 38px;
  border-radius: 14px;
  background: #8a8f99;
  color: #fff;
}

.contract-timeline li.done::before {
  content: "\2713";
  background: var(--blue);
}

.contract-timeline li.warning::before {
  content: "!";
  background: var(--red);
}

.contract-timeline strong,
.contract-timeline small {
  display: block;
}

.contract-timeline small {
  color: #111827;
}

.efficiency-card {
  min-height: 260px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.45)),
    radial-gradient(circle at 20% 20%, rgba(8, 91, 197, 0.18), transparent 42%);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.14);
  color: #fff;
}

.efficiency-card h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 28px;
}

.efficiency-card p {
  max-width: 560px;
  margin: 0 0 96px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.45;
}

.efficiency-card strong {
  color: #dbe8ff;
}

.efficiency-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.efficiency-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c8d8ff;
}

.efficiency-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.9);
}

.settings-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
  margin-bottom: 24px;
}

.settings-workspace {
  margin: -12px -40px 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.settings-tabs {
  display: flex;
  align-items: stretch;
  gap: 18px;
  min-height: 52px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.settings-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  min-height: 52px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #647084;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.settings-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.settings-tabs button.is-active {
  color: #7e2fb2;
}

.settings-tabs button.is-active::after {
  background: #7e2fb2;
}

.settings-tab-panel {
  padding: 24px 16px 36px;
}

.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(278px, 100%), 278px));
  justify-content: start;
  gap: 18px;
}

.settings-hub-card {
  width: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.settings-hub-card:hover,
.settings-hub-card.is-selected {
  border-color: #b78bd3;
  box-shadow: 0 16px 38px rgba(67, 37, 86, 0.12);
  transform: translateY(-1px);
}

.settings-hub-card.is-static {
  cursor: default;
}

.settings-hub-card.is-static:hover {
  border-color: #dfe4ec;
  box-shadow: none;
  transform: none;
}

/* Cartao do hub DESATIVADO (hoje so a Auditoria, em desenvolvimento). Nenhuma
   cor nova: opacidade e cursor, reaproveitando a borda do estado estatico. O
   cartao continua legivel de proposito — some-lo esconderia que o recurso
   existe e vai voltar. */
.settings-hub-card:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.settings-hub-card:disabled:hover {
  border-color: #dfe4ec;
  box-shadow: none;
  transform: none;
}

.settings-hub-card strong {
  font-size: 16px;
}

.settings-hub-card small {
  color: #647084;
  line-height: 1.4;
}

.settings-card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #2c58e8;
  background: #dbeafe;
}

.settings-card-icon .icon {
  width: 26px;
  height: 26px;
}

.settings-card-icon.violet {
  color: #5958e9;
  background: #e9e7ff;
}

.settings-card-icon.purple {
  color: #873cec;
  background: #eee0ff;
}

.settings-card-icon.green {
  color: #05a451;
  background: #d7f8e4;
}

.whatsapp-logo-icon {
  width: 31px;
  height: 31px;
  display: block;
  fill: currentColor;
}

.settings-card-icon.yellow {
  color: #d67b00;
  background: #fff0b8;
}

.settings-card-icon.gray {
  color: #657187;
  background: #eef2f7;
}

.settings-card-icon.white {
  color: #111827;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.openai-mark {
  font-weight: 800;
  letter-spacing: 0;
}

.knowledge-base-card {
  display: grid;
  gap: 18px;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 32px clamp(24px, 4vw, 44px);
  box-sizing: border-box;
}

.settings-detail-modal-body:has(#settings-detail-company-knowledge) {
  padding: clamp(20px, 3vw, 34px);
}

.settings-detail-modal-body:has(#settings-detail-company-knowledge) .settings-detail-panel {
  align-items: start;
}

.knowledge-base-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}

.knowledge-base-form .full-field {
  grid-column: 1 / -1;
}

.knowledge-base-form label {
  display: grid;
  gap: 8px;
  color: #172033;
  font-weight: 800;
}

.knowledge-base-form label span,
.knowledge-base-section-header strong {
  font-size: 13px;
}

.knowledge-base-form input,
.knowledge-base-form select,
.knowledge-base-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.knowledge-base-form textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.5;
}

.knowledge-base-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #edf1f7;
}

.knowledge-base-section-header small,
.knowledge-base-empty small {
  display: block;
  margin-top: 4px;
  color: #647084;
  font-weight: 600;
}

.knowledge-base-articles {
  display: grid;
  gap: 14px;
}

.knowledge-base-article {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fbfdff;
}

.knowledge-base-article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.knowledge-base-active-toggle {
  display: inline-flex !important;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 8px !important;
  width: fit-content;
}

.knowledge-base-active-toggle input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.knowledge-base-article-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 14px;
}

.knowledge-base-empty {
  padding: 18px;
  border: 1px dashed #c8d5e8;
  border-radius: 8px;
  color: #172033;
  background: #f8fbff;
  text-align: center;
}

.knowledge-base-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .knowledge-base-form,
  .knowledge-base-article-grid {
    grid-template-columns: 1fr;
  }
}

.knowledge-base-page {
  width: min(100%, 1320px);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.settings-detail-modal-card:has(#settings-detail-company-knowledge) {
  width: min(1440px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 42px));
}

.settings-detail-modal-body:has(#settings-detail-company-knowledge) {
  padding: 24px;
  background: #f8fbff;
}

.knowledge-base-page-header,
.knowledge-base-searchbar,
.knowledge-base-filter-panel,
.knowledge-base-table-card,
.knowledge-base-quick-card,
.knowledge-base-metrics article {
  border: 1px solid #dfe7f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.knowledge-base-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

.knowledge-base-title-group,
.knowledge-base-header-actions,
.knowledge-base-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-base-title-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1d66f0;
  background: #eef5ff;
}

.knowledge-base-page h2,
.knowledge-base-page h3,
.knowledge-base-page p {
  margin: 0;
}

.knowledge-base-page h2 {
  font-size: 18px;
}

.knowledge-base-page-header p,
.knowledge-base-quick-card p,
.knowledge-base-table-footer,
.knowledge-base-table td small {
  color: #647084;
  font-size: 12px;
}

.knowledge-base-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.knowledge-base-metrics article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  align-items: center;
  padding: 16px;
}

.knowledge-base-metrics article strong {
  font-size: 24px;
  line-height: 1;
}

.knowledge-base-metrics article small,
.knowledge-base-metrics article em {
  grid-column: 2;
  color: #647084;
  font-style: normal;
  font-size: 12px;
}

.knowledge-base-metric-icon {
  grid-row: span 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.knowledge-base-metric-icon.blue { color: #1d66f0; background: #eef5ff; }
.knowledge-base-metric-icon.green { color: #16a34a; background: #eafaf0; }
.knowledge-base-metric-icon.amber { color: #f59e0b; background: #fff7e6; }
.knowledge-base-metric-icon.purple { color: #9333ea; background: #f4e8ff; }

.knowledge-base-searchbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(150px, .7fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
}

.knowledge-base-searchbar label,
.knowledge-base-filter-panel label,
.knowledge-base-quick-card label {
  display: grid;
  gap: 7px;
  color: #46556f;
  font-size: 12px;
  font-weight: 800;
}

.knowledge-base-searchbar input,
.knowledge-base-searchbar select,
.knowledge-base-filter-panel select,
.knowledge-base-filter-panel textarea,
.knowledge-base-quick-card input,
.knowledge-base-quick-card select,
.knowledge-base-quick-card textarea,
.knowledge-base-table-toolbar select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d5dfed;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.knowledge-base-search-field {
  position: relative;
}

.knowledge-base-search-field .icon {
  position: absolute;
  left: 12px;
  bottom: 11px;
  width: 16px;
  height: 16px;
  color: #8a98ad;
}

.knowledge-base-search-field input {
  padding-left: 38px;
}

.knowledge-base-layout {
  display: grid;
  grid-template-columns: 220px minmax(520px, 1fr);
  gap: 18px;
  align-items: start;
}

.knowledge-base-filter-panel,
.knowledge-base-quick-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.knowledge-base-filter-panel h3,
.knowledge-base-quick-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.knowledge-base-filter-panel textarea,
.knowledge-base-quick-card textarea {
  min-height: 90px;
  resize: vertical;
}

.knowledge-base-apply-button,
.knowledge-base-quick-card .primary-button {
  width: 100%;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 12px;
  color: #fff;
  background: #16b957;
  font-weight: 900;
}

.knowledge-base-table-card {
  overflow: hidden;
}

.knowledge-base-table-toolbar,
.knowledge-base-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.knowledge-base-tabs {
  display: flex;
  gap: 18px;
}

.knowledge-base-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 0;
  background: transparent;
  color: #647084;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.knowledge-base-tabs button.is-active {
  border-color: #1d66f0;
  color: #1d66f0;
}

.knowledge-base-table-wrap {
  overflow-x: auto;
}

.knowledge-base-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.knowledge-base-table th,
.knowledge-base-table td {
  padding: 13px 14px;
  border-top: 1px solid #edf1f7;
  color: #172033;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.knowledge-base-table th {
  color: #647084;
  font-size: 11px;
  font-weight: 900;
}

.knowledge-base-title-cell {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.knowledge-base-title-cell .icon {
  width: 16px;
  height: 16px;
  color: #1d66f0;
  flex: 0 0 auto;
}

.knowledge-base-status-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.knowledge-base-status-pill.published { color: #047857; background: #dcfce7; }
.knowledge-base-status-pill.draft { color: #b45309; background: #fef3c7; }
.knowledge-base-status-pill.archived { color: #475569; background: #f1f5f9; }

.knowledge-base-quick-card {
  border-color: #c9f0d8;
  background: #f5fff9;
}

.knowledge-base-quick-card h3 span {
  color: #16a34a;
}

.knowledge-base-quick-card label small {
  justify-self: end;
  color: #647084;
  font-weight: 700;
}

.knowledge-article-modal {
  position: fixed;
  inset: var(--topbar-height) 0 0 var(--sidebar-collapsed-width, 84px);
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.34);
}

.knowledge-article-modal[hidden] {
  display: none;
}

.knowledge-article-modal-card {
  width: min(780px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 54px));
  max-height: calc(100dvh - var(--topbar-height) - 54px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .28);
}

.knowledge-article-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e5ebf5;
}

.knowledge-article-modal-header h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.knowledge-article-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  padding: 22px 24px 24px;
  overflow: auto;
}

.knowledge-article-form .full-field {
  grid-column: 1 / -1;
}

.knowledge-article-form label {
  display: grid;
  gap: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
}

.knowledge-article-form input,
.knowledge-article-form select,
.knowledge-article-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d2dceb;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.knowledge-article-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.knowledge-article-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 1380px) {
  .knowledge-base-layout {
    grid-template-columns: 230px minmax(460px, 1fr);
  }
}

@media (max-width: 1120px) {
  .knowledge-base-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-base-filter-panel,
  .knowledge-base-quick-card {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .knowledge-base-filter-panel h3,
  .knowledge-base-apply-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .knowledge-base-page-header,
  .knowledge-base-header-actions,
  .knowledge-base-table-toolbar,
  .knowledge-base-table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-base-metrics,
  .knowledge-base-searchbar,
  .knowledge-base-filter-panel,
  .knowledge-base-quick-card {
    grid-template-columns: 1fr;
  }

  .knowledge-article-modal {
    inset: var(--topbar-height) 0 0;
    padding: 14px;
  }

  .knowledge-article-modal-card {
    width: calc(100vw - 28px);
  }

  .knowledge-article-form {
    grid-template-columns: 1fr;
  }
}

.settings-detail-panel {
  margin-top: 0;
}

/* ===== Cadastro de Produtos (Configuracoes > Empresa) ===== */
.products-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.products-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.product-form {
  display: grid;
  gap: 14px;
  margin: 4px 20px 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted, #f8fafc);
}
.product-form-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}
.product-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.product-form-grid .product-field-full {
  grid-column: 1 / -1;
}
.product-form-grid input,
.product-form-grid textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.product-form-grid textarea {
  min-height: 72px;
  resize: vertical;
}
.product-form-grid .req-mark {
  color: #dc2626;
}
.product-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.products-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.products-table {
  width: 100%;
  /* 5 colunas desde 05/10 (entrou Part Number): o minimo subiu junto, senao a
     descricao ficaria espremida. O wrap tem overflow-x, entao em tela estreita
     a tabela rola em vez de amassar. */
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.products-table th,
.products-table td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
/* Uma linha por produto: nome, part number e descricao truncam em previa
   (texto completo no title/hover; conteudo integral ao Editar).

   ATENCAO ao mexer: a tabela e `table-layout: fixed` e as larguras vem por
   POSICAO. Quando o Part Number entrou como 2a coluna (05/10), os indices
   antigos passaram a apontar para a coluna errada — Descricao herdaria os
   120px do Valor. E a mesma armadilha da grade de Perfis de acesso, que tinha
   5 colunas no CSS quando o JS passou a emitir 6.
   Ordem atual: 1 Nome · 2 Part Number · 3 Descricao (flexivel) · 4 Valor ·
   5 Acoes. */
.products-table th:nth-child(1), .products-table td:nth-child(1) { width: 26%; }
.products-table th:nth-child(2), .products-table td:nth-child(2) { width: 140px; }
.products-table th:nth-child(4), .products-table td:nth-child(4) { width: 120px; }
.products-table th:nth-child(5), .products-table td:nth-child(5) { width: 150px; }
.products-cell-name,
.products-cell-pn,
.products-cell-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.products-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.products-table .products-empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 22px;
}
.products-row-actions {
  display: flex;
  gap: 12px;
  white-space: nowrap;
}
.products-row-actions .products-delete {
  color: #dc2626;
}

/* ===== Fornecedores (Config > Empresa) — tela NOVA, 05/10/2026 ==========
   Nasce no GUIA_DE_PADROES.md (formulario 2.5, tabela 2.3, card 2.6, botoes
   3.3). Classes proprias suppliers-*: nada aqui vaza para Produtos, que e o
   vizinho mais parecido e usa outra geracao de estilo. */
.suppliers-screen {
  display: grid;
  gap: 16px;
}
.suppliers-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.suppliers-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #1B2536;
}
.suppliers-head p {
  margin: 4px 0 0;
  max-width: 62ch;
  font-size: 13px;
  line-height: 1.5;
  color: #5A6472;
}
.suppliers-form {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid #E7EAF0;
  border-radius: 12px;
  background: #F8FAFC;
}
.suppliers-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.suppliers-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  color: #5A6472;
}
.suppliers-field-full {
  grid-column: 1 / -1;
}
/* O texto do rotulo vai num span proprio: com o <label> em grid, texto solto,
   asterisco e campo virariam TRES linhas — o "*" caia sozinho embaixo do
   "Nome" (pego na captura de tela; o cadastro de Produtos tem o mesmo defeito). */
.suppliers-label {
  display: block;
}
/* Os :not() repetidos sao de proposito: o reset global de input pesa (0,2,1)
   e, sem eles, o campo fica em 44px (armadilha do Lote 6 do guia). */
.suppliers-field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #E7EAF0;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #1B2536;
}
.suppliers-field input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.suppliers-field input.is-invalid {
  border-color: #DC2626;
}
.suppliers-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
/* Status vazio nao ocupa lugar: abria um vao entre o formulario e a tabela. */
.suppliers-screen > .form-status:empty {
  display: none;
}
.suppliers-table-wrap {
  border: 1px solid #E7EAF0;
  border-radius: 12px;
  background: #fff;
  overflow-x: auto;
}
/* Larguras por POSICAO com table-layout fixed — se entrar ou sair coluna,
   remapear (foi a armadilha do Part Number em Produtos, no mesmo dia).
   Ordem: 1 Nome · 2 CNPJ · 3 Contato · 4 Telefone · 5 E-mail · 6 Acoes. */
.suppliers-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.suppliers-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
  background: #F7F8FA;
  border-bottom: 1px solid #EEF1F5;
  white-space: nowrap;
}
.suppliers-table td {
  padding: 11px 12px;
  font-size: 13px;
  color: #1B2536;
  border-bottom: 1px solid #F1F4F8;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suppliers-table tbody tr:last-child td {
  border-bottom: 0;
}
.suppliers-table tbody tr:hover {
  background: #FAFBFC;
}
/* CNPJ formatado tem 18 caracteres: 150px cortava o final (captura de tela). */
.suppliers-table th:nth-child(2), .suppliers-table td:nth-child(2) { width: 168px; }
.suppliers-table th:nth-child(3), .suppliers-table td:nth-child(3) { width: 150px; }
.suppliers-table th:nth-child(4), .suppliers-table td:nth-child(4) { width: 140px; }
.suppliers-table th:nth-child(6), .suppliers-table td:nth-child(6) { width: 140px; }
.suppliers-table td.suppliers-name {
  font-weight: 600;
}
.suppliers-table td.suppliers-empty {
  padding: 20px 12px;
  text-align: center;
  color: #8A93A3;
  white-space: normal;
}
/* A celula de acoes NAO vira flex (desalinharia a divisoria da linha — Lote 4
   do guia): o flex fica no span de dentro. */
.suppliers-actions {
  display: inline-flex;
  gap: 12px;
}
.suppliers-actions .ghost-link {
  min-height: 32px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}
.suppliers-actions .suppliers-delete {
  color: #DC2626;
}
@media (max-width: 640px) {
  .suppliers-head { flex-direction: column; }
  .suppliers-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .product-form-grid { grid-template-columns: 1fr; }
}

.settings-detail-modal-open {
  overflow: hidden;
}

.settings-detail-modal {
  top: var(--topbar-height);
  bottom: 0;
  left: var(--sidebar-collapsed-width, 84px);
  right: 0;
  inset: var(--topbar-height) 0 0 var(--sidebar-collapsed-width, 84px);
  width: calc(100vw - var(--sidebar-collapsed-width, 84px));
  z-index: 1200;
  align-items: start;
  justify-items: center;
  place-items: start center;
  padding: 16px 24px 24px;
}

.settings-detail-modal-card {
  width: min(1120px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 42px));
  max-height: calc(100dvh - var(--topbar-height) - 46px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.settings-detail-modal-card:has(#settings-detail-api-openai) {
  width: min(720px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 42px));
  border-top: 3px solid #8e3bb8;
}

.settings-detail-modal.is-process-template-modal {
  align-items: center;
  justify-items: center;
  place-items: center;
  left: var(--sidebar-collapsed-width, 84px);
  width: calc(100vw - var(--sidebar-collapsed-width, 84px));
  padding: 22px 26px 22px 18px;
}

.settings-detail-modal.is-process-template-modal .settings-detail-modal-card {
  position: relative;
  width: min(1380px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 44px));
  min-width: min(760px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 44px));
  max-width: calc(100vw - var(--sidebar-collapsed-width, 84px) - 44px);
  max-height: calc(100dvh - var(--topbar-height) - 56px);
  resize: horizontal;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}

.settings-detail-modal.is-process-template-modal .settings-detail-modal-card::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 42%, #94a3b8 42% 50%, transparent 50% 100%),
    linear-gradient(135deg, transparent 0 62%, #cbd5e1 62% 70%, transparent 70% 100%);
  opacity: .75;
}

@media (max-width: 920px) {
  .settings-detail-modal {
    inset: var(--topbar-height) 0 0;
    left: 0;
    width: 100vw;
    padding: 14px;
  }

  .settings-detail-modal-card,
  .settings-detail-modal-card:has(#settings-detail-company-knowledge),
  .settings-detail-modal-card:has(#settings-detail-api-openai) {
    width: calc(100vw - 28px);
  }

  .settings-detail-modal.is-process-template-modal {
    left: 0;
    width: 100vw;
    padding: 14px;
  }

  .settings-detail-modal.is-process-template-modal .settings-detail-modal-card {
    width: calc(100vw - 28px);
    min-width: 0;
    resize: none;
  }

  .settings-detail-modal.is-process-template-modal .settings-detail-modal-card::after {
    display: none;
  }
}

.settings-detail-modal-body {
  min-height: 220px;
  overflow: auto;
  padding: 24px;
  background: #f8fafc;
}

.settings-detail-modal-body:has(#settings-detail-api-openai) {
  padding: 0;
  background: #fff;
}

.settings-detail-modal-body .settings-detail-panel {
  display: grid;
  gap: 18px;
}

.settings-detail-modal-body .settings-detail-panel > .card,
.settings-detail-modal-body .settings-detail-panel > .settings-top-grid,
.settings-detail-modal-body .settings-detail-panel > .settings-bottom-grid,
.settings-detail-modal-body .settings-detail-panel > .user-summary-grid,
.settings-detail-modal-body .settings-detail-panel > .users-table-card,
.settings-detail-modal-body .settings-detail-panel > .utility-grid,
.settings-detail-modal-body .settings-detail-panel > .permissions-card,
.settings-detail-modal-body .settings-detail-panel > .channels-automation-grid,
.settings-detail-modal-body .settings-detail-panel > .whatsapp-integration-card,
.settings-detail-modal-body .settings-detail-panel > .whatsapp-flow-card {
  margin-bottom: 0;
}

.openai-assistant-config-card {
  display: grid;
  gap: 10px;
  padding: 22px 20px 0;
  background: #fff;
}

.openai-assistant-config-card p {
  margin: 0 0 28px;
  color: #111827;
  font-size: 14px;
}

.openai-assistant-config-card label {
  display: grid;
  gap: 6px;
}

.openai-assistant-config-card label > span {
  color: #c5cbd6;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.openai-assistant-config-card input[type="text"],
.openai-assistant-config-card input[type="password"] {
  width: 100%;
  height: 32px;
  border: 1px solid #edf0f4;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font: inherit;
}

.openai-assistant-toggle {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 7px !important;
}

.openai-assistant-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #22c55e;
}

.openai-assistant-toggle span {
  color: #53617a !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.openai-assistant-actions {
  display: flex;
  gap: 4px;
  margin: 34px -20px 0;
  padding: 16px 14px 14px;
  border-top: 1px solid #edf0f4;
  background: #fff;
}

.openai-cancel-button,
.openai-test-button,
.openai-save-button {
  min-height: 30px;
  padding: 0 16px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.openai-cancel-button {
  background: #222;
}

.openai-test-button {
  background: #2563eb;
}

.openai-save-button {
  background: #22c55e;
}

.openai-cancel-button:disabled,
.openai-test-button:disabled,
.openai-save-button:disabled {
  opacity: .65;
  cursor: wait;
}

.openai-assistant-status {
  min-height: 20px;
  margin: 4px 0 -16px;
  color: #92400e;
  font-size: 13px;
}

.openai-assistant-status[data-state="success"] {
  color: #15803d;
}

.openai-assistant-status[data-state="error"] {
  color: #b91c1c;
}

.settings-detail-panel > .card,
.settings-detail-panel > .settings-top-grid,
.settings-detail-panel > .settings-bottom-grid,
.settings-detail-panel > .user-summary-grid,
.settings-detail-panel > .users-table-card,
.settings-detail-panel > .utility-grid,
.settings-detail-panel > .permissions-card,
.settings-detail-panel > .channels-automation-grid,
.settings-detail-panel > .whatsapp-integration-card,
.settings-detail-panel > .whatsapp-flow-card {
  margin-bottom: 18px;
}

.company-params-card,
.departments-card {
  padding: 24px;
}

.company-params-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 0;
}

.company-params-list div,
.department-grid article {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.company-params-list dt {
  margin-bottom: 6px;
  color: #647084;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.company-params-list dd {
  margin: 0;
  color: #172033;
  font-weight: 800;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.department-grid strong,
.department-grid small {
  display: block;
}

.department-grid small {
  margin-top: 6px;
  color: #647084;
  line-height: 1.45;
}

.process-template-builder {
  display: grid;
  gap: 28px;
}

.process-template-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0 14px;
}

.process-template-toolbar .secondary-button,
.process-template-toolbar .primary-button {
  min-height: 58px;
  padding: 0 28px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.process-template-toolbar .primary-button {
  min-width: 240px;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .22);
}

.process-template-toolbar .secondary-button {
  color: #1d4ed8;
  background: #fff;
}

.process-template-toolbar .process-template-reorder-button {
  color: #172033;
}

.process-template-grip-icon {
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: radial-gradient(circle at 4px 4px, #000 0 2px, transparent 2.5px) 0 0 / 10px 10px;
  mask: radial-gradient(circle at 4px 4px, #000 0 2px, transparent 2.5px) 0 0 / 10px 10px;
}

.process-template-save-icon {
  position: relative;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.process-template-save-icon::before {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 10px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

.process-template-save-icon::after {
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  content: "";
}

.process-template-stage-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.process-template-stage {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  min-height: 90px;
  padding: 16px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.process-template-stage:hover {
  border-color: #bfdbfe;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .07);
}

.process-template-stage-remove {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  cursor: pointer;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.process-template-stage-remove:hover,
.process-template-stage-remove:focus-visible {
  border-color: #fca5a5;
  background: #fecaca;
}

.process-template-stage label {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.process-template-stage label small,
.process-template-stage-description small {
  color: #647084;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.process-template-stage input,
.process-template-stage-description input,
.process-template-column li input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.process-template-stage input {
  min-height: 42px;
  padding: 7px 10px;
  border-color: #dbe3ef;
  background: #fff;
  color: #172033;
  font-size: 16px;
}

.process-template-stage input:hover,
.process-template-stage input:focus,
.process-template-stage-description input:hover,
.process-template-stage-description input:focus,
.process-template-column li input:hover,
.process-template-column li input:focus {
  border-color: #bfdbfe;
  background: #fff;
  color: #172033;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.process-template-stage.is-start span {
  background: #16a34a;
}

.process-template-stage.is-active {
  border-color: #2563eb;
  background: #f8fbff;
  color: #172033;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .14);
}

.process-template-stage span,
.process-template-column header span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #64748b;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
}

.process-template-stage.is-active span {
  background: #2563eb;
}

@media (max-width: 760px) {
  .process-template-toolbar {
    justify-content: stretch;
  }

  .process-template-toolbar .secondary-button,
  .process-template-toolbar .primary-button {
    flex: 1 1 100%;
    width: 100%;
  }

  .process-template-stage-flow {
    grid-template-columns: 1fr;
  }
}

.process-template-requirements-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.process-template-requirements-card > .card-header {
  padding: 18px 20px;
  border-bottom: 1px solid #e6edf5;
}

.process-template-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(360px, 1fr);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.process-template-column {
  min-width: 360px;
  min-height: 420px;
  padding: 18px 16px;
  border-right: 1px solid #e6edf5;
}

.process-template-column header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.process-template-column header b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #0f6bea;
  font-size: 12px;
}

.process-template-stage-description {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.process-template-stage-description input {
  min-height: 38px;
  padding: 0 10px;
  border-color: #dbe3ef;
  background: #f8fafc;
  color: #172033;
  font-weight: 700;
}

.process-template-column p {
  margin: 20px 0 16px;
  color: #647084;
  font-size: 13px;
  line-height: 1.45;
}

.process-template-column ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-template-column li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.process-template-column li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #22c55e;
  border-radius: 50%;
  color: #16a34a;
  font-size: 12px;
  grid-column: 1;
  grid-row: 1;
}

.process-template-column li input {
  padding-left: 28px;
  grid-column: 1;
  grid-row: 1;
  min-height: 34px;
  font-size: 13px;
}

.process-template-column li .process-template-required-toggle {
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: #e7f8ee;
  color: #16934f;
  font-weight: 800;
  cursor: pointer;
}

.process-template-column li.is-optional .process-template-required-toggle {
  background: #eef2f7;
  color: #64748b;
}

.process-template-column li .process-template-required-toggle:hover,
.process-template-column li .process-template-required-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.process-template-column li button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #cfe0f6;
  border-radius: 7px;
  background: #fff;
  color: #2563eb;
  font-weight: 800;
  cursor: pointer;
}

.process-template-column li .process-template-remove-requirement {
  border-color: #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.process-template-column footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.process-template-column footer button {
  min-height: 30px;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #fff;
  color: #2563eb;
  font-weight: 800;
  cursor: pointer;
}

.process-template-column footer .process-template-remove-stage-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.smtp-card,
.pop-card,
.webhook-card,
.integrations-card,
.general-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
}

/* ===== Contas de e-mail (multiplas contas + finalidades) ===== */
/* 2 colunas ocupando a largura util do modal (Contas | Envios). */
.email-accounts-view {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  align-items: start;
}
.email-accounts-card, .email-purposes-card { display: flex; flex-direction: column; padding: 18px; min-width: 0; }
.email-accounts-head, .email-purposes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.email-accounts-head h2, .email-purposes-head h2 { margin: 0 0 4px; }
.email-accounts-cards { display: flex; flex-direction: column; gap: 12px; }
.email-accounts-empty { color: var(--muted, #64748b); font-size: 14px; margin: 4px 0; }

.email-acc-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas: "avatar main" "avatar actions";
  gap: 6px 10px;
  align-items: start;
  border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 12px 14px;
  background: var(--panel, #fff);
}
.email-acc-avatar {
  grid-area: avatar; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-muted, #eef2f8); color: var(--text, #0f172a);
  font-weight: 700; font-size: 12px;
}
.email-acc-main { grid-area: main; min-width: 0; }
.email-acc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.email-acc-title strong { font-size: 13.5px; color: var(--text, #0f172a); }
.email-acc-sub { color: var(--muted, #64748b); font-size: 11px; margin-top: 2px; }
.email-acc-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-muted, #f1f5f9); color: var(--muted, #64748b);
}
.email-acc-badge.is-ok { background: #dcfce7; color: #15803d; }
.email-acc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.email-acc-chips:empty::after {
  content: "Nenhuma finalidade mapeada ainda.";
  font-size: 11px; color: var(--muted, #94a3b8);
}
.email-acc-chip {
  font-size: 9.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-muted, #eef2f7); color: #334155;
}
.email-acc-chip.is-amber { background: #fef3c7; color: #92400e; font-weight: 600; }
.email-acc-actions { grid-area: actions; display: flex; gap: 8px; margin-top: 6px; }
.email-acc-actions .secondary-button { padding: 5px 14px; font-size: 12.5px; }

.email-purposes-table { display: flex; flex-direction: column; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; overflow: hidden; }
.email-purpose-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--line, #eef2f7);
}
.email-purpose-row:last-child { border-bottom: none; }
/* Auto resposta sem destaque de fundo: fica branca como as demais linhas. */
.email-purpose-row.is-amber { background: transparent; }
.email-purpose-label { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.email-purpose-ico { font-size: 14px; line-height: 1.4; flex: 0 0 auto; }
.email-purpose-label strong { font-size: 12px; color: var(--text, #0f172a); }
.email-purpose-label small { display: block; color: var(--muted, #64748b); font-size: 11px; margin-top: 1px; }
.email-purpose-select { flex: 0 0 auto; }
.email-purpose-select select {
  min-height: 34px; min-width: 170px; padding: 0 10px;
  border: 1px solid var(--line, #e2e8f0); border-radius: 9px;
  background: var(--panel, #fff); color: var(--text, #1f2937); font-size: 12.5px;
}
.email-purpose-select select:disabled { background: var(--surface-muted, #f1f5f9); color: var(--muted, #64748b); }
.email-purposes-note { color: var(--muted, #64748b); font-size: 11.5px; margin: 10px 0 0; }
.email-accounts-head h2, .email-purposes-head h2 { font-size: 16px; }
/* Aviso temporario: reserva espaco estavel (nao empurra os botoes). */
#emailAccountsStatus:empty { display: none; }
#emailAccountsStatus { margin: 10px 0 4px; }

/* ===== Modal de conta de e-mail (3 faixas: cabecalho/corpo/rodape) ===== */
.email-account-card {
  max-width: 520px; width: 100%; padding: 0; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100dvh - 72px);
}
/* Cabecalho */
.email-account-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--line, #e2e8f0); margin: 0;
}
.email-account-header-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #E6F1FB; color: #185FA5; font-size: 19px; line-height: 1;
}
.email-account-header-text { flex: 1 1 auto; min-width: 0; }
.email-account-header-text .eyebrow { font-size: 11px; letter-spacing: .05em; }
.email-account-header-text h2 { font-size: 17px; font-weight: 500; margin: 2px 0 0; }

/* Corpo (rolagem interna) */
.email-account-body {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 24px; overflow-y: auto; flex: 1 1 auto;
}
.email-account-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.email-account-field input {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px; background: var(--panel, #fff); color: var(--text, #1f2937); font-weight: 500; font-size: 14px;
}
.email-account-name { margin: 0; }

/* Card de secao (Envio / Recebimento) */
.email-account-fieldset {
  border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.email-account-fieldset-title {
  display: flex; align-items: center; gap: 7px; margin: 0;
  font-size: 13px; font-weight: 600; color: var(--text, #0f172a);
}
.ea-ico { font-size: 14px; line-height: 1; }
.ea-ico-send { color: #185FA5; }
.ea-ico-recv { color: #854F0B; }
.email-account-grid { display: grid; gap: 10px; }
.ea-grid-2-1 { grid-template-columns: 2fr 1fr; }
.ea-grid-1-1 { grid-template-columns: 1fr 1fr; }

/* Toggle interno (SSL / recebimento automatico): plano, com borda superior */
.email-account-fieldset .toggle-panel {
  background: transparent; border: none; border-top: 1px solid var(--line, #eef2f7);
  border-radius: 0; padding: 10px 0 0; margin: 0;
}
.email-account-fieldset .toggle-panel strong { font-size: 13px; }
.email-account-fieldset .toggle-panel small { font-size: 11px; }

/* Linha do campo + botao de teste */
.email-account-test-row {
  display: flex; align-items: flex-end; gap: 10px;
  border-top: 1px solid var(--line, #eef2f7); padding-top: 10px;
}
.email-account-test-row .ea-flex { flex: 1 1 auto; min-width: 0; }
.email-account-test-row .secondary-button { flex: 0 0 auto; min-height: 40px; white-space: nowrap; padding: 0 16px; }
.email-account-test-row-pop { justify-content: flex-end; }

/* Secao POP */
.email-account-pop-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.email-account-pop-headtext { flex: 1 1 auto; min-width: 0; }
.email-account-pop-headtext small { display: block; font-size: 11px; color: var(--muted, #64748b); margin-top: 3px; }
.email-account-pop-hint {
  text-align: center; font-size: 11px; color: var(--muted, #94a3b8); margin: 0;
  border-top: 1px dashed var(--line, #e2e8f0); padding-top: 10px;
}
.email-account-pop-fields {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px dashed var(--line, #e2e8f0); padding-top: 10px;
}

/* Rodape */
.email-account-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 24px; border-top: 1px solid var(--line, #e2e8f0);
  background: var(--surface-muted, #f8fafc);
}

/* Abaixo de ~1040px de janela (modal < ~900px): empilha as 2 colunas. */
@media (max-width: 1040px) {
  .email-accounts-view { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .email-purpose-row { flex-direction: column; align-items: stretch; }
  .email-purpose-select select { width: 100%; }
}
@media (max-width: 560px) {
  .email-account-grid { grid-template-columns: 1fr; }
  .email-account-test-row { flex-direction: column; align-items: stretch; }
}

.smtp-card h2,
.pop-card h2,
.webhook-card h2,
.integrations-card h2,
.general-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.smtp-test-recipient {
  grid-column: 1 / -1;
}

.smtp-card .toggle-panel,
.pop-card .toggle-panel {
  margin-top: auto;
}

.smtp-card .form-actions,
.pop-card .form-actions {
  margin-top: 20px;
}

.smtp-provider-hint {
  margin: 14px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.smtp-provider-hint strong {
  color: #0f4fb8;
}

.email-channel-settings {
  display: block;
}

.email-settings-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.email-settings-tabs button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.email-settings-tabs button.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-soft);
}

.email-settings-panel[data-email-settings-panel="technical"].is-active {
  /* Antes era grid 2-col (SMTP+POP). Agora BLOCK: a grade de 2 colunas vive na
     propria .email-accounts-view, que assim ocupa a largura cheia do modal. */
  display: block;
}

.email-settings-panel[hidden] {
  display: none !important;
}

/* As tres abas de e-mail compartilham a MESMA regra de propósito. O cartao de
   Conclusao ficou de fora quando foi criado e o conteudo encostava nas bordas.
   E a terceira vez que isso acontece nesta tela (SLA e Filtro de remetentes
   tiveram o mesmo problema): quando nascer uma aba nova, acrescentar a classe
   AQUI em vez de escrever outra regra. */
.email-auto-response-card,
.email-sender-filter-card,
.email-closing-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
}

.email-auto-response-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.email-auto-response-header > div {
  min-width: 0;
}

.email-auto-response-card h2,
.email-sender-filter-card h2,
.email-closing-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
}

.email-auto-response-delay {
  display: grid;
  flex: 0 0 280px;
  gap: 10px;
  margin-left: auto;
  color: #101418;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.email-auto-response-delay input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #f0f2f5;
  color: #111;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.email-auto-response-form {
  grid-template-columns: 1fr;
}

.email-auto-response-form textarea {
  min-height: 260px;
  resize: vertical;
}

/* Editor do E-mail de Conclusao (texto/link/imagem) */
.email-closing-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}
.email-closing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.email-closing-tool {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  color: #334155;
}
.email-closing-tool:hover { background: #e2e8f0; }
.email-closing-editor {
  min-height: 180px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  background: #fff;
  overflow: auto;
}
.email-closing-editor:focus { outline: none; border-color: #2563eb; }
.email-closing-editor:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
}
.email-closing-editor img { max-width: 100%; height: auto; }
.email-closing-editor a { color: #2563eb; }
.email-closing-test {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.email-closing-test input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 14px;
}
.email-closing-test input:focus { outline: none; border-color: #2563eb; }
.email-closing-test button { flex: 0 0 auto; white-space: nowrap; }

/* Botoes de bloco na barra de ferramentas */
.email-closing-tool-stars {
  background: #fdf8ec;
  border-color: #f1b32b;
  color: #8a5a0b;
}
.email-closing-tool-stars:hover { background: #fbeecb; }
.email-closing-tool-google {
  background: #eef4fb;
  border-color: #7fa3cc;
  color: #16437e;
}
.email-closing-tool-google:hover { background: #dfeaf7; }

/* Chips dos blocos dentro do editor */
.cf-block-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 2px 8px;
  margin: 0 2px;
  font-size: 12px;
  font-weight: 700;
  border: 1px dashed;
  user-select: none;
  vertical-align: middle;
  white-space: nowrap;
}
.cf-chip-stars { background: #fdf8ec; border-color: #f1b32b; color: #8a5a0b; }
.cf-chip-google { background: #eef4fb; border-color: #7fa3cc; color: #16437e; }
.cf-block-chip .cf-chip-x,
.cf-block-chip .cf-chip-edit {
  cursor: pointer;
  font-weight: 400;
  opacity: 0.65;
  font-size: 12px;
}
.cf-block-chip .cf-chip-x:hover,
.cf-block-chip .cf-chip-edit:hover { opacity: 1; }

/* Toggle e campos de avaliacao */
.email-closing-rating-toggle { margin-top: 14px; }
.email-closing-rating-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.email-closing-rating-fields .full-field { flex: 1 1 260px; }
.email-closing-expiry-field {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}
.email-closing-expiry-field input {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 14px;
}

/* Mini-modais (link do Google e previa) */
.email-block-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1200;
}
.email-block-modal[hidden] { display: none; }
.email-block-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
}
.email-block-modal-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: #0f172a; }
.email-block-modal-sub { margin: 0 0 10px; font-size: 12px; color: #64748b; }
.email-block-modal-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 12px;
}
.email-block-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.email-closing-preview-box { max-width: 560px; }
.email-closing-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.email-closing-preview-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
}
.email-closing-preview-render {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  max-height: 60vh;
  overflow: auto;
  background: #fff;
}
.email-closing-preview-render img { max-width: 100%; height: auto; }

/* Avaliacao do cliente no detalhe do chamado */
.sr-prop-rating .sr-rating-stars {
  color: #f1b32b;
  font-size: 15px;
  letter-spacing: 1px;
}
.sr-prop-rating .sr-rating-comment {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

/* Resumo de CSAT na Central de Atendimento */
.csat-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin: 0 0 12px;
  background: #fdf8ec;
  border: 1px solid #f1e2bf;
  border-radius: 10px;
  font-size: 13px;
  color: #6b4e12;
}
.csat-summary[hidden] { display: none; }
.csat-summary-main { display: flex; align-items: baseline; gap: 8px; }
.csat-summary-score { font-size: 20px; font-weight: 700; color: #8a5a0b; }
.csat-summary-stars { color: #f1b32b; font-size: 15px; letter-spacing: 1px; }
.csat-summary-count { color: #94823f; }
.csat-summary-agents { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.csat-summary-agent { white-space: nowrap; }
.csat-summary-agent b { color: #8a5a0b; }

@media (max-width: 900px) {
  .email-auto-response-header {
    flex-direction: column;
  }

  .email-auto-response-delay {
    flex: 1 1 auto;
    width: 100%;
    margin-left: 0;
  }
}

.whatsapp-channel-settings {
  display: block;
  width: 100%;
}

.whatsapp-settings-tabs {
  margin-bottom: 20px;
}

.whatsapp-settings-panel {
  width: 100%;
}

.whatsapp-settings-panel.is-active {
  display: block;
}

.whatsapp-settings-panel[hidden] {
  display: none !important;
}

.whatsapp-settings-panel > .card,
.whatsapp-settings-panel > .integrations-card {
  width: 100%;
}

.settings-form label,
.general-grid label {
  display: grid;
  gap: 10px;
  color: #101418;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.settings-form input,
.general-grid select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #f0f2f5;
  color: #111;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.toggle-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 40px 0 26px;
  padding: 20px;
  border-radius: 4px;
  background: var(--panel-soft);
}

.toggle-panel strong,
.toggle-panel small {
  display: block;
}

.toggle-panel strong {
  font-size: 18px;
}

.toggle-panel small {
  margin-top: 4px;
  color: #343b47;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c7ccd5;
}

.switch span::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.switch input:checked + span {
  background: var(--blue);
}

.settings-aside {
  display: grid;
  gap: 24px;
}

.health-panel {
  min-height: 230px;
  padding: 28px;
  border-radius: 6px;
  background: var(--dark);
  color: #fff;
}

.health-panel h2 {
  margin: 14px 0 12px;
}

.health-panel p {
  color: #aeb9cb;
}

.health-panel div {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.health-panel span:not(.icon) {
  padding: 8px 12px;
  border: 1px solid #254d8d;
  border-radius: 3px;
  background: #17346a;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

.update-card {
  padding: 26px;
}

.update-card div {
  display: flex;
  gap: 18px;
  margin-top: 24px;
  padding: 20px;
  border-left: 4px solid var(--blue);
  background: var(--panel-soft);
}

.update-card p {
  margin: 0;
}

.update-card p strong {
  display: block;
  margin-bottom: 6px;
}

.webhook-card {
  margin-bottom: 24px;
}

.settings-bottom-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.6fr);
  gap: 24px;
}

.integration-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 16px;
}

.whatsapp-integration-card {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
  padding: 24px;
}

.whatsapp-connection-card {
  margin-bottom: 18px;
}

.whatsapp-flow-card {
  margin-bottom: 24px;
  padding: 24px;
}

.integration-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.integration-card-header h2 {
  margin-bottom: 8px;
}

.integration-card-header p,
.integration-helper-text {
  margin: 0;
  color: #64748b;
}

.whatsapp-connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #166534;
  background: #f0fdf4;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.whatsapp-connection-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
}

.whatsapp-connection-status.is-disconnected {
  border-color: #fed7aa;
  color: #b45309;
  background: #fff7ed;
}

.whatsapp-connection-status.is-disconnected i {
  background: #f59e0b;
}

.whatsapp-integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* WhatsApp Oficial (Cloud API) */
.whatsapp-cloud-form {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.whatsapp-cloud-field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--text, #334155);
  font-size: 13px;
}

.whatsapp-cloud-field input,
.whatsapp-cloud-field select {
  width: 100%;
}

.whatsapp-cloud-secret,
.whatsapp-cloud-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.whatsapp-cloud-secret input,
.whatsapp-cloud-inline input {
  flex: 1;
  min-width: 0;
}

.whatsapp-cloud-reveal {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-soft, #f8fafc);
  color: var(--text, #334155);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.whatsapp-cloud-reveal:hover { background: #eef2f9; }

.whatsapp-cloud-hint {
  font-weight: 500;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.whatsapp-cloud-help {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: var(--surface-soft, #f8fafc);
  color: var(--text, #475569);
  font-size: 12.5px;
  line-height: 1.55;
}

.whatsapp-cloud-help ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.channels-automation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.channels-automation-grid > .card {
  margin: 0;
  min-width: 0;
  height: 100%;
}

.openai-assistant-channel-card {
  padding: 0;
}

.openai-assistant-channel-card .whatsapp-assistant-card {
  display: grid;
  gap: 18px;
  height: 100%;
  padding: 30px;
  border-radius: inherit;
}

.openai-assistant-channel-card .integration-card-header {
  margin-bottom: 4px;
}

.openai-assistant-channel-card .integration-card-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.openai-assistant-channel-card .integration-card-header p {
  margin: 0;
  color: #64748b;
}

.openai-assistant-channel-card .openai-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #155bc7;
  font-size: 13px;
}

.openai-assistant-channel-card .whatsapp-assistant-actions {
  margin: auto -30px -30px;
  padding: 16px 30px;
}

.openai-assistant-relocated-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.openai-assistant-relocated-card p {
  margin: 0;
  color: #64748b;
}

.danger-outline-button {
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  background: #fff;
  font-weight: 800;
}

.danger-outline-button:hover {
  border-color: #ef4444;
  background: #fef2f2;
}

.danger-outline-button:disabled {
  cursor: progress;
  opacity: .65;
}

.whatsapp-qr-placeholder {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

.whatsapp-qr-placeholder[hidden] {
  display: none;
}

.whatsapp-qr-frame {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border-radius: 12px;
  color: #0f4fb8;
  background: #eaf2ff;
  font-weight: 900;
  overflow: hidden;
}

.whatsapp-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.whatsapp-qr-placeholder p {
  margin: 0;
  color: #475569;
}

.channels-automation-grid {
  gap: 18px;
}

.whatsapp-connection-card,
.openai-assistant-channel-card,
.instagram-integration-card {
  overflow: hidden;
  min-height: 390px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    #fff;
  box-shadow: 0 20px 58px rgba(15, 23, 42, 0.08);
}

.whatsapp-integration-card.whatsapp-connection-card {
  gap: 0;
  padding: 20px;
}

.whatsapp-connection-card .integration-card-header,
.openai-assistant-channel-card .integration-card-header {
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.integration-card-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.settings-card-icon.instagram {
  background:
    radial-gradient(circle at 72% 25%, #fef3c7 0 7px, transparent 8px),
    linear-gradient(135deg, #f97316 0%, #db2777 48%, #7c3aed 100%);
}

.instagram-brand-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 9px;
  color: #ffffff;
}

.instagram-brand-icon::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.instagram-brand-icon::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.instagram-brand-icon.large {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #db2777;
  background: #fdf2f8;
}

.instagram-brand-icon.large::before {
  width: 13px;
  height: 13px;
}

.instagram-integration-form {
  display: grid;
  gap: 18px;
}

.instagram-integration-card .integration-card-header {
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.instagram-integration-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 8px 14px;
  border: 1px solid #e9d5ff;
  border-radius: 999px;
  color: #7c3aed;
  background: #faf5ff;
  font-size: 13px;
  font-weight: 800;
}

.instagram-integration-status i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a855f7;
}

.instagram-integration-status.is-enabled {
  border-color: #bbf7d0;
  color: #15803d;
  background: #f0fdf4;
}

.instagram-integration-status.is-enabled i {
  background: #22c55e;
}

.instagram-integration-notice {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  background: #faf5ff;
  color: #581c87;
}

.instagram-integration-notice small {
  color: #6b21a8;
  line-height: 1.4;
}

.instagram-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.instagram-settings-grid label {
  display: grid;
  gap: 8px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
}

.instagram-settings-grid input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
}

.instagram-settings-grid .full-field,
.instagram-integration-actions {
  grid-column: 1 / -1;
}

.instagram-integration-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.instagram-integration-actions .form-status {
  margin: 0;
}

.instagram-integration-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.instagram-integration-action-buttons .secondary-button,
.instagram-integration-action-buttons .primary-button {
  min-height: 52px;
  padding-inline: 22px;
}

.integration-card-title h2 {
  margin: 1px 0 8px;
  color: #0f172a;
  font-size: clamp(22px, 1.7vw, 30px);
  line-height: 1.12;
  letter-spacing: 0;
}

.integration-card-title p {
  max-width: 560px;
  color: #53617a;
  font-size: 15px;
  line-height: 1.45;
}

.whatsapp-brand-icon,
.openai-assistant-channel-card .openai-mark {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.whatsapp-brand-icon {
  position: relative;
  background: linear-gradient(180deg, #5bed65 0%, #11bc49 100%);
  box-shadow: inset 0 -10px 18px rgba(3, 132, 49, 0.16), 0 14px 28px rgba(34, 197, 94, 0.2);
}

.whatsapp-brand-icon::before {
  content: "\260e";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  transform: rotate(-18deg);
}

.whatsapp-brand-icon::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 11px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, transparent 0 48%, #fff 49% 100%);
  transform: rotate(-17deg);
}

.whatsapp-connection-card .whatsapp-connection-status {
  margin-top: 2px;
  padding: 7px 11px;
  border-color: #b9f0cf;
  background: #f3fbf6;
  color: #11803a;
  font-size: 12px;
}

.whatsapp-current-connection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #b7efcf;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.88));
  color: #0f172a;
}

.whatsapp-current-connection.is-disconnected {
  border-color: #fed7aa;
  background: linear-gradient(90deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.88));
}

.whatsapp-current-check {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #1db954;
  border-radius: 999px;
  color: #1db954;
}

.whatsapp-current-check::before {
  content: "\2713";
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.whatsapp-current-connection.is-disconnected .whatsapp-current-check {
  border-color: #f59e0b;
  color: #b45309;
}

.whatsapp-current-connection strong,
.whatsapp-current-connection small {
  display: block;
}

.whatsapp-current-connection strong {
  font-size: 15px;
  line-height: 1.25;
}

.whatsapp-current-connection small {
  margin-top: 4px;
  color: #53617a;
  font-size: 12px;
}

.whatsapp-current-link {
  width: 18px;
  height: 18px;
  border: 2px solid #22c55e;
  border-radius: 5px;
  opacity: .95;
}

.whatsapp-current-link::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: -5px 0 0 9px;
  border-top: 2px solid #22c55e;
  border-right: 2px solid #22c55e;
}

.whatsapp-current-link::after {
  content: "";
  display: block;
  width: 11px;
  height: 2px;
  margin: -3px 0 0 6px;
  background: #22c55e;
  transform: rotate(-45deg);
  transform-origin: center;
}

.whatsapp-integration-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.whatsapp-integration-actions .primary-button,
.whatsapp-integration-actions .secondary-button,
.whatsapp-integration-actions .danger-outline-button,
.openai-assistant-channel-card .openai-save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.whatsapp-integration-actions .primary-button {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.16);
}

.whatsapp-integration-actions .secondary-button {
  border-color: #d5dde9;
  background: #fff;
  color: #111827;
}

.whatsapp-integration-actions .danger-outline-button {
  grid-column: 1 / -1;
  margin-top: 2px;
  border-color: #fca5a5;
  background: #fff;
  color: #dc2626;
}

.button-visual-icon {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 15px;
  height: 15px;
}

.shield-button-icon {
  border: 2px solid currentColor;
  border-radius: 8px 8px 10px 10px;
  clip-path: polygon(50% 0, 95% 18%, 87% 74%, 50% 100%, 13% 74%, 5% 18%);
}

.shield-button-icon::before {
  content: "\2713";
  position: absolute;
  left: 4px;
  top: 0;
  font-size: 10px;
  font-weight: 900;
}

.qr-button-icon {
  background:
    linear-gradient(currentColor 0 0) 0 0 / 5px 5px,
    linear-gradient(currentColor 0 0) 10px 0 / 5px 5px,
    linear-gradient(currentColor 0 0) 0 10px / 5px 5px,
    linear-gradient(currentColor 0 0) 10px 10px / 5px 5px,
    linear-gradient(currentColor 0 0) 7px 7px / 3px 3px;
  background-repeat: no-repeat;
}

.logout-button-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 2px;
  width: 8px;
  height: 11px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.logout-button-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 5px;
  width: 9px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.whatsapp-connection-card .integration-helper-text {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.78);
  color: #53617a;
  font-size: 12px;
  line-height: 1.45;
}

.whatsapp-connection-card .integration-helper-text::before {
  content: "i";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  border: 2px solid #2563eb;
  border-radius: 999px;
  color: #2563eb;
  font-weight: 800;
}

.openai-assistant-channel-card .whatsapp-assistant-card {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 20px 20px 0;
}

.openai-assistant-channel-card .openai-mark {
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  color: #3658e8;
  font-size: 21px;
  font-weight: 900;
}

.openai-assistant-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.04);
}

.openai-feature-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, #edf2ff, #dfe7ff);
}

.openai-feature-icon::before {
  content: "\2726";
  color: #3658e8;
  font-size: 23px;
  font-weight: 900;
}

.openai-feature-icon::after {
  content: "\002b";
  position: absolute;
  right: 9px;
  bottom: 7px;
  color: #3658e8;
  font-size: 14px;
  font-weight: 900;
}

.openai-assistant-feature strong,
.openai-assistant-feature small {
  display: block;
}

.openai-assistant-feature strong {
  color: #172554;
  font-size: 16px;
  line-height: 1.25;
}

.openai-assistant-feature small {
  margin-top: 6px;
  color: #53617a;
  font-size: 13px;
  line-height: 1.45;
}

.openai-assistant-channel-card .openai-assistant-toggle {
  align-items: flex-start;
  gap: 12px !important;
  margin-top: 22px;
}

.openai-assistant-channel-card .openai-assistant-toggle input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 7px;
  accent-color: #22c55e;
}

.openai-assistant-channel-card .openai-assistant-toggle span {
  color: #172554 !important;
  font-size: 14px !important;
  line-height: 1.35;
}

.openai-assistant-channel-card .openai-assistant-toggle strong,
.openai-assistant-channel-card .openai-assistant-toggle small {
  display: block;
}

.openai-assistant-channel-card .openai-assistant-toggle strong {
  color: #172554;
  font-size: 14px;
}

.openai-assistant-channel-card .openai-assistant-toggle small {
  margin-top: 6px;
  color: #53617a;
  font-size: 12px;
  font-weight: 600;
}

.openai-assistant-channel-card .openai-assistant-status {
  min-height: 22px;
  margin: 10px 0 0;
}

.openai-assistant-channel-card .whatsapp-assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
  margin: 18px -20px 0;
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.78);
}

.openai-assistant-channel-card .openai-save-button {
  min-width: 108px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 14px 26px rgba(22, 163, 74, 0.18);
  font-size: 13px;
}

.openai-assistant-channel-card .openai-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #0b5ed7;
  font-size: 13px;
  font-weight: 800;
}

.openai-assistant-channel-card .openai-secondary-button:hover {
  background: #dbeafe;
}

.document-button-icon::before {
  content: "";
  position: absolute;
  inset: 2px 4px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.document-button-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.whatsapp-assistant-instructions-card {
  width: min(720px, calc(100vw - 32px));
  max-height: min(88dvh, 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.whatsapp-assistant-instructions-card .modal-header {
  padding: 20px 28px 18px;
}

.whatsapp-assistant-instructions-card .modal-header h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.12;
}

.whatsapp-assistant-instructions-card .modal-header p {
  max-width: 620px;
  line-height: 1.35;
}

.whatsapp-assistant-instructions-body {
  display: grid;
  gap: 14px;
  padding: 20px 28px 10px;
  overflow: auto;
}

.whatsapp-assistant-instructions-body label {
  display: grid;
  gap: 9px;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.whatsapp-assistant-instructions-hint {
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #8A93A3;
}

.whatsapp-assistant-instructions-hint em {
  color: #5A6472;
  font-style: italic;
}

.whatsapp-assistant-instructions-body textarea {
  width: 100%;
  min-height: 88px;
  max-height: 190px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
}

.whatsapp-assistant-instructions-body textarea:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, .12);
}

#whatsappAssistantInstructionsText {
  min-height: 260px;
  max-height: 360px;
}

.whatsapp-assistant-instructions-actions {
  padding: 14px 28px 18px;
  border-top: 1px solid #e5ebf5;
  background: #fff;
}

@media (max-height: 780px) {
  .whatsapp-assistant-instructions-card {
    max-height: calc(100dvh - 28px);
  }

  .whatsapp-assistant-instructions-card .modal-header {
    padding: 16px 24px 14px;
  }

  .whatsapp-assistant-instructions-body {
    gap: 12px;
    padding: 16px 24px 8px;
  }

  .whatsapp-assistant-instructions-body textarea {
    min-height: 72px;
    max-height: 140px;
  }

  #whatsappAssistantInstructionsText {
    min-height: 200px;
    max-height: 260px;
  }

  .whatsapp-assistant-instructions-actions {
    padding: 12px 24px 14px;
  }
}

.save-button-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.save-button-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 5px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
}

.whatsapp-flow-form {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.integration-card-header.compact {
  margin-bottom: 0;
}

.whatsapp-flow-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-soft, #f1f5f9);
}

.whatsapp-flow-tab {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.whatsapp-flow-tab:hover {
  color: var(--ink, #0f172a);
}

.whatsapp-flow-tab.is-active {
  background: var(--panel, #fff);
  color: var(--blue, #1d4ed8);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.whatsapp-flow-tab-panel {
  display: grid;
  gap: 16px;
}

/* Seletor de canal (WhatsApp | Instagram): nivel acima das abas de secao.
   Cada canal edita um fluxo proprio; visual distinto do segmentado de abas. */
.whatsapp-flow-channels {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  padding: 5px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: var(--panel, #fff);
}

.whatsapp-flow-channel {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.whatsapp-flow-channel:hover {
  color: var(--ink, #0f172a);
  background: var(--surface-soft, #f1f5f9);
}

.whatsapp-flow-channel.is-active {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

.whatsapp-flow-channel[data-flow-channel="instagram"].is-active {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  box-shadow: 0 6px 16px rgba(219, 39, 119, .28);
}

.whatsapp-flow-channel-hint {
  margin: 0 0 12px;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
}

/* Caixa de modos de automacao (Assistente IA / Fluxo / Atendimento padrao):
   aparece so quando o flag "Ativar atendimento automatico" esta ligado. */
.whatsapp-flow-modes {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.whatsapp-flow-modes-label {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 700;
}

.whatsapp-flow-mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.whatsapp-flow-mode-card {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 74px;
  padding: 14px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--panel, #fff);
  text-align: left;
  cursor: pointer;
}

.whatsapp-flow-mode-card strong {
  font-size: 14px;
  color: var(--ink, #0f172a);
}

.whatsapp-flow-mode-card small {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.whatsapp-flow-mode-card:hover {
  border-color: var(--blue, #1d4ed8);
}

.whatsapp-flow-mode-card.is-active {
  border-color: var(--blue, #1d4ed8);
  background: rgba(37, 99, 235, .08);
  box-shadow: inset 0 0 0 1px var(--blue, #1d4ed8);
}

.whatsapp-flow-mode-card:disabled,
.whatsapp-flow-mode-card.is-disabled {
  opacity: .5;
  cursor: not-allowed;
}

.whatsapp-flow-mode-panel {
  display: grid;
  gap: 16px;
}

.whatsapp-flow-assistant-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface-soft, #f1f5f9);
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .whatsapp-flow-mode-cards {
    grid-template-columns: 1fr;
  }
}

.whatsapp-flow-hint {
  color: var(--muted, #64748b);
  font-size: 12.5px;
  font-weight: 600;
}

.whatsapp-flow-hint code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-soft, #f1f5f9);
  font-size: 12px;
  color: var(--ink, #0f172a);
}

.whatsapp-flow-inactive-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #fcd9a1;
  border-radius: 10px;
  background: #fff7ec;
  color: #9a5b12;
  font-size: 13px;
  font-weight: 600;
}

#attendanceFinishAction {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 10px);
  background: var(--panel, #fff);
  color: var(--text);
  font-size: 15px;
}

.integration-card-header.compact h2,
.integration-card-header.compact h3 {
  margin: 0 0 6px;
}

.whatsapp-flow-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  min-width: 214px;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: #f8fbff;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.whatsapp-flow-toggle:hover,
.whatsapp-flow-toggle:focus-within {
  border-color: rgba(37, 99, 235, 0.46);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.whatsapp-flow-toggle span,
.whatsapp-flow-toggle strong,
.whatsapp-flow-toggle small {
  display: block;
}

.whatsapp-flow-toggle strong {
  font-size: 13px;
  line-height: 1.2;
}

.whatsapp-flow-toggle small {
  margin-top: 3px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.whatsapp-flow-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.whatsapp-flow-toggle i {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background-color 150ms ease;
}

.whatsapp-flow-toggle i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  transition: transform 150ms ease;
}

.whatsapp-flow-toggle input:checked + i {
  background: var(--blue);
}

.whatsapp-flow-toggle input:checked + i::after {
  transform: translateX(20px);
}

.whatsapp-flow-toggle:has(input:not(:checked)) {
  border-color: rgba(148, 163, 184, 0.42);
  background: #f8fafc;
}

.whatsapp-flow-toggle:has(input:not(:checked)) small {
  color: #64748b;
}

.whatsapp-flow-form textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
}

.whatsapp-flow-options-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.whatsapp-flow-options-header strong,
.whatsapp-flow-options-header small {
  display: block;
}

.whatsapp-flow-options-header small {
  margin-top: 4px;
  color: #64748b;
}

.whatsapp-flow-options {
  display: grid;
  gap: 14px;
}

@media (max-width: 980px) {
  .channels-automation-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-connection-card,
  .openai-assistant-channel-card {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .whatsapp-integration-card.whatsapp-connection-card {
    padding: 18px 16px;
  }

  .openai-assistant-channel-card .whatsapp-assistant-card {
    padding: 18px 16px 0;
  }

  .whatsapp-connection-card .integration-card-header,
  .openai-assistant-channel-card .integration-card-header {
    display: grid;
    gap: 18px;
  }

  .integration-card-title {
    gap: 12px;
  }

  .integration-card-title h2 {
    font-size: 22px;
  }

  .integration-card-title p,
  .openai-assistant-feature small,
  .whatsapp-current-connection small,
  .whatsapp-connection-card .integration-helper-text {
    font-size: 12px;
  }

  .whatsapp-brand-icon,
  .openai-assistant-channel-card .openai-mark {
    width: 44px;
    height: 44px;
  }

  .whatsapp-current-connection,
  .openai-assistant-feature {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .whatsapp-current-link {
    display: none;
  }

  .whatsapp-integration-actions {
    grid-template-columns: 1fr;
  }

  .whatsapp-integration-actions .danger-outline-button {
    grid-column: auto;
  }

  .openai-assistant-channel-card .whatsapp-assistant-actions {
    margin-right: -18px;
    margin-left: -18px;
    padding: 20px 18px;
  }
}

.whatsapp-flow-option-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.whatsapp-flow-option-grid {
  display: grid;
  grid-template-columns: minmax(120px, .3fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.whatsapp-flow-option-grid label {
  display: grid;
  gap: 8px;
  color: #101418;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.whatsapp-flow-option-grid input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-transform: none;
}

.whatsapp-flow-option-grid textarea {
  background: #fff;
}

.whatsapp-flow-remove-option {
  min-height: 44px;
}

.integration-row strong,
.integration-row small {
  display: block;
}

.integration-row small {
  margin-top: 4px;
  color: #353c48;
}

.integration-logo {
  width: 42px;
  height: 42px;
  border-radius: 2px;
}

.integration-logo.google {
  background: linear-gradient(135deg, #e9eef6, #ffffff);
  box-shadow: inset 16px 16px 0 #e5e7eb, inset 26px 18px 0 #4a90e2;
}

.integration-logo.stripe {
  background: linear-gradient(135deg, #082033, #0a5166);
}

.integration-logo.aws {
  background: radial-gradient(circle at 60% 40%, #315b6d, #0d2632 60%);
}

.checkmark {
  margin-left: auto;
  color: var(--green);
  font-size: 28px;
}

.broken-link {
  margin-left: auto;
  color: #1b2029;
  font-size: 28px;
}

.general-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 44px;
}

.retention-box,
.debug-row {
  padding: 18px;
  border-radius: 4px;
  background: var(--panel-soft);
}

.retention-box strong {
  display: block;
  margin-bottom: 16px;
}

.retention-box input {
  width: 70%;
  accent-color: var(--blue);
}

.retention-box span {
  margin-left: 16px;
  font-family: Consolas, monospace;
}

.debug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.debug-row strong,
.debug-row small {
  display: block;
}

.debug-row small {
  color: var(--muted);
}

.map-panel {
  display: grid;
  place-items: center;
  min-height: 164px;
  margin-top: 32px;
  border-radius: 4px;
  background:
    linear-gradient(rgba(214, 232, 241, 0.5), rgba(214, 232, 241, 0.5)),
    repeating-linear-gradient(165deg, #b9d2dc 0 8px, #d7e7ee 8px 18px);
  color: var(--blue);
  text-transform: uppercase;
}

.map-panel small {
  color: #1f2937;
  letter-spacing: 0;
}

.placeholder-card {
  padding: 32px;
}

.icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
  color: currentColor;
}

.grid-icon {
  background:
    linear-gradient(currentColor 0 0) 2px 2px / 7px 7px,
    linear-gradient(currentColor 0 0) 15px 2px / 7px 7px,
    linear-gradient(currentColor 0 0) 2px 15px / 7px 7px,
    linear-gradient(currentColor 0 0) 15px 15px / 7px 7px;
  background-repeat: no-repeat;
}

.users-icon::before,
.users-icon::after,
.add-user-icon::before,
.add-user-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.users-icon::before {
  left: 3px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 10px 2px 0 -2px currentColor;
}

.users-icon::after {
  left: 1px;
  bottom: 4px;
  width: 17px;
  height: 7px;
  border-radius: 9px 9px 0 0;
}

.gear-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow:
    0 -5px 0 -2px currentColor,
    0 5px 0 -2px currentColor,
    5px 0 0 -2px currentColor,
    -5px 0 0 -2px currentColor;
}

.diamond-icon {
  background:
    linear-gradient(45deg, currentColor 45%, transparent 46%) 2px 8px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 13px 8px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 8px 2px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 8px 14px / 9px 9px;
  background-repeat: no-repeat;
}

.help-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.help-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 17px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor;
}

.exit-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 10px;
  height: 16px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 2px 0 0 2px;
}

.exit-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 10px;
  width: 11px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px -4px 0 -1px currentColor, 4px 4px 0 -1px currentColor;
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.bell-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 12px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 5px 5px;
}

.bell-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 18px;
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.refresh-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.refresh-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 3px;
  border: 5px solid transparent;
  border-left-color: currentColor;
  transform: rotate(-35deg);
}

.download-icon::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  width: 2px;
  height: 12px;
  background: currentColor;
}

.download-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  width: 12px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
}
.upload-icon::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  width: 2px;
  height: 12px;
  background: currentColor;
}
.upload-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}
.plus-icon::before { content: "+"; position: absolute; inset: -1px 0 0; display: grid; place-items: center; font-size: 30px; }
.filter-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.mail-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.mail-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.webhook-icon::before,
.webhook-icon::after,
.puzzle-icon::before,
.puzzle-icon::after,
.map-icon::before,
.map-icon::after {
  content: "";
  position: absolute;
}

.webhook-icon::before {
  left: 4px;
  top: 5px;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
}

.webhook-icon::after {
  right: 3px;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.puzzle-icon::before {
  left: 5px;
  top: 5px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.puzzle-icon::after {
  left: 10px;
  top: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 15px 0 currentColor;
}

.map-icon::before {
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.map-icon::after {
  left: 11px;
  top: 6px;
  width: 2px;
  height: 14px;
  background: currentColor;
  box-shadow: -5px 2px 0 -1px currentColor, 5px -2px 0 -1px currentColor;
}
.sliders-icon::before,
.sliders-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 8px 0 currentColor, 0 16px 0 currentColor;
}
.sliders-icon::before { top: 3px; }
.sliders-icon::after {
  top: 1px;
  left: 8px;
  right: auto;
  width: 4px;
  height: 4px;
  border: 2px solid currentColor;
  background: var(--navy);
  border-radius: 50%;
  box-shadow: 8px 8px 0 -2px var(--navy), 8px 8px 0 0 currentColor, -2px 16px 0 -2px var(--navy), -2px 16px 0 0 currentColor;
}
.alert-icon::before {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--red);
  font-weight: 800;
}

.shield-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 5px 5px;
  clip-path: polygon(50% 0, 100% 18%, 88% 78%, 50% 100%, 12% 78%, 0 18%);
}

.server-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 6px 0 rgba(8, 91, 197, 0.12), inset 0 -6px 0 rgba(8, 91, 197, 0.12);
}
.server-icon.dark { color: #1b2029; }
.add-user-icon::before { content: "+"; right: 0; top: -2px; border: 0; font-size: 18px; font-weight: 700; }
.add-user-icon::after { left: 3px; bottom: 3px; width: 16px; height: 8px; border-radius: 9px 9px 0 0; }
.document-icon::before,
.inbox-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 13px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 -5px 0 rgba(8, 91, 197, 0.12);
}

.document-icon::after,
.inbox-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.calendar-alert-icon::before {
  content: "";
  position: absolute;
  inset: 2px 0 0;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-top-width: 5px;
  border-radius: 2px;
  font-size: 16px;
}

.money-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.money-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.lock-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.lock-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 3px;
  width: 8px;
  height: 10px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.building-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
}

.building-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 2px;
  height: 2px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor, 0 5px 0 currentColor, 5px 5px 0 currentColor, 0 10px 0 currentColor, 5px 10px 0 currentColor;
}

.trend-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 5px;
  width: 19px;
  height: 13px;
  border-left: 3px solid currentColor;
  border-top: 3px solid currentColor;
  transform: skewY(-35deg) rotate(135deg);
}

.trend-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.wallet-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.wallet-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 10px;
  width: 8px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: var(--panel);
}

.chart-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.chart-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 7px;
  width: 3px;
  height: 5px;
  background: currentColor;
  box-shadow: 5px -4px 0 currentColor, 10px -1px 0 currentColor;
}

.funnel-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 3px solid currentColor;
  border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 60% 62%, 60% 100%, 40% 100%, 40% 62%);
}

@media (max-width: 1500px) {
  .dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-calendar-compact-card {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .dashboard-calendar-modal {
    padding: 10px;
  }

  .dashboard-overview-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-calendar-compact-card {
    grid-column: auto;
  }

  .dashboard-summary-card,
  .dashboard-calendar-compact-card {
    min-height: auto;
  }

  .dashboard-summary-item {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .dashboard-summary-meta {
    grid-column: 2;
    text-align: left;
  }

  .dashboard-calendar-modal-card {
    width: 100%;
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 1180px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 420px;
  }

  .login-copy {
    margin-bottom: 60px;
  }

  .sidebar { width: 230px; }
  .main-area { margin-left: 230px; }

  .brand-logo-sidebar {
    height: 50px;
    max-width: 180px;
  }

  .brand {
    padding: 18px 18px 12px;
  }

  .sidebar-nav {
    gap: 8px;
    padding: 12px;
  }

  .nav-item {
    min-height: 50px;
    padding: 9px 16px;
    font-size: 15px;
    gap: 12px;
  }

  .plain-action {
    padding: 10px 16px;
    font-size: 15px;
    gap: 12px;
  }

  .sidebar-footer {
    padding: 12px;
  }

  .metrics-grid,
  .dashboard-layout,
  .settings-top-grid,
  .settings-bottom-grid,
  .sales-metrics-grid,
  .sales-content-grid,
  .client-summary-grid,
  .client-detail-layout,
  .client-detail-metrics,
  .process-summary-grid,
  .process-content-grid,
  .contract-summary-grid,
  .contracts-bottom-grid {
    grid-template-columns: 1fr;
  }

  .email-settings-panel[data-email-settings-panel="technical"].is-active {
    grid-template-columns: 1fr;
  }

  .pipeline-steps {
    grid-template-columns: 1fr;
  }

  .pipeline-step,
  .pipeline-step:first-child,
  .pipeline-step:last-child,
  .process-flow article,
  .process-flow article:first-child {
    clip-path: none;
  }

  .process-flow {
    grid-template-columns: 1fr;
  }

  .process-kanban-board {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .right-stack {
    grid-template-columns: 1fr 1fr;
  }

  .user-summary-grid {
    grid-template-columns: 1fr;
  }
  .user-summary-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .login-visual,
  .login-panel-wrap {
    min-height: auto;
    padding: 28px 20px;
  }

  .login-card {
    padding: 28px 20px;
  }

  .brand-logo-login {
    height: 58px;
    max-width: 260px;
  }

  .login-copy h1 {
    font-size: 25px;
  }

  .login-copy p {
    font-size: 17px;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
  }

  .main-area {
    margin-left: 0;
  }

  .sidebar-nav {
    padding: 12px;
  }

  .sidebar-footer {
    padding: 16px;
  }

  .topbar,
  .connection-panel,
  .page-heading,
  .heading-actions,
  .tabs-row,
  .pagination-row,
  .utility-grid,
  .right-stack,
  .settings-form,
  .general-grid {
    flex-direction: column;
    display: flex;
    align-items: stretch;
  }

  .dashboard-calendar-card {
    overflow-x: auto;
  }

  .dashboard-calendar-header {
    min-width: 760px;
  }

  .dashboard-calendar-filters,
  .dashboard-calendar-weekdays,
  .dashboard-calendar-grid,
  .dashboard-calendar-legend {
    min-width: 760px;
  }

  .screen {
    padding: 28px 16px 80px;
  }

  .search-box {
    width: 100%;
  }

  .topbar-profile-menu {
    right: 8px;
    top: calc(100% + 8px);
  }

  .connection-panel {
    margin: 16px;
  }

  .admin-login-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-login-form input {
    width: 100%;
  }

  .page-heading h1 {
    font-size: 32px;
  }

  .metrics-grid,
  .dashboard-layout,
  .settings-top-grid,
  .settings-bottom-grid,
  .sales-metrics-grid,
  .sales-content-grid,
  .client-summary-grid,
  .client-detail-layout,
  .client-detail-metrics,
  .process-summary-grid,
  .process-content-grid,
  .contract-summary-grid,
  .contracts-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .contract-filters {
    grid-template-columns: 1fr;
  }

  .filter-button {
    justify-self: stretch;
  }

  .process-kanban-board {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
  }

  .client-profile-panel {
    position: static;
  }

}

/* UX polish: mobile-first behavior and touch-friendly web app layout */
html {
  scroll-behavior: smooth;
}

input,
select,
textarea {
  border-radius: var(--radius-sm);
}

.topbar,
.sidebar,
.card,
.modal-card,
.login-card {
  transition: box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.primary-button,
.secondary-button,
.logout-button,
.ghost-link,
.nav-item {
  transition: transform .12s ease, background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.primary-button:hover,
.secondary-button:hover,
.logout-button:hover,
.ghost-link:hover,
.nav-item:hover {
  transform: translateY(-1px);
}

.table-wrap {
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.table-wrap::after {
  content: "";
  position: sticky;
  right: 0;
  display: block;
  width: 34px;
  height: 1px;
  margin-left: auto;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(243, 246, 250, 0), rgba(243, 246, 250, .9));
}

@media (max-width: 900px) {
  .screen.requests-chat-screen {
    height: calc(100dvh - 70px);
    padding: 10px;
  }

  .conversations-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  .conversation-sidebar {
    max-height: 46dvh;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  /* Lista com mais altura no celular (antes ~148px, ~2-3 conversas). */
  .conversation-list {
    max-height: 36dvh;
  }

  /* Alvos de toque confortaveis no chat (>=44px). */
  .conversation-action-icon {
    width: 44px;
    height: 44px;
  }

  /* Botao de arquivar sempre visivel no toque (no desktop aparece so no hover). */
  .conversation-archive-button {
    opacity: 1;
    visibility: visible;
    width: 34px;
    height: 34px;
  }

  .conversation-chat-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .conversation-chat-meta {
    justify-items: start;
  }

  .conversation-message {
    max-width: 92%;
  }

  .crm-flow-summary {
    grid-template-columns: 1fr 1fr;
  }

  .crm-flow-summary > div:first-child,
  .crm-flow-summary > div:last-child {
    grid-column: 1 / -1;
  }

  .crm-plan-field > div:last-of-type {
    grid-template-columns: 1fr;
  }

  .app-shell {
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    max-height: 48dvh;
    border-right: 0;
    border-bottom: 1px solid rgba(199, 204, 213, .86);
    background: rgba(238, 242, 247, .94);
    backdrop-filter: blur(18px);
  }

  .brand {
    min-height: 64px;
    padding: 10px 16px 6px;
  }

  .brand-logo-sidebar {
    height: 42px;
    max-width: 170px;
  }

  .brand small {
    font-size: 10px;
  }

  .sidebar-nav {
    display: flex;
    gap: 8px;
    padding: 8px 12px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .sidebar-nav::-webkit-scrollbar {
    height: 0;
    width: 0;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 46px;
    min-width: max-content;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 15px;
    scroll-snap-align: start;
  }

  .nav-parent-item {
    margin-bottom: 0;
  }

  .nav-parent-item::after {
    width: 6px;
    height: 6px;
  }

  .nav-subitem {
    margin: 0;
    padding: 8px 13px;
    font-size: 14px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .76);
  }

  .nav-subitem::before {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    top: auto;
    min-height: auto;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .topbar-license {
    width: 100%;
  }

  .topbar-license-text strong {
    max-width: calc(100vw - 190px);
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .search-box {
    width: min(100%, 260px);
  }

  .user-menu {
    gap: 10px;
    margin-left: auto;
  }

  .topbar-user-copy {
    display: none;
  }

  .logout-button {
    min-width: 44px;
    padding: 0 12px;
  }

  .logout-button span:not(.icon) {
    display: none;
  }

  .screen {
    padding: 24px 14px 88px;
  }

  .page-heading {
    gap: 16px;
    margin-bottom: 22px;
  }

  .page-heading h1 {
    font-size: clamp(30px, 9vw, 40px);
    line-height: 1.05;
  }

  .page-heading p {
    font-size: 17px;
    line-height: 1.42;
  }

  .heading-actions,
  .form-actions,
  .proposal-builder-actions {
    gap: 10px;
  }

  .proposal-builder-actions {
    flex-wrap: wrap;
  }

  .heading-actions > *,
  .form-actions > *,
  .proposal-builder-actions > * {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    min-height: 50px;
    padding: 0 18px;
    font-size: 17px;
  }

  .card {
    border-radius: 14px;
  }

  .card-header {
    gap: 12px;
  }

  .proposal-builder-grid,
  .proposal-modules-grid,
  .opportunity-form,
  .settings-form,
  .general-grid,
  .contract-address-fields {
    grid-template-columns: 1fr !important;
  }

  .appointment-online-grid,
  .appointment-meeting-link-row {
    grid-template-columns: 1fr;
  }

  .modal-card {
    width: min(100% - 20px, 720px);
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 18px -24px -24px;
    padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
  }

  .client-detail-tabs {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .client-detail-tabs button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: var(--panel);
  }

  .client-detail-tabs button.is-active {
    border-color: var(--blue);
    background: var(--blue-soft);
  }

  .client-profile-panel {
    top: 0;
  }

  .interaction-footer,
  .client-process-context-footer,
  .calendar-event-actions,
  .commercial-demand-actions {
    gap: 10px;
  }

  .interaction-footer button,
  .client-process-actions button,
  .calendar-event-actions button {
    flex: 1 1 160px;
  }
}

@media (max-width: 520px) {
  .login-screen {
    background: var(--panel);
  }

  .login-visual {
    min-height: auto;
    padding: 22px 18px;
  }

  .login-copy,
  .login-footer,
  .office-visual {
    display: none;
  }

  .login-brand {
    padding: 8px 12px;
    border-radius: 12px;
  }

  .brand-logo-login {
    height: 48px;
    max-width: 220px;
  }

  .login-panel-wrap {
    place-items: start stretch;
    padding: 22px 16px 34px;
    background: var(--panel);
  }

  .login-card {
    gap: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-card h2 {
    font-size: 28px;
  }

  .login-input,
  .login-submit,
  .sso-button {
    min-height: 56px;
    border-radius: 12px;
    font-size: 17px;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar .search-box {
    height: 46px;
    border-radius: 999px;
  }

  .icon-button {
    width: 42px;
    height: 42px;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }

  .screen {
    padding-inline: 10px;
  }

  .page-heading h1 {
    font-size: 32px;
  }

  .page-heading p {
    font-size: 16px;
  }

  .card,
  .modal-card {
    border-radius: 12px;
  }

  .small-stat,
  .contract-stat,
  .sales-metric {
    min-height: auto;
    padding: 20px;
  }

  .table-wrap {
    margin-inline: -1px;
    border-radius: 0 0 12px 12px;
  }

  .client-detail-layout {
    gap: 14px;
  }

  .client-profile-panel,
  .interaction-card,
  .client-process-context,
  .client-timeline-card,
  .client-rdv-card,
  .client-proposals-card,
  .client-contracts-card,
  .client-demands-card,
  .client-attachments-card {
    padding-inline: 18px;
  }
}

/* CoreFlow UI polish: visual-only overrides. Keep business logic in JS untouched. */
body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 32vw),
    var(--bg);
  color: #1e293b;
  font-weight: 500;
}

.app-shell {
  background: transparent;
}

.sidebar {
  background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
  border-right-color: rgba(148, 163, 184, 0.38);
  box-shadow: 12px 0 28px rgba(15, 23, 42, 0.04);
}

.brand {
  border-bottom-color: rgba(148, 163, 184, 0.24);
}

.brand small,
.page-heading p,
.card-header p,
small,
.eyebrow {
  color: #64748b;
}

.sidebar-nav {
  padding-inline: 10px;
}

.nav-item,
.plain-action {
  min-height: 48px;
  margin: 4px 0;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #334155;
  font-weight: 650;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.nav-item:hover,
.plain-action:hover {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(148, 163, 184, 0.28);
  color: #0f172a;
  transform: translateX(2px);
}

.nav-item.is-active {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  border-color: rgba(37, 99, 235, 0.35);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
}

.nav-subitem {
  min-height: 42px;
  padding-left: 58px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

.topbar {
  border-bottom-color: var(--theme-topbar-line);
  background: var(--theme-topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-box,
.login-input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-color: #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #1e293b;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.search-box:focus-within,
.login-input:focus-within,
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.page-heading h1,
.screen > h1,
.card-header h2,
.card h2,
.modal-header h2,
.login-card h2 {
  color: #111827;
  font-weight: 800;
  letter-spacing: 0;
}

.page-heading h1,
.screen > h1 {
  line-height: 1.05;
}

.card,
.status-card,
.latency-card,
.small-stat,
.contract-stat,
.sales-metric,
.smtp-card,
.pop-card,
.webhook-card,
.integrations-card,
.general-card,
.process-flow-card,
.process-kanban-card,
.process-table-card,
.process-subflow-card,
.commercial-demands-card,
.proposal-clients-card,
.clients-table-card,
.users-table-card,
.contracts-table-card,
.modal-card,
.login-card {
  border-color: rgba(148, 163, 184, 0.36);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.card:hover,
.status-card:hover,
.latency-card:hover,
.small-stat:hover,
.contract-stat:hover,
.sales-metric:hover {
  box-shadow: var(--shadow-md);
}

.primary-button,
.secondary-button,
.login-submit,
.sso-button,
.table-actions button,
.ghost-link,
.service-request-start-button,
.service-request-transfer-button {
  border-radius: 12px;
  font-weight: 750;
  letter-spacing: 0;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.primary-button,
.login-submit {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.primary-button:hover,
.login-submit:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.30);
  transform: translateY(-1px);
}

.secondary-button,
.sso-button,
.table-actions button {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1e293b;
}

.secondary-button:hover,
.sso-button:hover,
.table-actions button:hover {
  border-color: rgba(37, 99, 235, 0.36);
  background: #f8fafc;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.login-submit:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
  transform: none;
}

table {
  color: #1f2937;
}

thead,
table th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

table td,
table th {
  border-color: rgba(226, 232, 240, 0.92);
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}

.pill,
.request-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.pill.success,
.request-badge.status-completed,
.request-badge.priority-low {
  background: #dcfce7;
  color: #15803d;
}

.pill.admin,
.pill.process-pill,
.request-badge.status-new,
.request-badge.status-triage {
  background: #dbeafe;
  color: #1d4ed8;
}

.request-badge.status-in_service,
.request-badge.status-development,
.request-badge.status-testing {
  background: #ede9fe;
  color: #6d28d9;
}

.request-badge.status-analysis,
.request-badge.priority-medium {
  background: #fef3c7;
  color: #b45309;
}

.request-badge.status-waiting_customer,
.request-badge.priority-high {
  background: #ffedd5;
  color: #c2410c;
}

.request-badge.status-automated_service {
  background: #e0f2fe;
  color: #075985;
}

.pill.danger,
.request-badge.status-cancelled,
.request-badge.priority-critical {
  background: #fee2e2;
  color: #b91c1c;
}

.pill.neutral,
.request-badge.status-not_applicable {
  background: #f1f5f9;
  color: #475569;
}

/* Central de Atendimento: dashboard-style queue */
.service-request-metric-grid {
  grid-template-columns: repeat(6, minmax(118px, 1fr));
}

.service-requests-panel {
  overflow: hidden;
}

.service-requests-panel > .card-header {
  padding-bottom: 14px;
}

.service-requests-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.service-requests-table th,
.service-requests-table td {
  padding: 13px 12px;
  box-sizing: border-box;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
}

.service-requests-table td {
  color: #172033;
  font-size: 13.5px;
  vertical-align: middle;
}

.service-requests-table th {
  color: #475569;
  font-size: 10px;
  font-weight: 850;
  user-select: none;
}

.service-requests-table th.is-sortable {
  cursor: pointer;
}

.service-requests-table th.is-sortable .th-label {
  transition: color .14s ease;
}

.service-requests-table th.is-sortable:hover .th-label,
.service-requests-table th.is-sorted .th-label {
  color: #0f5fc7;
}

.service-requests-table .th-sort-arrow {
  display: inline-block;
  margin-left: 2px;
  font-size: 8px;
  line-height: 1;
  vertical-align: middle;
}

.service-requests-table tr:hover td {
  background: #f8fbff;
}

.service-requests-table .mini-avatar {
  flex: 0 0 auto;
  margin-right: 0;
  background: linear-gradient(135deg, #0f5fc7, #23c7d6);
  color: #fff;
  font-size: 10px;
}

.service-requests-table .request-badge {
  gap: 5px;
  min-height: 22px;
  padding: 4px 9px;
  border: 0;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.service-requests-table .request-badge.status-new::before,
.service-requests-table .request-badge.status-in_service::before,
.service-requests-table .request-badge.status-analysis::before,
.service-requests-table .request-badge.status-waiting_customer::before,
.service-requests-table .request-badge.status-completed::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.request-badge.priority-critical {
  background: #fee2e2;
  color: #b91c1c;
}

.request-badge.priority-high {
  background: #ffedd5;
  color: #c2410c;
}

.request-badge.priority-medium {
  background: #fef3c7;
  color: #b45309;
}

.request-badge.priority-low {
  background: #dcfce7;
  color: #15803d;
}

.request-badge.status-new,
.request-badge.status-triage,
.request-badge.status-channel_queue {
  background: #f1f5f9;
  color: #475569;
}

.request-badge.status-in_service {
  background: #dbeafe;
  color: #1d4ed8;
}

.request-badge.status-analysis,
.request-badge.status-development,
.request-badge.status-testing {
  background: #ede9fe;
  color: #6d28d9;
}

.request-badge.status-waiting_customer,
.request-badge.status-paused {
  background: #fef3c7;
  color: #b45309;
}

.request-badge.status-automated_service {
  background: #e0f2fe;
  color: #075985;
}

.request-badge.status-completed {
  background: #dcfce7;
  color: #15803d;
}

.request-badge.status-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.request-badge.status-not_applicable {
  background: #e2e8f0;
  color: #475569;
}

/* Badges de canal: ícone da marca colorido, sem o "dot" de status */
.service-requests-table .request-badge.request-badge--channel::before {
  display: none;
}

.request-badge .sr-badge-icon {
  flex: 0 0 auto;
}

.request-badge--channel .sr-badge-icon-whatsapp {
  color: #1faf5e;
}

.request-badge--channel .sr-badge-icon-instagram {
  color: #d6367f;
}

.service-request-metric-card .instagram-metric-icon {
  position: relative;
  background:
    radial-gradient(circle at 72% 28%, #fef3c7 0 5px, transparent 6px),
    linear-gradient(135deg, #f97316 0%, #db2777 48%, #7c3aed 100%);
}

.service-request-metric-card .instagram-metric-icon::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid #ffffff;
  border-radius: 10px;
}

.service-request-metric-card .instagram-metric-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 1320px) {
  .service-request-metric-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .service-request-metric-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .service-requests-table th,
  .service-requests-table td {
    padding: 11px 8px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .service-request-metric-grid {
    grid-template-columns: 1fr;
  }

  .service-requests-table {
    min-width: 720px;
  }

  .service-request-table-wrap {
    overflow-x: auto;
  }
}

.form-status:not(:empty) {
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffbeb;
  color: #92400e;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px) saturate(1.06);
  -webkit-backdrop-filter: blur(10px) saturate(1.06);
}

#appointmentModal {
  z-index: 260;
}

#appointmentSuccessModal {
  z-index: 320;
}

.appointment-modal-backdrop {
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.appointment-modal-card {
  width: min(1240px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 26px 78px rgba(15, 23, 42, 0.28);
}

.appointment-modal-header {
  padding: 22px 32px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.appointment-modal-header h2 {
  margin: 0;
  color: #101827;
  font-size: clamp(23px, 2vw, 28px);
  line-height: 1.1;
}

.appointment-modal-header p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.25;
}

.appointment-modal-header .icon-button {
  width: 38px;
  min-height: 38px;
  color: #0f172a;
  font-size: 34px;
  line-height: 1;
  background: transparent;
}

.appointment-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 16px 28px;
  max-height: calc(100dvh - 126px);
  overflow: auto;
  padding: 28px 32px 26px;
}

.appointment-form label {
  gap: 8px;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.appointment-title-field span,
.appointment-description-field span {
  color: #ef4444;
}

.appointment-description-field > span {
  color: #526176;
  font-weight: 700;
}

.appointment-form input,
.appointment-form select,
.appointment-form textarea {
  min-height: 48px;
  border-color: #cbd5e1;
  border-radius: 9px;
  color: #172033;
  background: #ffffff;
  font-size: 16px;
}

.appointment-form textarea {
  min-height: 84px;
  resize: vertical;
}

.appointment-field-shell {
  position: relative;
  display: block;
}

.appointment-field-shell select,
.appointment-client-field .appointment-field-shell input[type="search"] {
  padding-left: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-client-field .client-search-results {
  z-index: 420;
}

.appointment-field-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 1;
  display: inline-block;
  width: 18px;
  height: 18px;
  color: #64748b;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.appointment-field-icon::before,
.appointment-field-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.appointment-icon-user::before {
  left: 6px;
  top: 2px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.appointment-icon-user::after {
  left: 3px;
  bottom: 1px;
  width: 12px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 3px 3px;
}

.appointment-icon-briefcase::before {
  inset: 5px 1px 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.appointment-icon-briefcase::after {
  left: 6px;
  top: 2px;
  width: 6px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.appointment-icon-flag::before {
  left: 3px;
  top: 2px;
  width: 2px;
  height: 15px;
  background: currentColor;
}

.appointment-icon-flag::after {
  left: 5px;
  top: 2px;
  width: 11px;
  height: 8px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 3px 3px 0;
}

.appointment-icon-calendar::before {
  inset: 2px 1px 1px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.appointment-icon-calendar::after {
  left: 4px;
  right: 4px;
  top: 7px;
  height: 2px;
  background: currentColor;
  box-shadow:
    0 4px 0 -0.5px currentColor,
    4px 4px 0 -0.5px currentColor;
}

.appointment-icon-clock::before {
  inset: 1px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.appointment-icon-clock::after {
  left: 8px;
  top: 4px;
  width: 5px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.appointment-date-section {
  display: grid;
  gap: 12px;
}

.appointment-date-section > strong {
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

.appointment-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 20px;
}

.appointment-date-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 8px !important;
  min-height: 64px;
  padding: 10px 14px 9px 42px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
}

.appointment-date-card .appointment-field-icon {
  left: 18px;
}

.appointment-date-card > span:not(.appointment-field-icon) {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.appointment-date-card input {
  grid-column: 1 / -1;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
}

.appointment-refresh-meeting-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.appointment-refresh-meeting-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.appointment-online-section {
  gap: 16px;
  padding: 18px 22px 20px;
  border-color: #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
}

.appointment-online-section legend {
  padding: 0 3px;
  color: #172033;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.appointment-online-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: #172033;
  font-size: 15px;
}

.appointment-online-toggle input {
  width: 18px;
  height: 18px;
}

.appointment-online-grid {
  grid-template-columns: minmax(230px, .95fr) minmax(360px, 1.45fr);
  gap: 20px 28px;
  align-items: start;
}

.appointment-online-grid > label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.appointment-online-grid > label > input,
.appointment-meeting-link-row input {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
}

.appointment-meeting-link-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  gap: 10px;
}

.appointment-meeting-link-row input {
  min-width: 0;
  overflow: hidden;
  padding-left: 14px;
  color: #64748b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-meeting-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.appointment-meeting-actions .compact-button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 8px;
  color: #0b66d8;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.appointment-guests-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.appointment-guests-field textarea {
  width: 100%;
  min-height: 58px;
  box-sizing: border-box;
  resize: vertical;
}

.appointment-guests-hint {
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.4;
}

.appointment-modal-actions {
  align-items: center;
  grid-column: 1 / -1;
  gap: 14px;
  padding-top: 6px;
}

.appointment-modal-actions span {
  flex: 1 1 auto;
}

.appointment-modal-actions .primary-button,
.appointment-modal-actions .secondary-button,
.appointment-modal-actions .danger-button {
  min-height: 52px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 900;
}

.appointment-modal-actions .primary-button {
  min-width: 230px;
}

.appointment-modal-actions .secondary-button {
  min-width: 140px;
}

.appointment-modal-actions .danger-button {
  min-width: 130px;
  border: 1px solid #ef4444;
  color: #ef4444;
  background: #ffffff;
}

#appointmentFormStatus {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 1180px) {
  .appointment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-date-grid,
  .appointment-online-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .appointment-modal-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .appointment-modal-card {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .appointment-modal-header {
    padding: 18px 18px 14px;
  }

  .appointment-form {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .appointment-date-grid,
  .appointment-online-grid {
    grid-template-columns: 1fr;
  }

  .appointment-meeting-actions,
  .appointment-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .appointment-modal-actions span {
    display: none;
  }

  .appointment-modal-actions .primary-button,
  .appointment-modal-actions .secondary-button,
  .appointment-modal-actions .danger-button {
    width: 100%;
  }
}

.modal-card {
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
}

.modal-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.service-request-sidebar > div {
  border-radius: 14px;
  background: #f8fafc;
}

.module-checkboxes {
  border-color: #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
}

.module-checkboxes label {
  color: #334155;
  font-weight: 650;
}

.module-checkboxes input[type="checkbox"],
input[type="checkbox"] {
  accent-color: var(--primary);
}

.service-request-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.columns-config-modal-card {
  width: min(620px, calc(100vw - 32px));
}

.columns-config-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px 24px;
}

/* ===== Destaque por canal nas linhas da Central =====
   Aplicado nas CELULAS (td), nao no <tr>: com border-collapse:collapse o
   background/box-shadow do <tr> nao renderiza de forma confiavel. As variaveis
   --sr-channel-* sao setadas inline no <tr> e herdadas pelas td. */
tr.sr-channel-row > td {
  background: var(--sr-channel-bg);
}
tr.sr-channel-row > td:first-child {
  box-shadow: inset 3px 0 0 0 var(--sr-channel-border);
}
tr.sr-channel-row:hover > td {
  box-shadow: inset 0 0 0 9999px rgba(15, 23, 42, 0.035);
}
tr.sr-channel-row:hover > td:first-child {
  box-shadow: inset 3px 0 0 0 var(--sr-channel-border), inset 0 0 0 9999px rgba(15, 23, 42, 0.035);
}

/* Seção "Destaques por canal" no modal Configurar colunas */
.channel-highlights {
  padding: 4px 24px 18px;
  border-top: 1px solid #eef0f3;
}
.channel-highlights:empty {
  display: none;
}
.channel-highlights-head {
  padding: 14px 0 8px;
}
.channel-highlights-head strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.channel-highlights-head small {
  color: #647084;
  font-size: 12px;
}
.channel-highlight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px solid #f3f4f7;
  cursor: pointer;
}
.channel-highlight-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: 0 0 auto;
}
.channel-highlight-icon {
  font-size: 15px;
  line-height: 1;
}
.channel-highlight-name {
  font-weight: 600;
  color: var(--text);
}
.channel-highlight-check {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.channel-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}
.channel-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}
.channel-highlight-check:checked ~ .channel-toggle {
  background: #2563eb;
}
.channel-highlight-check:checked ~ .channel-toggle::after {
  transform: translateX(18px);
}
.channel-highlight-check:focus-visible ~ .channel-toggle {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.column-config-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.column-config-option strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.column-config-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.column-config-option.is-locked {
  background: #f8fafc;
}

.a4-print-frame {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 210mm;
  height: 297mm;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  .columns-config-list {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body * {
    visibility: hidden !important;
  }

  .app-shell,
  .main-area,
  .screen,
  .modal-backdrop,
  .proposal-modal {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #proposalPages,
  #proposalPages * {
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #proposalPages {
    position: static !important;
    display: block;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  .proposal-modal-header {
    display: none;
  }

  .proposal-a4-page {
    display: flex !important;
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    break-after: page;
    page-break-after: always;
    transform: none !important;
  }

  .contract-a4-page {
    display: flex !important;
    flex-direction: column !important;
    padding: 16mm 20mm 12mm !important;
  }

  .proposal-html-page {
    display: flex !important;
    flex-direction: column !important;
    padding: 58px 56px 42px !important;
    background-color: #05204f !important;
    background-image: linear-gradient(150deg, #05204f, #0063b7) !important;
  }

  .proposal-a4-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}

@media (max-width: 1180px) {
  .dashboard-calendar-compact-card {
    overflow-x: hidden;
  }

  .dashboard-calendar-compact-card .dashboard-calendar-header,
  .dashboard-calendar-compact-card .dashboard-calendar-weekdays,
  .dashboard-calendar-compact-card .dashboard-calendar-grid,
  .dashboard-calendar-compact-card .dashboard-calendar-legend {
    min-width: 0;
  }

  .dashboard-calendar-modal-card .dashboard-calendar-header,
  .dashboard-calendar-modal-card .dashboard-calendar-filters,
  .dashboard-calendar-modal-card .dashboard-calendar-weekdays,
  .dashboard-calendar-modal-card .dashboard-calendar-grid,
.dashboard-calendar-modal-card .dashboard-calendar-legend {
    min-width: 760px;
  }
}

/* Dashboard principal redesenhado */
/* ---- Sidebar --------------------------------------------------------------
   EXCECAO AUTORIZADA a "modo claro pixel-identico" (decisao do Andre, 27/08).
   A sidebar era azul-marinho nos DOIS temas; agora acompanha o tema de verdade,
   e isso MUDA a aparencia do sistema para toda a equipe, inclusive para quem
   nunca abrir o seletor. Foi escolhido com o aviso na tela.

   O desenho claro nao foi inventado: e' o que ja existia no proprio arquivo
   (~linha 19306, gradiente #f8fafc -> #eef4fb), escrito antes de a sidebar
   escurecer e desde entao sobreposto por este bloco. As tintas claras vem da
   paleta do guia (secao 1.2), nao de hex novo.

   O item ATIVO fica igual nos dois temas: pilula azul cheia com texto branco
   funciona sobre fundo claro e sobre fundo escuro, e e' a marca de navegacao
   que a equipe ja reconhece. */
.sidebar {
  background: linear-gradient(180deg, var(--theme-sidebar-de) 0%, var(--theme-sidebar-ate) 100%);
  border-right-color: var(--theme-sidebar-line);
  box-shadow: var(--theme-sidebar-shadow);
}

.sidebar .brand small,
.sidebar-footer .plain-action,
.sidebar .plain-action,
.sidebar .nav-item {
  color: var(--theme-sidebar-ink);
}

.sidebar .brand strong,
.sidebar .brand-text,
.sidebar .plain-action:hover,
.sidebar .nav-item:hover {
  color: var(--theme-sidebar-ink-strong);
}

.sidebar .nav-item:hover,
.sidebar .plain-action:hover {
  background: var(--theme-sidebar-hover-bg);
  border-color: var(--theme-sidebar-hover-line);
}

.sidebar .nav-item.is-active {
  background: linear-gradient(135deg, #1672f3, #155fd0);
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow: 0 12px 26px rgba(22, 114, 243, 0.34);
}

.sidebar .nav-submenu {
  color: var(--theme-sidebar-submenu-ink);
}

.sidebar .nav-subitem {
  color: var(--theme-sidebar-subitem-ink);
}

.sidebar .nav-subitem.is-active,
.sidebar .nav-subitem:hover {
  color: var(--theme-sidebar-ink-strong);
  background: var(--theme-sidebar-hover-bg);
}

.dashboard-screen {
  max-width: 100%;
}

.dashboard-heading {
  margin-bottom: 16px;
}

.dashboard-heading h1 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1;
}

.dashboard-heading p {
  margin-top: 8px;
  color: #526176;
}

.dashboard-metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-metric-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 90px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

.dashboard-metric-card.is-dragging,
.dashboard-chart-card.is-dragging,
.dashboard-summary-card.is-dragging {
  opacity: 0.58;
  cursor: grabbing;
}

.dashboard-metric-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 900;
}

.dashboard-metric-card.blue .dashboard-metric-icon { color: #155fd0; background: #e8f1ff; }
.dashboard-metric-card.green .dashboard-metric-icon { color: #058346; background: #e8faef; }
.dashboard-metric-card.purple .dashboard-metric-icon { color: #6d3be8; background: #f0eaff; }
.dashboard-metric-card.orange .dashboard-metric-icon { color: #db6b07; background: #fff2df; }
.dashboard-metric-card.cyan .dashboard-metric-icon { color: #0891b2; background: #e5f8fb; }
.dashboard-metric-card.red .dashboard-metric-icon { color: #dc2626; background: #ffeaea; }

.dashboard-metric-card span:not(.dashboard-metric-icon),
.dashboard-metric-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric-card span:not(.dashboard-metric-icon) {
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-metric-card strong {
  display: block;
  margin: 5px 0 3px;
  color: #101826;
  font-size: 24px;
  line-height: 1;
}

.dashboard-metric-card small {
  font-size: 11px;
  font-weight: 700;
}

.dashboard-metric-card small.positive { color: #0b9f5b; }
.dashboard-metric-card small.negative { color: #dc2626; }
.dashboard-metric-card small.neutral { color: #64748b; }

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.dashboard-chart-card,
.dashboard-charts-grid .dashboard-calendar-compact-card {
  min-height: 280px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

.dashboard-widget-period {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f7fc;
  color: #526176;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-funnel-list {
  display: grid;
  gap: 11px;
  padding: 8px 20px 22px;
}

.dashboard-funnel-row {
  display: grid;
  grid-template-columns: 110px minmax(80px, 1fr) 92px;
  gap: 12px;
  align-items: center;
  color: #12213a;
  font-size: 12px;
}

.dashboard-funnel-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-funnel-row strong {
  color: #526176;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.dashboard-funnel-track {
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f9;
}

.dashboard-funnel-track i {
  display: block;
  height: 100%;
  min-width: 18px;
  border-radius: inherit;
}

.dashboard-funnel-track .funnel-1 { background: #1769e8; }
.dashboard-funnel-track .funnel-2 { background: #1e82f0; }
.dashboard-funnel-track .funnel-3 { background: #20a8df; }
.dashboard-funnel-track .funnel-4 { background: #2ec4b6; }
.dashboard-funnel-track .funnel-5 { background: #65c878; }
.dashboard-funnel-track .funnel-6 { background: #f8bf3a; }
.dashboard-funnel-track .funnel-7 { background: #f97316; }

.dashboard-donut-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 8px 22px 24px;
}

.dashboard-donut-chart {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  background: conic-gradient(#e8eef7 0% 100%);
}

.dashboard-donut-chart::after {
  content: '';
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #eef2f7;
}

.dashboard-donut-chart strong,
.dashboard-donut-chart span {
  position: relative;
  z-index: 1;
}

.dashboard-donut-chart strong {
  color: #111827;
  font-size: 26px;
  line-height: 1;
}

.dashboard-donut-chart span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-donut-legend {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dashboard-donut-legend-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #526176;
  font-size: 12px;
}

.dashboard-donut-legend-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dashboard-donut-legend-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-donut-legend-item strong {
  color: #12213a;
  font-size: 11px;
  white-space: nowrap;
}

#dashboardBottomWidgets.dashboard-overview-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  margin-bottom: 16px;
}

#dashboardBottomWidgets .dashboard-summary-card {
  min-height: 250px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

.dashboard-calendar-shell {
  display: grid;
  grid-template-columns: minmax(280px, 420px);
  justify-content: end;
  margin-bottom: 24px;
}

.dashboard-calendar-shell .dashboard-calendar-compact-card {
  min-height: auto;
}

@media (max-width: 1500px) {
  .dashboard-metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-metric-strip,
  .dashboard-charts-grid,
  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-donut-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-calendar-shell {
    grid-template-columns: 1fr;
  }
}

/* Dashboard: cards inferiores compactos */
#dashboardBottomWidgets.dashboard-overview-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

#dashboardBottomWidgets .dashboard-summary-card {
  min-height: 216px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

#dashboardBottomWidgets .dashboard-summary-header {
  min-width: 0;
  padding: 13px 16px 8px;
}

#dashboardBottomWidgets .dashboard-summary-header h2 {
  overflow: hidden;
  color: #12213a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-header .ghost-link {
  flex: 0 0 auto;
  min-height: auto;
  padding: 0;
  border: 0;
  color: #0b66d8;
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-list {
  gap: 0;
  padding: 0 16px 6px;
}

#dashboardBottomWidgets .dashboard-summary-item {
  grid-template-columns: 18px minmax(0, 1fr) minmax(44px, auto);
  gap: 8px;
  min-height: 37px;
  padding: 7px 0;
  align-items: center;
  border-bottom-color: #edf1f7;
}

#dashboardBottomWidgets .dashboard-summary-dot {
  width: 15px;
  height: 15px;
  margin-top: 0;
  font-size: 8px;
  line-height: 1;
}

#dashboardBottomWidgets .dashboard-summary-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

#dashboardBottomWidgets .dashboard-summary-copy strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-copy span,
#dashboardBottomWidgets .dashboard-summary-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #66758a;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#dashboardBottomWidgets .dashboard-summary-meta {
  max-width: 82px;
  overflow: hidden;
  color: #526176;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-meta.danger,
#dashboardBottomWidgets .dashboard-summary-meta.warning,
#dashboardBottomWidgets .dashboard-summary-meta.success {
  justify-self: end;
  padding: 3px 7px;
  border-radius: 999px;
}

#dashboardBottomWidgets .dashboard-summary-meta.danger {
  color: #d52020;
  background: #ffe8e8;
}

#dashboardBottomWidgets .dashboard-summary-meta.warning {
  color: #d97706;
  background: #fff2d8;
}

#dashboardBottomWidgets .dashboard-summary-meta.success {
  color: #08775a;
  background: #dcf7e7;
}

#dashboardBottomWidgets .dashboard-summary-progress {
  gap: 7px;
}

#dashboardBottomWidgets .dashboard-summary-progress span {
  width: 74px;
  height: 5px;
}

#dashboardBottomWidgets .dashboard-summary-progress strong {
  min-width: 28px;
  color: #12213a;
  font-size: 10px;
  line-height: 1;
}

#dashboardBottomWidgets .dashboard-summary-footer {
  min-height: 36px;
  padding: 0 12px;
  color: #0b66d8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-footer::after {
  content: '?';
  margin-left: 6px;
  font-size: 13px;
}

#dashboardBottomWidgets .dashboard-summary-list .empty-state {
  margin: 14px 0;
  font-size: 11px;
}

/* Sidebar: marca legível sobre o menu escuro */
.sidebar .brand {
  padding: 18px 18px 14px;
}

.sidebar .brand > div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 228px);
  padding: 10px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(2, 8, 23, 0.16);
}

.sidebar .brand-logo-sidebar {
  height: 48px;
  max-width: 188px;
  filter: none;
}

.sidebar .brand small {
  margin-top: 4px;
  color: #1f2937;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

@media (max-width: 1500px) {
  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar recolhida por padrao no desktop */
@media (min-width: 901px) {
  .sidebar:not(:hover) .nav-item {
    font-size: 0;
    text-indent: 0;
  }

  .sidebar:not(:hover) .nav-item > span:not(.icon),
  .sidebar:not(:hover) .plain-action > span:not(.icon),
  .sidebar:not(:hover) .nav-parent-item::after {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
  }

  .sidebar:not(:hover) .nav-subitem {
    display: none !important;
  }

  .sidebar:not(:hover) .nav-item .icon {
    display: inline-flex;
    font-size: 0;
    line-height: 1;
    margin: 0 auto;
  }

  .sidebar:not(:hover) .nav-item .icon::before,
  .sidebar:not(:hover) .nav-item .icon::after {
    text-indent: 0;
  }

  :root {
    --sidebar-collapsed-width: 84px;
    --sidebar-expanded-width: 300px;
  }

  .sidebar {
    width: var(--sidebar-collapsed-width);
    top: var(--topbar-height);
    z-index: 80;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    transition:
      width 220ms ease,
      box-shadow 220ms ease,
      border-color 220ms ease;
  }

  .sidebar:hover {
    width: var(--sidebar-expanded-width);
    box-shadow: 24px 0 46px rgba(2, 8, 23, 0.28);
  }

  .main-area {
    margin-left: var(--sidebar-collapsed-width);
    transition: margin-left 220ms ease;
  }

  .sidebar .brand {
    display: none;
  }

  .sidebar-nav {
    padding: 8px 10px 18px;
    overflow-x: hidden;
  }

  .nav-item,
  .plain-action {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
    white-space: nowrap;
  }

  .sidebar:hover .nav-item,
  .sidebar:hover .plain-action {
    justify-content: flex-start;
    gap: 18px;
    padding-inline: 22px;
  }

  .nav-item > span:not(.icon),
  .plain-action > span:not(.icon),
  .nav-parent-item::after {
    width: 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 140ms ease,
      max-width 180ms ease;
  }

  .sidebar:hover .nav-item > span:not(.icon),
  .sidebar:hover .plain-action > span:not(.icon),
  .sidebar:hover .nav-parent-item::after {
    width: auto;
    max-width: 210px;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-parent-item::after {
    display: block;
  }

  .nav-subitem {
    justify-content: center;
    margin-left: 0;
    padding-inline: 0;
  }

  .sidebar:not(:hover) .nav-subitem {
    display: none;
  }

  .sidebar:hover .nav-subitem {
    justify-content: flex-start;
    margin-left: 42px;
    padding-inline: 14px;
  }

  .sidebar .icon {
    flex: 0 0 auto;
  }

  .sidebar:not(:hover) .brand {
    align-items: center;
    padding-inline: 0;
  }

  .sidebar:not(:hover) .brand > div {
    margin-inline: auto;
  }

  .sidebar:not(:hover) .sidebar-nav {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    padding-inline: 0;
    width: 100%;
  }

  .sidebar:not(:hover) .nav-item,
  .sidebar:not(:hover) .plain-action {
    align-items: center;
    border-radius: 14px;
    display: flex;
    height: 56px;
    justify-content: center;
    margin-inline: auto;
    min-height: 56px;
    padding: 0;
    width: 56px;
  }

  .sidebar:not(:hover) .nav-subitem,
  .sidebar:not(:hover) .nav-subitem.is-expanded,
  .sidebar:not(:hover) .nav-subitem.is-active {
    display: none !important;
  }

  .sidebar:not(:hover) .nav-parent-item::after,
  .sidebar:not(:hover) .nav-subitem::before {
    display: none !important;
  }

  .sidebar:not(:hover) .nav-parent,
  .sidebar:not(:hover) .nav-group {
    align-items: center;
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .sidebar:not(:hover) .nav-item .icon,
  .sidebar:not(:hover) .plain-action .icon {
    flex: 0 0 24px;
    height: 24px;
    margin: 0;
    width: 24px;
  }

  .sidebar:not(:hover) .nav-item > span:not(.icon),
  .sidebar:not(:hover) .plain-action > span:not(.icon) {
    display: none !important;
  }
}

/* ===================== Pipeline de Vendas ===================== */
.pipeline-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.pipeline-metric {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
}

.pipeline-metric .eyebrow {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.pipeline-metric strong {
  color: var(--ink, #0f172a);
  font-size: 24px;
  font-weight: 800;
}

.pipeline-metric small {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.pipeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pipeline-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pipeline-filters input[type="search"],
.pipeline-filters select,
.pipeline-custom-range input[type="date"] {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: var(--panel, #fff);
  color: var(--text, #1f2937);
  font-size: 14px;
}

.pipeline-filters input[type="search"] {
  min-width: 260px;
}

/* Filtro de Tipo (multi-seleção por checkbox). */
.pipeline-type-filter {
  position: relative;
}

.pipeline-type-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: var(--panel, #fff);
  color: var(--text, #1f2937);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.pipeline-type-caret {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.pipeline-type-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 200px;
  padding: 6px;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}

.pipeline-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text, #0f172a);
  cursor: pointer;
}

.pipeline-type-option:hover {
  background: var(--surface-muted, #f1f5f9);
}

.pipeline-type-option input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.pipeline-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted, #64748b);
  font-size: 13px;
}

.pipeline-board {
  display: grid;
  /* 5 colunas sempre na mesma linha: preenchem a largura (1fr) e, quando nao
     couberem, param num minimo legivel (260px) e o board rola na horizontal —
     sem reorganizar/quebrar as etapas em varias linhas. */
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.pipeline-column {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  background: var(--surface-soft, #f8fafc);
  overflow: hidden;
}

.pipeline-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 11px;
  font-weight: 800;
  font-size: 12.5px;
  color: #fff;
  border-bottom: 3px solid rgba(15, 23, 42, .08);
}

.pipeline-column-head b {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  text-align: center;
  font-size: 11.5px;
}

/* Soma dos valores da etapa, centralizada no cabeçalho da coluna. */
.pipeline-column-sum {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0.95;
}
.pipeline-column-sum:empty {
  display: none;
}

.pipeline-column-head.is-nao-enviada { background: #64748b; }
.pipeline-column-head.is-enviada { background: #2563eb; }
.pipeline-column-head.is-negociacao { background: #d97706; }
.pipeline-column-head.is-fechada { background: #16a34a; }
.pipeline-column-head.is-perdida { background: #dc2626; }

.pipeline-column-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  min-height: 120px;
  transition: background .12s ease;
}

.pipeline-column-body.is-dropping {
  background: rgba(37, 99, 235, .08);
  outline: 2px dashed rgba(37, 99, 235, .4);
  outline-offset: -6px;
}

.pipeline-empty {
  margin: 8px 0;
  color: var(--muted, #94a3b8);
  font-size: 13px;
  text-align: center;
}

.pipeline-card {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line, #e2e8f0);
  border-left: 4px solid #cbd5e1;
  border-radius: 12px;
  background: var(--panel, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  cursor: grab;
}

.pipeline-card:active { cursor: grabbing; }
.pipeline-card.is-dragging { opacity: .5; }
.pipeline-card.is-expired { border-left-color: #dc2626; }
.pipeline-card.is-followup { border-left-color: #d97706; }

.pipeline-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-card-top strong {
  color: var(--ink, #0f172a);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.pipeline-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.pipeline-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}

.pipeline-badge.is-expired { background: #fee2e2; color: #b91c1c; }
.pipeline-badge.is-followup { background: #ffedd5; color: #9a3412; }

.pipeline-card-number {
  color: var(--muted, #64748b);
  font-size: 11.5px;
  font-weight: 700;
  /* Desde 29/09 esta linha traz a DESCRICAO da negociacao, que e' texto livre
     e pode ser longa ("Renovação de Licenciamento Veeam"). Sem o corte, ela
     quebra em duas linhas e desalinha a altura dos cartoes da coluna. O nome
     inteiro fica na dica do hover. */
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card-value {
  color: var(--ink, #0f172a);
  font-size: 14px;
  font-weight: 800;
}

.pipeline-card-time {
  color: var(--muted, #64748b);
  font-size: 11.5px;
}

.pipeline-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.pipeline-card-action {
  padding: 3px 8px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-soft, #f8fafc);
  color: var(--text, #334155);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.pipeline-card-action:hover { background: #eef2f9; }
.pipeline-card-action.is-win { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.pipeline-card-action.is-lose { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

/* Botao excluir negociacao (lixeira), alinhado a direita da barra de acoes. */
.pipeline-card-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: #94a3b8;
  cursor: pointer;
}
.pipeline-card-delete:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

/* Detalhe da proposta */
.pipeline-detail-card { max-width: 640px; width: min(640px, 92vw); }

.pipeline-detail-body {
  display: grid;
  gap: 16px;
  padding: 4px 4px 8px;
}

.pipeline-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-detail-grid > div {
  display: grid;
  gap: 2px;
}

.pipeline-detail-grid small {
  color: var(--muted, #64748b);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.pipeline-detail-grid strong {
  color: var(--ink, #0f172a);
  font-size: 14px;
}

.pipeline-detail-history h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink, #0f172a);
}

.pipeline-detail-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.pipeline-detail-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
}

.pipeline-detail-history li em { color: var(--muted, #64748b); font-style: normal; }
.pipeline-detail-history li span { margin-left: auto; color: var(--muted, #64748b); font-size: 12px; }
.pipeline-detail-history li small { flex-basis: 100%; color: var(--muted, #64748b); }

.pipeline-loss-card { max-width: 460px; width: min(460px, 92vw); }
.pipeline-loss-body { display: grid; gap: 16px; padding: 22px 28px 6px; }
.pipeline-loss-body .full-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #475569; }
.pipeline-loss-body select, .pipeline-loss-body textarea { border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 400; background: #fff; width: 100%; box-sizing: border-box; }
.pipeline-loss-body textarea { resize: vertical; min-height: 84px; }
.pipeline-loss-card .modal-actions { margin: 0; padding: 16px 28px 22px; border-top: 1px solid var(--line-soft); }

/* (Removidos os breakpoints que reduziam o Kanban para 3/2 colunas — agora as 5
   etapas ficam sempre em linha e o board rola na horizontal quando aperta.) */

/* Celular/tablet: botoes de acao do card com alvo de toque confortavel (>=40px). */
@media (max-width: 900px) {
  .pipeline-card-action {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* Celular: Kanban por rolagem horizontal com "snap" por coluna — mantem o modelo
   de Kanban (deslize para o lado para trocar de etapa) em vez de empilhar tudo. */
@media (max-width: 640px) {
  .pipeline-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 6px;
  }
  .pipeline-column {
    flex: 0 0 86vw;
    max-width: 86vw;
    scroll-snap-align: start;
  }
  .pipeline-detail-grid { grid-template-columns: 1fr; }
}

/* ===================== Detalhe da Negociacao (Pipeline) ===================== */
.negotiation-card {
  width: min(920px, 100%);
  /* Altura definida garante que o card sempre caiba na viewport e role por dentro
     (evita cortar o topo/base ao centralizar). */
  height: min(760px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.negotiation-head { padding: 16px 20px 12px; border-bottom: 1px solid #eef2f7; flex: 0 0 auto; }
.negotiation-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.negotiation-client { margin: 0; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; }
.negotiation-title-input {
  border: 1px solid transparent;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  padding: 3px 6px;
  margin: 2px 0 0 -6px;
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
}
.negotiation-title-input:hover { border-color: #e2e8f0; }
.negotiation-title-input:focus { border-color: #2563eb; background: #fff; outline: none; }
.negotiation-head-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.negotiation-proposal-num { font-size: 11px; color: #94a3b8; }
.negotiation-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

.pipeline-badge.is-nao-enviada { background: #eef2f7; color: #475569; }
.pipeline-badge.is-enviada { background: #dbeafe; color: #1d4ed8; }
.pipeline-badge.is-negociacao { background: #ffedd5; color: #9a3412; }
.pipeline-badge.is-fechada { background: #dcfce7; color: #15803d; }
.pipeline-badge.is-perdida { background: #fee2e2; color: #b91c1c; }

.negotiation-stagebar { display: flex; gap: 3px; margin-top: 12px; }
.negotiation-stage {
  flex: 1; text-align: center; padding: 6px 2px; border-radius: 6px;
  background: #f1f5f9; color: #94a3b8; font-size: 10.5px; line-height: 1.25;
  border: none; cursor: pointer; font-family: inherit;
}
.negotiation-stage:hover { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .35); }
.negotiation-stage b { font-weight: 600; }
.negotiation-stage small { display: block; opacity: .85; }
.negotiation-stage.is-done { background: #eef6ee; color: #4d7c3f; }
.negotiation-stage.is-current { color: #fff; }
.negotiation-stage.is-current.is-nao-enviada { background: #64748b; }
.negotiation-stage.is-current.is-enviada { background: #2563eb; }
.negotiation-stage.is-current.is-negociacao { background: #d97706; }
.negotiation-stage.is-current.is-fechada { background: #16a34a; }
.negotiation-stage.is-current.is-perdida { background: #dc2626; }

.negotiation-columns { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: minmax(0, 1fr); flex: 1 1 auto; overflow: hidden; min-height: 0; }
.negotiation-side { border-right: 1px solid #eef2f7; background: #fafbfc; padding: 14px 16px; overflow-y: auto; min-height: 0; }
.negotiation-main { padding: 14px 18px; overflow-y: auto; min-height: 0; }

.negotiation-section { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #eef2f7; }
.negotiation-section:last-child { border-bottom: none; margin-bottom: 0; }
.negotiation-section h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.negotiation-section h4 small { text-transform: none; letter-spacing: 0; color: #94a3b8; font-weight: 400; }
.negotiation-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #64748b; margin-bottom: 8px; }
.negotiation-field input, .negotiation-field select {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 9px; font-size: 13px; color: #0f172a; background: #fff;
}
.negotiation-field input:focus, .negotiation-field select:focus { border-color: #2563eb; outline: none; }
.negotiation-field input:disabled { background: #f1f5f9; color: #94a3b8; }
.negotiation-readonly { display: flex; flex-direction: column; margin-bottom: 6px; }
.negotiation-readonly small { font-size: 11px; color: #94a3b8; }
.negotiation-readonly span { font-size: 13px; color: #0f172a; }
.negotiation-hint { margin: -2px 0 8px; font-size: 11px; color: #b45309; }
.negotiation-link { display: inline-block; margin: -2px 0 8px; font-size: 12px; color: #1d4ed8; text-decoration: none; }
.negotiation-link:hover { text-decoration: underline; }
.negotiation-company { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #0f172a; }
.negotiation-stars { display: flex; gap: 2px; }
.negotiation-star { border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: #dbe1e8; padding: 0 1px; }
.negotiation-star.is-on { color: #f59e0b; }

.negotiation-tabs { display: flex; gap: 16px; border-bottom: 1px solid #eef2f7; margin-bottom: 12px; }
.negotiation-tab { border: none; background: none; cursor: pointer; padding: 0 0 8px; font-size: 13px; color: #64748b; border-bottom: 2px solid transparent; }
.negotiation-tab.is-active { color: #1d4ed8; font-weight: 600; border-bottom-color: #1d4ed8; }

.negotiation-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #eef2f7; }
.negotiation-timeline-item { position: relative; margin-bottom: 14px; }
.negotiation-timeline-item::before {
  content: ''; position: absolute; left: -19px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1;
}
.negotiation-timeline-item p { margin: 0; font-size: 13px; color: #0f172a; }
.negotiation-timeline-note { margin-top: 3px !important; background: #f8fafc; border-radius: 6px; padding: 6px 8px; color: #475569 !important; font-size: 12.5px; }
.negotiation-timeline-item time { font-size: 11px; color: #94a3b8; }
.negotiation-empty { font-size: 13px; color: #94a3b8; padding: 8px 0; }

/* Aba Anexos da negociacao */
.negotiation-attach-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.negotiation-attach-btn { display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.negotiation-attach-btn.is-disabled { opacity: 0.6; pointer-events: none; }
.negotiation-attach-status { min-height: 0; margin: 0 0 8px; font-size: 12.5px; }
.negotiation-attach-status:empty { display: none; }
.negotiation-attachments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.negotiation-attachment { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 8px; background: #fff; }
.negotiation-attachment-icon { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.negotiation-attachment-info { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.negotiation-attachment-name { font-weight: 600; color: #1f2937; overflow-wrap: anywhere; }
.negotiation-attachment-info small { color: #94a3b8; font-size: 12px; }
.negotiation-attachment-actions { display: flex; gap: 10px; flex: 0 0 auto; }

.negotiation-history-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.negotiation-filter { display: inline-flex; gap: 2px; background: #f1f5f9; border-radius: 999px; padding: 3px; }
.negotiation-filter button { border: none; background: none; cursor: pointer; font-size: 12px; color: #64748b; padding: 4px 12px; border-radius: 999px; }
.negotiation-filter button.is-active { background: #fff; color: #1d4ed8; font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.negotiation-note-editor { margin-bottom: 14px; }
.negotiation-note-editor textarea, .negotiation-note-edit-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 13px; resize: vertical; color: #0f172a; font-family: inherit; }
.negotiation-note-editor textarea:focus, .negotiation-note-edit-input:focus { border-color: #2563eb; outline: none; }
.negotiation-note-edit-input { border-color: #2563eb; margin: 4px 0; }
.negotiation-note-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.negotiation-timeline-foot { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.negotiation-note-tools { display: inline-flex; gap: 10px; }
.negotiation-timeline-item.is-note::before { background: #2563eb; }

.negotiation-tasks-count { font-size: 12px; color: #64748b; }
.negotiation-task-editor { margin-bottom: 14px; padding: 12px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; }
.negotiation-task-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.negotiation-task-list { display: flex; flex-direction: column; gap: 8px; }
.negotiation-task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 10px; }
.negotiation-task.is-done { opacity: .6; }
.negotiation-task.is-done .negotiation-task-title { text-decoration: line-through; }
.negotiation-task-check { display: flex; align-items: center; }
.negotiation-task-check input { width: 16px; height: 16px; margin-top: 2px; cursor: pointer; accent-color: #16a34a; }
.negotiation-task-body { flex: 1; min-width: 0; }
.negotiation-task-title { margin: 0; font-size: 13.5px; color: #0f172a; }
.negotiation-task-meta { margin: 2px 0 0; font-size: 12px; color: #94a3b8; }
.negotiation-task-meta .is-overdue { color: #dc2626; font-weight: 600; }
.negotiation-task-tools { display: inline-flex; gap: 10px; flex: 0 0 auto; }
.negotiation-task-tools button { font-size: 11.5px; }
@media (max-width: 720px) { .negotiation-task-form-row { grid-template-columns: 1fr; } }

.negotiation-proposal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin-bottom: 12px; }
.negotiation-proposal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.negotiation-proposal-modules { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.negotiation-proposal-modules span { background: #eff6ff; color: #1d4ed8; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; }

/* Outras propostas vinculadas a mesma negociacao (alem da principal). */
.negotiation-linked-proposals { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.negotiation-linked-proposals h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.negotiation-linked-proposal {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 6px;
}
.negotiation-linked-num { font-weight: 600; font-size: 13px; color: var(--text); }
.negotiation-linked-value { font-size: 13px; color: var(--muted); }
.negotiation-linked-proposal .ghost-link { margin-left: auto; }

/* Botoes de acao no topo (pequenos e delicados). */
.negotiation-headbtn { border: none; border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer; color: #fff; line-height: 1; white-space: nowrap; }
.negotiation-headbtn.is-lose { background: #dc2626; }
.negotiation-headbtn.is-lose:hover { background: #b91c1c; }
.negotiation-headbtn.is-win { background: #16a34a; }
.negotiation-headbtn.is-win:hover { background: #15803d; }
.negotiation-headbtn.is-reopen { background: #2563eb; }
.negotiation-headbtn.is-reopen:hover { background: #1d4ed8; }

/* Status vira uma faixa fina abaixo do cabecalho; some quando vazio. */
.negotiation-status { flex: 0 0 auto; }
.negotiation-status:empty { display: none; }
.negotiation-card .negotiation-status { margin: 0; font-size: 12px; padding: 5px 20px; background: #f8fafc; color: #475569; border-radius: 0; }
.negotiation-card .negotiation-status[data-state="success"] { color: #15803d; background: #f0fdf4; }
.negotiation-card .negotiation-status[data-state="error"] { color: #b91c1c; background: #fef2f2; }

@media (max-width: 720px) {
  .negotiation-card { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
  .negotiation-columns { grid-template-columns: 1fr; grid-template-rows: auto; overflow-y: auto; }
  .negotiation-side, .negotiation-main { overflow-y: visible; }
  .negotiation-side { border-right: none; border-bottom: 1px solid #eef2f7; }
  .negotiation-proposal-grid { grid-template-columns: 1fr; }
  .negotiation-stage b { font-size: 10px; }
}

/* ===================== Tarefas (Gestão Comercial) ===================== */
.sales-tasks-panel { padding: 18px 20px; }
.sales-tasks-counters { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sales-tasks-counter { border: none; background: none; cursor: pointer; font-size: 13px; color: #64748b; padding: 2px 4px; }
.sales-tasks-counter b { color: #0f172a; }
.sales-tasks-counter.is-overdue b { color: #dc2626; }
.sales-tasks-counter:hover { text-decoration: underline; }
.sales-tasks-counter-sep { color: #cbd5e1; }
.sales-tasks-toolbar { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.sales-tasks-situacao { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b; }
.sales-tasks-situacao select { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff; }
.sales-tasks-filter { position: relative; }
.sales-tasks-filter-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; color: #475569; white-space: nowrap; }
.sales-tasks-dropdown { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 6px; min-width: 220px; max-height: 280px; overflow-y: auto; }
.sales-tasks-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: #0f172a; cursor: pointer; }
.sales-tasks-dropdown-item:hover { background: #f1f5f9; }
.sales-tasks-dropdown-empty { padding: 8px; font-size: 12px; color: #94a3b8; margin: 0; }
.sales-tasks-filter-count { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: #64748b; white-space: nowrap; }
.sales-tasks-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sales-tasks-chips:empty { display: none; }
.sales-tasks-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f7; color: #334155; border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; }
.sales-tasks-chip button { border: none; background: none; cursor: pointer; color: #64748b; font-size: 14px; line-height: 1; padding: 0 2px; }
.sales-tasks-chip button:hover { color: #dc2626; }
.sales-tasks-custom-range input { min-width: 130px; }
.sales-tasks-table-wrap { overflow-x: auto; }
.sales-tasks-table { width: 100%; border-collapse: collapse; }
.sales-tasks-table th, .sales-tasks-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #eef2f7; font-size: 13px; vertical-align: middle; }
.sales-tasks-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 600; }
.sales-tasks-check-col { width: 34px; }
.sales-tasks-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sales-tasks-sortable:hover { color: #1d4ed8; }
.sales-tasks-table tr.is-done { opacity: .6; }
.sales-task-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.sales-task-badge.is-atrasada { background: #fee2e2; color: #b91c1c; }
.sales-task-badge.is-pendente { background: #eef2f7; color: #475569; }
.sales-task-badge.is-concluida { background: #dcfce7; color: #15803d; }
.sales-task-title-btn, .sales-task-neg-btn { border: none; background: none; cursor: pointer; text-align: left; padding: 0; color: #1d4ed8; font-size: 13px; }
.sales-task-title-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sales-task-type-icon { font-size: 15px; }
.sales-task-neg-btn { display: flex; flex-direction: column; gap: 1px; }
.sales-task-neg-btn strong { color: #1d4ed8; }
.sales-task-neg-btn small { color: #64748b; font-weight: 400; }
.sales-task-due { white-space: nowrap; }
.sales-task-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #e6f1fb; color: #185fa5; font-size: 11px; font-weight: 600; }
.sales-task-row-actions { display: inline-flex; gap: 10px; white-space: nowrap; }
.sales-task-row-actions button { font-size: 12px; }
.sales-tasks-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12px; color: #64748b; }
.sales-tasks-page-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 5px 10px; margin-left: 4px; cursor: pointer; font-size: 12px; }
.sales-tasks-page-btn.is-active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.sales-task-modal-card { width: min(660px, 100%); }
.sales-task-modal-body { display: flex; flex-direction: column; gap: 18px; padding: 22px 28px 6px; }
.sales-task-modal-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #64748b; }
.sales-task-modal-body input, .sales-task-modal-body select { border: 1px solid #e2e8f0; border-radius: 9px; padding: 11px 12px; font-size: 14px; background: #fff; width: 100%; box-sizing: border-box; }
.sales-task-modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.1fr); gap: 14px; }

/* ----- Modal Criar Negociacao (negociacao sem proposta) ----- */
.create-negotiation-card { width: min(520px, 100%); }
.create-negotiation-body { display: flex; flex-direction: column; gap: 14px; padding: 22px 28px 6px; }
.create-negotiation-body > label, .create-negotiation-grid2 label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #475569; }
.create-negotiation-body input, .create-negotiation-body select { border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; background: #fff; width: 100%; box-sizing: border-box; font-weight: 400; }
.create-negotiation-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.create-neg-amount input { max-width: 200px; }
.req-mark { color: #dc2626; }
.create-negotiation-section { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; border-top: 1px solid #eef2f7; padding-top: 14px; margin: 4px 0 -2px; }
.create-negotiation-body .ghost-link { align-self: flex-start; font-size: 12.5px; margin-top: -6px; }
.create-negotiation-actions { justify-content: flex-end; gap: 8px; }
/* Rodape com respiro nas bordas (o .modal-card nao tem padding interno; cada
   secao se pada. Neutraliza os margins negativos do sticky footer <=900px). */
.sales-task-modal-card .modal-actions,
.create-negotiation-card .modal-actions {
  margin: 0;
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line-soft);
}
.create-neg-client-results { border: 1px solid #e2e8f0; border-radius: 9px; overflow: hidden; margin-top: -6px; max-height: 220px; overflow-y: auto; box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.create-neg-client-item { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: none; background: #fff; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.create-neg-client-item:last-child { border-bottom: none; }
.create-neg-client-item:hover { background: #f8fafc; }
.create-neg-client-item strong { font-size: 13px; color: #0f172a; }
.create-neg-client-item small { font-size: 11px; color: #64748b; }
.create-neg-client-empty { padding: 10px 12px; font-size: 12px; color: #94a3b8; }
.pipeline-card-number.is-no-proposal { color: #94a3b8; font-style: italic; }
.negotiation-proposal-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; }
.negotiation-proposal-empty p { margin: 0; color: #475569; font-size: 13px; }
.negotiation-proposal-empty small { color: #94a3b8; font-size: 11.5px; }

.sales-tasks-bulkbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; color: #1e40af; }
.sales-tasks-bulk-reschedule { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #1e40af; }
.sales-tasks-bulk-reschedule input { border: 1px solid #bfdbfe; border-radius: 8px; padding: 5px 8px; font-size: 12px; }

@media (max-width: 720px) {
  .sales-task-modal-grid { grid-template-columns: 1fr; }
  .create-negotiation-grid2 { grid-template-columns: 1fr; }
  .sales-tasks-toolbar { gap: 8px; }
  .sales-tasks-filter-count { margin-left: 0; }
  .sales-tasks-table thead { display: none; }
  .sales-tasks-table, .sales-tasks-table tbody, .sales-tasks-table tr, .sales-tasks-table td { display: block; width: 100%; }
  .sales-tasks-table tr { border: 1px solid #eef2f7; border-radius: 12px; margin-bottom: 10px; padding: 10px 12px 8px; position: relative; }
  .sales-tasks-table td { border: none; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .sales-tasks-table td[data-label]::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 600; flex: 0 0 auto; }
  .sales-tasks-table .sales-tasks-check-col { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; }
  .sales-task-neg-btn { align-items: flex-end; text-align: right; }
  .sales-task-row-actions { justify-content: flex-end; width: 100%; }
  .sales-tasks-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ===================== Central de Atendimento: modo tela cheia ===================== */
.service-requests-fullscreen-interval {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
}
.service-requests-fullscreen-interval select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.9rem;
}
/* Relogio do painel de parede (22/09/2026). Substituiu o "Atualizado HH:MM:SS":
   num monitor de parede o que importa e' a hora AGORA, nao quando o dado veio.
   40px e' o UNICO tamanho fora da escala do GUIA_DE_PADROES, por decisao do
   Andre em 22/09 e pelo motivo registrado na secao 3.4 do guia: esta tela e'
   lida a metros de distancia, nao a distancia de mesa. Cor #0F172A e peso 700
   sao os do guia. Escopado no painel porque `.card-header` e' compartilhado
   por 30+ telas. */
#serviceRequestsPanel .service-requests-fullscreen-clock {
  /* Fica dentro da barra de acoes, logo antes do "Atualizar a cada" (o gap de
     12px do container e' o unico respiro de que precisa). */
  margin: 0 12px 0 0;
  align-self: center;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  white-space: nowrap;
}

#serviceRequestsPanel .service-requests-fullscreen-clock[hidden] {
  display: none;
}

/* Cobre 100% da viewport. Aplicado por JS (funciona com ou sem Fullscreen API
   nativo): quando o nativo esta ativo, o elemento ja preenche a tela; quando
   falha, este overlay fixo garante a visao cheia mesmo assim. */
.service-requests-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 4000;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  overflow: auto;
  background: #fff;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service-requests-panel.is-fullscreen .table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  max-height: none;
}
.service-requests-panel.is-fullscreen .service-requests-table {
  font-size: 1.02rem;
}
.service-requests-panel.is-fullscreen .service-requests-table th,
.service-requests-panel.is-fullscreen .service-requests-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}
/* Em tela cheia, esconde filtros avancados e paginacao para foco no monitoramento. */
.service-requests-panel.is-fullscreen .service-request-advanced-filters,
.service-requests-panel.is-fullscreen .service-request-table-footer {
  display: none;
}
/* Cards de indicadores dentro da tela cheia: mantem a altura e nao encolhem. */
.service-request-metric-grid.is-fullscreen-metrics {
  flex: 0 0 auto;
  margin: 0;
}

/* ===================== Novo Dashboard (pipeline + tarefas) ===================== */
.dashboard-kpi {
  display: flex; flex-direction: column; gap: 4px;
  min-height: 96px; padding: 16px;
  border: 1px solid rgba(148, 163, 184, .2); border-radius: 14px; background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07); cursor: default;
}
.dashboard-kpi.accent-green { border-top: 3px solid #16a34a; }
/* Tarefas atrasadas > 0: destaque forte em vermelho com pulsar leve. */
.dashboard-kpi.is-danger {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 10px 28px rgba(239, 68, 68, .16);
  animation: dashboardOverduePulse 1.8s ease-in-out infinite;
}
.dashboard-kpi.is-danger .dashboard-kpi-label { color: #b91c1c; }
@keyframes dashboardOverduePulse {
  0%, 100% {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 10px 28px rgba(239, 68, 68, .16);
  }
  50% {
    border-color: #dc2626;
    background: #fee2e2;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .28), 0 12px 30px rgba(239, 68, 68, .30);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-kpi.is-danger { animation: none; }
}
.dashboard-kpi.is-clickable { cursor: pointer; }
.dashboard-kpi.is-clickable:hover { box-shadow: 0 12px 30px rgba(15, 23, 42, .13); }
.dashboard-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dashboard-kpi-label { color: #526176; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.dashboard-kpi-value { color: #101826; font-size: 22px; line-height: 1.1; font-weight: 800; margin: 2px 0; }
.dashboard-kpi-value.danger-text { color: #b91c1c; }
.dashboard-kpi-caption { color: #64748b; font-size: 11px; }
.dashboard-kpi-gear { border: none; background: none; cursor: pointer; color: #94a3b8; font-size: 15px; line-height: 1; padding: 0; }
.dashboard-kpi-gear:hover { color: #185fa5; }
.dashboard-goal-define { align-self: flex-start; font-size: 12px; padding: 0; }
.dashboard-goal-bar { height: 8px; border-radius: 6px; background: #e8edf3; overflow: hidden; margin-top: 4px; }
.dashboard-goal-bar i { display: block; height: 100%; background: #16a34a; border-radius: 6px; }

.dashboard-row-2 { display: grid; gap: 16px; margin-bottom: 16px; align-items: start; }
.dashboard-row-funnel, .dashboard-row-tasks { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
/* align-self:start garante altura natural dos cards de conteudo variavel
   (Ranking, Tarefas) — nao esticam para igualar o vizinho mais alto. */
.dashboard-row-2 > .card { align-self: start; }
/* A Agenda (calendario) ESTICA para preencher a altura da linha (igualando o
   Funil) e distribui a grade internamente para ocupar o espaco. */
.dashboard-row-2 > .dashboard-calendar-compact-card {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}
.dashboard-row-2 > .dashboard-calendar-compact-card .dashboard-calendar-grid { grid-auto-rows: 1fr; }
.dashboard-funnel-card, .dashboard-ranking-card, .dashboard-mytasks-card, .dashboard-recent-requests-card { padding: 16px 18px; }
/* Estados vazios das listas do dashboard: compactos, sem reservar area grande. */
.dashboard-mytasks-list .empty-state, .dashboard-ranking-list .empty-state { margin: 8px 0 2px; color: #94a3b8; font-size: 13px; }

.dashboard-pipeline-funnel { display: grid; gap: 10px; margin-top: 8px; }
.dashboard-pipeline-funnel .dashboard-funnel-row {
  display: grid; grid-template-columns: 120px minmax(60px, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; border: none; background: none; cursor: pointer; padding: 4px 2px; text-align: left; border-radius: 8px;
}
.dashboard-pipeline-funnel .dashboard-funnel-row:hover { background: #f8fafc; }
.dashboard-funnel-label { font-size: 12px; color: #12213a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-funnel-track { height: 8px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.dashboard-funnel-track i { display: block; height: 100%; border-radius: 6px; }
.dashboard-funnel-value { font-size: 11.5px; font-weight: 700; color: #526176; white-space: nowrap; text-align: right; }
.dashboard-funnel-note { margin: 12px 0 0; color: #94a3b8; font-size: 11.5px; }

.dashboard-ranking-list { display: grid; gap: 12px; margin-top: 8px; }
.dashboard-ranking-row { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr); gap: 10px; align-items: center; }
.dashboard-ranking-pos { font-size: 12px; font-weight: 800; color: #94a3b8; }
.dashboard-ranking-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #e6f1fb; color: #185fa5; font-size: 12px; font-weight: 700; }
.dashboard-ranking-main { min-width: 0; }
.dashboard-ranking-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.dashboard-ranking-top strong { color: #12213a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-ranking-top span { color: #526176; white-space: nowrap; font-weight: 600; }
.dashboard-ranking-track { display: block; height: 6px; border-radius: 6px; background: #eef2f7; overflow: hidden; margin-top: 5px; }
.dashboard-ranking-track i { display: block; height: 100%; background: #185fa5; border-radius: 6px; }

.dashboard-mytasks-list { display: grid; gap: 6px; margin-top: 8px; }
.dashboard-task-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 6px; border-radius: 10px; }
.dashboard-task-row:hover { background: #f8fafc; }
.dashboard-task-check { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #cbd5e1; background: #fff; color: #16a34a; cursor: pointer; font-size: 13px; line-height: 1; }
.dashboard-task-check:hover { border-color: #16a34a; background: #f0fdf4; }
.dashboard-task-main { min-width: 0; cursor: pointer; }
.dashboard-task-line { display: flex; align-items: center; gap: 8px; }
.dashboard-task-line strong { font-size: 13px; color: #12213a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-task-main small { color: #64748b; font-size: 11.5px; }
.dashboard-task-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex: 0 0 auto; }
.dashboard-task-badge.is-overdue { color: #b91c1c; background: #fdecec; }
.dashboard-task-badge.is-today { color: #475569; background: #eef2f7; }
.dashboard-task-badge.is-upcoming { color: #185fa5; background: #e8f1fb; }

/* Calendario realocado para a 2a linha: mantem o card sem padding proprio. */
.dashboard-row-2 .dashboard-calendar-compact-card { padding: 0; overflow: hidden; cursor: pointer; }

/* Modal "Definir meta do mes" */
.dashboard-goal-card { width: min(420px, 100%); }
.dashboard-goal-body { display: flex; flex-direction: column; gap: 16px; padding: 22px 28px 6px; }
.dashboard-goal-body .full-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #475569; }
.dashboard-goal-body input { border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 400; background: #fff; width: 100%; box-sizing: border-box; }
.dashboard-goal-card .modal-actions { margin: 0; padding: 16px 28px 22px; border-top: 1px solid var(--line-soft); }

@media (max-width: 1100px) {
  .dashboard-row-funnel, .dashboard-row-tasks { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .dashboard-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-row-funnel, .dashboard-row-tasks { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dashboard-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===================== Aba Domínios do cliente ===================== */
.client-domains-hint { margin: 0 0 14px; color: #64748b; font-size: 13px; }
.client-domains-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.client-domains-add input { flex: 1 1 260px; min-width: 220px; border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; background: #fff; box-sizing: border-box; }
.client-domains-items { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.client-domain-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #eef2f7; border-radius: 12px; background: #fff; }
.client-domain-info { min-width: 0; }
.client-domain-info strong { display: block; font-size: 14px; color: #12213a; }
.client-domain-info small { color: #64748b; font-size: 12px; }
.client-domains-empty { margin-top: 16px; padding: 22px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; text-align: center; }
.client-domains-empty strong { display: block; color: #334155; font-size: 14px; margin-bottom: 4px; }
.client-domains-empty p { margin: 0 0 12px; color: #94a3b8; font-size: 12.5px; }

/* ==== Chat Web (canais embeddaveis) ==== */
.web-chat-card .integration-card-header { align-items: flex-start; }
.web-chat-brand-icon { font-size: 22px; line-height: 1; }
.web-chat-org-label { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: var(--primary, #2563eb); display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft, #dbeafe); padding: 5px 11px; border-radius: 999px; }
.web-chat-channel-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.web-chat-channel-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--border, #e2e8f0); border-radius: 12px;
  background: var(--surface, #fff); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.web-chat-channel-item:hover { border-color: var(--primary, #2563eb); box-shadow: 0 1px 6px rgba(37, 99, 235, .12); }
.web-chat-channel-dot { width: 12px; height: 12px; border-radius: 999px; flex: 0 0 auto; }
.web-chat-channel-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.web-chat-channel-info strong { font-size: 14px; color: #1e293b; }
.web-chat-channel-info small { font-size: 12px; color: #94a3b8; }
.web-chat-channel-status { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.web-chat-channel-status.is-active { background: #dcfce7; color: #15803d; }
.web-chat-channel-status.is-inactive { background: #f1f5f9; color: #64748b; }

.web-chat-form { margin-top: 14px; padding: 16px; border: 1px solid var(--border, #e2e8f0); border-radius: 14px; background: var(--surface-muted, #f8fafc); display: flex; flex-direction: column; gap: 12px; }
.web-chat-form-head { display: flex; align-items: center; justify-content: space-between; }
.web-chat-form-head strong { font-size: 15px; color: #1e293b; }
.web-chat-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #475569; }
.web-chat-field input, .web-chat-field textarea, .web-chat-field select {
  font-weight: 400; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--border, #cbd5e1);
  border-radius: 9px; background: #fff; color: #1e293b; width: 100%;
}
.web-chat-field textarea { resize: vertical; font-family: inherit; }
.web-chat-hint { font-weight: 400; font-size: 11.5px; color: #94a3b8; }
.web-chat-field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.web-chat-field-row .web-chat-field { flex: 1 1 140px; }
.web-chat-field-color input[type="color"] { padding: 3px; height: 38px; cursor: pointer; }
.web-chat-fields-required { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 12px; display: flex; gap: 18px; flex-wrap: wrap; }
.web-chat-fields-required legend { font-size: 12px; font-weight: 600; color: #64748b; padding: 0 6px; }
.web-chat-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #334155; }
.web-chat-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.web-chat-snippet { margin-top: 4px; border-top: 1px dashed var(--border, #cbd5e1); padding-top: 12px; }
.web-chat-snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.web-chat-snippet-head strong { font-size: 13px; color: #1e293b; }
.web-chat-snippet-code {
  margin: 8px 0 0; padding: 12px; border-radius: 10px; background: #0f172a; color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-all; overflow-x: auto;
}
@media (max-width: 640px) {
  .web-chat-field-row { flex-direction: column; }
}



/* ===================== Central Administrativa / Financeira ===================== */
.ac-heading-actions { display: flex; gap: 8px; align-items: center; }

.ac-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 18px; }
.ac-card { text-align: left; background: #fff; border: 1px solid #e5e7eb; border-left: 3px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: box-shadow .15s, transform .12s; }
.ac-card:hover { box-shadow: 0 6px 18px rgba(15,27,45,.10); transform: translateY(-1px); }
.ac-card-label { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.ac-card-value { font-size: 20px; font-weight: 800; color: #0f1b2d; }
.ac-card-hint { font-size: 10.5px; color: #94a3b8; }
.ac-card-afaturar { border-left-color: #EF9F27; } .ac-card-afaturar .ac-card-value { color: #8A5A0B; }
.ac-card-faturado { border-left-color: #639922; } .ac-card-faturado .ac-card-value { color: #3B6D11; }
.ac-card-rdv { border-left-color: #378ADD; } .ac-card-rdv .ac-card-value { color: #185FA5; }
.ac-card-contratos { border-left-color: #E24B4A; } .ac-card-contratos .ac-card-value { color: #A32D2D; }

.ac-tabs { display: flex; gap: 18px; border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; }
.ac-tab { background: none; border: none; padding: 0 0 8px; font-size: 13.5px; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.ac-tab.is-active { color: #185FA5; font-weight: 700; border-bottom-color: #185FA5; }
.ac-badge { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: #FCEBEB; color: #791F1F; }

.ac-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.ac-toolbar input, .ac-toolbar select { border: 1px solid #d7dde6; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: #0f1b2d; background: #fff; }
.ac-toolbar input[type="search"] { min-width: 220px; }
.ac-toolbar-spacer { flex: 1 1 auto; }

.ac-table-wrap { min-height: 120px; }
.ac-table-scroll { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 10px; }
.ac-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 12.5px; }
.ac-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: #94a3b8; padding: 9px 12px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
/* Corpo padrao de toda celula da tabela (evita herdar tamanhos maiores de
   regras genericas de td de outras telas). */
.ac-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #1e293b; font-size: 12.5px; }
/* Nome do cliente/colaborador: mesmo corpo da tabela, so em negrito. */
.ac-table td strong { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
/* Nome do tecnico: texto padrao (nunca em destaque maior). */
.ac-table td.ac-tech { font-size: 12.5px; font-weight: 400; }
.ac-table tr:last-child td { border-bottom: none; }
.ac-table-wrap .muted, .ac-modal .muted { color: #94a3b8; font-size: .92em; }
.ac-row-aging { background: #FCF7F0; }
.ac-aging { color: #B0530F; font-weight: 700; font-size: 10.5px; }
.ac-warn { color: #B0530F; font-weight: 600; font-size: 11px; }

.ac-origin { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 7px; background: #eef2f7; color: #475569; }
.ac-origin-service_order { background: #E6F1FB; color: #0C447C; }
.ac-origin-attendance { background: #EEF2F7; color: #475569; }
.ac-origin-manual { background: #F3EAFB; color: #6B21A8; }

.ac-badge2 { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 8px; white-space: nowrap; display: inline-block; }
.b-afaturar { color: #8A5A0B; background: #FAEEDA; }
.b-faturado { color: #0C447C; background: #E6F1FB; }
.b-pago { color: #27500A; background: #EAF3DE; }
.b-alerta { color: #791F1F; background: #FCEBEB; }
.b-neutro { color: #475569; background: #eef2f7; }

/* Coluna Ação: os botões ficam alinhados e do MESMO tamanho em todas as linhas,
   mesmo quando a linha tem 1 botão e a de baixo tem 4 (min-width fixo).
   Quebram em duas linhas se faltar espaço, em vez de empurrar a tabela e
   criar barra de rolagem horizontal. */
.ac-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
  padding-right: 8px;
}
.ac-mini {
  box-sizing: border-box;
  flex: none;
  /* 68px cabe o maior rotulo ("Reprovar") a 11px e mantem todos iguais.
     Foi 84px e a coluna passou de ~350px, empurrando a tabela para fora e
     cortando o ultimo botao. */
  min-width: 68px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
}
.ac-mini:hover:not(:disabled) { background: #f8fafc; }
.ac-mini:disabled { opacity: 0.45; cursor: not-allowed; }
.ac-mini-primary { color: #27500A; border-color: #C0DD97; background: #F4FAEC; }
.ac-mini-primary:hover:not(:disabled) { background: #EAF3DE; }
.ac-mini-danger { color: #B42318; border-color: #F3C6C2; background: #FEF3F2; }
.ac-mini-danger:hover:not(:disabled) { background: #FEE4E2; }

.ac-empty { padding: 40px 16px; text-align: center; color: #94a3b8; font-size: 13px; border: 1px dashed #e2e8f0; border-radius: 10px; }
.ac-footnote { margin-top: 10px; color: #94a3b8; font-size: 11px; line-height: 1.5; }

/* Modal do modulo financeiro */
.ac-modal-overlay { position: fixed; inset: 0; background: rgba(15,27,45,.45); display: flex; align-items: center; justify-content: center; z-index: 3000; padding: 16px; }
.ac-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 380px; padding: 20px; box-shadow: 0 20px 50px rgba(15,27,45,.30); max-height: 90vh; overflow-y: auto; }
.ac-modal-wide { max-width: 520px; }
.ac-modal h3 { margin: 0 0 14px; font-size: 16px; color: #0f1b2d; }
.ac-modal-form { display: flex; flex-direction: column; gap: 12px; }
.ac-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #475569; }
.ac-field input, .ac-field textarea { border: 1px solid #d7dde6; border-radius: 9px; padding: 9px 11px; font-size: 13px; color: #0f1b2d; font-family: inherit; }
.ac-field input:focus, .ac-field textarea:focus { outline: none; border-color: #185FA5; }
.ac-client-search { position: relative; display: flex; flex-direction: column; }
.ac-client-search input { border: 1px solid #d7dde6; border-radius: 9px; padding: 9px 11px; font-size: 13px; color: #0f1b2d; font-family: inherit; }
.ac-client-search input:focus { outline: none; border-color: #185FA5; }
.ac-client-search-results { margin-top: 6px; border: 1px solid #e3e9f0; border-radius: 9px; overflow: hidden; max-height: 220px; overflow-y: auto; }
.ac-client-search-results[hidden] { display: none; }
.ac-client-search-results button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: #fff; border: none; border-bottom: 1px solid #eef2f7; padding: 8px 11px; cursor: pointer; font-family: inherit; }
.ac-client-search-results button:last-child { border-bottom: none; }
.ac-client-search-results button:hover { background: #f1f6fc; }
.ac-client-search-results strong { font-size: 13px; font-weight: 600; color: #0f1b2d; }
.ac-client-search-results small { font-size: 11px; font-weight: 500; color: #64748b; }
.ac-client-search-empty { margin: 0; padding: 9px 11px; font-size: 12px; font-weight: 500; color: #64748b; }
.ac-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Confirmacao (acConfirm) — substitui o window.confirm do navegador. */
.ac-confirm { max-width: 420px; }
.ac-confirm-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.ac-confirm-head h3 { margin: 0; }
.ac-confirm-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FEE4E2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B42318' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 19px 19px;
}
.ac-confirm-msg {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f1b2d;
  font-size: 13px;
  font-weight: 600;
}
.ac-confirm-details { margin: 0 0 16px; color: #64748b; font-size: 12.5px; line-height: 1.5; }
.ac-confirm .ac-modal-actions { margin-top: 0; }
.ac-confirm-danger-btn { background: #B42318; border-color: #B42318; color: #fff; }
.ac-confirm-danger-btn:hover { background: #912018; border-color: #912018; }
.ac-picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; margin-bottom: 14px; }
.ac-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #eef2f7; border-radius: 9px; padding: 9px 11px; font-size: 12px; }

.ac-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 3200; padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: opacity .25s, transform .25s; }
.ac-toast-success { background: #16803c; }
.ac-toast-error { background: #b42318; }
.ac-toast.is-out { opacity: 0; transform: translateX(-50%) translateY(8px); }

@media (max-width: 900px) { .ac-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .ac-cards { grid-template-columns: 1fr; }
  .ac-toolbar input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .ac-tabs { gap: 12px; }
}

.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #E24B4A; color: #fff; font-size: 10px; font-weight: 700; }

/* Modal do PDF do RDV (conferencia do financeiro) */
.ac-modal-pdf { max-width: 840px; width: 100%; height: 88vh; display: flex; flex-direction: column; }
.ac-pdf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ac-pdf-head h3 { margin: 0; font-size: 15px; }
.ac-close-x { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #64748b; }
.ac-close-x:hover { color: #0f1b2d; }
.ac-code-link { background: none; border: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: #185FA5; cursor: pointer; }
.ac-code-link:hover { text-decoration: underline; }
.ac-os-info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ac-os-info-head > div { display: flex; align-items: center; gap: 8px; }
.ac-os-info-head h3 { margin: 0; font-size: 16px; color: #0f1b2d; }
.ac-os-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 14px; }
.ac-os-info-cell { display: flex; flex-direction: column; gap: 2px; }
.ac-os-info-cell span { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .02em; }
.ac-os-info-cell strong { font-size: 13px; font-weight: 600; color: #0f1b2d; }
.ac-os-info-block { margin-bottom: 14px; }
.ac-os-info-block > span { display: block; font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 5px; }
.ac-os-info-block > p { margin: 0; font-size: 13px; color: #0f1b2d; white-space: pre-wrap; }
.ac-os-info .service-order-detail-list { display: flex; flex-direction: column; gap: 6px; }
.ac-os-info select { border: 1px solid #d7dde6; border-radius: 9px; padding: 9px 11px; font-size: 13px; color: #0f1b2d; font-family: inherit; background: #fff; }
.ac-os-info select:focus { outline: none; border-color: #185FA5; }
.ac-os-info .ac-field > span { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .02em; }
.ac-os-info .ac-modal-actions button { white-space: nowrap; }
.ac-pdf-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ac-pdf-frame { flex: 1 1 auto; width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.ac-pdf-loading { padding: 48px 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.ac-pdf-open { margin-top: 8px; font-size: 12px; }
.ac-pdf-open a { color: #185FA5; }
@media (max-width: 560px) { .ac-modal-pdf { height: 92vh; } }

.b-info { color: #1d4ed8; background: #dbeafe; }

/* ============================================================
   Dashboard customizavel por widgets (gridstack)
   ============================================================ */
.dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.dashboard-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dashboard-edit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dashboard-edit-actions[hidden] { display: none; }
.dashboard-customize-btn { white-space: nowrap; }
.dashboard-edit-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #475569;
  background: #eef4fb;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  padding: 8px 12px;
}
.dashboard-edit-hint[hidden] { display: none; }

.dashboard-screen { overflow-x: hidden; }
.dashboard-grid.grid-stack { min-height: 120px; }

/* O card do widget preenche o item do grid; cabecalho fixo, corpo rola. */
.grid-stack-item-content { display: flex; }
.dashboard-widget-card {
  height: 100%;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.dashboard-widget-card > .dashboard-summary-header,
.dashboard-widget-card > .dashboard-calendar-header,
.dashboard-widget-card > .dashboard-calendar-weekdays,
.dashboard-widget-card > .dashboard-calendar-legend,
.dashboard-widget-card > .dashboard-funnel-note { flex: 0 0 auto; }
.dashboard-widget-card .dashboard-pipeline-funnel,
.dashboard-widget-card .dashboard-ranking-list,
.dashboard-widget-card .dashboard-mytasks-list,
.dashboard-widget-card .dashboard-summary-list,
.dashboard-widget-card .dashboard-calendar-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Widget de metrica */
.dashboard-metric-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}
.dashboard-kpi.dashboard-widget-card { justify-content: center; }

/* Modo edicao */
.grid-stack.is-editing .grid-stack-item-content {
  outline: 2px dashed #b9c6da;
  outline-offset: -2px;
  border-radius: 12px;
}
.grid-stack.is-editing .dashboard-widget-card { cursor: move; }
.grid-stack.is-editing .dashboard-widget-card * { cursor: inherit; }
.grid-stack.is-editing .dashboard-widget-card button,
.grid-stack.is-editing .dashboard-widget-card a { cursor: pointer; }
.dashboard-widget-remove { display: none; }
.grid-stack.is-editing .dashboard-widget-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.grid-stack.is-editing .dashboard-widget-remove:hover { background: #dc2626; }
/* Alca de redimensionar mais visivel em edicao */
.grid-stack.is-editing .grid-stack-item > .ui-resizable-se {
  opacity: 1;
  width: 20px;
  height: 20px;
}

/* Galeria "+ Adicionar widget" */
.dashboard-gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}
.dashboard-gallery-modal[hidden] { display: none; }
.dashboard-gallery-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
}
.dashboard-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f7;
  font-size: 16px;
}
.dashboard-gallery-close { border: none; background: none; font-size: 20px; cursor: pointer; color: #64748b; }
.dashboard-gallery-list { padding: 12px 14px; display: grid; gap: 8px; overflow: auto; }
.dashboard-gallery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
}
.dashboard-gallery-item:hover { border-color: #2563eb; background: #f8fafc; }
.dashboard-gallery-icon { font-size: 22px; flex: 0 0 auto; }
.dashboard-gallery-meta { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.dashboard-gallery-meta small { color: #64748b; font-size: 12px; }
.dashboard-gallery-plus { font-size: 20px; color: #2563eb; font-weight: 700; flex: 0 0 auto; }

/* Adaptacao de conteudo por tamanho (nunca cortar/distorcer) */
.dashboard-kpi.is-tall .dashboard-kpi-value { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.dashboard-kpi.is-short .dashboard-kpi-value { font-size: 1.15rem; }
.dashboard-kpi.is-narrow .dashboard-kpi-caption,
.dashboard-kpi.is-short .dashboard-kpi-caption { font-size: 10.5px; }
.dashboard-widget-card.is-narrow .dashboard-funnel-label,
.dashboard-widget-card.is-narrow .dashboard-funnel-value { font-size: 11px; }
.dashboard-widget-card.is-narrow .dashboard-ranking-top span { font-size: 11px; }

/* Personalizacao apenas em telas largas */
@media (max-width: 1100px) {
  .dashboard-customize-btn { display: none; }
  .dashboard-edit-actions { display: none; }
}

/* Widget "Chamados por status" (donut) dentro da grade */
.dashboard-status-chart-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; align-items: center; }
.dashboard-widget-card .dashboard-donut-layout { width: 100%; padding: 8px 12px 12px; }
.dashboard-widget-card.is-narrow .dashboard-donut-layout { grid-template-columns: 1fr; justify-items: center; gap: 12px; }

/* ============================================================
   Central de Atendimento: em monitores estreitos a tabela rola na
   horizontal (comportamento correto de tabela larga). Fixamos CODIGO
   (esquerda) e ACOES (direita) para o chamado e os botoes Iniciar/
   Pausar ficarem SEMPRE visiveis. Em telas largas nao ha rolagem ->
   efeito nulo (layout identico). So CSS, nao altera larguras/resize.
   ============================================================ */
.service-requests-table th[data-request-column="code"],
.service-requests-table td[data-request-column="code"] {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}
.service-requests-table th[data-request-column="code"] {
  background: var(--panel-soft);
  z-index: 4;
}
.service-requests-table td[data-request-column="code"] {
  box-shadow: 6px 0 8px -8px rgba(15, 23, 42, .18);
}
.service-requests-table th[data-request-column="actions"],
.service-requests-table td[data-request-column="actions"] {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
}
.service-requests-table th[data-request-column="actions"] {
  background: var(--panel-soft);
  z-index: 4;
}
.service-requests-table td[data-request-column="actions"] {
  box-shadow: -6px 0 8px -8px rgba(15, 23, 42, .18);
}
/* Mantem o destaque de hover da linha tambem nas colunas fixas. */
.service-requests-table tbody tr:hover td[data-request-column="code"],
.service-requests-table tbody tr:hover td[data-request-column="actions"] {
  background: #f8fbff;
}
/* A coluna Ações é sticky (z-index:2), entao o menu "⋯" (fixed) ficava preso
   nesse stacking context e era coberto pelas células sticky das linhas de baixo.
   Com o menu aberto, elevamos a célula da linha ativa acima das demais. */
.service-requests-table td[data-request-column="actions"]:has(.sr-action-menu.is-open) {
  z-index: 1500;
}

/* ===== Iniciar chat ativo (modal do botao "Iniciar chat" na Central) ===== */
.start-chat-card {
  width: 520px;
  max-width: 94vw;
}
.start-chat-step-label {
  margin: 4px 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
/* Linha do rotulo "2. Contato" + filtro da lista (17/09). O filtro segue o
   padrao de CONTROLE DE FILTRO do guia (secao 2.2): 32px de altura, raio 8,
   12px, borda #D8DDE6 — menor que o campo de busca do cliente (42px), porque
   e' filtro de lista, nao a entrada principal do modal. */
.start-chat-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px;
}
.start-chat-step-row .start-chat-step-label { margin: 0; }
.start-chat-contact-filter {
  position: relative;
  display: block;
  flex: 0 1 220px;
  min-width: 0;
}
.start-chat-contact-filter input {
  width: 100%;
  box-sizing: border-box;
  min-height: 32px;
  height: 32px;
  padding: 5px 10px 5px 30px;
  font-size: 12px;
  color: #1B2536;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  background: #fff;
}
.start-chat-contact-filter input::placeholder { color: #8A93A3; }
.start-chat-contact-filter-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: #8A93A3;
  pointer-events: none;
}
@media (max-width: 520px) {
  .start-chat-step-row { flex-wrap: wrap; }
  .start-chat-contact-filter { flex: 1 1 100%; }
}
.start-chat-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
/* Com apenas um canal ativo (WhatsApp), o card ocupa a largura toda. */
.start-chat-channels:has(.start-chat-channel:only-child) {
  grid-template-columns: 1fr;
}
.start-chat-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.start-chat-channel.is-selected {
  border: 2px solid #1d9e75;
  background: #e1f5ee;
}
.start-chat-channel-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #0f6e56;
}
.start-chat-channel-text strong {
  display: block;
  font-size: 14px;
  color: #085041;
}
.start-chat-channel-text small {
  display: block;
  font-size: 12px;
  color: #0f6e56;
}
.start-chat-search-field {
  position: relative;
  display: block;
  margin-bottom: 8px;
}
.start-chat-search-field input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 38px;
}
.start-chat-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--muted);
  pointer-events: none;
}
.start-chat-client-results {
  position: static;
  margin-bottom: 12px;
  box-shadow: none;
}
.start-chat-selected-client {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--primary-soft);
  background: var(--primary-soft);
  border-radius: 10px;
  cursor: pointer;
}
.start-chat-selected-client[hidden] {
  display: none;
}
.start-chat-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  color: var(--primary-dark);
}
.start-chat-selected-client-info strong {
  display: block;
  font-size: 14px;
  color: var(--primary-dark);
}
.start-chat-selected-client-info small {
  display: block;
  font-size: 12px;
  color: var(--primary-dark);
}
.start-chat-selected-client button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.start-chat-contacts {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.start-chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.start-chat-contact:first-child {
  border-top: 0;
}
.start-chat-contact.is-selected {
  background: var(--panel-soft);
  border-left: 3px solid #1d9e75;
}
/* Atalho para cadastrar contato sem sair do "Iniciar chat". Fica como ULTIMA
   linha da lista (o container tem borda e overflow hidden, entao um botao com
   raio proprio criaria borda dupla); o azul e o "+" o separam dos contatos, que
   sao opcoes de escolha — este e uma acao. */
.start-chat-add-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.start-chat-add-contact:hover {
  background: var(--panel-soft);
}
.start-chat-contact-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--panel-soft);
  color: var(--muted);
}
.start-chat-contact.is-selected .start-chat-contact-avatar {
  background: #e1f5ee;
  color: #0f6e56;
}
.start-chat-contact-info strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.start-chat-contact-info small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.start-chat-contact-check {
  margin-left: auto;
  color: #0f6e56;
  font-weight: 800;
}
.start-chat-hint {
  margin: 0;
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Iniciar chat — ajustes de layout (header com badge, ícones) ===== */
.start-chat-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.start-chat-brand-badge {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e1f5ee;
  color: #0f6e56;
}
.start-chat-header-text {
  flex: 1 1 auto;
  min-width: 0;
}
.start-chat-header-text h2 {
  margin: 0;
}
.start-chat-brand-sub {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f6e56;
}
/* Corpo com o mesmo respiro lateral do cabeçalho (padrão dos modais: 28px). */
.start-chat-body {
  padding: 22px 28px 26px;
}
.start-chat-lead {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}
.start-chat-selected-check {
  margin-left: auto;
  color: var(--primary-dark);
  font-weight: 800;
}
.start-chat-contact-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.start-chat-contact-line svg {
  flex: 0 0 auto;
  color: #1d9e75;
}
.start-chat-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Aba global "Pesquisa de Satisfação" (CSAT) no Fluxo de atendimento. */
.satisfaction-survey-panel {
  display: grid;
  gap: 16px;
}
.satisfaction-survey-panel[hidden] { display: none; }
.satisfaction-survey-panel .settings-form {
  transition: opacity .15s ease;
}

/* ===== Relatórios (screen-reports) ===== */
.reports-hub[hidden],
.reports-detail[hidden] { display: none; }

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 18px;
}

.report-card {
  width: 100%;
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px 18px;
  border: 1px solid #dfe4ec;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.report-card:hover,
.report-card:focus-visible {
  border-color: #b7c2d6;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  outline: none;
}

.report-card strong { font-size: 15px; }

.report-card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #2c58e8;
  background: #dbeafe;
}
.report-card-icon .icon { width: 26px; height: 26px; }
.report-card-icon.amber  { color: #d67b00; background: #fff0cf; }
.report-card-icon.blue   { color: #2c58e8; background: #dbeafe; }
.report-card-icon.green  { color: #05a451; background: #d7f8e4; }
.report-card-icon.indigo { color: #5958e9; background: #e9e7ff; }
.report-card-icon.purple { color: #873cec; background: #eee0ff; }
.report-card-icon.teal   { color: #0e8f9c; background: #cff3f6; }

/* ---- Detalhe do relatório ---- */
.report-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
/* Ações + intervalo de datas padronizados no topo à direita do cabeçalho.
   Os botões ficam à esquerda das datas, na mesma linha, alinhados pela base. */
.report-head-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.report-head-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.report-head-buttons:empty { display: none; }
/* Botões do cabeçalho na mesma altura dos campos de data (38px) = "sincronizado". */
.report-head-buttons .secondary-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
}
.report-head-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.report-head-dates:empty { display: none; }
/* Telas estreitas: ações ocupam a linha inteira, alinhadas à esquerda, sem
   ficarem espremidas contra a borda direita; datas e botões esticam. */
@media (max-width: 720px) {
  .report-head-actions {
    margin-left: 0;
    width: 100%;
  }
  .report-head-buttons,
  .report-head-dates { flex: 1 1 auto; }
  .report-head-dates .report-field { flex: 1 1 140px; }
  .report-head-dates .report-field input { width: 100%; }
}
.report-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dfe4ec;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #37445c;
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.report-back:hover { border-color: #b7c2d6; color: #172033; }
.report-detail-head h2 { font-size: 18px; margin: 0; }

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border, #e3e8f0);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.report-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-field label {
  font-size: 12px;
  font-weight: 600;
  color: #647084;
}
.report-field input,
.report-field select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d7deea;
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: #172033;
}
.report-toolbar-spacer { flex: 1 1 auto; }

/* Campo de busca da barra de relatórios: cresce para ocupar o espaço vazio à
   direita, alinhado aos demais filtros e sem empurrar para outra linha. */
.report-field-search {
  flex: 1 1 220px;
  min-width: 180px;
}
.report-field-search input {
  width: 100%;
}

.report-summary {
  color: #647084;
  font-size: 13px;
  margin: 0 2px 10px;
}

.report-table-wrap {
  border: 1px solid var(--border, #e3e8f0);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

/* Paginação dos relatórios (padrão 10/página). */
.report-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 2px 0;
}
.report-pagination-wrap:empty {
  display: none;
}
.report-pagination-info {
  color: #647084;
  font-size: 13px;
}
.report-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.report-pagination-pages button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border, #e3e8f0);
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-size: 13px;
  cursor: pointer;
}
.report-pagination-pages button:hover:not(:disabled):not(.current) {
  background: #f1f5f9;
}
.report-pagination-pages button.current {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 700;
}
.report-pagination-pages button:disabled {
  opacity: 0.45;
  cursor: default;
}
.report-pagination-gap {
  color: #94a3b8;
  padding: 0 2px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table th,
.report-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  white-space: nowrap;
}
.report-table th {
  position: sticky;
  top: 0;
  background: #f6f8fb;
  color: #4a5670;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover td { background: #f9fbfd; }

.report-empty,
.report-soon {
  padding: 34px 20px;
  text-align: center;
  color: #647084;
}
.report-soon strong { display: block; color: #172033; margin-bottom: 4px; }

.report-badge-soon {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff0cf;
  color: #a35a00;
  font-size: 12px;
  font-weight: 600;
}

/* ---- Configurar colunas ---- */
.report-cols { position: relative; }
.report-cols-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
}
.report-cols-panel[hidden] { display: none; }
.report-cols-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #172033;
}
.report-cols-item:hover { background: #f2f6fb; }
.report-cols-item input { width: 15px; height: 15px; flex: none; }

/* ---- Menu de exportação (PDF/Excel/CSV) ---- */
.report-export { position: relative; }
.report-export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 170px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}
.report-export-menu[hidden] { display: none; }
.report-export-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #172033;
  cursor: pointer;
}
.report-export-menu button:hover { background: #f2f6fb; }

/* ===== SLA por prioridade (Config > Atendimento) ===== */
/* Modal justo ao conteudo (enquadramento do mockup), em vez da largura padrao. */
.settings-detail-modal-card:has(#settings-detail-attendance-sla) {
  width: min(620px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 42px));
}
.settings-detail-modal-body:has(#settings-detail-attendance-sla) {
  padding: clamp(18px, 2.4vw, 28px);
}
.settings-card-icon.sla-amber { color: #854F0B; background: #FAEEDA; }
.sla-hub-card { position: relative; }
.sla-hub-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #185FA5; background: #E6F1FB; border-radius: 999px; padding: 2px 8px;
}

.sla-config { max-width: 560px; margin: 0 auto; }
.sla-config-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.sla-config-head-icon {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #854F0B; background: #FAEEDA;
}
.sla-config-head-text { display: flex; flex-direction: column; gap: 2px; }
.sla-config-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8A93A3; }
.sla-config-title { font-size: 17px; font-weight: 500; margin: 0; color: #1B2536; }
.sla-config-intro { font-size: 13px; color: #5A6472; line-height: 1.5; margin: 6px 0 16px; }

.sla-config-card { border: 1px solid #E7EAF0; border-radius: 12px; background: #fff; overflow: hidden; }
.sla-priority-list { margin-bottom: 14px; }
.sla-priority-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-top: 1px solid #EEF1F5;
}
.sla-priority-row:first-child { border-top: none; }
.sla-priority-row--critical { background: #FDF6F8; }
.sla-priority-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sla-priority-desc { font-size: 11px; color: #8A93A3; }

.sla-badge {
  align-self: flex-start; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 11px; border-radius: 999px;
}
.sla-badge--critical { background: #6E2440; color: #fff; }
.sla-badge--high { background: #FBEAF0; color: #993556; }
.sla-badge--medium { background: #FAEEDA; color: #854F0B; }
.sla-badge--low { background: #EEF0F3; color: #5A6472; }

.sla-priority-input { display: flex; align-items: center; gap: 8px; flex: none; }
.sla-priority-input input {
  width: 60px; text-align: center; font-size: 15px; font-weight: 600; color: #1B2536;
  padding: 8px 6px; border: 1px solid #D8DDE6; border-radius: 8px; background: #fff;
  -moz-appearance: textfield;
}
.sla-priority-input input::-webkit-outer-spin-button,
.sla-priority-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sla-priority-input input:focus { outline: none; border-color: #185FA5; box-shadow: 0 0 0 3px rgba(24,95,165,.12); }
.sla-priority-input > span { font-size: 13px; color: #5A6472; }

.sla-pause-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.sla-pause-text { display: flex; flex-direction: column; gap: 3px; }
.sla-pause-text strong { font-size: 13px; font-weight: 500; color: #1B2536; }
.sla-pause-text span { font-size: 11px; color: #8A93A3; line-height: 1.4; }

.sla-switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.sla-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sla-switch-track {
  width: 44px; height: 24px; border-radius: 999px; background: #C7CDD8;
  display: inline-flex; align-items: center; padding: 2px; transition: background .2s;
}
.sla-switch-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.sla-switch input:checked + .sla-switch-track { background: #2563EB; }
.sla-switch input:checked + .sla-switch-track .sla-switch-thumb { transform: translateX(20px); }
.sla-switch input:focus-visible + .sla-switch-track { box-shadow: 0 0 0 3px rgba(37,99,235,.3); }

.sla-config-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  margin-top: 18px; padding: 14px 16px; background: #F5F7FA;
  border: 1px solid #E7EAF0; border-radius: 12px;
}
.sla-config-status { margin-right: auto; font-size: 12px; color: #5A6472; }
.sla-config-status.is-error { color: #C93B3B; }
.sla-config-status.is-success { color: #1D9E75; }
.sla-config-actions { display: flex; gap: 10px; }
.sla-config-actions .primary-button { display: inline-flex; align-items: center; gap: 6px; }

/* ----- Coluna SLA na Central de Atendimento ----- */
td.sla-column { vertical-align: middle; }
.sla-cell { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.sla-cell-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; line-height: 1.25; }
.sla-cell-elapsed { font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: #5A6472; }
.sla-cell-remaining { font-size: 10px; color: #8A93A3; text-align: right; }
.sla-cell-ico { flex: none; }
.sla-cell-bar { height: 6px; border-radius: 3px; background: #E6E9EF; overflow: hidden; }
.sla-cell-fill { display: block; height: 100%; border-radius: 3px; background: #C7CDD8; transition: width .3s ease; }
.sla-cell-empty { color: #B4BAC6; }

/* NO PRAZO (verde) */
.sla-cell--ok .sla-cell-elapsed { color: #1D9E75; }
.sla-cell--ok .sla-cell-fill { background: #1D9E75; }

/* ATENCAO 70-100% (ambar nas duas pontas) */
.sla-cell--warning .sla-cell-elapsed,
.sla-cell--warning .sla-cell-remaining { color: #854F0B; }
.sla-cell--warning .sla-cell-fill { background: #E3A008; }

/* ESTOURADO (barra vermelha, textos rosa) */
.sla-cell--breached .sla-cell-elapsed,
.sla-cell--breached .sla-cell-remaining,
.sla-cell--breached .sla-cell-over { color: #993556; font-weight: 600; }
.sla-cell--breached .sla-cell-fill { background: #C93B3B; }

/* PAUSADO (cinza congelado) */
.sla-cell--paused .sla-cell-elapsed,
.sla-cell--paused .sla-cell-remaining { color: #8A93A3; }
.sla-cell--paused .sla-cell-fill { background: #9AA6B5; }

/* CONCLUIDO: no prazo (verde) / com atraso (vermelho) */
.sla-cell--done .sla-cell-elapsed { color: #1D9E75; }
.sla-cell--done .sla-cell-fill { background: #1D9E75; }
.sla-cell--done.is-late .sla-cell-elapsed,
.sla-cell--done.is-late .sla-cell-remaining,
.sla-cell--done.is-late .sla-cell-over { color: #993556; font-weight: 600; }
.sla-cell--done.is-late .sla-cell-fill { background: #C93B3B; }

/* ===== Linha do chat: prioridade + SLA + separador + etiquetas ===== */
/* A faixa de tags vira display:contents para que TUDO (pilula, chip, separador,
   icone, chips e "+ Tag") flua na MESMA linha flex e quebre junto. */
.floating-chat-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.floating-chat-meta .floating-whatsapp-tags { display: contents; }
.floating-whatsapp-window.is-minimized .floating-chat-meta { display: none; }

.floating-chat-sep {
  flex: none;
  width: 1px;
  align-self: stretch;
  min-height: 18px;
  background: #E1E6EE;
}

/* Linha compacta: o reset global impoe min-height: var(--tap-size) (44px) em
   todo button, o que inflava a pilula, os chips de tag e o "+ Tag". Aqui a
   altura fica uniforme em 26px — folga sobre a linha de texto (~17px), sem
   cortar nada e sem forcar quebra (todos com white-space: nowrap). */
.floating-chat-meta .chat-priority-pill,
.floating-chat-meta .chat-sla-chip,
.floating-chat-meta .floating-tag-chip,
.floating-chat-meta .floating-tag-add-btn {
  box-sizing: border-box;
  height: 26px;
  min-height: 26px;
  white-space: nowrap;
}
.floating-chat-meta .chat-priority-pill { padding: 2px 9px; }
.floating-chat-meta .chat-sla-chip { padding: 2px 4px 2px 9px; }
.floating-chat-meta .floating-tag-chip { padding: 2px 8px; }
.floating-chat-meta .floating-tag-add-btn { padding: 2px 10px; }
/* O "x" do chip tambem e button — sem isso ele estouraria os 26px. */
.floating-chat-meta .floating-tag-chip-remove {
  min-height: 14px;
  min-width: 14px;
}

/* --- Pilula de prioridade --- */
.chat-priority-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: #EEF0F3;
  color: #5A6472;
  transition: filter .15s;
}
.chat-priority-pill:hover { filter: brightness(.97); }
.chat-priority-pill.is-low { background: #EEF0F3; color: #5A6472; border-color: #C7CDD8; }
.chat-priority-pill.is-medium { background: #FAEEDA; color: #854F0B; border-color: #B98418; }
.chat-priority-pill.is-high { background: #FBEAF0; color: #993556; border-color: #C25B7C; }
.chat-priority-pill.is-critical { background: #6E2440; color: #fff; border-color: #6E2440; }
.chat-priority-chevron { opacity: .75; }

/* --- Chip de SLA --- */
.chat-sla-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 4px 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  background: #F0FAF4;
  color: #1D9E75;
}
.chat-sla-text { font-weight: 600; white-space: nowrap; }
.chat-sla-bar {
  flex: none;
  width: 46px;
  height: 5px;
  border-radius: 3px;
  background: #DCE3EC;
  overflow: hidden;
}
.chat-sla-fill { display: block; height: 100%; border-radius: 3px; background: currentColor; transition: width .3s ease; }

.chat-sla-chip--ok { background: #F0FAF4; color: #1D9E75; }
.chat-sla-chip--warning { background: #FDF6E7; color: #854F0B; }
.chat-sla-chip--warning .chat-sla-fill { background: #E3A008; }
.chat-sla-chip--breached { background: #FDF6F8; color: #993556; }
.chat-sla-chip--breached .chat-sla-fill { background: #C93B3B; }
.chat-sla-chip--paused { background: #FAEEDA; color: #854F0B; }
.chat-sla-chip--paused .chat-sla-fill { background: #9AA6B5; }
.chat-sla-chip--done { background: #F2F5F9; color: #5A6472; }
.chat-sla-chip--done .chat-sla-fill { background: #9AA6B5; }

/* O reset global impoe min-height: var(--tap-size) em todo button, o que
   esticava este botao em elipse — por isso o min-height/min-width zerados. */
.chat-sla-chip .chat-sla-btn {
  flex: none;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  aspect-ratio: 1 / 1;
  display: inline-grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
  color: #5A6472;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .18);
}
.chat-sla-btn:hover { filter: brightness(.95); }
.chat-sla-btn.is-resume { background: #1D9E75; color: #fff; }

/* Aviso no lugar do compositor quando o SLA esta em pausa manual. */
/* Janela de 24h fechada (canal Oficial): aviso + botoes de template — 21/09/2026 */
.floating-whatsapp-janela-fechada {
  flex-wrap: wrap;
  background: #E6F1FB;
  color: #185FA5;
}
.floating-whatsapp-janela-fechada .floating-whatsapp-sla-blocked-icon { background: #185FA5; }
.floating-whatsapp-janela-fechada p { flex: 1 1 260px; }
.floating-whatsapp-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.floating-whatsapp-template-actions .secondary-button {
  height: 38px;
  min-height: 0;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
}

.floating-whatsapp-sla-blocked {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: #FAEEDA;
  color: #854F0B;
  font-size: 12px;
  line-height: 1.45;
}
.floating-whatsapp-sla-blocked p { margin: 0; }
.floating-whatsapp-sla-blocked-icon {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #854F0B;
  position: relative;
}
.floating-whatsapp-sla-blocked-icon::before,
.floating-whatsapp-sla-blocked-icon::after {
  content: '';
  position: absolute;
  top: 4.5px;
  width: 3px;
  height: 9px;
  border-radius: 1px;
  background: #FAEEDA;
}
.floating-whatsapp-sla-blocked-icon::before { left: 5.5px; }
.floating-whatsapp-sla-blocked-icon::after { right: 5.5px; }

/* --- Popover de prioridade --- */
.chat-priority-popover {
  position: fixed;
  z-index: 3400;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #E1E6EE;
  box-shadow: 0 14px 38px rgba(15, 27, 45, .16);
}
.chat-priority-popover-title {
  margin: 2px 6px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  color: #8A93A3;
}
.chat-priority-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #1B2536;
  text-align: left;
}
.chat-priority-option:hover { background: #F3F6FA; }
.chat-priority-option.is-current { background: #F3F6FA; }
.chat-priority-swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.chat-priority-swatch.is-low { background: #9AA6B5; }
.chat-priority-swatch.is-medium { background: #E3A008; }
.chat-priority-swatch.is-high { background: #C25B7C; }
.chat-priority-swatch.is-critical { background: #6E2440; }
.chat-priority-name { flex: 1; }
.chat-priority-sla { font-size: 11px; color: #8A93A3; }
.chat-priority-check { color: #1D9E75; font-weight: 700; }

/* --- Popover de pausa (motivo obrigatorio) --- */
.chat-sla-pause-popover {
  position: fixed;
  z-index: 3400;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #E1E6EE;
  box-shadow: 0 14px 38px rgba(15, 27, 45, .16);
}
.chat-sla-pause-label { display: block; font-size: 11px; font-weight: 600; color: #5A6472; margin-bottom: 6px; }
.chat-sla-pause-popover input {
  width: 100%;
  padding: 7px 9px;
  font-size: 13px;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  background: #fff;
  color: #1B2536;
}
.chat-sla-pause-popover input:focus { outline: none; border-color: #185FA5; box-shadow: 0 0 0 3px rgba(24,95,165,.12); }
.chat-sla-pause-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.chat-sla-pause-actions button { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chat-sla-pause-cancel { border: 1px solid #D8DDE6; background: #fff; color: #5A6472; }
.chat-sla-pause-confirm { border: none; background: #2563EB; color: #fff; }
.chat-sla-pause-confirm:disabled { background: #C7CDD8; cursor: not-allowed; }

/* Linha ESTOURADA: fundo rosado com PRIORIDADE sobre a cor do canal. */
tr.sr-sla-breached > td { background: #FDF6F8; }
tr.sr-sla-breached:hover > td { box-shadow: inset 0 0 0 9999px rgba(201, 59, 59, 0.045); }
tr.sr-sla-breached.sr-channel-row > td:first-child { box-shadow: inset 3px 0 0 0 var(--sr-channel-border); }

/* ===== Relatório de SLA ===== */
.sla-rep-subtitle { margin: 2px 0 0; font-size: 12px; color: #8A93A3; }

/* Barra de filtros */
.sla-rep-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  background: #F7F8FA; border: 1px solid #E7EAF0; border-radius: 12px;
}
.sla-rep-funnel { color: #8A93A3; align-self: center; flex: none; }
.sla-rep-field { display: flex; flex-direction: column; gap: 4px; }
.sla-rep-field label {
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: #8A93A3;
}
.sla-rep-field select {
  min-height: 32px; padding: 5px 26px 5px 10px; font-size: 12px;
  border: 1px solid #D8DDE6; border-radius: 8px; background-color: #fff; color: #1B2536;
}
.sla-rep-clear {
  margin-left: auto; align-self: center; min-height: 0; padding: 4px 6px;
  border: none; background: none; color: #2563EB; font-size: 12px; font-weight: 600; cursor: pointer;
}

/* Chips de filtros ativos + contador */
.sla-rep-chips {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.sla-rep-chips-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sla-rep-chips-label { font-size: 12px; color: #8A93A3; }
.sla-rep-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: #EEF0F3; color: #5A6472; font-size: 12px; font-weight: 600;
}
.sla-rep-chip.is-muted { background: none; font-weight: 400; }
.sla-rep-chip.is-period { background: #E6F1FB; color: #185FA5; }
.sla-rep-chip.is-priority-critical { background: #6E2440; color: #fff; }
.sla-rep-chip.is-priority-high { background: #FBEAF0; color: #993556; }
.sla-rep-chip.is-priority-medium { background: #FAEEDA; color: #854F0B; }
.sla-rep-chip.is-priority-low { background: #EEF0F3; color: #5A6472; }
.sla-rep-chip button {
  min-height: 0; padding: 0; border: none; background: none;
  color: inherit; font-size: 13px; line-height: 1; cursor: pointer; opacity: .7;
}
.sla-rep-count { font-size: 12px; color: #8A93A3; }

/* KPIs */
.sla-rep-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.sla-rep-kpi {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid #E7EAF0;
}
.sla-rep-kpi.is-green { background: #E1F5EE; border-color: transparent; }
.sla-rep-kpi.is-green strong { color: #085041; }
.sla-rep-kpi.is-pink { background: #FBEAF0; border-color: transparent; }
.sla-rep-kpi.is-pink strong { color: #6E2440; }
.sla-rep-kpi-label { font-size: 12px; color: #5A6472; }
.sla-rep-kpi strong { font-size: 20px; font-weight: 700; color: #1B2536; line-height: 1.2; }
.sla-rep-kpi strong.is-amber { color: #854F0B; }
.sla-rep-kpi-note { font-size: 11px; color: #8A93A3; }

/* Bloco da tabela */
.sla-rep-table-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.sla-rep-table-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: #1B2536; }
.sla-rep-table-head h3 span { font-weight: 400; font-size: 11px; color: #8A93A3; }
.sla-rep-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #5A6472; }
.sla-rep-sort select {
  min-height: 30px; padding: 4px 24px 4px 8px; font-size: 12px; font-weight: 600;
  border: 1px solid #D8DDE6; border-radius: 8px; background-color: #fff; color: #1B2536;
}
.sla-rep-table-wrap { border: 1px solid #E7EAF0; border-radius: 10px 10px 0 0; overflow-x: auto; }
.sla-rep-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.sla-rep-table th {
  padding: 9px 12px; text-align: left; background: #F7F8FA;
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8A93A3;
  border-bottom: 1px solid #E7EAF0;
}
.sla-rep-table td { padding: 11px 12px; font-size: 12px; color: #1B2536; border-bottom: 1px solid #F0F2F6; vertical-align: middle; }
.sla-rep-table tbody tr:last-child td { border-bottom: none; }
.sla-rep-table th:nth-child(1), .sla-rep-table td:nth-child(1) { width: 13.2%; }
.sla-rep-table th:nth-child(2), .sla-rep-table td:nth-child(2) { width: 23.5%; }
.sla-rep-table th:nth-child(3), .sla-rep-table td:nth-child(3) { width: 10.3%; }
.sla-rep-table th:nth-child(4), .sla-rep-table td:nth-child(4) { width: 8.8%; }
.sla-rep-table th:nth-child(5), .sla-rep-table td:nth-child(5) { width: 13.2%; }
.sla-rep-table th:nth-child(6), .sla-rep-table td:nth-child(6) { width: 17.6%; }
.sla-rep-table th:nth-child(7), .sla-rep-table td:nth-child(7) { width: 13.2%; }
.sla-rep-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sla-rep-table tr.is-over-row > td { background: #FDF6F8; }
.sla-rep-code {
  min-height: 0; padding: 0; border: none; background: none;
  color: #2563EB; font-size: 12px; font-weight: 600; cursor: pointer;
}
.sla-rep-code:hover { text-decoration: underline; }
.sla-rep-spent { white-space: nowrap; }
.sla-rep-spent.is-over { color: #993556; font-weight: 600; }
.sla-rep-spent.is-risk { color: #854F0B; font-weight: 600; }
.sla-rep-pause { display: inline-flex; margin-left: 5px; color: #9AA6B5; vertical-align: middle; }

.sla-rep-prio {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #EEF0F3; color: #5A6472;
}
.sla-rep-prio.is-critical { background: #6E2440; color: #fff; }
.sla-rep-prio.is-high { background: #FBEAF0; color: #993556; }
.sla-rep-prio.is-medium { background: #FAEEDA; color: #854F0B; }
.sla-rep-prio.is-low { background: #EEF0F3; color: #5A6472; }

.sla-rep-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
  background: #EEF0F3; color: #5A6472;
}
.sla-rep-badge.is-over { background: #FBEAF0; color: #993556; }
.sla-rep-badge.is-risk { background: #FAEEDA; color: #854F0B; }
.sla-rep-badge.is-met { background: #E1F5EE; color: #0F6E56; }
.sla-rep-badge.is-ok { background: #EEF0F3; color: #5A6472; }

.sla-rep-table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; background: #F7F8FA;
  border: 1px solid #E7EAF0; border-top: none; border-radius: 0 0 10px 10px;
  font-size: 12px; color: #8A93A3;
}
.sla-rep-more {
  min-height: 0; padding: 0; border: none; background: none;
  color: #2563EB; font-size: 12px; font-weight: 600; cursor: pointer;
}
.sla-rep-empty { text-align: center; color: #8A93A3; padding: 22px 12px !important; }
.sla-rep-notice { padding: 18px; font-size: 13px; color: #5A6472; background: #F7F8FA; border: 1px solid #E7EAF0; border-radius: 10px; }

@media (max-width: 1100px) {
  .sla-rep-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sla-rep-kpis { grid-template-columns: 1fr; }
}

/* ===== Auditoria do sistema ===== */
.settings-card-icon.audit-shield { color: #534AB7; background: #EEEDFE; }
.audit-hub-card small { font-size: 11px; color: #8A93A3; }

.audit-screen { max-width: 1180px; }
.audit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.audit-head h2 { margin: 0; font-size: 19px; font-weight: 600; color: #1B2536; }
.audit-head p { margin: 2px 0 0; font-size: 12px; color: #8A93A3; }
.audit-head .secondary-button { display: inline-flex; align-items: center; gap: 6px; }

.audit-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  background: #F7F8FA; border: 1px solid #E7EAF0; border-radius: 12px;
}
.audit-funnel { color: #8A93A3; align-self: center; flex: none; }
.audit-field { display: flex; flex-direction: column; gap: 4px; }
.audit-field label { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8A93A3; }
.audit-field select, .audit-field input {
  min-height: 32px; padding: 5px 10px; font-size: 12px;
  border: 1px solid #D8DDE6; border-radius: 8px; background-color: #fff; color: #1B2536;
}
.audit-field-search { flex: 1 1 220px; }
.audit-field-search input { width: 100%; }
.audit-clear { margin-left: auto; align-self: center; min-height: 0; padding: 4px 6px;
  border: none; background: none; color: #2563EB; font-size: 12px; font-weight: 600; cursor: pointer; }

.audit-chips { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.audit-chips-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.audit-chips-label { font-size: 12px; color: #8A93A3; }
.audit-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: #EEF0F3; color: #5A6472; font-size: 12px; font-weight: 600; }
.audit-chip.is-period { background: #E6F1FB; color: #185FA5; }
.audit-chip.is-muted { background: none; font-weight: 400; }
.audit-chip button { min-height: 0; padding: 0; border: none; background: none; color: inherit; font-size: 13px; line-height: 1; cursor: pointer; opacity: .7; }
.audit-count { font-size: 12px; color: #8A93A3; }

.audit-table-wrap { border: 1px solid #E7EAF0; border-radius: 10px 10px 0 0; overflow-x: auto; }
.audit-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.audit-table th { padding: 9px 12px; text-align: left; background: #F7F8FA; font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: #8A93A3; border-bottom: 1px solid #E7EAF0; }
.audit-table td { padding: 11px 12px; font-size: 12px; color: #1B2536; border-bottom: 1px solid #F0F2F6; vertical-align: middle; }
.audit-row { cursor: pointer; }
.audit-row:hover > td { background: #FAFBFD; }
.audit-row.is-delete > td { background: #FDF6F8; }
.audit-row.is-delete > td:first-child { box-shadow: inset 3px 0 0 0 #C25B7C; }
.audit-when { white-space: nowrap; color: #5A6472; }
.audit-user { display: inline-flex; align-items: center; gap: 7px; }
.audit-detail-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }

.audit-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; background: #EEF0F3; color: #5A6472; }
.audit-badge.is-criou { background: #E1F5EE; color: #0F6E56; }
.audit-badge.is-editou { background: #E4F5FA; color: #14556B; }
.audit-badge.is-excluiu { background: #FBEAF0; color: #993556; }
.audit-badge.is-alterou { background: #FAEEDA; color: #854F0B; }
.audit-badge.is-login, .audit-badge.is-logout, .audit-badge.is-falha_login { background: #EEEDFE; color: #534AB7; }

.audit-detail-row > td { background: #FBFCFE; padding: 0 !important; }
.audit-detail { padding: 14px 16px; border-left: 3px solid #E7EAF0; }
.audit-detail-head { margin-bottom: 10px; }
.audit-detail-head strong { font-size: 13px; color: #1B2536; }
.audit-detail-head span { font-size: 12px; color: #8A93A3; }
.audit-detail-head small { display: block; font-size: 11px; color: #8A93A3; margin-top: 2px; }
.audit-detail-section { margin: 0 0 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8A93A3; }

.audit-diff { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #E7EAF0; border-radius: 8px; overflow: hidden; }
.audit-diff th { padding: 7px 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #8A93A3; background: #F7F8FA; text-align: left; }
.audit-diff td { padding: 8px 10px; font-size: 12px; border-top: 1px solid #F0F2F6; }
.audit-arrow { color: #8A93A3; text-align: center; width: 30px; }
.audit-old { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #FBEAF0; color: #993556; text-decoration: line-through; }
.audit-new { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #E1F5EE; color: #0F6E56; font-weight: 600; }

.audit-deleted { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px;
  padding: 12px 14px; background: #FDF6F8; border: 1px dashed #EFCBD7; border-radius: 8px; }
.audit-deleted small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #993556; }
.audit-deleted span { font-size: 12px; color: #1B2536; }

.audit-detail-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.audit-tag { padding: 3px 9px; border-radius: 999px; border: 1px solid #E7EAF0; background: #fff; font-size: 11px; color: #5A6472; }
.audit-copy { min-height: 0; padding: 3px 9px; border: 1px solid #D8DDE6; border-radius: 999px; background: #fff;
  color: #2563EB; font-size: 11px; font-weight: 600; cursor: pointer; }

.audit-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px;
  background: #F7F8FA; border: 1px solid #E7EAF0; border-top: none; border-radius: 0 0 10px 10px; font-size: 12px; color: #8A93A3; }
.audit-more { min-height: 0; padding: 0; border: none; background: none; color: #2563EB; font-size: 12px; font-weight: 600; cursor: pointer; }
.audit-empty { text-align: center; color: #8A93A3; padding: 22px 12px !important; }
.audit-notice { padding: 18px; font-size: 13px; color: #5A6472; background: #F7F8FA; border: 1px solid #E7EAF0; border-radius: 10px; }
.audit-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 11px; color: #8A93A3; }
.audit-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.audit-open { min-height: 0; padding: 3px 10px; border: 1px solid #D8DDE6; border-radius: 999px;
  background: #fff; color: #2563EB; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.audit-open:hover { background: #F3F6FA; }

/* ===== Empresa > Parametros: painel de status (so leitura) ===== */
.params-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; margin-top: 14px; align-items: start; }
.params-right { display: flex; flex-direction: column; gap: 14px; }
.params-grid .card { padding: 16px 18px; }
.params-grid header { margin-bottom: 12px; }
.params-grid h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; font-weight: 600; color: #1B2536; }
.params-grid h3 svg { color: #8A93A3; }
.params-grid header p { margin: 3px 0 0; font-size: 12px; color: #8A93A3; }

.params-channel { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid #F0F2F6; }
.params-channel:first-child { border-top: none; }
.params-channel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.params-channel-text strong { font-size: 13px; color: #1B2536; }
.params-channel-text small { font-size: 10.5px; color: #8A93A3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.params-channel-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; background: #EEF0F3; }
.params-channel-icon.is-whatsapp { background: #E1F5EE; }
.params-channel-icon.is-instagram { background: #FBEAF0; }
.params-channel-icon.is-email { background: #E6F1FB; }
.params-channel-icon.is-webchat { background: #EEEDFE; }

.params-badge { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.params-badge.is-on { background: #E1F5EE; color: #0F6E56; }
.params-badge.is-off { background: #EEF0F3; color: #5A6472; }
.params-badge.is-unknown { background: #FAEEDA; color: #854F0B; }

.params-link { margin-top: 10px; min-height: 0; padding: 0; border: none; background: none;
  color: #2563EB; font-size: 12px; font-weight: 600; cursor: pointer; }

.params-usage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.params-stat { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border-radius: 8px; background: #F7F8FA; }
.params-stat span { font-size: 11.5px; color: #5A6472; }
.params-stat strong { font-size: 19px; font-weight: 700; color: #1B2536; }
.params-stat strong em { font-size: 11.5px; font-weight: 400; font-style: normal; color: #8A93A3; }

.params-system-list { margin: 0; }
.params-system-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-top: 1px solid #F0F2F6; }
.params-system-list > div:first-child { border-top: none; }
.params-system-list dt { font-size: 12px; color: #5A6472; }
.params-system-list dd { margin: 0; font-size: 12px; font-weight: 600; color: #1B2536; }

/* ===== Personalizacao da marca (Config > Empresa > Parametros) — 18/09/2026 ===== */
.brand-card { margin-top: 14px; padding: 18px 20px; }
.brand-card-header { margin-bottom: 14px; }
.brand-card-header h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; font-weight: 600; color: #1B2536; }
.brand-card-header h3 svg { color: #8A93A3; }
.brand-card-header p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #5A6472; }

.brand-slots { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.brand-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.brand-slot-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8A93A3; }
.brand-previews + .brand-slot-label, .brand-status + .brand-slot-label { margin-top: 14px; }

.brand-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px;
  padding: 16px; border: 1.5px dashed #D8DDE6; border-radius: 12px; background: #FFFFFF; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.brand-dropzone:hover, .brand-dropzone.is-dragging { border-color: #2563EB; background: #F8FAFC; }
.brand-dropzone.is-readonly { cursor: default; }
.brand-dropzone.is-readonly:hover { border-color: #D8DDE6; background: #FFFFFF; }
.brand-dropzone-preview { display: flex; align-items: center; justify-content: center; min-height: 48px; max-width: 100%; }
.brand-dropzone-preview img { display: block; max-width: 260px; max-height: 64px; }
.brand-slot.is-icon .brand-dropzone-preview img { max-width: 72px; max-height: 72px; border-radius: 14px; }
.brand-dropzone-preview .brand-placeholder { font-size: 13px; color: #8A93A3; }
.brand-dropzone-cta { font-size: 13px; color: #1B2536; }
.brand-dropzone-cta strong { color: #2563EB; font-weight: 600; }
.brand-dropzone-hint { font-size: 11.5px; line-height: 1.5; color: #8A93A3; }
.brand-status { min-height: 0; margin: 10px 0 0; }
.brand-status:empty { display: none; }

.brand-previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
.brand-preview { min-width: 0; border: 1px solid #E7EAF0; border-radius: 12px; overflow: hidden; background: #FFFFFF; }
.brand-preview-title { display: block; padding: 8px 12px; border-bottom: 1px solid #E7EAF0; background: #F8FAFC; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8A93A3; }
.brand-preview-pdf { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.brand-preview-pdf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 2px solid #2563EB; font-size: 11px; font-weight: 700; color: #1B2536; }
.brand-preview-pdf-head img { display: block; width: 68px; height: 24px; object-fit: contain; object-position: right center; }
.brand-preview-email { display: flex; flex-direction: column; gap: 6px; padding: 0 0 8px; }
.brand-preview-email-head { display: flex; align-items: center; justify-content: center; height: 54px; background: #101D31; border-bottom: 3px solid #2563EB; }
.brand-preview-email-head img { display: block; width: 100px; height: 36px; object-fit: contain; }
.brand-preview-email .brand-preview-line { margin-left: 12px; }
.brand-preview-email small { margin: 4px 12px 0; font-size: 10px; color: #8A93A3; text-align: center; }
.brand-preview-line { display: block; width: 55%; height: 6px; border-radius: 3px; background: #E7EAF0; }
.brand-preview-line.is-long { width: 85%; }

.brand-warning { display: flex; gap: 6px; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #FAEEDA; color: #854F0B; font-size: 12px; line-height: 1.5; }
.brand-pending { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #E6F1FB; color: #185FA5; font-size: 12px; }
.brand-pending-actions { display: flex; gap: 8px; }
.brand-default-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 1px solid #E7EAF0; border-radius: 12px; background: #F8FAFC; font-size: 12px; line-height: 1.5; color: #5A6472; }
.brand-default-note .params-link { margin: 0; white-space: nowrap; }

@media (max-width: 900px) {
  .brand-slots, .brand-previews { grid-template-columns: 1fr; }
  .brand-default-note, .brand-pending { flex-direction: column; align-items: flex-start; }
}
.params-empty { color: #8A93A3; font-weight: 400 !important; }

@media (max-width: 1000px) { .params-grid { grid-template-columns: 1fr; } }
.params-channel-icon { display: grid; place-items: center; }
.params-channel-icon.is-whatsapp { color: #0F6E56; }
.params-channel-icon.is-instagram { color: #993556; }
.params-channel-icon.is-email { color: #185FA5; }
.params-channel-icon.is-webchat { color: #534AB7; }

/* ===== Popup do Aplicativo Mobile (menu do usuario) ===== */
.mobile-app-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 27, 45, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-app-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 26px 24px 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 27, 45, 0.32);
  text-align: center;
}

.mobile-app-card h3 {
  margin: 0;
  color: #0f1b2d;
  font-size: 18px;
  font-weight: 800;
}

.mobile-app-sub {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

/* Moldura clara e fixa: o QR precisa de contraste e de area de silencio ao
   redor para a camera ler. */
.mobile-app-qr {
  display: grid;
  place-items: center;
  width: 234px;
  height: 234px;
  margin: 18px auto 0;
  padding: 12px;
  border: 1px solid var(--line-soft, #e5e9f0);
  border-radius: 14px;
  background: #fff;
}

.mobile-app-qr img {
  display: block;
  width: 210px;
  height: 210px;
  image-rendering: pixelated;
}

.mobile-app-link {
  margin: 14px 0 0;
  color: #64748b;
  font-size: 12.5px;
  word-break: break-all;
}

.mobile-app-link a {
  color: #2563EB;
  font-weight: 600;
}

.mobile-app-nota {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

/* O reset global poe min-height 44px em todo button (ver GOTCHA 1): o X
   precisa de medida propria para nao virar uma barra. */
.mobile-app-close {
  position: absolute;
  top: 10px;
  right: 12px;
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mobile-app-close:hover {
  background: #f1f5f9;
  color: #0f1b2d;
}

/* ===== Imagens na resposta ao cliente (detalhe do chamado) ===== */
.sr-reply-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.sr-reply-thumb {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line-soft, #e5e9f0);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.sr-reply-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* O reset global poe min-height 44px em todo button (GOTCHA 1): o X da
   miniatura precisa de medida propria. */
.sr-reply-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  box-sizing: border-box;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 27, 45, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.sr-reply-thumb-remove:hover {
  background: #b42318;
}

.sr-reply-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.sr-reply-attach {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-right: auto;
  padding: 8px 13px;
  border: 1px solid var(--line-soft, #e5e9f0);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sr-reply-attach:hover {
  border-color: #c7d7fe;
  background: #f8faff;
}

.sr-reply-attach span {
  width: 16px;
  height: 16px;
  background-color: #2563EB;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-4.5-4.5L7 21'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-4.5-4.5L7 21'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Modelo de contrato SISINFRA: tabelas de SLA/valores, subclausulas e listas.
   Vive dentro de .contract-a4-page, entao herda a fonte/justificacao do A4 e
   e capturado pelo mesmo html2canvas que ja gera o PDF dos outros contratos. */
.contract-table {
  width: 100%;
  margin: 6px 0 8px;
  border-collapse: collapse;
  font-size: 13px;
}

.contract-table th,
.contract-table td {
  padding: 4px 7px;
  border: 1px solid #000;
  color: #000;
  line-height: 1.28;
  text-align: left;
  vertical-align: top;
}

.contract-table th {
  background: #e8e8e8;
  font-weight: 700;
}

.contract-subclause {
  margin-top: 7px;
}

.contract-subclause h4,
.contract-a4-page h4.contract-subtitle {
  margin: 0 0 3px;
  color: #000;
  font-size: 13.4px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.contract-a4-page h4.contract-subtitle {
  margin-top: 8px;
}

.contract-list {
  margin: 3px 0 5px;
  padding-left: 20px;
}

.contract-list li {
  color: #000;
  font-size: 13.6px;
  line-height: 1.32;
  text-align: justify;
}

/* ===== Filtro de remetentes (Configuracoes > E-mail) ===== */
.email-sender-filter-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
/* min-width:0 e obrigatorio: sem ele o <input> usa a largura intrinseca dele e
   ignora o encolhimento do grid, escapando do cartao. */
.email-sender-filter-add input { min-width: 0; }

.email-sender-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.email-sender-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}
.email-sender-filter-value {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-all;
}
.email-sender-filter-item .icon-button {
  min-width: 22px;
  width: 22px;
  height: 22px;
  min-height: 22px; /* sobrepoe o min-height:44px global de button */
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  color: #64748b;
}
.email-sender-filter-item .icon-button:hover { background: #e2e8f0; color: #b91c1c; }
.email-sender-filter-empty { margin: 0; font-size: 13px; color: #64748b; }

/* ===== Chat: atendimento nao iniciado (bloqueia o envio) ===== */
.floating-whatsapp-not-started {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: center;
}
.floating-whatsapp-not-started p {
  margin: 0;
  font-size: 13px;
  color: #475569;
}
.floating-whatsapp-not-started-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dbeafe;
  position: relative;
}
/* Triangulo de "play", o mesmo simbolo do botao Iniciar atendimento no topo. */
.floating-whatsapp-not-started-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 52%;
  transform: translate(-50%, -50%);
  border-left: 8px solid #1d4ed8;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.floating-whatsapp-start-cta {
  padding: 9px 18px;
  border: 0;
  border-radius: 8px;
  background: #075ec8;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.floating-whatsapp-start-cta:hover { background: #0b4ea3; }

/* ===== SLA: horario de atendimento (expediente) ===== */
.sla-business-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* .sla-config-card tem overflow:hidden, que CORTA a etiqueta NOVO (ela fica
     meio para fora da borda). Liberado so aqui. */
  overflow: visible;
  margin-top: 12px;
  /* 14px 16px e o padding dos demais cards do modal; o topo ganha folga extra
     para a etiqueta NOVO, que fica meio para fora da borda. */
  padding: 24px 16px 16px;
  border: 2px solid #2563eb;
  background: #eff6ff;
}
/* Expediente desligado: o card continua legivel, mas visivelmente inativo. */
.sla-business-card.is-disabled { opacity: .55; border-color: #cbd5e1; background: #f8fafc; }
.sla-business-card.is-disabled .sla-day-pill,
.sla-business-card.is-disabled input,
.sla-business-card.is-disabled .sla-holidays-button { pointer-events: none; }

.sla-business-tag {
  position: absolute;
  top: -11px;
  left: 16px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
}
.sla-business-tag--inline { position: static; margin-left: 6px; }

.sla-business-head strong { display: block; font-size: 15px; color: #0f172a; }
.sla-business-head span { font-size: 13px; color: #475569; }

.sla-business-days { display: flex; flex-wrap: wrap; gap: 8px; }
.sla-day-pill {
  min-height: 36px; /* sobrepoe o min-height:44px global de button */
  padding: 7px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.sla-day-pill.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }

.sla-business-times { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sla-business-times span { font-size: 14px; color: #334155; }
.sla-business-times input[type="time"] {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.sla-holidays-button { min-height: 38px; margin-left: auto; padding: 8px 14px; font-size: 13px; }
.sla-holidays-count {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

/* ----- Modal de feriados ----- */
.sla-holidays-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
}
.sla-holidays-modal[hidden] { display: none; }
.sla-holidays-box {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .25);
}
.sla-holidays-header { display: flex; align-items: center; justify-content: space-between; }
.sla-holidays-header h3 { margin: 0; font-size: 17px; color: #0f172a; }
.sla-holidays-hint { margin: 6px 0 14px; font-size: 13px; color: #64748b; }
.sla-holidays-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.sla-holidays-add input {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
}
.sla-holidays-status { margin: 8px 0 0; min-height: 16px; font-size: 12px; color: #2563eb; }
.sla-holidays-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; max-height: 190px; overflow-y: auto; }
.sla-holiday-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.sla-holiday-item .icon-button {
  min-width: 20px; width: 20px; height: 20px; min-height: 20px;
  padding: 0; line-height: 1; border-radius: 50%; color: #64748b;
}
.sla-holiday-item .icon-button:hover { background: #e2e8f0; color: #b91c1c; }
.sla-holidays-empty { margin: 0; font-size: 13px; color: #64748b; }
.sla-holidays-footer { display: flex; justify-content: space-between; gap: 10px; }
.sla-holidays-footer .secondary-button { font-size: 13px; }

/* ===== Relatório de Pipeline de Vendas (detalhado) ===== */
.pipe-subtitle { margin: 0 0 14px; font-size: 13px; color: #64748b; }
.pipe-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  background: #fff;
}
.pipe-toolbar .report-field-search { flex: 1 1 220px; }
.pipe-clear-all {
  min-height: 34px;
  margin-left: auto;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pipe-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 12px; }
.pipe-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pipe-chips-label { font-size: 13px; color: #64748b; }
.pipe-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #eef2f7; color: #334155; font-size: 12px; font-weight: 600;
}
.pipe-chip-period { background: #e6f1fb; color: #185fa5; }
.pipe-chip-owner { background: #e1f5ee; color: #0f6e56; }
.pipe-chip button { min-height: 0; padding: 0; border: 0; background: none; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; opacity: .7; }
.pipe-chip button:hover { opacity: 1; }
.pipe-count { margin-left: auto; font-size: 13px; color: #64748b; }

.pipe-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pipe-kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid #e7eaf0; border-radius: 10px; background: #fff;
}
.pipe-kpi-green { background: #e1f5ee; border-color: transparent; }
.pipe-kpi-green .pipe-kpi-label, .pipe-kpi-green .pipe-kpi-sub { color: #0f6e56; }
.pipe-kpi-green .pipe-kpi-value { color: #085041; }
.pipe-kpi-pink { background: #fbeaf0; border-color: transparent; }
.pipe-kpi-pink .pipe-kpi-label, .pipe-kpi-pink .pipe-kpi-sub { color: #993556; }
.pipe-kpi-pink .pipe-kpi-value { color: #6e2440; }
.pipe-kpi-label { font-size: 12px; color: #64748b; }
.pipe-kpi-value { font-size: 19px; font-weight: 700; color: #0f172a; }
.pipe-kpi-sub { font-size: 11px; color: #8a93a3; line-height: 1.35; }

.pipe-section-title { margin: 20px 0 10px; font-size: 15px; font-weight: 600; color: #0f172a; }
.pipe-sellers { padding: 14px 16px; border: 1px solid #e7eaf0; border-radius: 12px; background: #fff; }
.pipe-seller { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 6px 0; }
.pipe-seller-name { font-size: 14px; color: #0f172a; }
.pipe-seller-bar { height: 10px; border-radius: 999px; background: #e7eaf0; overflow: hidden; }
.pipe-seller-bar span { display: block; height: 100%; border-radius: 999px; background: #1d9e75; }
.pipe-seller-value { font-size: 13px; color: #334155; white-space: nowrap; }

.pipe-table-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.pipe-sort { font-size: 13px; color: #64748b; }
.pipe-sort select { margin-left: 6px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-weight: 600; color: #0f172a; }

.pipe-table-wrap { border: 1px solid #e7eaf0; border-radius: 12px; background: #fff; overflow-x: auto; }
.pipe-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pipe-table th {
  padding: 12px 14px; text-align: left; font-size: 10px; font-weight: 700;
  letter-spacing: .5px; color: #8a93a3; border-bottom: 1px solid #eef1f5; white-space: nowrap;
}
.pipe-table td { padding: 14px; border-bottom: 1px solid #f1f4f8; color: #0f172a; vertical-align: middle; }
.pipe-table tbody tr:last-child td { border-bottom: 0; }
.pipe-row { cursor: pointer; }
.pipe-row:hover { background: #fafbfc; }
.pipe-row.is-lost { background: #fdf6f8; }
.pipe-row.is-open { background: #f6f8fb; }
.pipe-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-value { font-weight: 600; white-space: nowrap; }
.pipe-link { color: #2563eb; font-weight: 600; text-decoration: none; }
.pipe-link:hover { text-decoration: underline; }
.pipe-muted { color: #8a93a3; }

.pipe-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pipe-badge-fechada { background: #e1f5ee; color: #0f6e56; }
.pipe-badge-perdida { background: #fbeaf0; color: #993556; }
.pipe-badge-enviada { background: #e6f1fb; color: #185fa5; }
.pipe-badge-em_negociacao { background: #faeeda; color: #854f0b; }
.pipe-badge-nao_enviada { background: #eef2f7; color: #64748b; }

.pipe-timeline-row td { background: #fbfbfd; padding: 4px 14px 16px; }
.pipe-timeline-title { margin: 6px 0 10px; font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #8a93a3; }
.pipe-timeline ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pipe-tl-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #334155; }
.pipe-tl-item.is-strong { font-weight: 600; color: #0f172a; }
.pipe-tl-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; flex: none; }
.pipe-tl-dot-enviada { background: #2563eb; }
.pipe-tl-dot-em_negociacao { background: #d99a1a; }
.pipe-tl-dot-fechada { background: #1d9e75; }
.pipe-tl-dot-perdida { background: #d1477a; }
.pipe-timeline-loading, .pipe-timeline-empty { margin: 8px 0; font-size: 13px; color: #8a93a3; }

.pipe-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; font-size: 13px; color: #64748b; }
.pipe-more { min-height: 32px; padding: 4px 10px; border: 0; background: none; color: #2563eb; font-size: 13px; font-weight: 600; cursor: pointer; }
.pipe-empty { padding: 26px 14px; margin: 0; border: 1px solid #e7eaf0; border-radius: 12px; background: #fff; text-align: center; font-size: 13px; color: #64748b; }

@media (max-width: 900px) {
  .pipe-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-seller { grid-template-columns: 90px minmax(0, 1fr); }
  .pipe-seller-value { grid-column: 1 / -1; }
}

/* ===== Relatório de Produtividade (por funcionário) ===== */
/* Mesmo sistema visual do Relatório de Pipeline, com classes proprias: os dois
   evoluem separados, entao um ajuste la nao pode mexer aqui sem querer. */
.prod-subtitle { margin: 0 0 14px; font-size: 13px; color: #64748b; }
.prod-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  background: #fff;
}
.prod-funnel { display: inline-flex; align-items: center; padding-bottom: 7px; color: #94a3b8; }
.prod-clear-all {
  min-height: 34px;
  margin-left: auto;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.prod-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 12px; }
.prod-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prod-chips-label { font-size: 13px; color: #64748b; }
.prod-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #eef2f7; color: #334155; font-size: 12px; font-weight: 600;
}
.prod-chip-period { background: #e6f1fb; color: #185fa5; }
.prod-chip button { min-height: 0; padding: 0; border: 0; background: none; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; opacity: .7; }
.prod-chip button:hover { opacity: 1; }
.prod-count { margin-left: auto; font-size: 13px; color: #64748b; }

.prod-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.prod-kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid #e7eaf0; border-radius: 10px; background: #fff;
}
.prod-kpi-label { font-size: 12px; color: #64748b; }
.prod-kpi-value { font-size: 22px; font-weight: 700; color: #0f172a; }
.prod-kpi-green { color: #085041; }
.prod-kpi-late { font-size: 13px; font-weight: 600; color: #993556; }
.prod-kpi-sub { font-size: 11px; color: #8a93a3; line-height: 1.35; }

.prod-table-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.prod-section-title { margin: 20px 0 10px; font-size: 15px; font-weight: 600; color: #0f172a; }
.prod-sort { font-size: 13px; color: #64748b; }
.prod-sort select { margin-left: 6px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-weight: 600; color: #0f172a; }

.prod-table-wrap { border: 1px solid #e7eaf0; border-radius: 12px; background: #fff; overflow-x: auto; }
.prod-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prod-table th {
  padding: 12px 14px; text-align: left; font-size: 10px; font-weight: 700;
  letter-spacing: .5px; color: #8a93a3; border-bottom: 1px solid #eef1f5; white-space: nowrap;
}
.prod-table td { padding: 13px 14px; border-bottom: 1px solid #f1f4f8; color: #0f172a; vertical-align: middle; }
.prod-table tbody tr:last-child td { border-bottom: 0; }
.prod-row { cursor: pointer; }
.prod-row:hover { background: #fafbfc; }
.prod-row.is-open { background: #f6f8fb; }

.prod-person { display: inline-flex; align-items: center; gap: 10px; }
.prod-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  border-radius: 50%; background: #eef2f7; color: #64748b;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
}
.prod-person-text { display: flex; flex-direction: column; line-height: 1.3; }
.prod-person-text strong { font-size: 13.5px; font-weight: 600; color: #0f172a; }
.prod-role { font-size: 9.5px; color: #8a93a3; }
.prod-sub { display: block; font-size: 11px; color: #8a93a3; margin-top: 2px; }
.prod-dash { color: #a6adba; }
.prod-link { color: inherit; text-decoration: none; border-bottom: 1px dotted #c3cad6; }
.prod-link:hover { color: #2563eb; border-bottom-color: #2563eb; }
.prod-sla { font-weight: 600; }
.prod-sla.is-good { color: #085041; }
.prod-sla.is-warn { color: #854f0b; }
.prod-sla.is-bad { color: #993556; }
.prod-ontime { color: #0f6e56; }
.prod-late { color: #993556; }

.prod-detail-row td { background: #fbfbfd; padding: 4px 14px 18px; }
.prod-detail-head { margin: 8px 0 12px; font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #8a93a3; }
.prod-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.prod-detail-card {
  padding: 14px 16px; border: 1px solid #e7eaf0; border-radius: 10px; background: #fff;
}
.prod-detail-card p { margin: 0 0 6px; font-size: 12.5px; color: #334155; }
.prod-detail-card p:last-child { margin-bottom: 0; }
.prod-detail-title { font-size: 11px; font-weight: 700; letter-spacing: .4px; margin-bottom: 10px !important; }
.prod-detail-atend .prod-detail-title { color: #185fa5; }
.prod-detail-com .prod-detail-title { color: #854f0b; }
.prod-detail-campo .prod-detail-title { color: #0f6e56; }
.prod-detail-tar .prod-detail-title { color: #534ab7; }
.prod-detail-base { color: #8a93a3; font-size: 11.5px; }
.prod-detail-empty { margin: 8px 0; font-size: 13px; color: #8a93a3; }

.prod-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; font-size: 13px; color: #64748b; }
.prod-more { min-height: 32px; padding: 4px 10px; border: 0; background: none; color: #2563eb; font-size: 13px; font-weight: 600; cursor: pointer; }
.prod-empty { padding: 26px 14px; margin: 0; border: 1px solid #e7eaf0; border-radius: 12px; background: #fff; text-align: center; font-size: 13px; color: #64748b; }
.prod-note { margin: 14px 0 0; font-size: 11.5px; color: #8a93a3; }
.prod-note-warn { color: #854f0b; }

.prod-denied {
  padding: 30px 24px; border: 1px solid #e7eaf0; border-radius: 12px;
  background: #fff; text-align: center;
}
.prod-denied strong { display: block; margin-bottom: 8px; font-size: 15px; color: #0f172a; }
.prod-denied p { margin: 0 auto; max-width: 420px; font-size: 13px; color: #64748b; line-height: 1.5; }

@media (max-width: 900px) {
  .prod-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 1 (calibracao)                                    */
/* Ver GUIA_DE_PADROES.md secao 2.1 e INVENTARIO_DESVIOS.md lote 1.      */
/*                                                                       */
/* Fica no FIM do arquivo de proposito: com 24.700 linhas e regras       */
/* globais tardias (ex.: .primary-button na linha ~19453), uma regra de  */
/* mesma especificidade escrita antes vira codigo morto. Terminar o      */
/* arquivo garante que o valor declarado e o valor efetivo.              */
/*                                                                       */
/* ESCOPO: 4 modais. Onde a classe e COMPARTILHADA com um modal fora do  */
/* lote (.success-modal-card / .success-modal-icon tambem servem o       */
/* serviceRequestSuccessModal, do lote 10), a regra e escopada pelo      */
/* backdrop para nao vazar.                                              */
/* ===================================================================== */

/* ---- Peças comuns do padrão ---------------------------------------- */
.delete-confirm-header,
.appointment-success-header,
.modal-header.dashboard-calendar-modal-header,
.modal-header.email-account-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.delete-confirm-icon,
.appointment-success-backdrop .success-modal-icon,
.dashboard-calendar-modal-icon,
.email-account-header-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
}

/* Cor do ícone pela natureza da ação (pares semânticos do guia). */
.delete-confirm-icon { background: #FBEAF0; color: #993556; }
.appointment-success-backdrop .success-modal-icon { background: #E1F5EE; color: #0F6E56; }
.dashboard-calendar-modal-icon { background: #E6F1FB; color: #185FA5; }
.email-account-header-icon { background: #E6F1FB; color: #185FA5; }

.delete-confirm-heading,
.appointment-success-heading,
.dashboard-calendar-modal-heading,
.email-account-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.delete-confirm-heading .eyebrow,
.appointment-success-heading .eyebrow,
.dashboard-calendar-modal-heading .eyebrow,
.email-account-header-text .eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

.delete-confirm-heading h2,
.appointment-success-heading h2,
.dashboard-calendar-modal-heading h2,
.email-account-header-text h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}

.delete-confirm-actions,
.appointment-success-footer,
.modal-actions.email-account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* ---- 1. deleteConfirmModal ------------------------------------------ */
/* Deixa de ser um cartão centralizado e passa às três faixas do padrão. */
.delete-confirm-card {
  width: min(440px, calc(100vw - 32px));
  display: block;
  /* O cartão antigo era `display: grid; justify-items: center`. Trocar só o
     display NÃO basta: no Chromium o justify-items também vale para layout de
     bloco, e cada faixa ficava com a largura do próprio conteúdo (cabeçalho
     328px e rodapé 143px dentro de um cartão de 440px). Precisa voltar a
     stretch para as faixas irem de ponta a ponta. */
  justify-items: stretch;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: 16px;
}

/* O título recebe texto variável de 25 pontos de chamada
   (confirmDeletion(mensagem)), às vezes com o nome do registro — por isso
   quebra em várias linhas em vez de truncar. */
.delete-confirm-card h2 { font-size: 17px; line-height: 1.3; }

/* A regra antiga `.delete-confirm-actions button` (raio 8, peso 800, borda
   transparente) tem especificidade maior que .secondary-button/.primary-button
   e continuava vencendo — os dois botões ficavam fora da família, e o "Não"
   perdia a borda (branco no branco). Duas classes reequilibram. */
/* Os valores acompanham a familia (decisao A), mas precisam ficar escritos
   aqui: a regra antiga `.delete-confirm-actions button` tem especificidade
   (0,1,1) e vence `.primary-button` (0,1,0). Tirando estas linhas o botao
   volta para 16px/800 — testado no lote 5. */
.delete-confirm-actions .secondary-button,
.delete-confirm-actions .primary-button {
  min-width: 96px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}
.delete-confirm-actions .secondary-button { border: 1px solid #CBD5E1; }

/* O botão de confirmar herda a caixa do .primary-button (altura, raio,
   peso) e troca só a cor. Especificidade dupla de propósito: a regra
   global do .primary-button vem depois no arquivo, então uma classe
   simples aqui seria sobrescrita pelo gradiente azul. */
.primary-button.delete-confirm-yes,
.primary-button.delete-confirm-yes:hover {
  background: #993556;
  background-image: none;
  border-color: transparent;
  color: #ffffff;
  box-shadow: none;
}
.primary-button.delete-confirm-yes:hover { background: #6E2440; }

/* ---- 2. appointmentSuccessModal ------------------------------------- */
/* Escopado no backdrop: .success-modal-card também serve o
   serviceRequestSuccessModal, que é do lote 10 e não pode mudar aqui. */
.appointment-success-backdrop .success-modal-card {
  width: min(460px, calc(100vw - 32px));
  display: block;
  justify-items: stretch; /* mesmo motivo do .delete-confirm-card acima */
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: 16px;
}

.appointment-success-body { padding: 20px 24px; }
.appointment-success-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #5A6472;
}

/* ---- 3. dashboardCalendarModal -------------------------------------- */
.dashboard-calendar-modal-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5A6472;
}
.modal-header.dashboard-calendar-modal-header .icon-button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
}

/* ---- 4. emailAccountModal ------------------------------------------- */
/* Markup já estava no padrão; o que destoava era tipografia e espaçamento
   (eyebrow 500/.05em, título 800, cabeçalho 18px, rodapé 14px/gap 10). */
.modal-header.email-account-header { align-items: flex-start; }
.email-account-body { padding: 20px 24px; }

/* ===================================================================== */
/* PADRONIZACAO — LOTE 2                                                 */
/* dashboardGoalModal · whatsappAssistantInstructionsModal · userModal ·  */
/* implementationReportModal                                             */
/*                                                                       */
/* ESCOPO POR ID onde a classe e compartilhada com modal de outro lote:   */
/*   #userModal                -> .modal-card e .modal-actions sao        */
/*                                genericos (clientModal/opportunityModal */
/*                                usam os mesmos, lotes 6 e 9)           */
/*   #implementationReportModal -> .demand-report-modal-card e a mesma do */
/*                                commercialDemandReportModal (lote 6)    */
/* Id em seletor pesa (0,1,0,0) e nunca vaza — e o preco de padronizar um */
/* modal por vez num CSS sem componentes.                                */
/* ===================================================================== */

/* ---- Cabeçalho: três faixas (guia 2.1) ------------------------------ */
.modal-header.dashboard-goal-header,
.modal-header.whatsapp-assistant-instructions-header,
.modal-header.implementation-report-header,
.modal-header.user-modal-header {
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.dashboard-goal-icon,
.whatsapp-assistant-instructions-icon,
.implementation-report-icon,
#userModal .user-modal-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

/* Cor pela natureza da ação: âmbar = configurar, azul = criar/consultar. */
.dashboard-goal-icon { background: #FAEEDA; color: #854F0B; }
.whatsapp-assistant-instructions-icon { background: #FAEEDA; color: #854F0B; }
.implementation-report-icon { background: #E6F1FB; color: #185FA5; }
/* O avatar do usuário já era o "quadrado" do cabeçalho: vira 40px, raio 10
   e o par azul do guia (era 44px, círculo, #DBEAFE/#1D4ED8). */
#userModal .user-modal-avatar { background: #E6F1FB; color: #185FA5; }

.dashboard-goal-heading,
.whatsapp-assistant-instructions-heading,
.implementation-report-heading,
#userModal .user-modal-heading {
  flex: 1 1 auto;
  min-width: 0;
}
#userModal .user-modal-heading { display: flex; align-items: center; gap: 12px; }

.dashboard-goal-heading .eyebrow,
.whatsapp-assistant-instructions-heading .eyebrow,
.implementation-report-heading .eyebrow,
#userModal .user-modal-heading .eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

.dashboard-goal-heading h2,
.whatsapp-assistant-instructions-heading h2,
.implementation-report-heading h2,
#userModal .user-modal-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}

/* O cartão do assistente tem regras proprias de titulo/subtitulo com dois
   niveis de classe (.whatsapp-assistant-instructions-card .modal-header h2,
   com clamp ate 30px). Uma classe so nao vence: e preciso repetir o cartao
   no seletor. Mesmo caso do lote 1 com o botao do delete. */
.whatsapp-assistant-instructions-card .whatsapp-assistant-instructions-heading h2 {
  font-size: 17px;
  line-height: 1.3;
}
.whatsapp-assistant-instructions-card .whatsapp-assistant-instructions-heading p {
  font-size: 13px;
  line-height: 1.45;
}

.whatsapp-assistant-instructions-heading p,
.implementation-report-heading p,
#userModal #userModalSubtitle {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #5A6472;
}

.modal-header.dashboard-goal-header .icon-button,
.modal-header.whatsapp-assistant-instructions-header .icon-button,
.modal-header.implementation-report-header .icon-button,
.modal-header.user-modal-header .icon-button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
}

/* ---- Rodapé em faixa ------------------------------------------------ */
.dashboard-goal-card .modal-actions,
.modal-actions.whatsapp-assistant-instructions-actions,
#implementationReportModal .modal-actions {
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* No userModal o rodapé vive DENTRO do <form class="opportunity-form">, que
   tem padding 28px. Sem a margem negativa a faixa ficaria "flutuando" com
   28px de branco em volta em vez de encostar nas bordas do cartão. */
#userModal .modal-actions {
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  margin: 8px -28px -28px;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}
/* "Excluir usuário" é a ação destrutiva: fica à esquerda, separada das
   ações de fluxo (Cancelar/Salvar), como já acontecia. */
#userModal .modal-actions #deleteUserButton { margin-right: auto; }

/* ---- Corpo ---------------------------------------------------------- */
.dashboard-goal-body { padding: 20px 24px; }
.whatsapp-assistant-instructions-body { padding: 20px 24px; }
#implementationReportModal .demand-report { padding: 20px 24px; }

/* ===================================================================== */
/* PADRONIZACAO — LOTE 3 (agenda e comercial de baixo trafego)           */
/* appointmentModal · presentationAppointmentModal · salesTaskModal ·    */
/* commercialDemandReportModal                                           */
/*                                                                       */
/* Primeiro lote com formulario grande (appointmentModal, 17 campos).    */
/* Os botoes NAO sao tocados aqui: a Decisao A (botao liso 38px) e do    */
/* lote 5, e o appointmentModal tem ate um terceiro estilo proprio       */
/* (primario 52px/16px/900, secundario 38px/14px/800) que sai junto la.  */
/* ===================================================================== */

/* ---- Cabeçalho ------------------------------------------------------ */
.modal-header.appointment-modal-header,
.modal-header.presentation-appointment-header,
.modal-header.sales-task-modal-header,
.modal-header.commercial-demand-report-header {
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.appointment-modal-icon,
.presentation-appointment-icon,
.sales-task-modal-icon,
.commercial-demand-report-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E6F1FB;
  color: #185FA5;
}

.appointment-modal-heading,
.presentation-appointment-heading,
.sales-task-modal-heading,
.commercial-demand-report-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.appointment-modal-heading .eyebrow,
.presentation-appointment-heading .eyebrow,
.sales-task-modal-heading .eyebrow,
.commercial-demand-report-heading .eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

/* Titulo: o cartao da apresentacao tem regra propria de dois niveis
   (.presentation-appointment-card .modal-header h2), entao repetimos o
   cartao no seletor — mesma armadilha do lote 2. */
.appointment-modal-heading h2,
.sales-task-modal-heading h2,
.commercial-demand-report-heading h2,
.presentation-appointment-card .presentation-appointment-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}

.appointment-modal-heading p,
.commercial-demand-report-heading p,
.presentation-appointment-card .presentation-appointment-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #5A6472;
  max-width: none;
}

.modal-header.appointment-modal-header .icon-button,
.modal-header.presentation-appointment-header .icon-button,
.modal-header.sales-task-modal-header .icon-button,
.modal-header.commercial-demand-report-header .icon-button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
}

/* ---- Corpo ---------------------------------------------------------- */
.appointment-modal-card .appointment-form { padding: 20px 24px; }
.presentation-appointment-card .presentation-appointment-form { padding: 20px 24px; }
.sales-task-modal-body { padding: 20px 24px; }
#commercialDemandReportModal .demand-report { padding: 20px 24px; }

/* ---- Rodapé em faixa ------------------------------------------------ */
/* Nos dois modais de agenda o rodape vive DENTRO do <form>, que agora tem
   padding 20px 24px. A margem negativa leva a faixa ate as bordas do
   cartao — mesma solucao do userModal (lote 2). */
.appointment-modal-card .modal-actions.appointment-modal-actions,
.presentation-appointment-card .presentation-appointment-form .modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 8px -24px -20px;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

.sales-task-modal-card .modal-actions,
#commercialDemandReportModal .modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 4 (primeiras TELAS)                               */
/* screen-users · screen-internal-tasks                                  */
/*                                                                       */
/* Primeiro lote fora de modal: exercita TABELA (decisao D) e BARRA DE   */
/* FILTROS (decisao B).                                                  */
/*                                                                       */
/* ESCOPO POR #screen-*: .users-table tambem e usada dentro de           */
/* Configuracoes (.settings-detail-panel > .users-table-card) e          */
/* .small-stat aparece em 6 lugares, 4 deles fora deste lote. Sem o id   */
/* da tela a migracao vazaria.                                           */
/*                                                                       */
/* FICOU DE FORA, por serem globais (ver relatorio): o tamanho do <h1>   */
/* das telas (40px, 18 telas) e o raio do .card (102 usos). Sao decisoes */
/* de sistema, como a Decisao A do botao — merecem lote isolado.         */
/* ===================================================================== */

/* ---- Tabela (decisao D) --------------------------------------------- */
/* O `th` vinha da regra global `thead, table th` (12px/800, padding
   20px 30px) e o `td` herdava 18px do body — o desvio de maior impacto
   visual do inventario. Corrigido AQUI, nesta tabela, e nunca por regra
   global nova (foi a condicao da decisao D). */
#screen-users .users-table th {
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
  background: #F7F8FA;
  border-bottom: 1px solid #EEF1F5;
  white-space: nowrap;
}

#screen-users .users-table td {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 400;
  color: #1B2536;
  border-bottom: 1px solid #F1F4F8;
}

#screen-users .users-table tbody tr:last-child td { border-bottom: 0; }
#screen-users .users-table tbody tr:hover { background: #FAFBFC; }

/* `td:first-child` era `display: flex` (para alinhar avatar + nome), o que
   tira a celula do fluxo da tabela: a borda de baixo passa a acompanhar a
   altura do proprio flex, nao a da linha. Com padding de 28px o desencontro
   ficava escondido; com 11px a divisoria do primeiro campo apareceu
   desalinhada das demais. Volta a ser celula de tabela, com o avatar
   alinhado inline — mesmo resultado visual, sem quebrar a linha. */
#screen-users .users-table td:first-child {
  display: table-cell;
  vertical-align: middle;
}
#screen-users .users-table td:first-child .letter-avatar {
  vertical-align: middle;
  margin-right: 12px;
}

/* Pilulas e status dentro da tabela seguem o padrao de badge do guia. */
#screen-users .users-table .pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
}

/* ---- Cartoes de resumo ---------------------------------------------- */
/* O rotulo vinha do .eyebrow global, que e 20px — maior que o proprio
   texto de apoio. Escopado na tela: o .eyebrow global serve tambem
   modais e telas ainda nao migrados. */
#screen-users .small-stat .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.4;
  color: #8A93A3;
}
#screen-users .small-stat strong { font-size: 22px; font-weight: 700; color: #0F172A; }
#screen-users .small-stat small { font-size: 11.5px; color: #8A93A3; }

/* ---- Barra de filtros (decisao B) ----------------------------------- */
#screen-internal-tasks .internal-tasks-period span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

#screen-internal-tasks #internalTasksPeriod {
  min-height: 32px;
  padding: 5px 26px 5px 10px;
  font-size: 12px;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  background-color: #fff;
  color: #1B2536;
}

/* ---- Paineis de Tarefas internas ------------------------------------ */
#screen-internal-tasks .internal-panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid #EEF1F5;
  align-items: center;
  gap: 12px;
}

#screen-internal-tasks .internal-panel-head h2 {
  font-size: 13px;
  font-weight: 600;
  color: #1B2536;
}

#screen-internal-tasks .internal-panel-empty {
  font-size: 13px;
  font-weight: 400;
  color: #8A93A3;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 5 (FUNDACAO)                                      */
/* Decisoes A + E + G, juntas de proposito: as tres sao regras GLOBAIS.  */
/* Agrupadas, a equipe ve UMA mudanca de aparencia em vez de tres.       */
/*                                                                       */
/*   A — familia de botoes: liso 38px / 13px / 600, sem gradiente        */
/*   E — titulo de tela: 40px -> 24px / 700                              */
/*   G — .eyebrow global: 20px -> 11px / 600 caixa alta                  */
/*                                                                       */
/* A decisao F (raio do .card, 102 usos) NAO entra aqui.                 */
/* ===================================================================== */

/* ---- DECISAO A — familia de botoes ---------------------------------- */
/* NAO inclui .login-submit: a tela de login vive fora do shell do app,
   tem um CTA proprio e nao passou por lote nenhum. Ela mantem o
   gradiente ate ter lote proprio. */
.primary-button,
.secondary-button {
  min-height: 38px;
  padding: 0 16px;
  gap: 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.primary-button {
  border: 1px solid transparent;
  background: #2563EB;
  background-image: none;
  color: #ffffff;
  box-shadow: none;
}
.primary-button:hover:not(:disabled) {
  background: #1D4ED8;
  background-image: none;
  box-shadow: none;
  transform: none;
}

.secondary-button {
  border: 1px solid #CBD5E1;
  background: #ffffff;
  color: #334155;
  box-shadow: none;
}
.secondary-button:hover:not(:disabled) {
  background: #F8FAFC;
  border-color: #CBD5E1;
  box-shadow: none;
  transform: none;
}

/* Botao de texto: acompanha o tamanho da familia. Sem isto um rodape
   ficaria com "Salvar" em 13px ao lado de "Cancelar" em 18px. */
.ghost-link {
  min-height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #2563EB;
}
.ghost-link:hover { transform: none; }

/* Contextos que declaravam o proprio tamanho de botao voltam para a
   familia. Sao modais ja migrados (lote 3) — deixa-los fora criaria uma
   terceira medida de botao no sistema, que e o que este lote elimina. */
.appointment-modal-actions .primary-button,
.appointment-modal-actions .secondary-button,
.appointment-modal-actions .danger-button {
  min-height: 38px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}
.appointment-modal-actions .primary-button { min-width: 0; }
.appointment-modal-actions .secondary-button { min-width: 0; color: #334155; }

/* ---- DECISAO E — titulo de tela ------------------------------------- */
/* 40px deixava o titulo maior que o valor de um KPI. 24px preserva a
   hierarquia sem o susto de cair direto para 19px. */
.page-heading h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: #0F172A;
}

@media (max-width: 760px) {
  .page-heading h1 { font-size: 20px; }
}

/* ---- DECISAO G — eyebrow global ------------------------------------- */
/* Era 20px: a raiz dos rotulos gigantes corrigidos modal a modal nos
   lotes 1 a 4. Com a regra certa aqui, todo lugar ainda nao migrado ja
   nasce no padrao e nenhum lote futuro precisa repetir isto. */
.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.4;
  text-transform: uppercase;
  color: #8A93A3;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 6 (FUNDACAO: FORMULARIOS)                         */
/*                                                                       */
/* Segundo lote de fundacao, mesma logica do 5: sao regras que valem      */
/* para o sistema todo, entao mexer nelas uma vez evita repetir campo a   */
/* campo em cada lote de tela.                                           */
/*                                                                       */
/* O sistema tinha QUATRO tamanhos de rotulo convivendo:                 */
/*   .opportunity-form      16px/600   (cliente, usuario, oportunidade)  */
/*   .appointment-form      14px/800   (compromisso)                     */
/*   .service-request-form  13px/700   (nova solicitacao)                */
/*   .settings-form         12px/500 caixa alta                          */
/* O alvo (guia 2.5) e 12px/500 #5A6472 — que ja e o do quick-client.    */
/*                                                                       */
/* ATENCAO: como no lote 5 (decisao G), isto ALCANCA telas que ainda nao */
/* tiveram lote proprio. E intencional: campo de formulario e elemento   */
/* de fundacao, nao decoracao de tela.                                   */
/* ===================================================================== */

/* ---- Rotulo --------------------------------------------------------- */
.opportunity-form label,
.appointment-form label,
.presentation-appointment-form label,
.service-request-form label,
.service-request-filters label,
.settings-form label,
.general-grid label,
.inline-client-form label {
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #5A6472;
}

/* ---- Controle ------------------------------------------------------- */
/* 42px em vez dos 44px do alvo de toque global: o campo fica proporcional
   ao botao de 38px do lote 5 e continua confortavel no mouse. Em tela
   pequena volta para 44px (e 16px de fonte — abaixo disso o iOS da zoom
   automatico ao focar o campo). */
.opportunity-form input,
.opportunity-form select,
.opportunity-form textarea,
.appointment-form input,
.appointment-form select,
.appointment-form textarea,
.presentation-appointment-form input,
.presentation-appointment-form select,
.service-request-form input,
.service-request-form select,
.service-request-form textarea,
.settings-form input,
.settings-form select,
.settings-form textarea,
.inline-client-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #E7EAF0;
  border-radius: 10px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 400;
  color: #1B2536;
}

/* O reset global (linha ~548) e
   `button, a, input:not([type="checkbox"]):not([type="radio"]), select, textarea`,
   que para INPUT pesa (0,2,1) — mais que `.x-form input` (0,1,1). Sem repetir
   os :not aqui, o min-height de 44px e o raio antigo continuam vencendo e o
   campo nao acompanha o botao de 38px. `select` e `textarea` entram no reset
   como elemento puro (0,0,1), entao a regra acima ja basta para eles.
   Pego pela medicao: o min-height era o unico valor que nao mudava. */
.opportunity-form input:not([type="checkbox"]):not([type="radio"]),
.appointment-form input:not([type="checkbox"]):not([type="radio"]),
.presentation-appointment-form input:not([type="checkbox"]):not([type="radio"]),
.service-request-form input:not([type="checkbox"]):not([type="radio"]),
.settings-form input:not([type="checkbox"]):not([type="radio"]),
.inline-client-form input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 42px;
  border-radius: 10px;
  border-color: #E7EAF0;
}

@media (max-width: 760px) {
  .opportunity-form input:not([type="checkbox"]):not([type="radio"]),
  .appointment-form input:not([type="checkbox"]):not([type="radio"]),
  .service-request-form input:not([type="checkbox"]):not([type="radio"]),
  .settings-form input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
  }
}

.opportunity-form textarea,
.appointment-form textarea,
.service-request-form textarea,
.settings-form textarea {
  padding: 10px 12px;
  line-height: 1.5;
}

.opportunity-form input:focus,
.opportunity-form select:focus,
.opportunity-form textarea:focus,
.appointment-form input:focus,
.appointment-form select:focus,
.appointment-form textarea:focus,
.presentation-appointment-form input:focus,
.presentation-appointment-form select:focus,
.service-request-form input:focus,
.service-request-form select:focus,
.service-request-form textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

@media (max-width: 760px) {
  .opportunity-form input,
  .opportunity-form select,
  .opportunity-form textarea,
  .appointment-form input,
  .appointment-form select,
  .appointment-form textarea,
  .service-request-form input,
  .service-request-form select,
  .service-request-form textarea,
  .settings-form input,
  .settings-form select,
  .settings-form textarea {
    min-height: 44px;
    font-size: 16px;
  }
}

/* ---- Obrigatorio e validacao ---------------------------------------- */
.req-mark { color: #DC2626; font-weight: 600; }

/* O asterisco do titulo do compromisso caia numa LINHA PROPRIA: o <label>
   e `display: grid`, entao o <span> do asterisco virava uma faixa da
   grade em vez de ficar ao lado do texto. Volta a ser bloco simples, com
   o espacamento que a grade dava. (Achado registrado no lote 3.) */
.appointment-form label.appointment-title-field { display: block; }
.appointment-form label.appointment-title-field > input { margin-top: 6px; }
.appointment-title-field > span[aria-hidden="true"] {
  display: inline;
  color: #DC2626;
  font-weight: 600;
}

/* Campos do compromisso que tem icone dentro da caixa reservam 52px a
   esquerda (.appointment-field-shell). O `padding: 0 12px` do padrao comia
   essa reserva e o icone ficava POR CIMA da primeira letra — visivel na
   captura, invisivel na medicao (o valor medido estava correto; errado era
   o efeito). Mantem a reserva e aplica so o padding vertical do padrao. */
.appointment-form .appointment-field-shell select,
.appointment-form .appointment-client-field .appointment-field-shell input[type="search"] {
  padding-left: 52px;
  padding-right: 12px;
}

.form-status {
  font-size: 12px;
  line-height: 1.4;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 7 (comercial)                                     */
/* screen-sales · screen-sales-tasks · createNegotiationModal ·          */
/* opportunityModal · commercialDemandModal                              */
/*                                                                       */
/* Primeiro lote depois das duas fundacoes. Botao, titulo, eyebrow,      */
/* rotulo e campo ja vem certos — sobra cabecalho, rodape e tabela.      */
/*                                                                       */
/* CORRECAO DO INVENTARIO: as tabelas do comercial NAO sao "sem classe". */
/* Sao TRES familias com classe propria e valores diferentes entre si:   */
/*   .commercial-demands-table   th 12px/800  td 18px  padding 28px 30px */
/*   .proposal-clients-table     th 12px/800  td 18px  padding 18px 22px */
/*   .opportunities-table        th 12px/800  td 18px  padding 28px 30px */
/* O td de 18px vinha do body, como nas demais.                          */
/* ===================================================================== */

/* ---- Tabelas (decisao D) -------------------------------------------- */
#screen-sales .commercial-demands-table th,
#screen-sales .proposal-clients-table th,
#screen-sales .opportunities-table th,
#screen-sales-tasks table th {
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
  background: #F7F8FA;
  border-bottom: 1px solid #EEF1F5;
  white-space: nowrap;
}

#screen-sales .commercial-demands-table td,
#screen-sales .proposal-clients-table td,
#screen-sales .opportunities-table td,
#screen-sales-tasks table td {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 400;
  color: #1B2536;
  border-bottom: 1px solid #F1F4F8;
}

#screen-sales .commercial-demands-table tbody tr:last-child td,
#screen-sales .proposal-clients-table tbody tr:last-child td,
#screen-sales .opportunities-table tbody tr:last-child td { border-bottom: 0; }

#screen-sales .commercial-demands-table tbody tr:hover,
#screen-sales .proposal-clients-table tbody tr:hover,
#screen-sales .opportunities-table tbody tr:hover { background: #FAFBFC; }

/* ---- Cabecalho dos tres modais -------------------------------------- */
/* opportunityModal e commercialDemandModal usam .modal-card e
   .modal-actions genericos (os mesmos do clientModal, lote 9), por isso
   o escopo por id. */
.modal-header.create-negotiation-header,
.modal-header.opportunity-modal-header,
.modal-header.commercial-demand-header {
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.create-negotiation-icon,
.opportunity-modal-icon,
.commercial-demand-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E6F1FB;
  color: #185FA5;
}

.create-negotiation-heading,
.opportunity-modal-heading,
.commercial-demand-heading { flex: 1 1 auto; min-width: 0; }

.create-negotiation-heading h2,
.opportunity-modal-heading h2,
.commercial-demand-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}

.opportunity-modal-heading p,
.commercial-demand-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #5A6472;
}

.modal-header.create-negotiation-header .icon-button,
.modal-header.opportunity-modal-header .icon-button,
.modal-header.commercial-demand-header .icon-button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
}

/* ---- Rodape em faixa ------------------------------------------------ */
.create-negotiation-card .modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* Nestes dois o rodape vive dentro do <form class="opportunity-form">,
   que tem padding 28px — margem negativa leva a faixa ate as bordas.
   Mesma solucao do userModal (lote 2). */
#opportunityModal .modal-actions,
#commercialDemandModal .modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 8px -28px -28px;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* ---- Corpo ---------------------------------------------------------- */
.create-negotiation-body { padding: 20px 24px; }

/* ===================================================================== */
/* PADRONIZACAO — LOTE 8 (pipeline)                                      */
/* screen-sales-pipeline · pipelineLossModal · barra de filtros dos      */
/* RELATORIOS (.report-field)                                            */
/*                                                                       */
/* FORA DO LOTE: pipelineDetailModal. O cabecalho dele e montado pelo    */
/* script.js (<header id="negotiationHead"> vazio no HTML) e o desenho   */
/* e proprio — titulo editavel inline, colunas, linha do tempo. Nao e um */
/* modal de tres faixas; entra no plano dos componentes em runtime.      */
/* ===================================================================== */

/* ---- Metricas do pipeline ------------------------------------------- */
/* O .eyebrow global ja e 11px/600/.06em desde o lote 5; aqui havia uma
   sobrescrita antiga (12px/700/.03em) que o mantinha fora do padrao. */
.pipeline-metric .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #8A93A3;
}

.pipeline-metric strong {
  font-size: 22px;
  font-weight: 700;
  color: #0F172A;
}

.pipeline-metric small { font-size: 11.5px; color: #8A93A3; }
.pipeline-metric { padding: 14px 16px; }

/* ---- Filtro da tela (decisao B) ------------------------------------- */
.pipeline-filters select,
.pipeline-type-filter select {
  min-height: 32px;
  padding: 5px 26px 5px 10px;
  font-size: 12px;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  background-color: #fff;
  color: #1B2536;
}

/* ---- Barra de filtros dos RELATORIOS (decisao B) -------------------- */
/* `.report-field` e usado por TODOS os relatorios (o renderizador
   generico monta a barra), inclusive Pipeline e Produtividade — que eu
   mesmo entreguei fora do padrao, usando a variante de 12px em vez da
   de 10px caixa alta. Uma regra so alinha os sete. */
.report-field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

.report-field input,
.report-field select {
  height: auto;
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  color: #1B2536;
}
.report-field select { padding-right: 26px; }

/* Os :not() repetidos sao obrigatorios: o reset global pesa (0,2,1) para
   INPUT e mantinha os campos de data em 44px/raio 12 ao lado de selects
   de 32px/raio 8. Armadilha ja documentada no lote 6 (guia 3.1) — e ainda
   assim escapou aqui na primeira escrita. Pego pela medicao. */
.report-field input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 32px;
  border-radius: 8px;
  border-color: #D8DDE6;
}

.report-toolbar,
.pipe-toolbar,
.prod-toolbar {
  padding: 12px 14px;
  background: #F7F8FA;
  border: 1px solid #E7EAF0;
  border-radius: 12px;
  box-shadow: none;
  gap: 12px;
}

/* ---- pipelineLossModal ---------------------------------------------- */
/* Icone rosa: e a acao de marcar a negociacao como PERDIDA. */
.modal-header.pipeline-loss-header {
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.pipeline-loss-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FBEAF0;
  color: #993556;
}

.pipeline-loss-heading { flex: 1 1 auto; min-width: 0; }
.pipeline-loss-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}
.modal-header.pipeline-loss-header .icon-button { flex: 0 0 auto; margin: -4px -4px 0 0; }

.pipeline-loss-body { padding: 20px 24px; }

.pipeline-loss-card .modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 9 (contratos e propostas)                         */
/* screen-proposal-builder · screen-contract-builder · screen-contracts  */
/*                                                                       */
/* CUIDADO CENTRAL DESTE LOTE — O PDF DO CLIENTE                         */
/* O PDF da proposta e do contrato e gerado por html2canvas FOTOGRAFANDO */
/* o DOM das paginas `.proposal-a4-page` (script.js ~9176 e ~10238). Ou  */
/* seja: qualquer regra que alcance essas paginas muda o documento que   */
/* chega ao cliente.                                                     */
/*                                                                       */
/* Por isso TUDO aqui e escopado no FORMULARIO (.proposal-builder-form)  */
/* ou na tela (#screen-contracts). As paginas A4 sao injetadas pelo      */
/* script.js em #proposalPages/#contractPages, fora do formulario, e     */
/* usam classes proprias (word-contract-page, megaup-proposal-page,      */
/* sisinfra-proposal-page) que nenhum lote tocou ate agora.              */
/*                                                                       */
/* NAO acrescentar aqui nenhuma regra por ELEMENTO (h1, table, input     */
/* soltos): seria o unico jeito de vazar para dentro do PDF.             */
/* ===================================================================== */

/* ---- Formulario dos construtores ------------------------------------ */
.proposal-builder-form label {
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #5A6472;
}

.proposal-builder-form input:not([type="checkbox"]):not([type="radio"]),
.proposal-builder-form select,
.proposal-builder-form textarea {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #E7EAF0;
  border-radius: 10px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 400;
  color: #1B2536;
}

.proposal-builder-form textarea {
  min-height: 80px;
  padding: 10px 12px;
  line-height: 1.5;
}

.proposal-builder-form input:not([type="checkbox"]):not([type="radio"]):focus,
.proposal-builder-form select:focus,
.proposal-builder-form textarea:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

@media (max-width: 760px) {
  .proposal-builder-form input:not([type="checkbox"]):not([type="radio"]),
  .proposal-builder-form select,
  .proposal-builder-form textarea {
    min-height: 44px;
    font-size: 16px;
  }
}

/* ---- Tabela de contratos (decisao D) -------------------------------- */
#screen-contracts table th {
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
  background: #F7F8FA;
  border-bottom: 1px solid #EEF1F5;
  white-space: nowrap;
}

#screen-contracts table td {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 400;
  color: #1B2536;
  border-bottom: 1px solid #F1F4F8;
}

#screen-contracts table tbody tr:last-child td { border-bottom: 0; }
#screen-contracts table tbody tr:hover { background: #FAFBFC; }

/* ---- Filtros da tela de contratos (decisao B) ----------------------- */
#screen-contracts .contract-filters label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

#screen-contracts .contract-filters select,
#screen-contracts .contract-filters input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  background-color: #fff;
  color: #1B2536;
}
#screen-contracts .contract-filters select { padding-right: 26px; }

/* ===================================================================== */
/* PADRONIZACAO — LOTE 10 (clientes)                                     */
/* screen-clients · screen-client-detail (9 tabelas) · clientModal ·     */
/* clientContactModal                                                    */
/*                                                                       */
/* ALTA CRITICIDADE: `clients` tem 9 pessoas distintas escrevendo em 30  */
/* dias — mais gente do que qualquer outra entidade do sistema.          */
/*                                                                       */
/* NOTA sobre as 9 tabelas do detalhe: o <tbody> nasce vazio no HTML e   */
/* as linhas sao injetadas pelo script.js. A regra do `td` foi escrita   */
/* junto com a do `th` (que a medicao alcanca) — mesma forma usada nos   */
/* lotes 4, 7 e 9, ja validada. Conferir em tela com dados reais.        */
/* ===================================================================== */

/* ---- Tabelas (decisao D) -------------------------------------------- */
#screen-clients .clients-table th,
#screen-client-detail .client-rdv-table th,
#screen-client-detail .client-agendas-table th,
#screen-client-detail .client-service-orders-table th,
#screen-client-detail .client-neg-table th,
#screen-client-detail .client-proposals-table th,
#screen-client-detail .client-contracts-table th,
#screen-client-detail .client-contacts-table th,
#screen-client-detail .client-demands-table th,
#screen-client-detail .client-attachments-table th {
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
  background: #F7F8FA;
  border-bottom: 1px solid #EEF1F5;
  white-space: nowrap;
}

#screen-clients .clients-table td,
#screen-client-detail .client-rdv-table td,
#screen-client-detail .client-agendas-table td,
#screen-client-detail .client-service-orders-table td,
#screen-client-detail .client-neg-table td,
#screen-client-detail .client-proposals-table td,
#screen-client-detail .client-contracts-table td,
#screen-client-detail .client-contacts-table td,
#screen-client-detail .client-demands-table td,
#screen-client-detail .client-attachments-table td {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 400;
  color: #1B2536;
  border-bottom: 1px solid #F1F4F8;
}

#screen-clients .clients-table tbody tr:last-child td,
#screen-client-detail table tbody tr:last-child td { border-bottom: 0; }
#screen-clients .clients-table tbody tr:hover,
#screen-client-detail table tbody tr:hover { background: #FAFBFC; }

/* ---- Filtros do detalhe (decisao B) --------------------------------- */
#screen-client-detail .client-demands-filters label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

#screen-client-detail .client-demands-filters select,
#screen-client-detail .client-demands-filters input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  background-color: #fff;
  color: #1B2536;
}
#screen-client-detail .client-demands-filters select { padding-right: 26px; }

/* ---- Cabecalho dos dois modais -------------------------------------- */
.modal-header.client-modal-header,
.modal-header.client-contact-modal-header {
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.client-modal-icon,
.client-contact-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E6F1FB;
  color: #185FA5;
}

.client-modal-heading,
.client-contact-heading { flex: 1 1 auto; min-width: 0; }

/* O cartao do contato tem regra propria de dois niveis para o cabecalho
   (eyebrow 16px/700 e titulo ate 30px), entao repetimos o cartao no
   seletor — armadilha ja conhecida desde o lote 2. */
.client-modal-heading .eyebrow,
.client-contact-modal-card .client-contact-heading .eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

.client-modal-heading h2,
.client-contact-modal-card .client-contact-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}

.client-modal-heading p,
.client-contact-modal-card .client-contact-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #5A6472;
}

.modal-header.client-modal-header .icon-button,
.modal-header.client-contact-modal-header .icon-button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
}

/* ---- Rodape em faixa ------------------------------------------------ */
/* No clientModal o rodape vive dentro do <form class="opportunity-form">
   (padding 28px) — margem negativa leva a faixa ate as bordas. */
#clientModal .modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 8px -28px -28px;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* Precisa de ID no seletor: existe `#clientContactForm .modal-actions`
   (0,1,1,0) com `padding: 18px 28px 0` e `margin-top: 20px`, que vence
   qualquer regra de duas classes. Pego pela medicao — o padding era o
   unico valor do rodape que nao mudava. */
#clientContactModal .modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 11 (Central de Atendimento: filtros e modais)     */
/*                                                                       */
/* A TELA MAIS USADA DO SISTEMA: 1.381 eventos em 30 dias, 7 pessoas.    */
/* Por isso o lote e deliberadamente PARCIAL: barra de filtros + os 6    */
/* modais de chamado. A TABELA da Central fica para um lote proprio —    */
/* ela tem coluna de SLA com estados coloridos, dot de resposta nao      */
/* lida e linhas sinteticas de WhatsApp/chat web; e acoplamento demais   */
/* para misturar com o resto.                                            */
/* ===================================================================== */

/* ---- Barra de filtros (decisao B) — CORRECAO DE UM ERRO MEU ---------- */
/* No lote 6 eu coloquei `.service-request-filters label` na familia de
   FORMULARIO (12px/500). Filtro nao e formulario: pela decisao B o rotulo
   e 10px caixa alta e o controle tem 32px. Corrigido aqui. */
.service-request-filters label {
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

.service-request-filters select,
.service-request-filters input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #D8DDE6;
  border-radius: 8px;
  background-color: #fff;
  color: #1B2536;
}
.service-request-filters select { padding-right: 26px; }

/* ---- Cabecalho dos 6 modais ----------------------------------------- */
.modal-header.sr-transfer-header,
.modal-header.sr-columns-header,
.modal-header.sr-link-header,
.modal-header.sr-os-header,
.modal-card-header.sr-client-change-header,
.sr-success-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.sr-transfer-icon,
.sr-columns-icon,
.sr-link-icon,
.sr-os-icon,
.sr-client-change-icon,
.service-request-success-backdrop .success-modal-icon,
#serviceRequestSuccessModal .success-modal-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
}

/* Cor pela natureza: azul = mover/vincular/consultar, ambar = configurar,
   verde = confirmar. */
.sr-transfer-icon,
.sr-link-icon,
.sr-os-icon,
.sr-client-change-icon { background: #E6F1FB; color: #185FA5; }
.sr-columns-icon { background: #FAEEDA; color: #854F0B; }
#serviceRequestSuccessModal .success-modal-icon { background: #E1F5EE; color: #0F6E56; }

.sr-transfer-heading,
.sr-columns-heading,
.sr-link-heading,
.sr-os-heading,
.sr-client-change-heading,
.sr-success-heading { flex: 1 1 auto; min-width: 0; }

/* O cartao de vincular tem regra propria de dois niveis (eyebrow 13px e
   titulo ate 32px) — repetir o cartao no seletor, como no lote 2. */
.sr-transfer-heading .eyebrow,
.sr-columns-heading .eyebrow,
.sr-os-heading .eyebrow,
.sr-client-change-heading .eyebrow,
.sr-success-heading .eyebrow,
.service-request-link-client-card .sr-link-heading .eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

.sr-transfer-heading h2,
.sr-columns-heading h2,
.sr-os-heading h2,
.sr-client-change-heading h2,
.sr-success-heading h2,
.service-request-link-client-card .sr-link-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}

.sr-transfer-heading p,
.sr-columns-heading p,
.sr-os-heading p,
.sr-client-change-heading p,
.service-request-link-client-card .sr-link-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #5A6472;
}

.modal-header.sr-transfer-header .icon-button,
.modal-header.sr-columns-header .icon-button,
.modal-header.sr-link-header .icon-button,
.modal-header.sr-os-header .icon-button,
.modal-card-header.sr-client-change-header .icon-button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
}

/* ---- Modal de sucesso: tres faixas ---------------------------------- */
/* Escopado no ID porque `.success-modal-card` tambem serve o
   appointmentSuccessModal, migrado no lote 1 com escopo pelo backdrop —
   os dois precisam continuar independentes. */
#serviceRequestSuccessModal .success-modal-card {
  width: min(460px, calc(100vw - 32px));
  display: block;
  justify-items: stretch;   /* senao cada faixa encolhe (armadilha do lote 1) */
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: 16px;
}

.sr-success-body { padding: 20px 24px; }
.sr-success-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #5A6472;
}

/* ---- Rodape em faixa ------------------------------------------------ */
.sr-success-footer,
.service-request-transfer-card .modal-actions,
.service-request-link-client-card .modal-actions,
.service-order-detail-card .modal-actions,
.sr-client-change-card .modal-actions,
.sr-history-card .modal-actions,
#serviceRequestColumnsModal .modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 12 (FUNDACAO: cartoes / decisao F)                */
/*                                                                       */
/* Ultima decisao global pendente. `.card` aparece 102 vezes e todas as  */
/* ocorrencias mediam igual (raio 16, borda rgba(148,163,184,.36)),      */
/* entao uma regra resolve o sistema inteiro.                            */
/*                                                                       */
/* O `.modal-card` NAO entra: pelo guia (1.3) cartao de modal fica em    */
/* 16px, e so o cartao de conteudo vai para 12px. Sao classes distintas  */
/* e nenhum elemento tem as duas.                                        */
/* ===================================================================== */

.card {
  border-radius: 12px;
  border-color: #E7EAF0;
}

/* Cartao dentro de cartao nao empilha sombra: a de dentro fica so com a
   borda. Sem isto, um painel dentro de um painel ganha duas sombras
   sobrepostas e o cinza acumula. */
.card .card {
  box-shadow: none;
  border-color: #E7EAF0;
}

/* O raio menor precisa acompanhar quem "encaixa" no cartao: cabecalho e
   rodape colados nas bordas herdavam o canto de 16px. */
.card > .card-header:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }

/* ===================================================================== */
/* PADRONIZACAO — LOTE 13 (tabela da Central de Atendimento)             */
/*                                                                       */
/* A tabela onde a equipe passa o dia: 1.381 eventos em 30 dias.         */
/* Ela ja estava PERTO do padrao (th 10px caixa alta, td 13,5px), entao  */
/* o lote e pequeno de proposito — so tipografia, cor e respiro.         */
/*                                                                       */
/* O QUE NAO SE TOCA AQUI:                                               */
/*  - larguras de coluna: nenhuma regra de width foi escrita. Ainda      */
/*    assim elas SE MOVEM ~2%, porque a tabela e `width: max-content` e  */
/*    as colunas sao %: mudar a metrica das celulas muda a largura       */
/*    intrinseca e as colunas acompanham. Medido: 122,4 -> 124,6px na    */
/*    coluna 1. Nao da para evitar sem manter a tipografia antiga.       */
/*    Em producao as colunas ainda sao redimensionaveis pelo usuario     */
/*    (MutationObserver que injeta colgroup) — nao escrever width aqui   */
/*    e justamente o que evita brigar com esse mecanismo;                */
/*  - a coluna de SLA (estados coloridos), o dot de resposta nao lida e  */
/*    as linhas sinteticas de WhatsApp/chat web — todos tem classe       */
/*    propria e ficam como estao;                                        */
/*  - `vertical-align` e o border-TOP como separador de linha: a tabela  */
/*    tem celulas de varias linhas e o alinhamento atual e deliberado.   */
/* ===================================================================== */

.service-requests-table th {
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #8A93A3;
  background: #F7F8FA;
  border-top-color: #EEF1F5;
}

.service-requests-table td {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 400;
  color: #1B2536;
  line-height: 1.45;
  border-top-color: #F1F4F8;
}

.service-request-table-footer {
  font-size: 13px;
  color: #5A6472;
}

/* ===================================================================== */
/* PADRONIZACAO — LOTE 14 (os 6 modais estaticos que faltavam)           */
/* startChatModal · conversationClientLinkModal ·                        */
/* conversationNewContactModal · whatsappHistoryModal ·                  */
/* serviceOrderImagePreviewModal · settingsDetailModal                   */
/*                                                                       */
/* Com este lote, 100% do HTML ESTATICO do painel esta no padrao. O que  */
/* fica de fora sao os componentes montados em runtime pelo script.js    */
/* (chat flutuante, detalhe do chamado, detalhe da negociacao), que      */
/* precisam de plano proprio.                                            */
/*                                                                       */
/* Os dois cartoes de conversa nao TINHAM cabecalho: o botao de fechar,  */
/* o rotulo, o titulo e o texto eram filhos diretos do cartao, num grid  */
/* de uma coluna. Ganharam as tres faixas (markup + CSS).                */
/* ===================================================================== */

/* ---- Cabecalho ------------------------------------------------------ */
.modal-header.start-chat-header,
.conversation-link-header,
.modal-header.wa-history-header,
.modal-header.sr-history-header,
.modal-header.os-image-header,
.modal-header.settings-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
  margin: 0;
}

.start-chat-brand-badge,
.conversation-link-icon,
.conversation-contact-icon,
.wa-history-icon,
.sr-history-icon,
.os-image-icon,
.settings-detail-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Cor pela natureza. O chat e o historico ficam no verde do WhatsApp —
   e o unico lugar do sistema onde a cor identifica o CANAL, nao a acao;
   trocar por azul tiraria uma pista util de contexto. */
.start-chat-brand-badge,
.wa-history-icon { background: #E1F5EE; color: #0F6E56; }
.conversation-link-icon,
.conversation-contact-icon,
.sr-history-icon,
.os-image-icon { background: #E6F1FB; color: #185FA5; }
.settings-detail-icon { background: #FAEEDA; color: #854F0B; }

.start-chat-header-text,
.conversation-link-heading,
.wa-history-header-text,
.sr-history-header-text,
.os-image-header-text,
.settings-detail-header-text { flex: 1 1 auto; min-width: 0; }

.start-chat-header-text .eyebrow,
.conversation-link-heading .eyebrow,
.wa-history-header-text .eyebrow,
.sr-history-header-text .eyebrow,
.os-image-header-text .eyebrow,
.settings-detail-header-text .eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

/* `.conversation-link-card h2` tem regra propria de dois niveis (28px) —
   repetir o cartao no seletor, como nos lotes anteriores. */
.start-chat-header-text h2,
.wa-history-header-text h2,
.sr-history-header-text h2,
.os-image-header-text h2,
.settings-detail-header-text h2,
.conversation-link-card .conversation-link-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #1B2536;
}

.wa-history-header-text p,
.sr-history-header-text p,
.os-image-header-text p,
.conversation-link-card .conversation-link-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #5A6472;
}

.modal-header.start-chat-header .icon-button,
.modal-header.wa-history-header .icon-button,
.modal-header.sr-history-header .icon-button,
.modal-header.os-image-header .icon-button,
.modal-header.settings-detail-header .icon-button,
.conversation-link-header .icon-button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
}

/* ---- Cartoes de conversa: de grid unico para tres faixas ------------ */
.conversation-link-card {
  display: block;
  justify-items: stretch;   /* armadilha do lote 1 */
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

/* O botao de fechar era posicionado em absoluto no canto do cartao;
   agora vive dentro do cabecalho, no fluxo. */
.conversation-link-close {
  position: static;
  top: auto;
  right: auto;
}

.conversation-link-body {
  display: grid;
  gap: 14px;
  padding: 20px 24px;
}

/* Estes cartoes nao entraram em nenhuma familia de formulario do lote 6
   (tem markup proprio), entao o rotulo continuava em negrito escuro. */
.conversation-link-body > label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #5A6472;
}
.conversation-link-body input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #E7EAF0;
  border-radius: 10px;
  font-size: 14px;
  color: #1B2536;
}
.conversation-link-body input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.conversation-link-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: #F8FAFC;
  border-top: 1px solid #E7EAF0;
}
.conversation-link-footer .conversation-link-submit { width: auto; }

/* Codigo clicavel na tabela de relatorio (abre o chamado na Central).
   min-height:0 e' obrigatorio: ha um `button { min-height: 44px }` global que,
   sem isso, estica a linha da tabela. Mesma receita do .sla-rep-code. */
.report-table .report-link {
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
  color: #2563EB;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.report-table .report-link:hover { text-decoration: underline; }
.report-table .report-link:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; border-radius: 4px; }

/* ---- Popup de historico do chamado (relatorio da Central) ------------
   Cabecalho, icone e rodape reusam os seletores do lote 14 (a classe foi
   acrescentada la em cima). Aqui fica so o que e' proprio deste cartao.
   Medidas iguais as do historico do WhatsApp — mesma familia de popup. */
.sr-history-card {
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.sr-history-summary {
  display: grid;
  /* Solicitante e' quase sempre um e-mail: recebe mais espaco que os outros
     tres campos, para nao quebrar no meio do dominio. */
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid #E7EAF0;
  background: #F8FAFC;
}
.sr-history-summary span { display: grid; gap: 4px; min-width: 0; }
.sr-history-summary small {
  color: #8A93A3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
/* Sem reticencias: o e-mail do solicitante e' justamente o dado que o
   corte comia (visto no screenshot). Deixa quebrar. */
.sr-history-summary strong {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: #1B2536;
  overflow-wrap: anywhere;
}
.sr-history-body { overflow: auto; padding: 18px 24px; background: #F8FAFC; }

/* ============================================================================
   BARRA LATERAL — redesenho (lote especial da padronizacao, 28/08)
   ============================================================================
   Fonte da verdade: o mockup enviado pelo Andre, nos DOIS temas.

   ONDE FICA: no fim da folha, de proposito. As regras antigas da barra estao
   espalhadas por ~6 pontos (base, refino claro, bloco de tema, media queries).
   Vir por ULTIMO vence por ordem com a MESMA especificidade — nao precisei
   subir seletor nem usar !important em lugar nenhum.

   NENHUM HEX AQUI. Tudo sai dos tokens --theme-nav-*, que tem par claro/escuro.

   GEOMETRIA so vale acima de 901px, que e' onde existe o trilho/expansao que o
   mockup desenha. Abaixo disso a barra vira overlay de largura total, com regras
   proprias — mexer la mudaria a responsividade, que o pedido manda preservar.
   As CORES, essas valem em toda largura: senao o overlay do celular ficaria
   preso no tema antigo. */

/* Fundo chapado, no lugar do gradiente. */
.sidebar {
  background: var(--theme-nav-bg);
  border-right: 1px solid var(--theme-nav-divider);
}

.nav-item {
  color: var(--theme-nav-ink);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.nav-subitem {
  color: var(--theme-nav-ink-soft);
}

/* Pilula do item ativo: azul SOLIDO, no lugar do brilho difuso.

   O seletor precisa do .sidebar na frente. Com apenas `.nav-item.is-active`
   (2 classes) quem vencia era `.sidebar .nav-item.is-active` (3 classes), la em
   cima na folha, que pinta um GRADIENTE 135deg #1672f3 -> #155fd0 e um halo de
   26px. Medido no computado: a pilula saia degrade, nao chapada.

   background-image: none e' obrigatorio junto: background-color sozinho fica
   ATRAS da imagem do gradiente e nao aparece. */
.sidebar .nav-item.is-active {
  background-color: var(--theme-nav-accent);
  background-image: none;
  color: var(--theme-nav-accent-ink);
  border-color: transparent;
  box-shadow: var(--theme-nav-accent-shadow);
  font-weight: 600;
}

.nav-badge {
  background: var(--theme-nav-accent);
  color: var(--theme-nav-accent-ink);
}

@media (min-width: 901px) {
  /* ---- itens de 1o nivel: 36px, no lugar dos 48px de hoje ---------------- */
  .sidebar:hover .nav-item {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    gap: 10px;
  }

  .sidebar:hover .nav-item:not(.is-active):hover {
    background: var(--theme-nav-hover);
  }

  /* Os icones da barra viraram SVG de traco, entao basta dizer o tamanho.
     A gambiarra que morava aqui — transform: scale(0.6667) com margens
     negativas — existia porque os icones antigos eram desenhados com gradientes
     em posicoes FIXAS numa caixa de 24px: mudar width/height CORTAVA o desenho
     em vez de reduzi-lo. Com SVG o traco escala de verdade. */
  .sidebar:hover .nav-item .nav-icon {
    width: 18px;
    height: 18px;
  }

  /* ---- grupo aberto vira CARTAO -----------------------------------------
     O markup e' PLANO: os subitens sao IRMAOS do pai, nao filhos. Nao ha um
     contedor de grupo para receber o fundo. Envolver em <div> resolveria, mas
     as permissoes escondem cada <a> individualmente (item.hidden = !allowed) e
     um grupo todo oculto deixaria um cartao VAZIO na tela — daria para consertar
     com mais JS, so que o pedido diz que essa logica nao muda.

     Entao o cartao e' desenhado por PARTES contiguas: o pai arredonda em cima,
     os subitens continuam o fundo, e o ultimo arredonda embaixo. Some sozinho
     quando o grupo fecha, e respeita item escondido por permissao. */
  .sidebar:hover .nav-parent-item.is-expanded {
    background: var(--theme-nav-group-bg);
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    /* Cor NORMAL do tema, so o peso muda. O rotulo azul competia com a pilula:
       dois azuis fortes na mesma coluna, e o olho nao sabia qual era o item da
       rota. O unico ponto de acento do grupo e' o quadradinho do icone. */
    font-weight: 600;
  }

  .sidebar:hover .nav-subitem.is-expanded {
    background: var(--theme-nav-group-bg);
    border-radius: 0;
    /* Fecha o gap:10px do grid .sidebar-nav. Sem isto o "cartao" sai em FAIXAS
       separadas e a linha-guia vira tracinhos soltos — conferido na captura. */
    margin-top: -10px;
    margin-left: 0;
    /* Recuo de 44px, nao 34: a coluna de texto dos subitens tem de coincidir
       com a da pilula, e a pilula precisa comecar bem a DIREITA da linha-guia.
       Com 34 ela ficava a 4px da linha — colada, e a guia lia como sujeira. */
    padding: 6px 10px 6px 44px;
    min-height: 0;
    font-size: 12.5px;
    font-weight: 500;
    position: relative;
  }

  /* Ultimo subitem VISIVEL fecha o cartao. O :has() e' o que faz isso respeitar
     permissao: se o ultimo estiver escondido, quem arredonda e o anterior. */
  .sidebar:hover .nav-subitem.is-expanded:not([hidden]):not(:has(~ .nav-subitem.is-expanded:not([hidden]))) {
    border-radius: 0 0 10px 10px;
    /* O respiro que fecha o CARTAO sai de uma BORDA transparente, nao do
       padding. Assim o padding dos subitens fica LITERALMENTE identico — era o
       pedido — e o fundo do cartao ainda pinta a faixa, porque o recorte padrao
       e border-box. O texto tambem nao se mexe: borda inferior nao empurra
       conteudo. */
    border-bottom: 6px solid transparent;
  }

  /* ---- linha-guia vertical ligando os subitens ao pai --------------------
     Reaproveita o ::before que hoje desenha a bolinha solta de cada subitem:
     vira um segmento de 2px. Colados, os segmentos formam uma linha continua. */
  .sidebar:hover .nav-subitem.is-expanded::before {
    content: "";
    position: absolute;
    left: 24px;
    /* -1px em cima e embaixo para COBRIR a borda transparente de 1px que todo
       .nav-item carrega. Sem isso cada segmento media 27,6px numa linha de 30 e
       a guia saia PICOTADA, com 2px de falha entre um subitem e o seguinte. */
    top: -1px;
    bottom: -1px;
    width: 2px;
    height: auto;
    border-radius: 0;
    background: var(--theme-nav-guide);
    opacity: 1;
  }

  /* ---- quadradinho colorido no icone do grupo aberto --------------------- */
  /* Quadradinho colorido do grupo aberto — agora nos 26px do mockup.
     Antes ficava preso em 24px porque o icone precisava da caixa inteira para
     nao ser cortado. Com SVG da para separar as duas coisas: 18px de desenho
     mais 4px de padding de cada lado fecham exatamente 26. */
  .sidebar:hover .nav-parent-item.is-expanded .nav-icon {
    box-sizing: content-box;
    padding: 4px;
    border-radius: 8px;
    background: var(--theme-nav-accent-soft);
    color: var(--theme-nav-accent-icon);
  }

  /* ---- item ativo dentro do submenu: a pilula vence o fundo do cartao ---- */
  /* A pilula comeca DEPOIS da linha-guia, como no mockup — antes ela passava por
     cima e a linha atravessava o azul.
     O recuo vem de uma BORDA TRANSPARENTE de 28px, nao de margin-left. Medido:
     com margem, a caixa era EMPURRADA sem encolher e a pilula ia a 317px numa
     barra de 300 — cortada pela borda da barra. A borda entra para dentro
     (box-sizing: border-box), entao a direita fica onde estava, em 289px.
     O padding-left cai de 34 para 6 e o texto continua no mesmo x dos irmaos:
     nada dança quando a rota muda. */
  /* A PILULA E' UM SUBITEM IGUAL AOS OUTROS. So muda a cor.
     Mesmo corpo (12.5px, padding 6px 10px, cantos 8px), MESMA coluna de texto
     (54px) e MESMA altura das irmas. O recuo de 34px deixa a linha-guia passar
     INTEIRA a esquerda, sem ser coberta — antes eram 28px e a pilula encostava
     nela, o que dava a impressao de vazar ate a borda da barra.

     DUAS camadas de fundo, com recortes diferentes, e a razao importa:
       - a de cima (padding-box) e' a pilula azul, que para antes da borda;
       - a de baixo (border-box) devolve o fundo do CARTAO na faixa da borda.
     Sem a segunda, a faixa nao era pintada por ninguem e vazava a cor crua da
     barra: um entalhe escuro a esquerda da pilula. */
  .sidebar:hover .nav-subitem.is-active {
    background:
      linear-gradient(var(--theme-nav-accent) 0 0) padding-box,
      linear-gradient(var(--theme-nav-group-bg) 0 0) border-box;
    /* 35, nao 34: .nav-item tem `border: 1px solid transparent`, e a borda
       esquerda da pilula SUBSTITUI esse 1px. Sem somar de volta, o texto da
       pilula caia 1px a esquerda do das irmas e a linha-guia ficava torta pelo
       mesmo motivo. Medido com decimais: 1,000px de diferenca, nao
       arredondamento. */
    border-left: 35px solid transparent;
    color: var(--theme-nav-accent-ink);
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    /* A sombra PRECISA vir daqui. Sem esta linha vencia uma regra antiga com um
       brilho de 26px (rgba(22,114,243,.34) 0 12px 26px) — conferido no
       computado. O pedido pede sombra SUAVE. */
    box-shadow: var(--theme-nav-accent-shadow);
  }

  /* O item ativo comeca 34px a direita, entao a linha volta 10px para cair no
     MESMO x das irmas (34 - 10 = 24) e seguir reta pelo submenu inteiro. */
  .sidebar:hover .nav-subitem.is-active::before {
    left: -10px;
    background: var(--theme-nav-guide);
  }

  /* ---- divisor antes de Relatorios/Configuracoes -------------------------
     Linha em pseudo-elemento, NAO border-top no item. Com a borda no proprio
     item, a rota /reports ativa ganhava uma pilula de TOPO QUADRADO (o raio
     precisava ser 0 0 9 9 para nao cortar a linha) e a linha colava no azul.
     Assim o divisor flutua acima e a pilula fica inteira nos 9px em toda rota. */
  .sidebar:hover .nav-item[data-screen="reports"] {
    position: relative;
    margin-top: 17px;
  }

  .sidebar:hover .nav-item[data-screen="reports"]::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -9px;
    height: 1px;
    background: var(--theme-nav-divider);
  }

  /* ---- o chevron dos grupos SAI (31/08, a pedido do Andre) ---------------
     Ele e' desenhado como um quadrado de 8px com border-right + border-bottom,
     girado 45 graus. Nesse tamanho, e com o traco de 2px, o resultado nao lia
     como uma seta: lia como um TRACINHO diagonal solto na margem direita.

     Some junto a minha propria regra de rotacao ao abrir o grupo — sem o
     elemento visivel ela viraria declaracao morta, do tipo que este arquivo ja
     acumulou demais.

     O estado do grupo continua legivel sem ele: o grupo aberto vira CARTAO, o
     icone ganha o quadradinho colorido e os subitens aparecem. Havia tres pistas
     para a mesma informacao; ficaram duas, mais fortes.

     A classe .nav-parent-item so existe na barra (5 ocorrencias no index.html, nenhuma
     no script.js), entao esconder aqui nao alcanca mais nada. */
  .sidebar .nav-parent-item::after {
    display: none;
  }

  /* ---- trilho (barra fechada): mesmo espacamento novo --------------------
     O item do trilho e' um QUADRADO RIGIDO de 56x56 (regra bem acima nesta
     folha, com height/width/min-height juntos). Meu primeiro palpite foi so
     min-height: 44px — e nao mudou NADA, porque height vence min-height. Ficou
     uma declaracao morta na folha ate eu medir: 56px antes, 56px depois.
     Para encolher de verdade e' preciso derrubar os tres.
     A margem tambem entra na conta: .nav-item tem margin: 4px 0, e com o
     gap:10px do grid o passo entre icones dava 76px. */
  /* No trilho o icone e' a UNICA pista do que e' cada item — sem rotulo. Por
     isso 20px, e nao os 18 do menu aberto. */
  .sidebar:not(:hover) .nav-icon {
    width: 20px;
    height: 20px;
  }

  .sidebar:not(:hover) .nav-item,
  .sidebar:not(:hover) .plain-action {
    height: 44px;
    width: 44px;
    min-height: 44px;
    border-radius: 10px;
    margin-block: 0;
  }

  .sidebar:not(:hover) .nav-item[data-screen="reports"] {
    position: relative;
    margin-top: 17px;
  }

  .sidebar:not(:hover) .nav-item[data-screen="reports"]::before {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    top: -9px;
    height: 1px;
    background: var(--theme-nav-divider);
  }
}

/* ---- Barra de filtros do Pipeline: os tres controles no mesmo tamanho ------
   Medido em 31/08: busca 42px/raio 10/fonte 14, periodo 32px/raio 8/fonte 12,
   tipo 42px/raio 10/fonte 14. O PERIODO era o unico ja no padrao do
   GUIA_DE_PADROES (barra de filtros: controle 32px, raio 8) — os outros dois
   destoavam em 10px, e era isso que aparecia na tela.

   Precisa de `min-height` explicito, nao so `height`: a folha tem
   `input, select { min-height: 42px }` e `button { min-height: 44px }` como
   regras globais, e min-height vence height quando e' maior. Ja perdi tempo com
   isso no seletor de tema e no trilho da barra lateral. */
.pipeline-filters #pipelineSearch,
.pipeline-filters .pipeline-type-toggle {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.pipeline-filters .pipeline-type-toggle {
  gap: 6px;
}

/* ---- Reordenar colunas da Central arrastando o cabecalho -------------------
   O <th> inteiro e' a alca. A faixa azul mostra ONDE a coluna vai cair: na
   metade esquerda cai antes, na direita cai depois — sem isso nao da para levar
   uma coluna para a ultima posicao.

   `inset` no box-shadow, e nao borda: borda mudaria a largura do <th> e a tabela
   inteira dançaria durante o arrasto, justamente quando o usuario precisa de
   referencia estavel para mirar.

   Nenhuma cor nova: usa o token de acento que ja existe. */
#serviceRequestsTableHeadRow th[data-request-column] {
  cursor: grab;
}

#serviceRequestsTableHeadRow th[data-request-column]:active {
  cursor: grabbing;
}

#serviceRequestsTableHeadRow th.is-dragging {
  opacity: 0.45;
}

#serviceRequestsTableHeadRow th.is-drop-before {
  box-shadow: inset 2px 0 0 var(--theme-primary);
}

#serviceRequestsTableHeadRow th.is-drop-after {
  box-shadow: inset -2px 0 0 var(--theme-primary);
}

/* A alca de largura mantem o proprio cursor: sao dois gestos diferentes no mesmo
   elemento, e o ponteiro precisa dizer qual esta ao alcance. */
#serviceRequestsTableHeadRow .column-resizer {
  cursor: col-resize;
}

/* ===== Tela de PERFIL (menu do usuario > Perfil) ============================
   Valores do GUIA_DE_PADROES: cabecalho com icone 40px em quadrado raio 10 +
   eyebrow 11px/600 caixa alta + titulo 17px/500, padding 20px 24px e
   align-items flex-start; rotulo de formulario 12px/500 #5A6472; campo 42px,
   raio 10, fonte 14; rodape em faixa #F8FAFC com borda #E7EAF0.

   NENHUM HEX NOVO: as sete cores usadas aqui ja existiam na folha (conferido
   antes de escrever — #E6F1FB aparece 23x, #185FA5 35x, #EEEDFE 3x, e por ai).

   Classes proprias (profile-screen-*) para um ajuste aqui nao vazar para outro
   modal — a regra que evitou retrabalho nos 14 lotes. */
.profile-screen-card {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.profile-screen-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #E7EAF0;
}

.profile-screen-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E6F1FB;
  color: #185FA5;
}

.profile-screen-heading { flex: 1 1 auto; min-width: 0; }
.profile-screen-heading .eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}
.profile-screen-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 500;
  color: #0F172A;
}

.profile-screen-body {
  padding: 20px 24px;
  overflow-y: auto;
}

/* ---- cartao do usuario ---- */
.profile-screen-usercard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #E7EAF0;
  border-radius: 12px;
  background: #F8FAFC;
}

.profile-screen-avatar-wrap { position: relative; flex: 0 0 auto; }

.profile-screen-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #185FA5;
  background-size: cover;
  background-position: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}
.profile-screen-avatar.tem-foto { background-color: transparent; }

.profile-screen-avatar-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #2563EB;
  color: #fff;
  cursor: pointer;
}

.profile-screen-usercard-info { flex: 1 1 auto; min-width: 0; }
.profile-screen-usercard-info strong { display: block; font-size: 15px; color: #0F172A; }
.profile-screen-usercard-line {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #5A6472;
}
.profile-screen-usercard-meta { margin: 4px 0 0; font-size: 12px; color: #8A93A3; }

.profile-screen-role-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #EEEDFE;
  color: #534AB7;
  font-size: 11px;
  font-weight: 600;
}
.profile-screen-role-badge[hidden] { display: none; }

.profile-screen-usercard-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.profile-screen-link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #5A6472;
  font-size: 12px;
  cursor: pointer;
}
.profile-screen-link-button:hover { color: #0F172A; text-decoration: underline; }

/* ---- secoes e grade ---- */
.profile-screen-section {
  margin: 22px 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8A93A3;
}

.profile-screen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.profile-screen-grid label { display: flex; flex-direction: column; gap: 6px; }
.profile-screen-grid label > span { font-size: 12px; font-weight: 500; color: #5A6472; }
.profile-screen-grid label > span i { font-style: normal; color: #8A93A3; }
.profile-screen-required { color: #E24B4A; }

.profile-screen-grid input {
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #E7EAF0;
  border-radius: 10px;
  font-size: 14px;
}
.profile-screen-grid input:disabled {
  background: #F8FAFC;
  color: #8A93A3;
  cursor: not-allowed;
}

.profile-screen-hint { font-size: 11.5px; color: #8A93A3; }

.profile-screen-signature {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E7EAF0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
}

/* ---- preferencias ---- */
.profile-screen-prefs {
  border: 1px solid #E7EAF0;
  border-radius: 12px;
  overflow: hidden;
}

.profile-screen-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}
.profile-screen-pref-row + .profile-screen-pref-row { border-top: 1px solid #E7EAF0; }
.profile-screen-pref-row strong { display: block; font-size: 13px; font-weight: 600; color: #0F172A; }
.profile-screen-pref-row p { margin: 2px 0 0; font-size: 12px; color: #8A93A3; }

.profile-screen-pref-row select {
  height: 38px;
  min-height: 38px;
  min-width: 220px;
  padding: 0 10px;
  border: 1px solid #E7EAF0;
  border-radius: 8px;
  font-size: 13px;
}

/* Mesmo desenho do seletor de tema do menu de perfil: e a MESMA preferencia,
   entao precisa parecer o mesmo controle. */
.profile-screen-theme-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid #E7EAF0;
  border-radius: 999px;
  background: #F8FAFC;
}
.profile-screen-theme-switch button {
  min-height: 0;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #5A6472;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.profile-screen-theme-switch button[aria-checked="true"] {
  background: #fff;
  color: #0F172A;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

@media (max-width: 720px) {
  .profile-screen-grid { grid-template-columns: 1fr; }
  .profile-screen-usercard { flex-wrap: wrap; }
  .profile-screen-usercard-actions { align-items: flex-start; }
}

/* O cartao "Nome do remetente" e' um item da grade .email-accounts-view
   (1fr 1.1fr). Sem isto ele ocupa a COLUNA ESQUERDA e empurra "Contas
   cadastradas" para a direita e "Envios por finalidade" para a linha de baixo —
   foi o que quebrou a tela em 01/09.

   Ele vale para os tres e-mails, entao faixa inteira no topo e' tambem a leitura
   certa: nao pertence a nenhuma das duas colunas. */
.email-sender-name-card {
  /* Terceiro item da grade de 2 colunas: cai na COLUNA ESQUERDA da linha 2,
     preenchendo o espaco que sobrava embaixo de "Contas cadastradas" (a coluna
     da direita e mais alta). Foi onde o Andre pediu.
     NAO usa grid-column: 1 / -1 — isso o faria voltar a ser faixa inteira. */
  padding: 18px;
}

/* Campo e acao ocupam a faixa toda, sem esticar o input ate a outra ponta. */
.email-sender-name-card .settings-form { max-width: 420px; }
.email-sender-name-card .form-actions { justify-content: flex-start; }

/* Coluna da esquerda da tela de Contas de e-mail: as contas em cima e o nome do
   remetente logo abaixo. Sem este empilhamento o remetente vira o 3o item da
   grade e cai na linha 2 — abaixo do cartao mais alto, com o vao ao lado das
   contas continuando vazio. */
.email-accounts-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* ===== Menu "+" do chat (criar solicitacao / agenda / tarefa) ==========
   Ancorado no cabecalho da janela flutuante, que tem position: relative.

   NAO usa o atributo `hidden` para esconder: neste projeto ele ja perdeu tres
   vezes para uma regra de `display` do autor. O estado vem da classe .is-open,
   e o padrao aqui e display:none — nao ha o que perder por especificidade. */
.floating-whatsapp-actions { position: relative; }

.floating-whatsapp-mais {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  padding: 6px;
  gap: 2px;
  background: #FFFFFF;
  border: 1px solid #E7EAF0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.floating-whatsapp-mais.is-open {
  display: grid;
}

.floating-whatsapp-mais button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #0F172A;
  text-align: left;
  cursor: pointer;
}

.floating-whatsapp-mais button:hover:not(:disabled) { background: #F1F5F9; }

.floating-whatsapp-mais button:disabled {
  color: #8A93A3;
  cursor: not-allowed;
}

.floating-whatsapp-mais-hint {
  display: block;
  padding: 6px 10px 4px;
  border-top: 1px solid #E7EAF0;
  margin-top: 4px;
  font-size: 11px;
  color: #8A93A3;
}

/* ===== Modulos desligados =============================================
   O <body> ganha a classe `modulo-<nome>-off` (ver marcarModulosNoBody em
   script.js) e tudo que estiver marcado com data-modulo some.

   `!important` e' proposital: os alvos sao <th>, <td>, painel de formulario e
   cartao, cada um com sua propria regra de display. Sem ele esta regra perde
   por especificidade em parte dos casos e o modulo fica meio escondido — que
   e' pior do que nao esconder, porque parece funcionar. */
body.modulo-processo-off [data-modulo="processo"],
body.modulo-comercial-off [data-modulo="comercial"],
body.modulo-contratos-off [data-modulo="contratos"],
body.modulo-financeiro-off [data-modulo="financeiro"],
body.modulo-administrativa-off [data-modulo="administrativa"] {
  display: none !important;
}

/* Ligacao na linha do tempo da conversa (F2 lote 1, 17/09) — faixa neutra e
   centrada, no estilo de aviso do WhatsApp, nunca uma bolha de mensagem. */
.floating-whatsapp-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  max-width: 88%;
  margin: 4px auto;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #F8FAFC;
  color: #5A6472;
  font-size: 12px;
  line-height: 1.35;
}
.floating-whatsapp-call small { color: #8A93A3; font-size: 11px; }
.floating-whatsapp-call-icon {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8A93A3;
  position: relative;
}
.floating-whatsapp-call-icon::before {
  content: '';
  position: absolute;
  inset: 3.5px;
  border-radius: 2px 2px 3px 3px;
  background: #F8FAFC;
}
.floating-whatsapp-call.is-missed { background: #FDECEC; border-color: #F5C2C2; color: #96322F; }
.floating-whatsapp-call.is-missed .floating-whatsapp-call-icon { background: #C4423E; }
.floating-whatsapp-call.is-missed .floating-whatsapp-call-icon::before { background: #FDECEC; }
.floating-whatsapp-call.is-done { background: #ECF7EF; border-color: #BFE2CA; color: #276B43; }
.floating-whatsapp-call.is-done .floating-whatsapp-call-icon { background: #2F8A53; }
.floating-whatsapp-call.is-done .floating-whatsapp-call-icon::before { background: #ECF7EF; }
.floating-whatsapp-call.is-ringing,
.floating-whatsapp-call.is-active { background: #FAEEDA; border-color: #EBD5A8; color: #854F0B; }
.floating-whatsapp-call.is-ringing .floating-whatsapp-call-icon,
.floating-whatsapp-call.is-active .floating-whatsapp-call-icon { background: #854F0B; }
.floating-whatsapp-call.is-ringing .floating-whatsapp-call-icon::before,
.floating-whatsapp-call.is-active .floating-whatsapp-call-icon::before { background: #FAEEDA; }

/* =====================================================================
   RENOVAÇÕES (Gestão Comercial) — 29/09/2026
   =====================================================================
   Tela nova, já no padrão (GUIA_DE_PADROES.md secção 7).

   CORES: nenhum hex novo. Usa os tokens --ctr-* do :root, que são a paleta
   semântica compartilhada — o prefixo é histórico (nasceram na tela de
   Contratos), os valores são os 6 pares do guia. Os tipos usam quatro pares
   diferentes: roxo (Licença), azul (Contrato), âmbar (Certificado) e verde
   (Serviço, o "teal" do mockup — o guia não tem par teal próprio).

   ESCOPO: tudo por #id. .eyebrow global é 20px, .page-heading h1 é 40px e
   .page-heading p é 20px — sem o escopo, o cabeçalho sai gigante; com ele,
   nada vaza para as outras telas.

   TEMA ESCURO: o conteúdo continua claro, como em todas as telas (só topo,
   menu e sidebar escurecem). Os tokens --ctr-* não têm redefinição no escuro,
   por decisão — a mesma da tela de Contratos.
   ===================================================================== */

/* ---- Cabeçalho ---- */
#screen-sales-renewals .page-heading {
  align-items: flex-start;
  margin-bottom: 20px;
}

#screen-sales-renewals .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--ctr-accent);
  margin-bottom: 2px;
}

#screen-sales-renewals .page-heading h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
}

#screen-sales-renewals .page-heading p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ctr-ink-soft);
}

/* ---- KPIs ---- */
#screen-sales-renewals .renewal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

#screen-sales-renewals .renewal-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--ctr-line);
  border-radius: 12px;
  background: var(--ctr-surface);
}

#screen-sales-renewals .renewal-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ctr-ink-soft);
}

#screen-sales-renewals .renewal-kpi strong {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

#screen-sales-renewals .renewal-kpi small {
  font-size: 11px;
  color: var(--ctr-ink-faint);
}

/* O KPI colorido perde a borda e ganha o tom-claro do par; a tinta escura fica
   só no número, que é o que precisa saltar. */
#screen-sales-renewals .renewal-kpi.is-overdue {
  background: var(--ctr-danger-tint);
  border-color: transparent;
}
#screen-sales-renewals .renewal-kpi.is-overdue .renewal-kpi-label,
#screen-sales-renewals .renewal-kpi.is-overdue small { color: #6e2440; }
#screen-sales-renewals .renewal-kpi.is-overdue strong { color: #6e2440; }

#screen-sales-renewals .renewal-kpi.is-soon {
  background: var(--ctr-warning-tint);
  border-color: transparent;
}
#screen-sales-renewals .renewal-kpi.is-soon .renewal-kpi-label,
#screen-sales-renewals .renewal-kpi.is-soon small { color: var(--ctr-warning-ink); }
#screen-sales-renewals .renewal-kpi.is-soon strong { color: var(--ctr-warning-ink); }

#screen-sales-renewals .renewal-kpi.is-renewed {
  background: var(--ctr-success-tint);
  border-color: transparent;
}
#screen-sales-renewals .renewal-kpi.is-renewed .renewal-kpi-label,
#screen-sales-renewals .renewal-kpi.is-renewed small { color: #085041; }
#screen-sales-renewals .renewal-kpi.is-renewed strong { color: #085041; }

/* ---- Barra de filtros (Variante A) ---- */
#screen-sales-renewals .renewals-table-card {
  padding: 0;
  overflow: hidden;
}

#screen-sales-renewals .renewal-filters {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ctr-surface-bar);
  border-bottom: 1px solid var(--ctr-line);
}

#screen-sales-renewals .renewal-filters-icon {
  display: flex;
  align-items: center;
  height: 32px;
  color: var(--ctr-ink-faint);
  flex: none;
}

#screen-sales-renewals .renewal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  /* min-width: 0 é obrigatório: sem ele o input dentro do flex nunca encolhe
     e a barra empurra a tabela para fora do card. */
  min-width: 0;
}

#screen-sales-renewals .renewal-field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint);
}

#screen-sales-renewals .renewal-field select,
#screen-sales-renewals .renewal-field input {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ctr-field-line);
  border-radius: 8px;
  background: var(--ctr-surface);
  color: var(--ctr-ink-strong);
  font-size: 13px;
  width: 100%;
}

#screen-sales-renewals .renewal-field-search { flex: 1 1 200px; }

#screen-sales-renewals .renewal-field select:focus,
#screen-sales-renewals .renewal-field input:focus {
  outline: none;
  border-color: var(--ctr-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* O reset global de `button` impõe min-height 44px (--tap-size): sem zerar,
   o "Limpar" fica 12px mais alto que os controles e desalinha a barra. */
#screen-sales-renewals .renewal-filters-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  min-height: 0;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--ctr-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}

#screen-sales-renewals .renewal-clear-x { font-size: 11px; }

/* ---- Tabela ---- */
#screen-sales-renewals .renewals-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#screen-sales-renewals .renewals-table th {
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ctr-ink-faint);
  background: var(--ctr-surface);
  border-bottom: 1px solid var(--ctr-line);
  white-space: nowrap;
}

/* A correção do td vai NESTA tabela, não no seletor genérico: as regras
   globais de `td` chegam com 18px em algumas telas, e mexer nelas mudaria
   todas as tabelas do painel. */
#screen-sales-renewals .renewals-table td {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ctr-ink-strong);
  border-bottom: 1px solid var(--ctr-line-soft);
  vertical-align: middle;
}

#screen-sales-renewals .renewals-table tbody tr { cursor: pointer; }
#screen-sales-renewals .renewals-table tbody tr:hover { background: var(--ctr-row-hover); }

/* A linha inteira ganha o tom da urgência — é o que faz a tela ser lida de
   longe. O hover continua funcionando porque vem depois. */
#screen-sales-renewals .renewal-row.is-overdue { background: var(--ctr-row-danger); }
#screen-sales-renewals .renewal-row.is-soon { background: var(--ctr-row-warning); }

#screen-sales-renewals .renewal-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ctr-ink-faint);
  cursor: default;
}

/* Colunas. Largura por %, e o corte com reticências fica no SPAN interno:
   o MutationObserver global torna toda tabela redimensionável e sobrescreve
   larguras de colgroup/th, então text-overflow no td não sobrevive. */
#screen-sales-renewals .renewals-table th:nth-child(1) { width: 22%; }
#screen-sales-renewals .renewals-table th:nth-child(2) { width: 27%; }
#screen-sales-renewals .renewals-table th:nth-child(3) { width: 15%; }
#screen-sales-renewals .renewals-table th:nth-child(4) { width: 12%; }
#screen-sales-renewals .renewals-table th:nth-child(5) { width: 13%; }
#screen-sales-renewals .renewals-table th:nth-child(6) { width: 11%; }

#screen-sales-renewals .renewal-client-cell,
#screen-sales-renewals .renewal-item-cell,
#screen-sales-renewals .renewal-due-cell {
  display: table-cell;
}

#screen-sales-renewals .renewal-client-name {
  display: block;
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--ctr-ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#screen-sales-renewals .renewal-client-owner {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ctr-ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#screen-sales-renewals .renewal-item-desc {
  display: block;
  margin-top: 3px;
  max-width: 100%;
  font-size: 12px;
  color: var(--ctr-ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#screen-sales-renewals .renewal-due-date {
  display: block;
  font-size: 13px;
  color: var(--ctr-ink-strong);
  font-variant-numeric: tabular-nums;
}
#screen-sales-renewals .renewal-due-date.is-overdue { color: #6e2440; font-weight: 600; }
#screen-sales-renewals .renewal-due-date.is-soon { color: var(--ctr-warning-ink); font-weight: 600; }
#screen-sales-renewals .renewal-due-date.is-renewed { color: var(--ctr-ink-strong); }

#screen-sales-renewals .renewal-due-context {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ctr-ink-faint);
}
#screen-sales-renewals .renewal-due-context.is-overdue { color: #6e2440; font-weight: 600; }
#screen-sales-renewals .renewal-due-context.is-soon { color: var(--ctr-warning-ink); }
#screen-sales-renewals .renewal-due-context.is-renewed { color: #085041; }

#screen-sales-renewals .renewal-amount-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#screen-sales-renewals .renewal-no-amount { color: var(--ctr-ink-faint); }

/* ---- Badges ---- */
#screen-sales-renewals .renewal-type-badge,
#screen-sales-renewals .renewal-status-badge {
  display: inline-block;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#screen-sales-renewals .renewal-type-badge.is-licenca { background: #eeedfe; color: #534ab7; }
#screen-sales-renewals .renewal-type-badge.is-contrato { background: #e6f1fb; color: #185fa5; }
#screen-sales-renewals .renewal-type-badge.is-certificado { background: var(--ctr-warning-tint); color: var(--ctr-warning-ink); }
#screen-sales-renewals .renewal-type-badge.is-servico { background: var(--ctr-success-tint); color: var(--ctr-success-ink); }

#screen-sales-renewals .renewal-status-badge.is-overdue { background: var(--ctr-danger-tint); color: var(--ctr-danger-ink); }
#screen-sales-renewals .renewal-status-badge.is-soon { background: var(--ctr-warning-tint); color: var(--ctr-warning-ink); }
#screen-sales-renewals .renewal-status-badge.is-ok { background: var(--ctr-neutral-tint); color: var(--ctr-neutral-ink); }
#screen-sales-renewals .renewal-status-badge.is-renewed { background: var(--ctr-success-tint); color: var(--ctr-success-ink); }

/* ---- Ações em ícone ---- */
#screen-sales-renewals .renewal-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* min-height: 0 anula o reset global `button { min-height: var(--tap-size) }`
   (44px). Sem isso cada linha da tabela cresce 12px. */
#screen-sales-renewals .renewal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--ctr-line);
  border-radius: 8px;
  background: var(--ctr-surface);
  color: var(--ctr-ink-soft);
  cursor: pointer;
}

#screen-sales-renewals .renewal-action:hover:not(:disabled) {
  border-color: var(--ctr-field-line);
  background: var(--ctr-surface-bar);
}

#screen-sales-renewals .renewal-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Par semântico pela natureza da ação: verde confirma/conversa, azul cria. */
#screen-sales-renewals .renewal-action.is-whatsapp { color: var(--ctr-success-ink); }
#screen-sales-renewals .renewal-action.is-negotiation,
#screen-sales-renewals .renewal-action.is-open-negotiation { color: var(--ctr-accent); }
#screen-sales-renewals .renewal-action.is-open-negotiation { background: #e6f1fb; border-color: transparent; }
#screen-sales-renewals .renewal-action.is-renew { color: var(--ctr-success-ink); }
#screen-sales-renewals .renewal-action.is-history { color: var(--ctr-ink-soft); }

/* ---- Rodapé e nota ---- */
#screen-sales-renewals .renewals-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ctr-surface-bar);
  border-top: 1px solid var(--ctr-line);
  font-size: 12px;
  color: var(--ctr-ink-soft);
}

#screen-sales-renewals .renewals-more {
  min-height: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ctr-accent);
}

#screen-sales-renewals .renewals-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 14px 2px 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ctr-ink-faint);
}

#screen-sales-renewals .renewals-note-icon {
  display: inline-flex;
  margin-top: 2px;
  flex: none;
}

/* ---- Modais (cadastro, renovação e histórico) ---- */
#renewalModal .eyebrow,
#renewalRenewModal .eyebrow,
#renewalHistoryModal .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--ctr-ink-faint);
}

#renewalModal .modal-header,
#renewalRenewModal .modal-header,
#renewalHistoryModal .modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ctr-line);
}

#renewalModal .modal-header h2,
#renewalRenewModal .modal-header h2,
#renewalHistoryModal .modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--ctr-ink-strong);
}

#renewalModal .renewal-modal-icon,
#renewalRenewModal .renewal-renew-icon,
#renewalHistoryModal .renewal-history-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
}

/* Azul = criar/editar; verde = confirmar; neutro = consultar. */
#renewalModal .renewal-modal-icon { background: #e6f1fb; color: #185fa5; }
#renewalRenewModal .renewal-renew-icon { background: var(--ctr-success-tint); color: var(--ctr-success-ink); }
#renewalHistoryModal .renewal-history-icon { background: var(--ctr-neutral-tint); color: var(--ctr-neutral-ink); }

#renewalModal .renewal-modal-heading,
#renewalRenewModal .renewal-renew-heading,
#renewalHistoryModal .renewal-history-heading { flex: 1 1 auto; min-width: 0; }

#renewalModal .renewal-modal-body,
#renewalRenewModal .renewal-renew-body,
#renewalHistoryModal .renewal-history-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
  max-height: 68vh;
  overflow-y: auto;
}

#renewalModal .renewal-modal-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* O rotulo NAO pode ser flex-column: o <span class="req-mark">*</span> vira
   um item de coluna proprio e cai numa LINHA so dele, entre o rotulo e o
   campo. Alem de feio, isso deixa a coluna da esquerda uma linha mais alta
   que a da direita e desalinha os pares (Tipo/Responsavel, Data/Valor).
   Com display:block o texto e o asterisco fluem na MESMA linha e o campo
   desce pelo margin-top. */
#renewalModal label,
#renewalRenewModal label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ctr-ink-soft);
  min-width: 0;
}

#renewalModal label > input,
#renewalModal label > select,
#renewalModal label > textarea,
#renewalRenewModal label > input {
  margin-top: 5px;
}

#renewalModal .req-mark,
#renewalRenewModal .req-mark { color: #dc2626; }

#renewalModal input,
#renewalModal select,
#renewalModal textarea,
#renewalRenewModal input {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--ctr-line);
  border-radius: 10px;
  background: var(--ctr-surface);
  color: var(--ctr-ink-strong);
  font-size: 14px;
  width: 100%;
  min-width: 0;
}

#renewalModal textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
  /* textarea NAO herda font-family do documento: sem isto o campo sai em
     monoespacada, destoando de todos os outros do modal. */
  font-family: inherit;
}

#renewalModal input:focus,
#renewalModal select:focus,
#renewalModal textarea:focus,
#renewalRenewModal input:focus {
  outline: none;
  border-color: var(--ctr-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#renewalModal .renewal-client-results {
  margin-top: -8px;
  border: 1px solid var(--ctr-line);
  border-radius: 10px;
  overflow: hidden;
  max-height: 210px;
  overflow-y: auto;
}

#renewalModal .renewal-client-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  min-height: 0;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--ctr-line-soft);
  background: var(--ctr-surface);
  text-align: left;
  cursor: pointer;
}
#renewalModal .renewal-client-item:last-child { border-bottom: 0; }
#renewalModal .renewal-client-item:hover { background: var(--ctr-row-hover); }
#renewalModal .renewal-client-item strong { font-size: 13px; font-weight: 600; color: var(--ctr-ink-strong); }
#renewalModal .renewal-client-item small { font-size: 11px; color: var(--ctr-ink-faint); }
#renewalModal .renewal-client-empty { padding: 12px; font-size: 12px; color: var(--ctr-ink-faint); }

/* Rodapé de modal: faixa clara, ações à direita, destrutiva à esquerda. */
#renewalModal .modal-actions,
#renewalRenewModal .modal-actions,
#renewalHistoryModal .modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--ctr-line);
}

#renewalModal .renewal-delete {
  margin-right: auto;
  min-height: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ctr-danger-ink);
}

#renewalRenewModal .renewal-renew-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ctr-surface-bar);
}
#renewalRenewModal .renewal-renew-item strong { font-size: 13px; color: var(--ctr-ink-strong); }
#renewalRenewModal .renewal-renew-item span { font-size: 12px; color: var(--ctr-ink-soft); }
#renewalRenewModal .renewal-renew-hint { margin: 0; font-size: 11.5px; color: var(--ctr-ink-faint); }

#renewalHistoryModal .renewal-history-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}
#renewalHistoryModal .renewal-history-item strong { font-size: 13px; color: var(--ctr-ink-strong); }
#renewalHistoryModal .renewal-history-item span { font-size: 12px; color: var(--ctr-ink-soft); }

#renewalHistoryModal .renewal-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#renewalHistoryModal .renewal-history-cycle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--ctr-line);
  border-radius: 10px;
  background: var(--ctr-surface);
}
#renewalHistoryModal .renewal-history-cycle.is-current { border-color: var(--ctr-accent); }
#renewalHistoryModal .renewal-history-cycle-n {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint);
}
#renewalHistoryModal .renewal-history-cycle-due { font-size: 13px; color: var(--ctr-ink-strong); }
#renewalHistoryModal .renewal-history-cycle-meta { font-size: 11.5px; color: var(--ctr-ink-soft); }

/* ---- Telas estreitas ---- */
@media (max-width: 1100px) {
  #screen-sales-renewals .renewal-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #screen-sales-renewals .renewal-filters { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  #screen-sales-renewals .renewal-kpi-grid { grid-template-columns: 1fr; }
  #renewalModal .renewal-modal-grid2 { grid-template-columns: 1fr; }
}


/* =====================================================================
   ABA CUSTOS — CARTOES DE ITEM (29/09/2026)
   =====================================================================
   Substituiu a tabela de 7 colunas. Com o painel esquerdo do popup nao
   sobravam 860px: havia rolagem horizontal, PRECO CLIENTE saia da tela e o
   nome do item truncava. Num registro de cotacao, o nome do item e o dado
   que mais importa — e o que nunca pode ser cortado.

   REGRA DESTE BLOCO: nada aqui tem largura minima fixa. Tudo encolhe ou
   quebra; nenhuma largura de popup produz rolagem horizontal.

   Escopo por #negotiationTabContent, o container das cinco abas.
   Cores: tokens --ctr-* e os pares do GUIA_DE_PADROES. Nenhum hex novo.
   ===================================================================== */

/* ---- Barra do topo, em UMA linha ---- */
/* flex-wrap aqui e no grupo da direita e o que garante "nenhuma rolagem em
   nenhuma largura": o popup tem largura propria, entao media query (que olha
   a JANELA) nao serve — num popup estreito ela nunca dispara. Havendo espaco,
   a barra continua em uma linha so; faltando, ela quebra em vez de transbordar. */
#negotiationTabContent .neg-cost-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--ctr-line);
  border-radius: 10px;
  background: var(--ctr-surface-bar);
}

/* O aviso encolhe (e quebra em duas linhas se precisar); o grupo da direita
   nunca quebra — era ele que jogava o "+ Item" para a linha de baixo. */
#negotiationTabContent .neg-cost-internal {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ctr-ink-soft);
}
#negotiationTabContent .neg-cost-internal b { color: var(--ctr-ink-strong); }
#negotiationTabContent .neg-cost-lock { font-size: 12px; flex: none; }

#negotiationTabContent .neg-cost-bar-right {
  display: inline-flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

#negotiationTabContent .neg-cost-default {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#negotiationTabContent .neg-cost-default label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint);
}

#negotiationTabContent .neg-cost-default-input {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
  border: 1px solid var(--ctr-field-line);
  border-radius: 8px;
  background: var(--ctr-surface);
}
#negotiationTabContent .neg-cost-default-input input {
  width: 46px;
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ctr-ink-strong);
  font-size: 13px;
  text-align: right;
}
#negotiationTabContent .neg-cost-default-input input:focus { outline: none; }
#negotiationTabContent .neg-cost-default-input:focus-within {
  border-color: var(--ctr-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#negotiationTabContent .neg-cost-margin-sign {
  font-size: 12px;
  color: var(--ctr-ink-faint);
}

/* min-height: 0 anula o reset global `button { min-height: var(--tap-size) }`
   (44px), que deixaria a barra mais alta que os controles. */
#negotiationTabContent .neg-cost-bar .ghost-link {
  min-height: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ctr-accent);
}
#negotiationTabContent .neg-cost-bar .ghost-link:disabled {
  color: var(--ctr-ink-faint);
  cursor: not-allowed;
}

#negotiationTabContent .neg-cost-add {
  height: 32px;
  min-height: 0;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  flex: none;
}

/* ---- Lista de cartoes ---- */
#negotiationTabContent .neg-cost-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#negotiationTabContent .neg-cost-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ctr-line);
  border-radius: 10px;
  background: var(--ctr-surface);
}

#negotiationTabContent .neg-cost-card.is-off-margin {
  background: var(--ctr-row-warning);
  border-color: #f0e3c8;
}

#negotiationTabContent .neg-cost-card.is-editing { border-color: var(--ctr-accent); }

#negotiationTabContent .neg-cost-empty {
  margin: 0;
  padding: 26px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--ctr-ink-faint);
  border: 1px dashed var(--ctr-line);
  border-radius: 10px;
}

/* ---- Linha 1: identificacao ---- */
#negotiationTabContent .neg-cost-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#negotiationTabContent .neg-cost-card-title {
  flex: 1 1 auto;
  min-width: 0;
}

/* A descricao NUNCA e cortada: quebra em quantas linhas precisar. Era este o
   defeito central da tabela. */
#negotiationTabContent .neg-cost-card-title strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ctr-ink-strong);
  overflow-wrap: anywhere;
}

#negotiationTabContent .neg-cost-card-title small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--ctr-ink-faint);
  overflow-wrap: anywhere;
}

#negotiationTabContent .neg-cost-card-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

#negotiationTabContent .neg-cost-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ctr-ink-faint);
  cursor: pointer;
}
#negotiationTabContent .neg-cost-tool:hover {
  background: var(--ctr-neutral-tint);
  color: var(--ctr-ink-strong);
}
#negotiationTabContent .neg-cost-tool.is-danger:hover {
  background: var(--ctr-danger-tint);
  color: var(--ctr-danger-ink);
}

/* ---- Linha 2: o calculo como fluxo ---- */
#negotiationTabContent .neg-cost-card-calc {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ctr-ink-soft);
}

#negotiationTabContent .neg-cost-calc-cost { white-space: nowrap; }
#negotiationTabContent .neg-cost-calc-cost b {
  color: var(--ctr-ink-strong);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#negotiationTabContent .neg-cost-arrow {
  color: var(--ctr-ink-faint);
  font-size: 13px;
}

/* O resultado cola na direita quando sobra espaco, e desce inteiro (sem
   separar "unit." da pilula) quando nao sobra. */
#negotiationTabContent .neg-cost-calc-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#negotiationTabContent .neg-cost-unit {
  font-size: 11.5px;
  color: var(--ctr-ink-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#negotiationTabContent .neg-cost-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ctr-success-tint);
  color: #085041;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- Campo de margem ---- */
#negotiationTabContent .neg-cost-margin-wrap {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding-right: 6px;
  border: 1px solid var(--ctr-field-line);
  border-radius: 8px;
  background: var(--ctr-surface);
  flex: none;
}

#negotiationTabContent .neg-cost-margin-wrap:focus-within {
  border-color: var(--ctr-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#negotiationTabContent .neg-cost-margin {
  width: 44px;
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ctr-ink-strong);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#negotiationTabContent .neg-cost-margin:focus { outline: none; }

/* Margem diferente da padrao: o par ambar do guia. */
#negotiationTabContent .neg-cost-margin-wrap.is-off {
  border-color: #e3c88a;
  background: #fdf6e7;
}
#negotiationTabContent .neg-cost-margin-wrap.is-off .neg-cost-margin,
#negotiationTabContent .neg-cost-margin-wrap.is-off .neg-cost-margin-sign {
  color: var(--ctr-warning-ink);
}

/* ---- Cartao aberto para edicao ---- */
#negotiationTabContent .neg-cost-card-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--ctr-line);
}

#negotiationTabContent .neg-cost-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

#negotiationTabContent .neg-cost-card-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint);
}

#negotiationTabContent .neg-cost-card-edit input {
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ctr-field-line);
  border-radius: 8px;
  background: var(--ctr-surface);
  color: var(--ctr-ink-strong);
  font-size: 13px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}
#negotiationTabContent .neg-cost-card-edit input:focus {
  outline: none;
  border-color: var(--ctr-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Lista de sugestao do item de custo = o MESMO componente da proposta
   (.proposal-product-dropdown, posicionado em relacao a este embrulho).
   Ela mora DENTRO do <label>, que aqui e 10px/600, caixa alta e espacado —
   sem o reset abaixo a lista herdaria isso e sairia diferente da proposta. */
#negotiationTabContent .neg-cost-combo {
  position: relative;
  display: block;
}
#negotiationTabContent .neg-cost-combo .proposal-product-dropdown {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ctr-ink-strong, #1B2536);
}
/* Part Number ao lado do nome do produto (so no custo: e o que identifica a
   peca na cotacao do distribuidor). */
#negotiationTabContent .neg-cost-combo-pn {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  color: #8A93A3;
}

#negotiationTabContent .neg-cost-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
#negotiationTabContent .neg-cost-edit-actions .ghost-link {
  min-height: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ctr-ink-soft);
}
#negotiationTabContent .neg-cost-edit-actions .secondary-button {
  height: 32px;
  min-height: 0;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}

/* ---- Os tres cards de total ---- */
#negotiationTabContent .neg-cost-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

#negotiationTabContent .neg-cost-total-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--ctr-line);
  border-radius: 10px;
  background: var(--ctr-surface);
  min-width: 0;
}

#negotiationTabContent .neg-cost-total-card span {
  font-size: 11px;
  color: var(--ctr-ink-soft);
}

#negotiationTabContent .neg-cost-total-card strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--ctr-ink-strong);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#negotiationTabContent .neg-cost-total-card.is-sale,
#negotiationTabContent .neg-cost-total-card.is-profit {
  background: var(--ctr-success-tint);
  border-color: transparent;
}
#negotiationTabContent .neg-cost-total-card.is-sale span,
#negotiationTabContent .neg-cost-total-card.is-profit span,
#negotiationTabContent .neg-cost-total-card.is-sale strong,
#negotiationTabContent .neg-cost-total-card.is-profit strong { color: #085041; }

/* ---- Gerar proposta ---- */
#negotiationTabContent .neg-cost-generate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

#negotiationTabContent .neg-cost-generate small {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 11px;
  color: var(--ctr-ink-faint);
}

#negotiationTabContent .neg-cost-generate .primary-button { flex: none; }
#negotiationTabContent .neg-cost-generate .primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* O resultado cola na direita quando sobra espaco. Quando a linha do calculo
   quebra, margin-left:auto empurraria a pilula sozinha para a direita de uma
   linha vazia — por isso some na tela estreita. */
@media (max-width: 620px) {
  #negotiationTabContent .neg-cost-calc-result { margin-left: 0; }
}

/* =====================================================================
   POPUP DA NEGOCIACAO — AMPLO, EM TRES COLUNAS (29/09/2026)
   =====================================================================
   O popup ocupava 920x760 no meio da tela, com faixas vazias enormes dos
   dois lados — e a aba Custos, que tem muita informacao por linha, ficava
   espremida. Agora ele usa ~95% da viewport (margem de 24px), com teto de
   1800px para nao virar uma faixa esticada em monitor ultrawide.

   ESTE BLOCO E SO DE APRESENTACAO. Todo seletor sobrescreve regra que ja
   existe acima (por isso vem depois no arquivo) ou cria classe nova da
   coluna de resumo. Nenhum comportamento muda: os inputs do painel
   esquerdo sao os MESMOS, com os MESMOS data-attributes, so que sem
   moldura ate o hover.

   As tres faixas de largura:
     >= 1400px  tres colunas (esquerda · centro · resumo)
     720-1400   resumo desce para baixo do centro, os 3 cartoes em linha
     <= 720px   empilhado, exatamente como era antes
   ===================================================================== */

/* ---- O popup ocupa a AREA DE CONTEUDO ---- */
/* Ele nao cobre a barra de cima nem o menu lateral: os dois continuam
   visiveis e CLICAVEIS com o popup aberto — foi o pedido do Andre depois de
   ver a versao em tela cheia.
   Isso tambem dissolve o problema de empilhamento: .main-area tem
   position:relative + z-index:1 e cria um contexto, entao nada aqui dentro
   alcanca a .sidebar (z 80), que e IRMA dela. Sem sobreposicao, nao ha
   disputa — e o menu, ao expandir no hover (84px -> 300px), passa por CIMA
   do popup, como deve.
   --sidebar-collapsed-width so existe a partir de 901px; abaixo disso o
   menu entra no fluxo e o fallback 0px devolve o comportamento de antes. */
@media (min-width: 901px) {
  .negotiation-modal {
    top: var(--topbar-height);
    left: var(--sidebar-collapsed-width, 0px);
  }
}

/* ---- Tamanho ---- */
/* 100% do ESPACO DO BACKDROP, e nao uma conta sobre 100vw.
   A primeira versao usava calc(100vw - 48px), mas .modal-backdrop tem
   padding: 28px (56 no total) e place-items: center — o cartao saia 8px
   maior que o espaco e vazava cortado dos dois lados. Pior: com barra de
   rolagem visivel, 100vw ainda conta a largura da barra, e o excesso
   aumentava. Com 100% o valor resolve contra a area util do backdrop:
   nao depende de saber o padding nem de haver barra de rolagem. */
.negotiation-card {
  width: min(1800px, 100%);
  height: 100%;
  max-height: 100%;
}

/* ---- Cabecalho compacto ---- */
.negotiation-head { padding: 12px 20px 10px; }

/* Cliente, titulo, badge e codigo na MESMA linha. min-width:0 no titulo e o
   que permite o input encolher em vez de empurrar os botoes para fora. */
.negotiation-head-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}
.negotiation-head-title .negotiation-client {
  flex: 1 1 100%;
  font-size: 10px;
  line-height: 1.3;
}
.negotiation-title-input {
  flex: 0 1 auto;
  width: auto;
  min-width: 180px;
  max-width: 460px;
  font-size: 17px;
  margin: 0 0 0 -6px;
}
.negotiation-head-meta { margin-top: 0; }

/* "Marcar como perdida" deixa de ser pilula vermelha cheia: vira contorno com
   tinta rosa do guia. Acao destrutiva nao precisa gritar — precisa ser
   distinguivel da acao positiva, que e a que se repete todo dia. */
.negotiation-headbtn { padding: 7px 14px; font-size: 12px; }
.negotiation-headbtn.is-lose {
  background: #fff;
  color: #993556;
  border: 1px solid #f0cdd9;
}
.negotiation-headbtn.is-lose:hover { background: #fbeaf0; color: #7d2b46; }
.negotiation-headbtn.is-win { background: #0f6e56; }
.negotiation-headbtn.is-win:hover { background: #0b5744; }

/* ---- Stepper em pilulas, com os dias DENTRO ---- */
.negotiation-stagebar { gap: 6px; margin-top: 10px; }
.negotiation-stage {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  min-height: 0;
}
.negotiation-stage small {
  display: inline;
  font-size: 10.5px;
  opacity: .75;
}
/* O "—" das etapas nao visitadas fica mais discreto que o numero de dias. */
.negotiation-stage.is-todo small { opacity: .5; }
/* Na etapa ATIVA o texto e branco sobre cor cheia: 0.75 de opacidade deixava
   os dias quase ilegiveis. O numero de dias na etapa atual e justamente o que
   diz ha quanto tempo a negociacao esta parada ali. */
.negotiation-stage.is-current small { opacity: .92; }

/* ---- Tres colunas ---- */
.negotiation-columns {
  grid-template-columns: 260px minmax(0, 1fr) 300px;
}

.negotiation-side { padding: 14px 16px; }

.negotiation-summary {
  border-left: 1px solid var(--ctr-line, #e7eaf0);
  background: var(--ctr-surface-bar, #f7f8fa);
  padding: 14px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Painel esquerdo em modo leitura denso ---- */
/* Os inputs continuam sendo os MESMOS (data-neg-field / data-neg-contact):
   so perdem a moldura ate o hover/foco. Trocar por texto + lapis exigiria
   reconstruir os campos no clique, e era ai que a edicao poderia quebrar. */
.negotiation-side .negotiation-section { margin-bottom: 14px; }
.negotiation-side .negotiation-section h4 {
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.negotiation-side .negotiation-field {
  gap: 1px;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.negotiation-side .negotiation-field input,
.negotiation-side .negotiation-field select {
  border: 1px solid transparent;
  background: transparent;
  padding: 3px 6px;
  margin-left: -6px;
  min-height: 28px;
  height: auto;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ctr-ink-strong, #1b2536);
  border-radius: 7px;
  width: calc(100% + 6px);
}
.negotiation-side .negotiation-field input:hover:not(:disabled),
.negotiation-side .negotiation-field select:hover:not(:disabled) {
  border-color: #e2e8f0;
  background: #fff;
}
.negotiation-side .negotiation-field input:focus,
.negotiation-side .negotiation-field select:focus {
  border-color: #2563eb;
  background: #fff;
  outline: none;
}
.negotiation-side .negotiation-field input:disabled,
.negotiation-side .negotiation-field select:disabled {
  color: var(--ctr-ink-faint, #8a93a3);
}

/* O Valor total e o numero que se olha primeiro. */
.negotiation-side .negotiation-field input[data-neg-field="amount"] {
  font-size: 18px;
  font-weight: 700;
  min-height: 32px;
}

.negotiation-side .negotiation-readonly {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
}
.negotiation-side .negotiation-readonly small {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint, #8a93a3);
}
.negotiation-side .negotiation-readonly span { font-size: 12.5px; }

.negotiation-side .negotiation-link {
  display: inline-block;
  margin: 2px 0 8px;
  font-size: 12px;
}

.negotiation-side .negotiation-company { font-size: 12.5px; margin: 0 0 6px; }
.negotiation-side .negotiation-hint { font-size: 11px; margin: 0 0 8px; }

/* ---- Cartoes do resumo ---- */
.neg-summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--ctr-line, #e7eaf0);
  border-radius: 10px;
  background: var(--ctr-surface, #fff);
}

.neg-summary-card h5 {
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint, #8a93a3);
}
.neg-summary-card h5 small {
  font-size: 9.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.neg-summary-card .ghost-link {
  align-self: flex-start;
  min-height: 0;
  margin-top: 2px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ctr-accent, #2563eb);
}

.neg-summary-task,
.neg-summary-proposal,
.neg-summary-none {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ctr-ink-strong, #1b2536);
  overflow-wrap: anywhere;
}
.neg-summary-proposal { color: var(--ctr-accent, #2563eb); }

.neg-summary-date { margin: 0; font-size: 11.5px; color: var(--ctr-ink-soft, #5a6472); }
.neg-summary-date.is-late { color: #993556; font-weight: 600; }
.neg-summary-extra { margin: 0; font-size: 11.5px; color: var(--ctr-ink-faint, #8a93a3); }

/* Negociacao sem proximo passo: o ambar e o alerta, nao enfeite. */
.neg-summary-card.is-empty-task { border-color: #ecd9b0; background: var(--ctr-row-warning, #fdfbf5); }
.neg-summary-card.is-empty-task .neg-summary-none { color: var(--ctr-ink-soft, #5a6472); }
.neg-summary-warn { margin: 0; font-size: 11.5px; color: var(--ctr-warning-ink, #854f0b); }

.neg-summary-money { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.neg-summary-money > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.neg-summary-money dt { font-size: 11.5px; color: var(--ctr-ink-soft, #5a6472); }
.neg-summary-money dd {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  color: var(--ctr-ink-strong, #1b2536);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.neg-summary-money dd.is-sale,
.neg-summary-money dd.is-profit { color: #085041; }


/* ---- Resumo: cartoes OU faixa de 1 linha --------------------------------
   Os dois vivem no DOM ao mesmo tempo. A media query decide qual aparece,
   entao arrastar a borda da janela atravessa os modos sem re-render e sem
   perder o que estiver sendo digitado numa aba. */
.neg-summary-bar { display: none; }
.neg-summary-cards { display: contents; }

/* Chips e setinha. O min-height explicito NAO e enfeite: a folha tem
   `button { min-height: var(--tap-size) }` (44px) global, e sem isto cada
   chip esticaria a faixa de 36px para 44 — justamente a altura que esta
   mudanca existe para devolver as abas. */
.neg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  max-width: 100%;
  padding: 3px 10px;
  border: 1px solid var(--ctr-line, #e7eaf0);
  border-radius: 999px;
  background: var(--ctr-surface, #fff);
  color: var(--ctr-ink, #0f172a);
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.neg-chip:hover { border-color: var(--ctr-accent, #2563eb); }
.neg-chip strong { font-weight: 600; }
.neg-chip-icon { flex: 0 0 auto; font-size: 11px; line-height: 1; }

/* Ambar = tarefa vencida ou negociacao sem proximo passo. Mesma leitura do
   cartao: e o estado que faz a negociacao morrer esquecida. */
.neg-chip.is-warn {
  border-color: #ecd9b0;
  background: var(--ctr-row-warning, #fdfbf5);
  color: var(--ctr-warning-ink, #854f0b);
}
.neg-chip.is-finance strong { color: #085041; }
.neg-chip.is-proposal strong { color: var(--ctr-accent, #2563eb); }

.neg-summary-toggle {
  flex: 0 0 auto;
  min-height: 26px;
  width: 26px;
  padding: 0;
  border: 1px solid var(--ctr-line, #e7eaf0);
  border-radius: 8px;
  background: var(--ctr-surface, #fff);
  color: var(--ctr-ink-soft, #5a6472);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease;
}
.neg-summary-toggle:hover { border-color: var(--ctr-accent, #2563eb); }
/* ---- Faixa intermediaria: o resumo desce, os 3 cartoes em linha ----
   Escolhido em vez de secao recolhivel: recolher esconderia o Financeiro
   atras de um clique justamente onde a tela ja esta apertada, e exigiria
   guardar aberto/fechado por usuario. */
@media (max-width: 1399px) {
  .negotiation-columns {
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .negotiation-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    flex-wrap: wrap;
    border-left: 0;
    border-top: 1px solid var(--ctr-line, #e7eaf0);
    overflow-y: visible;
  }
  .negotiation-summary .neg-summary-card { flex: 1 1 220px; min-width: 0; }
}

/* ---- FAIXA DE RESUMO: telas BAIXAS ou intermediarias --------------------
   O criterio deixou de ser so largura. No notebook 1366x768 a regra antiga
   empilhava os 3 cartoes numa fileira fixa ABAIXO do centro, e essa fileira
   comia a altura: sobravam ~150px para o conteudo das abas, e um item de
   custo aparecia pela metade. Altura e o recurso escasso nessas telas, nao
   largura — por isso a condicao inclui max-height.

   Vale quando NAO e mobile (>= 1100px, onde o layout atual foi validado) e
   a tela e baixa (< 820px) OU intermediaria (< 1400px).

   Isto SUBSTITUI a escolha de 29/09 (cartoes empilhados). O receio de
   entao — esconder o Financeiro atras de um clique — some porque o chip
   mostra o lucro na propria faixa; o clique so expande o detalhe. */
@media (min-width: 1100px) and (max-width: 1399.98px),
       (min-width: 1100px) and (max-height: 819.98px) {
  .negotiation-columns {
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .negotiation-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    display: block;
    border-left: 0;
    border-top: 1px solid var(--ctr-line, #e7eaf0);
    padding: 0;
    overflow-y: auto;
    /* vh, e NAO 50%: a porcentagem resolve contra a propria area de grade,
       que aqui e dimensionada pelo conteudo (37px). O resultado era um teto
       de 18,5px — metade da faixa cortada. Medido antes de trocar. O teto so
       vale quando os cartoes estao expandidos; recolhido nao alcanca. */
    max-height: 45vh;
  }

  /* A faixa: ~36px. Toda a altura que sobra vai para o conteudo das abas. */
  .neg-summary-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 12px;
  }
  .neg-summary-bar-label {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ctr-ink-faint, #8a93a3);
  }
  .neg-summary-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  /* Os cartoes completos ficam atras da setinha, recolhidos por padrao. */
  .neg-summary-cards { display: none; }
  .negotiation-summary.is-expanded .neg-summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 12px 12px;
  }
  .negotiation-summary.is-expanded .neg-summary-card { flex: 1 1 220px; min-width: 0; }
  .negotiation-summary.is-expanded .neg-summary-toggle { transform: rotate(180deg); }

  /* Cabecalho e etapas ~15% mais baixos: a altura devolvida vai para as abas. */
  .negotiation-head { padding: 10px 20px 8px; }
  .negotiation-stagebar { margin-top: 8px; }
}
/* ---- Telas estreitas: exatamente o empilhamento de antes ---- */
@media (max-width: 720px) {
  /* Tambem 100% do espaco do backdrop: 100vh vazava 56px (o padding dele) e
     cortava 28px em cima e embaixo — isso ja acontecia antes desta tarefa. */
  .negotiation-card { width: 100%; height: 100%; max-height: 100%; }
  .negotiation-columns { grid-template-columns: 1fr; grid-template-rows: auto; }
  .negotiation-summary {
    flex-direction: column;
    grid-column: auto;
    grid-row: auto;
    border-top: 1px solid var(--ctr-line, #e7eaf0);
  }
  .negotiation-title-input { max-width: none; min-width: 0; }
  .negotiation-stagebar { flex-wrap: wrap; }
  .negotiation-stage { flex: 1 1 auto; }
}

/* =====================================================================
   ORDEM DE COMPRA — 29/09/2026
   =====================================================================
   Duas partes: o modal de confirmacao (padrao dos modais) e a PAGINA A4 do
   documento, que existe so para ser capturada pelo html2canvas.

   A pagina A4 fica FORA da tela (nao escondida com display:none, que o
   html2canvas nao consegue medir): posicionada para fora do viewport. Foi
   assim que a proposta e o contrato resolveram isso.

   Cores: tokens --ctr-* e os pares do guia. Nenhum hex novo.
   ===================================================================== */

/* ---- Botao na aba Custos ---- */
#negotiationTabContent .neg-cost-po {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  min-height: 0;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  flex: none;
}

/* ---- Modal ---- */
#purchaseOrderModal .purchase-order-card { width: min(620px, 100%); }

#purchaseOrderModal .modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ctr-line, #e7eaf0);
}
#purchaseOrderModal .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.4;
  color: var(--ctr-ink-faint, #8a93a3);
}
#purchaseOrderModal .modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--ctr-ink-strong, #1b2536);
}
#purchaseOrderModal .purchase-order-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
  /* Ambar de "configurar/emitir": a acao nao e destrutiva nem confirmatoria. */
  background: var(--ctr-warning-tint, #faeeda);
  color: var(--ctr-warning-ink, #854f0b);
}
#purchaseOrderModal .purchase-order-heading { flex: 1 1 auto; min-width: 0; }

#purchaseOrderModal .purchase-order-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  max-height: 66vh;
  overflow-y: auto;
}

/* O aviso de documento interno nao e decoracao: e a diferenca entre este PDF
   e a proposta do cliente. */
#purchaseOrderModal .po-interno {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ctr-row-warning, #fdfbf5);
  border: 1px solid #ecd9b0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ctr-warning-ink, #854f0b);
}

/* Aviso de cadastro incompleto: ambar de ATENCAO, nao rosa de erro — a OC
   sai assim mesmo, so vai faltar um dado que quem emite completa. */
#purchaseOrderModal .po-cadastro {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--ctr-warning-tint, #faeeda);
  color: var(--ctr-warning-ink, #854f0b);
  font-size: 11.5px;
  line-height: 1.5;
}
#purchaseOrderModal .po-cadastro .ghost-link {
  min-height: 0;
  margin-left: 6px;
  padding: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ctr-warning-ink, #854f0b);
  text-decoration: underline;
}

#purchaseOrderModal .po-resumo {
  margin: 0;
  font-size: 13px;
  color: var(--ctr-ink-strong, #1b2536);
}

#purchaseOrderModal .po-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#purchaseOrderModal .po-secao {
  margin: 6px 0 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ctr-ink-faint, #8a93a3);
}

#purchaseOrderModal .po-aviso {
  margin: -4px 0 0;
  font-size: 11px;
  color: var(--ctr-ink-faint, #8a93a3);
}

#purchaseOrderModal label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ctr-ink-soft, #5a6472);
  min-width: 0;
}
#purchaseOrderModal label small { font-weight: 400; color: var(--ctr-ink-faint, #8a93a3); }
#purchaseOrderModal label > input { margin-top: 5px; }

#purchaseOrderModal input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--ctr-line, #e7eaf0);
  border-radius: 10px;
  background: var(--ctr-surface, #fff);
  color: var(--ctr-ink-strong, #1b2536);
  font-size: 14px;
  font-family: inherit;
}
#purchaseOrderModal input:focus {
  outline: none;
  border-color: var(--ctr-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

#purchaseOrderModal .modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--ctr-line, #e7eaf0);
}

@media (max-width: 620px) {
  #purchaseOrderModal .po-grid2 { grid-template-columns: 1fr; }
}

/* ---- Selo de anexo interno ---- */
.negotiation-attachment-internal {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ctr-warning-tint, #faeeda);
  color: var(--ctr-warning-ink, #854f0b);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* =====================================================================
   A PAGINA A4 DO DOCUMENTO
   ===================================================================== */
/* Fora do viewport, e nao display:none: o html2canvas precisa da pagina
   LAYOUTADA para medir. Mesma tecnica da proposta e do contrato. */
.oc-pdf-capture {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  z-index: -1;
  pointer-events: none;
}

.oc-a4-page {
  box-sizing: border-box;
  width: 794px;
  min-height: 1123px;
  padding: 44px 46px;
  background: #fff;
  color: #1b2536;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

/* A logo fica sozinha na primeira linha; numero e emissao vem na de baixo,
   um em cada ponta — as duas se leem juntas. */
.oc-a4-page .oc-cabecalho {
  padding-bottom: 8px;
  border-bottom: 2px solid #1b2536;
  margin-bottom: 14px;
}
/* TABELA e nao flex: o html2canvas nao honra flexbox ao capturar, e a
   emissao caia para a linha de baixo NO PDF mesmo estando certa no
   navegador. Duas celulas renderizam igual em qualquer motor. */
.oc-a4-page .oc-cabecalho-linha {
  width: 100%;
  border-collapse: collapse;
}
.oc-a4-page .oc-cabecalho-linha td {
  border: 0;
  padding: 0;
  vertical-align: baseline;
}
.oc-a4-page .oc-cab-emissao {
  text-align: right;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 700;
}

/* Altura fixa e largura automatica: a logo de cada empresa tem proporcao
   propria, e travar a largura amassaria umas e esticaria outras. */
.oc-a4-page .oc-logo { display: block; height: 38px; width: auto; max-width: 220px; object-fit: contain; margin-bottom: 10px; }
.oc-a4-page .oc-cabecalho h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.oc-a4-page .oc-cabecalho span { font-size: 11.5px; font-weight: 700; }

.oc-a4-page .oc-blocos-topo,
.oc-a4-page .oc-blocos-rodape {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.oc-a4-page .oc-blocos-direita { display: flex; flex-direction: column; gap: 10px; }

.oc-a4-page .oc-bloco {
  border: 1px solid #1b2536;
  padding: 8px 10px;
}
.oc-a4-page .oc-bloco h4 {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.oc-a4-page .oc-bloco p { margin: 0 0 2px; font-size: 10.5px; overflow-wrap: anywhere; }
.oc-a4-page .oc-forte { font-weight: 700; }

.oc-a4-page .oc-secao {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-transform: uppercase;
}

/* A folha tem um `table { min-width: 720px }` GLOBAL (linha ~2776), pensado
   para as tabelas de dados do app. Dentro da pagina A4 ele e nocivo: a caixa
   de conteudo do documento tem 702px, entao TODA tabela daqui era empurrada
   para 720px e terminava 18px a direita das caixas do topo, do total e do
   rodape. Era exatamente o desalinhamento que o Andre marcou com a linha
   vermelha no pedido nº 00004 — 720 menos 702.
   O documento da PROPOSTA ja neutraliza o mesmo global (`.proposal-a4-page
   table { min-width: 0 }`); a ordem de compra nascera sem isso. */
.oc-a4-page table {
  min-width: 0;
}

.oc-a4-page .oc-tabela {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.oc-a4-page .oc-tabela th {
  padding: 4px 6px;
  border: 1px solid #1b2536;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}
.oc-a4-page .oc-tabela td {
  padding: 5px 6px;
  border: 1px solid #1b2536;
  font-size: 10px;
  vertical-align: top;
}
.oc-a4-page .oc-pn { font-weight: 700; overflow-wrap: anywhere; }
.oc-a4-page .oc-desc { text-align: left; }
.oc-a4-page .oc-qtd { text-align: center; white-space: nowrap; }
.oc-a4-page .oc-vlr { text-align: right; white-space: nowrap; }
.oc-a4-page .oc-tabela tfoot td { border-top: 1px solid #1b2536; font-weight: 700; }
.oc-a4-page .oc-total-rot { text-align: right; text-decoration: underline; white-space: nowrap; }
.oc-a4-page .oc-total-vlr { text-align: right; text-decoration: underline; }
.oc-a4-page .oc-tabela tfoot td:first-child { border-left: 0; border-bottom: 0; }

.oc-a4-page .oc-total-pedido {
  margin: 0 0 16px;
  padding: 8px 10px;
  border: 2px solid #1b2536;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}
