/* ═══════════════════════════════════════════════════════════════════════
   Poli ACM · Painel de Marketing — visual premium claro (SaaS)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E7EAF0;
  --border-forte: #D6DBE4;
  --ink: #0F1728;
  --ink-2: #344054;
  --soft: #667085;
  --soft-2: #98A2B3;

  --primaria: #0B1F43;
  --primaria-escura: #060F24;
  --primaria-suave: #E9EDF5;
  --laranja: #F4D21F;        /* cor secundária da marca (amarelo) */
  --amarelo-escuro: #C7A70A; /* amarelo legível para ícones pequenos */
  --verde: #12855A;
  --verde-suave: #E7F6EE;
  --erro: #C0362C;
  --erro-suave: #FCEEEC;

  --fonte: 'Manrope', system-ui, sans-serif;
  --display: 'Archivo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  --r: 14px;
  --r-input: 10px;
  --sombra-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sombra-2: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -8px rgba(16, 24, 40, .10);
  --sombra-3: 0 4px 12px -2px rgba(16, 24, 40, .10), 0 24px 48px -16px rgba(16, 24, 40, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fonte);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--primaria);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.oculto { display: none !important; }

/* ── Marca ──────────────────────────────────────────────────────────── */
.marca, .sidebar-brand { display: flex; align-items: center; gap: 10px; }

.logo-sidebar {
  height: 46px;
  width: auto;
  display: block;
}

.logo-login {
  height: 72px;
  width: auto;
  display: block;
  margin: 0 auto;
}
.login-card .marca { justify-content: center; }

.marca-quadrado {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--laranja) 0%, #D9B70E 100%);
  box-shadow: 0 2px 6px rgba(244, 210, 31, .45);
  position: relative;
}
.marca-quadrado::after {
  content: '';
  position: absolute; inset: 8px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 3px;
}

.marca-texto {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.marca-texto strong { font-weight: 900; }

.marca-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primaria);
  background: var(--primaria-suave);
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 2px;
}

/* ── Elementos comuns ───────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primaria);
  margin-bottom: 8px;
}

.label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.opcional { color: var(--soft-2); font-weight: 500; }

.input {
  padding: 10px 13px;
  border: 1px solid var(--border-forte);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  border-radius: var(--r-input);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #C0C7D4; }
.input:focus {
  outline: none;
  border-color: var(--primaria);
  box-shadow: 0 0 0 4px rgba(11, 31, 67, .14);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23667085' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.btn {
  padding: 11px 22px;
  background: var(--primaria);
  color: #FFF;
  border: none;
  border-radius: var(--r-input);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--sombra-1), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: background .15s, transform .1s, box-shadow .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover { background: var(--primaria-escura); box-shadow: var(--sombra-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.btn:disabled::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #FFF;
  border-radius: 50%;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.btn-escuro { background: var(--ink); }
.btn-escuro:hover { background: #232D40; }
.btn-block { width: 100%; }

.btn-ghost {
  padding: 11px 18px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--border-forte);
  border-radius: var(--r-input);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--bg); border-color: #C0C7D4; }

.erro {
  background: var(--erro-suave);
  color: var(--erro);
  border: 1px solid #F2C4BF;
  border-radius: var(--r-input);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.ok {
  background: var(--verde-suave);
  color: var(--verde);
  border: 1px solid #BFE5D0;
  border-radius: var(--r-input);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.hint { font-size: 13px; color: var(--soft); margin-bottom: 14px; }
.hint-inline { margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sombra-1);
}

/* ── Login ──────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(11, 31, 67, .08), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(244, 210, 31, .12), transparent 60%),
    var(--bg);
}

.login-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 24, 40, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 40, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(600px 420px at 50% 42%, #000 30%, transparent 75%);
  pointer-events: none;
}

.login-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--sombra-3);
  padding: 38px 36px 30px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-title {
  margin: 20px 0 2px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  font-stretch: 110%;
  letter-spacing: -0.02em;
}

.login-sub { margin: 0 0 16px; font-size: 14px; color: var(--soft); }

.login-card .label { margin-top: 10px; margin-bottom: 6px; }
.login-card .btn { margin-top: 22px; padding: 13px; }

.login-rodape {
  margin-top: 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft-2);
}

/* ── Layout com menu lateral ────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand { padding: 0 8px 20px; }

.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.menu-grupo {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--soft-2);
  padding: 14px 10px 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.menu-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--soft); transition: color .12s; }
.menu-item:hover { background: var(--bg); color: var(--ink); }
.menu-item.ativo {
  background: var(--primaria-suave);
  color: var(--primaria);
  font-weight: 700;
}
.menu-item.ativo svg { color: var(--primaria); }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 8px 0;
  border-top: 1px solid var(--border);
}

.avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primaria) 0%, #24406F 100%);
  color: #FFF;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foot-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.usuario-logado {
  font-weight: 700;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-sair { font-size: 12px; color: var(--soft); text-decoration: none; }
.link-sair:hover { color: var(--erro); text-decoration: underline; }

.conteudo {
  flex: 1;
  min-width: 0;
  padding: 34px clamp(16px, 4vw, 44px) 70px;
  max-width: 1240px;
}

/* Modo kanban: usa a largura toda da tela */
.conteudo.conteudo-cheia { max-width: none; }

/* ── Cabeçalho de página + stats ────────────────────────────────────── */
.pagina-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.titulo {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.subtexto { margin: 8px 0 0; font-size: 14.5px; color: var(--soft); max-width: 52ch; }

.stats { display: flex; gap: 12px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sombra-1);
  padding: 14px 18px 14px 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 168px;
}

.stat-icone {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icone svg { width: 20px; height: 20px; }
.stat-icone-azul { background: var(--primaria-suave); color: var(--primaria); }
.stat-icone-verde { background: var(--verde-suave); color: var(--verde); }
.stat-icone-laranja { background: #FEF0E4; color: #B45309; }

/* ── Uso Claude ─────────────────────────────────────────────────────── */
.td-custo { white-space: nowrap; }

.uso-falha {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--erro);
  background: var(--erro-suave);
  border-radius: 999px;
  padding: 2px 8px;
}

.stat-num {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  font-stretch: 108%;
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--soft); margin-top: 3px; }

/* ── Formulário de busca ────────────────────────────────────────────── */
.form-busca {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--sombra-2);
}

.campo { display: flex; flex-direction: column; gap: 6px; flex: 1 1 170px; }
.campo-segmento { flex: 2 1 260px; }
.campo-uf { max-width: 92px; flex-basis: 92px; }
.campo-qtd { max-width: 84px; flex-basis: 84px; }
.form-busca .btn { padding: 11px 26px; }

/* ── Barra de progresso da pesquisa ─────────────────────────────────── */
.progresso {
  padding: 18px 20px 16px;
  margin-bottom: 16px;
  box-shadow: var(--sombra-2);
}

.progresso-topo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.progresso-msg { font-weight: 700; font-size: 14px; color: var(--ink); }

.progresso-pct {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--primaria);
}

.progresso-trilha {
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progresso-preenchido {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primaria) 0%, #2C4A7D 55%, var(--primaria) 100%);
  background-size: 200% 100%;
  animation: brilho-progresso 1.6s linear infinite;
  transition: width .35s ease;
  min-width: 6px;
}

@keyframes brilho-progresso {
  from { background-position: 0% 0; }
  to   { background-position: -200% 0; }
}

.progresso-etapas {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.progresso-etapas span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--soft-2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.progresso-etapas span::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border-forte);
  transition: background .3s;
}

.progresso-etapas span.feita { color: var(--primaria); }
.progresso-etapas span.feita::before { background: var(--primaria); }

@media (max-width: 640px) {
  .progresso-etapas span { font-size: 9px; }
}

/* ── Estado vazio ───────────────────────────────────────────────────── */
.vazio {
  padding: 60px 24px;
  text-align: center;
  border-style: dashed;
  border-color: var(--border-forte);
  box-shadow: none;
}

.vazio-icone {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--primaria-suave);
  color: var(--primaria);
  display: flex; align-items: center; justify-content: center;
}
.vazio-icone svg { width: 26px; height: 26px; }

.vazio-titulo {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  font-stretch: 110%;
  margin-bottom: 6px;
}
.vazio-texto { color: var(--soft); font-size: 14px; line-height: 1.7; }

/* ── Tabela ─────────────────────────────────────────────────────────── */
.tabela-wrap { overflow-x: auto; box-shadow: var(--sombra-2); }
.tabela-wrap-interna { box-shadow: none; margin-bottom: 4px; }

.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.tabela th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--soft);
  background: #FAFBFC;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tabela td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
  color: var(--ink-2);
}
.tabela tbody tr:last-child td { border-bottom: none; }
.tabela tbody tr:nth-child(even) td { background: #FBFCFD; }
.tabela tbody tr:hover td { background: var(--primaria-suave); }

.td-empresa { font-weight: 700; color: var(--ink); }
.td-contato { font-family: var(--mono); font-size: 12px; }
.td-cidade { white-space: nowrap; }
.td-obs { color: var(--soft); }

.footer-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ── Clientes: badge do menu ────────────────────────────────────────── */
.menu-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--primaria);
  background: var(--primaria-suave);
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}
.menu-item.ativo .menu-badge { background: #FFF; }

/* ── Clientes: chips do funil ───────────────────────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border-forte);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { background: var(--bg); }
.chip.ativo { background: var(--ink); border-color: var(--ink); color: #FFF; }

.chip-num {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(16, 24, 40, .07);
  border-radius: 999px;
  padding: 1px 7px;
}
.chip.ativo .chip-num { background: rgba(255, 255, 255, .2); }

.chip-novo .chip-num       { background: var(--primaria-suave); color: var(--primaria); }
.chip-contatado .chip-num  { background: #FEF0E4; color: #B45309; }
.chip-negociacao .chip-num { background: #F0EBFE; color: #6941C6; }
.chip-fechado .chip-num    { background: var(--verde-suave); color: var(--verde); }
.chip-descartado .chip-num { background: #F2F4F7; color: var(--soft); }
.chip.ativo .chip-num      { background: rgba(255, 255, 255, .2); color: #FFF; }

/* ── Clientes: select de status colorido ────────────────────────────── */
.status-select {
  appearance: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 28px 6px 13px;
  border: 1px solid transparent;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23667085' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.st-novo       { background-color: var(--primaria-suave); color: var(--primaria); border-color: #C5CEDF; }
.st-contatado  { background-color: #FEF0E4; color: #B45309; border-color: #F6D8B8; }
.st-negociacao { background-color: #F0EBFE; color: #6941C6; border-color: #DCD0FB; }
.st-fechado    { background-color: var(--verde-suave); color: var(--verde); border-color: #BFE5D0; }
.st-descartado { background-color: #F2F4F7; color: var(--soft); border-color: var(--border-forte); }

/* ── Clientes: tabela e detalhes ────────────────────────────────────── */
.toolbar-clientes { margin-bottom: 16px; }
.th-acoes { width: 170px; }
.td-acoes { text-align: right; white-space: nowrap; }

.marca-anotacao {
  margin-left: 7px;
  font-size: 12px;
  color: var(--amarelo-escuro);
}

.linha-detalhe td {
  background: #FAFBFD !important;
  border-top: none;
  padding: 18px 20px 20px;
}

.detalhe-grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.detalhe-col { display: flex; flex-direction: column; gap: 10px; }
.detalhe-col .campo { gap: 5px; }

.detalhe-info {
  font-size: 12.5px;
  color: var(--soft);
  line-height: 1.7;
  padding-top: 4px;
}

.detalhe-anotacoes {
  min-height: 108px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.55;
}

.detalhe-acoes { display: flex; gap: 10px; margin-top: 2px; }

@media (max-width: 760px) {
  .detalhe-grade { grid-template-columns: 1fr; }
}

/* ── Clientes: alternador Lista ⇄ Kanban ────────────────────────────── */
.campo-visao { flex: 0 0 auto; }

.visao-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border-forte);
  border-radius: var(--r-input);
  padding: 3px;
  gap: 2px;
}

.visao-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
  cursor: pointer;
  transition: background .12s, color .12s, box-shadow .12s;
}
.visao-btn svg { width: 15px; height: 15px; }
.visao-btn:hover { color: var(--ink); }
.visao-btn.ativo {
  background: var(--surface);
  color: var(--primaria);
  box-shadow: var(--sombra-1);
}

/* ── Clientes: quadro Kanban ────────────────────────────────────────── */
.kanban {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 14px;
}

.kanban-col {
  flex: 1 0 232px;
  min-width: 232px;
  background: #EEF0F4;
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  max-height: 72vh;
  transition: border-color .15s, background .15s;
}

.kanban-col.kanban-alvo {
  border-color: var(--primaria);
  background: var(--primaria-suave);
}

.kanban-topo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
}

.kanban-ponto { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kanban-topo-novo       .kanban-ponto { background: var(--primaria); }
.kanban-topo-contatado  .kanban-ponto { background: #E8850C; }
.kanban-topo-negociacao .kanban-ponto { background: #6941C6; }
.kanban-topo-fechado    .kanban-ponto { background: var(--verde); }
.kanban-topo-descartado .kanban-ponto { background: var(--soft-2); }

.kanban-rotulo {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  letter-spacing: .01em;
}

.kanban-num {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  background: rgba(16, 24, 40, .06);
  border-radius: 999px;
  padding: 2px 8px;
}

.kanban-corpo {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 2px 10px 12px;
  overflow-y: auto;
  min-height: 70px;
  flex: 1;
}

.kanban-cartao {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--sombra-1);
  padding: 11px 13px;
  cursor: grab;
  transition: box-shadow .15s, transform .12s, border-color .15s;
}
.kanban-cartao:hover {
  box-shadow: var(--sombra-2);
  border-color: var(--border-forte);
  transform: translateY(-1px);
}
.kanban-cartao.arrastando { opacity: .45; cursor: grabbing; }

.kanban-nome { font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.35; }
.kanban-cidade { font-size: 12px; color: var(--soft); margin-top: 4px; }
.kanban-contato {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-vazio-col {
  border: 1.5px dashed var(--border-forte);
  border-radius: 10px;
  padding: 18px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--soft-2);
}

/* ── Abas Clientes | Roteirização ───────────────────────────────────── */
.abas {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}

.aba {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--soft);
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.aba svg { width: 16px; height: 16px; }
.aba:hover { color: var(--ink); }
.aba.ativo { color: var(--primaria); border-bottom-color: var(--primaria); font-weight: 700; }

/* ── Roteirização ───────────────────────────────────────────────────── */
.rotas-topo { justify-content: space-between; }

.rotas-contadores { display: flex; gap: 26px; align-items: center; }
.rotas-contador { display: flex; align-items: baseline; gap: 7px; }
.rotas-contador strong {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  font-stretch: 108%;
  color: var(--primaria);
}
.rotas-contador span { font-size: 12.5px; color: var(--soft); }

.campo-rep { max-width: 220px; }

.viagem-card { margin-bottom: 14px; overflow: hidden; }

.viagem-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  flex-wrap: wrap;
}

.viagem-info { flex: 1; min-width: 180px; }
.viagem-nome { font-weight: 800; font-size: 15.5px; font-family: var(--display); font-stretch: 108%; }
.viagem-meta { font-size: 12.5px; color: var(--soft); margin-top: 3px; }

.btn-mapa { text-decoration: none; display: inline-flex; align-items: center; }
.btn-mapa.desabilitado, .btn-ghost.desabilitado, .btn-ghost:disabled {
  opacity: .45;
  pointer-events: none;
}

.visitas-trilho {
  display: flex;
  gap: 12px;
  align-items: stretch;
  overflow-x: auto;
  padding: 4px 18px 18px;
  border-top: 1px solid var(--border);
  background: #FAFBFD;
}

.visita-cartao {
  position: relative;
  flex: 0 0 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--sombra-1);
  padding: 12px 14px;
  margin-top: 12px;
  cursor: grab;
  transition: box-shadow .15s, border-color .15s, opacity .15s;
}
.visita-cartao:hover { box-shadow: var(--sombra-2); }
.visita-cartao.arrastando { opacity: .45; cursor: grabbing; }
.visita-cartao.visita-alvo { border-color: var(--primaria); box-shadow: 0 0 0 3px rgba(11, 31, 67, .15); }

.visita-ordem {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primaria);
  margin-bottom: 6px;
}

.visita-nome {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.35;
  cursor: pointer;
}
.visita-nome:hover { color: var(--primaria); text-decoration: underline; }

.visita-cidade { font-size: 12px; color: var(--soft); margin-top: 3px; }

.visita-linha { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.visita-hora { width: 92px; padding: 6px 8px; font-size: 12.5px; font-family: var(--mono); }

.visita-remover {
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: none;
  font-size: 17px;
  line-height: 1;
  color: var(--soft-2);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
}
.visita-remover:hover { color: var(--erro); background: var(--erro-suave); }

.visita-adicionar {
  flex: 0 0 170px;
  margin-top: 12px;
  border: 1.5px dashed var(--border-forte);
  border-radius: 12px;
  background: none;
  color: var(--soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  min-height: 100px;
}
.visita-adicionar:hover { border-color: var(--primaria); color: var(--primaria); }
.visita-adicionar.visita-alvo { border-color: var(--primaria); color: var(--primaria); background: var(--primaria-suave); }

/* ── Indicador "cliente em rota" ────────────────────────────────────── */
.marca-rota {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 7px;
  color: var(--primaria);
}
.marca-rota svg { width: 14px; height: 14px; }

.kanban-cartao-rota {
  border-color: #C5CEDF;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F8FE 100%);
  border-left: 3px solid var(--primaria);
}

.kanban-selo-rota {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primaria);
  background: var(--primaria-suave);
  border-radius: 999px;
  padding: 3px 10px;
}
.kanban-selo-rota svg { width: 12px; height: 12px; }

/* ── Abas do modal do cliente (Dados | Histórico) ───────────────────── */
.modal-abas {
  display: flex;
  gap: 2px;
  padding: 12px 22px 0;
  border-bottom: 1px solid var(--border);
}

.modal-aba {
  padding: 8px 16px 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--soft);
  cursor: pointer;
}
.modal-aba:hover { color: var(--ink); }
.modal-aba.ativo { color: var(--primaria); border-bottom-color: var(--primaria); font-weight: 700; }

/* ── Histórico do cliente ───────────────────────────────────────────── */
#modal-aba-historico { padding-bottom: 20px; max-height: 56vh; }

.hist-secao {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--soft-2);
  margin: 8px 0 2px;
}
.hist-secao:first-child { margin-top: 0; }

.hist-viagem {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--primaria-suave);
  border: 1px solid #C5CEDF;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.hist-viagem svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--primaria); margin-top: 2px; }

.hist-vazio { font-size: 13px; color: var(--soft-2); padding: 4px 0 6px; }

.hist-item {
  position: relative;
  padding: 2px 0 12px 18px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
}
.hist-item:last-child { padding-bottom: 2px; }
.hist-item::before {
  content: '';
  position: absolute;
  left: -6px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--primaria);
}

.hist-quando {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft-2);
}
.hist-texto { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }

/* ── Seletor de cliente para a viagem ───────────────────────────────── */
.escolher-lista {
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.escolher-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.escolher-item:hover { border-color: var(--primaria); background: var(--primaria-suave); }

.escolher-nome { font-weight: 700; font-size: 13.5px; }
.escolher-det { font-size: 12px; color: var(--soft); white-space: nowrap; }

.escolher-vazio { text-align: center; color: var(--soft-2); font-size: 13px; padding: 24px 0; }

/* ── Modal de detalhes ──────────────────────────────────────────────── */
.sem-rolagem { overflow: hidden; }

.modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--sombra-3);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modal-entrada .18s ease;
}

@keyframes modal-entrada {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.modal-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 0;
}

.modal-titulo {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  font-stretch: 110%;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.modal-fechar {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--soft);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}
.modal-fechar:hover { background: var(--bg); color: var(--ink); }

.modal-corpo {
  padding: 14px 22px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.modal-corpo .campo { gap: 5px; }

.modal-acoes {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 22px 20px;
}
.modal-remover { margin-left: auto; }

.modal-linha-dupla {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 12px;
}

.obrigatorio { color: var(--erro); }

/* ── Configuração ───────────────────────────────────────────────────── */
.bloco-config { padding: 24px; margin-bottom: 18px; box-shadow: var(--sombra-2); }

.bloco-topo { display: flex; gap: 15px; margin-bottom: 16px; }

.bloco-icone {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  background: var(--primaria-suave);
  color: var(--primaria);
  display: flex; align-items: center; justify-content: center;
}
.bloco-icone svg { width: 20px; height: 20px; }

.subtitulo {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  font-stretch: 110%;
  letter-spacing: -0.01em;
}
.subtitulo-menor { margin: 20px 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.texto-apoio { margin: 0; font-size: 13.5px; color: var(--soft); line-height: 1.65; max-width: 68ch; }
.texto-apoio a { color: var(--primaria); font-weight: 600; }

.status-chave {
  font-family: var(--mono);
  font-size: 12.5px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  color: var(--ink-2);
}

.form-linha { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.form-linha .input { flex: 1 1 220px; width: auto; }
.input-chave { font-family: var(--mono); font-size: 13px; }

.btn-mini {
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  background: var(--surface);
  color: var(--erro);
  border: 1px solid #F2C4BF;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.btn-mini:hover { background: var(--erro-suave); }
.btn-mini-neutro { color: var(--ink-2); border-color: var(--border-forte); margin-right: 6px; }
.btn-mini-neutro:hover { background: var(--bg); }

/* ── Perfis de acesso ───────────────────────────────────────────────── */
.perfil-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.perfil-admin { background: var(--primaria-suave); color: var(--primaria); }
.perfil-representante { background: #FEF0E4; color: #B45309; }

.select-perfil { flex: 0 1 260px; }

/* ── Responsivo ─────────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    gap: 4px;
    overflow-x: auto;
  }
  .sidebar-brand { padding: 0 10px 0 4px; }
  .marca-tag { display: none; }
  .menu { flex-direction: row; align-items: center; gap: 4px; }
  .menu-grupo { display: none; }
  .menu-item { padding: 9px 12px; white-space: nowrap; }
  .sidebar-foot { margin-left: auto; border: none; padding: 0 4px; }
  .foot-info { display: none; }
  .pagina-header { align-items: flex-start; }
  .stats { width: 100%; }
  .stat-card { flex: 1; min-width: 0; }
  .conteudo { padding-top: 22px; }
}
