/* Veri — o funil é uma linha: cada etapa é uma estação com a sua cor,
   e cor de etapa só marca etapa. As cores conversam com o site (azul, verde-água,
   violeta do vidro líquido), com um âmbar como único tom quente. Vermelho é só
   para atraso. Uma só grotesca (Archivo) do numeral à legenda. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-standard-normal.de2f1fe81758.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-ext-standard-normal.589f7bc0fac4.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #15171a;
  --ink-2: #3d4148;
  --muted: #565b63;
  --ground: #f7f7f5;
  --surface: #ffffff;
  --sunk: #eaebe6;
  --line: #e0e1dc;
  --line-strong: #c9cbc5;
  --shell: #15171a;
  --shell-2: #262a30;
  --shell-text: #f4f4f1;
  --shell-muted: #b3b8bf;

  --l-new: #3b6fd4;
  --l-contacted: #d29a3a;
  --l-qualified: #2f9c96;
  --l-converted: #8a6fd6;
  --l-discarded: #8c9198;
  --late: #c2473a;
  --late-ink: #9c3127;
  --late-bg: #fcebe8;

  --radius: 12px;
  --pill: 999px;
  --gutter: clamp(16px, 3.2vw, 44px);
  --nav-h: 0px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
  accent-color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  caret-color: var(--l-new);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--l-contacted); color: var(--ink); }

a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--l-new); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: var(--pill);
  background: var(--l-contacted);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 650; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.35rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }

.lede { color: var(--ink-2); font-size: 1.05rem; margin: 6px 0 0; }
.help, .empty, .more { color: var(--muted); font-size: 0.9rem; }
.empty { margin: 8px 0; }
.nowrap { white-space: nowrap; }
.late-text { color: var(--late-ink); font-weight: 650; }

/* ——— Casca ——— */

.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  min-height: 64px;
  padding: 0 var(--gutter);
  background: var(--shell);
  color: var(--shell-text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--shell-text);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

/* Logo Vínculo: dois C ligados; o nome se escreve Veri, assinado by Averisen. */
.brand-mark { width: 28px; height: 28px; flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; font-weight: 750; letter-spacing: -0.03em; }
.wordmark small { margin-top: 3px; font-size: 0.62rem; font-weight: 550; letter-spacing: 0.06em; color: var(--shell-muted); }

.nav { display: flex; gap: 4px; }

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--pill);
  color: var(--shell-muted);
  font-weight: 550;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav a::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.nav a:hover { background: var(--shell-2); color: var(--shell-text); }
.nav a[aria-current="page"] { background: var(--shell-text); color: var(--ink); }

.nav-painel { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 18h18'/%3E%3Cpath d='M6 18V9'/%3E%3Cpath d='M11 18V5'/%3E%3Cpath d='M16 18v-6'/%3E%3Cpath d='M21 18V8'/%3E%3C/svg%3E"); }
.nav-tarefas { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.5 2.5L16 9.5'/%3E%3C/svg%3E"); }
.nav-leads { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12h20'/%3E%3Ccircle cx='5' cy='12' r='2.5'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Ccircle cx='19' cy='12' r='2.5'/%3E%3C/svg%3E"); }
.nav-clientes { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.4-4 4.5-6 8-6s6.6 2 8 6'/%3E%3C/svg%3E"); }
.nav-vendas { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-3-2-3 2-3-2-3 2z'/%3E%3Cpath d='M9 8h6'/%3E%3Cpath d='M9 12h6'/%3E%3C/svg%3E"); }

.account { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.account .who { color: var(--shell-muted); font-size: 0.9rem; margin-right: 6px; }
.account a, .account button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--pill);
  border: 1px solid #3a3f46;
  background: transparent;
  color: var(--shell-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
}
.account a:hover, .account button:hover { background: var(--shell-2); }
.account a[aria-current="page"] { background: var(--shell-text); color: var(--ink); }
.account form { margin: 0; }

.shell main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px var(--gutter) 56px;
}

.signature {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: center;
  padding: 20px var(--gutter) calc(20px + var(--nav-h));
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.signature a { color: var(--muted); }
.by-averisen { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.averisen-mark { width: 14px; height: 15px; }

/* ——— Blocos ——— */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.2vw, 28px);
}

.panel > h2,
.panel-head h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
}
.panel-head a { font-size: 0.9rem; font-weight: 550; color: var(--ink-2); }

.narrow { max-width: 38rem; }
.panel.narrow h1 { margin-bottom: 18px; }

.welcome { max-width: 46rem; }
.welcome h2 { font-size: 1.5rem; letter-spacing: -0.02em; text-transform: none; margin-bottom: 8px; }

.row-links { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; margin-top: 28px; }

/* ——— Botões e campos ——— */

.primary, .secondary, .danger, .search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--pill);
  border: 1px solid var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.primary, .search button { background: var(--ink); color: #fff; }
.primary:hover, .search button:hover { background: #2c3036; }
.secondary { background: var(--surface); color: var(--ink); }
.secondary:hover { background: var(--sunk); }
.danger { background: var(--late); border-color: var(--late); color: #fff; }
.danger:hover { background: var(--late-ink); }
.small { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }

.danger-link { color: var(--late-ink); font-weight: 550; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }

.field { margin-bottom: 18px; }
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.req { font-weight: 500; font-size: 0.78rem; color: var(--muted); margin-left: 4px; }

.control,
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.control::placeholder { color: #6b7078; }
.control:hover { border-color: #a9aca5; }
.control:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(30, 91, 216, 0.22); }
.control[aria-invalid="true"] { border-color: var(--late); }
.field .help { margin-top: 6px; }
.error { color: var(--late-ink); font-weight: 600; font-size: 0.9rem; margin: 6px 0 0; }
.error-summary { background: var(--late-bg); border: 1px solid #f2c3bc; border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; }
.error-summary .error { margin: 0; }

.field-check label { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.field-check input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; }

.search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 22px;
}
.search > label:not(.check-field) { flex-basis: 100%; margin-bottom: -6px; }
.search > .control { flex: 1 1 16rem; width: auto; }
.search-field { flex: 1 1 16rem; }
.search-field.narrow-field { flex: 0 1 12rem; }
.search-field label { font-size: 0.82rem; }
.check-field { display: inline-flex; gap: 8px; align-items: center; min-height: 46px; font-weight: 500; font-size: 0.92rem; margin: 0; }
.check-field input { width: 18px; height: 18px; min-height: 0; }
.clear-filters { align-self: center; font-size: 0.9rem; }

/* ——— Mensagens ——— */

.messages { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.message {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #c3dccd;
  background: #e9f5ee;
  color: var(--ink);
}
.message::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--l-qualified); transform: translateY(1px); }
.message.info { background: #eaf0fc; border-color: #c4d4f3; }
.message.info::before { background: var(--l-new); }
.message.error, .message.warning { background: var(--late-bg); border-color: #f2c3bc; }
.message.error::before, .message.warning::before { background: var(--late); }

/* ——— Etiquetas de estado ——— */

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--pill);
  background: var(--sunk);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); }

.stage-new { --dot: var(--l-new); }
.stage-contacted { --dot: var(--l-contacted); }
.stage-qualified { --dot: var(--l-qualified); }
.stage-converted { --dot: var(--l-converted); }
/* Temperatura não usa cor de linha: é um medidor de três barras em tinta. */
.status.temp-cold::before, .status.temp-warm::before, .status.temp-hot::before {
  width: 12px;
  height: 10px;
  border-radius: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 100% / 3px 45% no-repeat,
    linear-gradient(var(--t2), var(--t2)) 4.5px 100% / 3px 72% no-repeat,
    linear-gradient(var(--t3), var(--t3)) 9px 100% / 3px 100% no-repeat;
}
.temp-cold { --t2: var(--line-strong); --t3: var(--line-strong); }
.temp-warm { --t2: var(--ink); --t3: var(--line-strong); }
.temp-hot { --t2: var(--ink); --t3: var(--ink); }
/* Perdido e descartado: o traço cortado. Vermelho fica só para atraso. */
.status-lost::before, .stage-discarded::before {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ink-2) 0 40%, transparent 40% 60%, var(--ink-2) 60%);
}
/* Situação de venda no vocabulário de estado: anel = em aberto, disco lilás = fechada
   (a venda fechada é a estação Cliente), traço cortado = perdida. */
.status-negotiating::before { background: transparent; border: 2px solid var(--ink); }
.status-closed { --dot: var(--l-converted); }
.status.today { --dot: var(--ink); }
.status.overdue { background: var(--late-bg); color: var(--late-ink); --dot: var(--late); }

/* Estado de tarefa: anel = aberta, anel vermelho = atrasada, disco = concluída. */
.state-ring { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ink); }
.is-late .state-ring { border-color: var(--late); }

/* ——— Listas ——— */

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s var(--ease);
}
a.card:hover { border-color: var(--ink); }
.card strong { font-size: 1.05rem; font-weight: 650; }
.card > span { color: var(--ink-2); font-size: 0.95rem; }
.card .tags { margin: 4px 0; }
.card > .status { align-self: flex-start; }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0 0 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.summary div { padding: 14px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.summary dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.summary dd { margin: 4px 0 0; font-size: clamp(1.45rem, 1rem + 1.6vw, 1.9rem); white-space: nowrap; font-weight: 700; font-stretch: 85%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.summary dd a { text-decoration: none; }
.summary .sub { font-size: 0.85rem; font-weight: 500; font-stretch: 100%; letter-spacing: 0; color: var(--muted); }
.summary .alert dd { color: var(--late-ink); }

.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 22px; color: var(--muted); }
.pager a { font-weight: 600; }

/* ——— Painel: a linha do funil ——— */

.line-panel { padding-bottom: 18px; }

.metro {
  --rail: 12px;
  --dot: 44px;
  position: relative;
  list-style: none;
  margin: 8px 0 6px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.metro::before {
  content: "";
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: calc(var(--dot) / 2 - var(--rail) / 2);
  height: var(--rail);
  border-radius: var(--rail);
  background: linear-gradient(90deg,
    var(--l-new) 0 33.3%, var(--l-contacted) 33.3% 66.6%, var(--l-qualified) 66.6% 100%);
  animation: rail-draw 0.9s var(--ease) both;
}

@keyframes rail-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rail-draw-down { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

.station { position: relative; display: flex; justify-content: center; }
.station a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 8px 8px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
.station-dot {
  position: relative;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--surface);
  border: 9px solid var(--route);
  transition: transform 0.3s var(--ease);
}
.station a:hover .station-dot { transform: scale(1.12); }
.station-count {
  margin-top: 14px;
  font-size: clamp(2.6rem, 1.6rem + 3vw, 4.25rem);
  font-weight: 700;
  font-stretch: 80%;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.station-name { margin-top: 8px; font-weight: 650; font-size: 1rem; }
.station-value { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.terminal .station-dot { background: var(--route); box-shadow: inset 0 0 0 7px var(--surface); }
.line-panel .more { text-align: right; margin: 10px 0 0; }

.route-new { --route: var(--l-new); }
.route-contacted { --route: var(--l-contacted); }
.route-qualified { --route: var(--l-qualified); }
.route-converted { --route: var(--l-converted); }
.route-discarded { --route: var(--l-discarded); }

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: stretch;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.support-col { display: grid; gap: 20px; align-content: start; }

.due { list-style: none; margin: 0; padding: 0; }
.due-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  grid-template-areas: "ring main form" "ring meta form";
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.due-row:first-child { border-top: 0; padding-top: 4px; }
.due-row .state-ring { grid-area: ring; align-self: start; margin-top: 3px; }
.due-main { grid-area: main; display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; color: var(--ink); text-decoration: none; min-width: 0; }
.due-main strong { font-weight: 650; }
.due-main span { color: var(--ink-2); }
.due-main:hover strong { text-decoration: underline; }
.due-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 6px; }
.due-row form { grid-area: form; margin: 0; }

.month-total {
  margin: 4px 0 2px;
  font-size: clamp(2.4rem, 1.7rem + 2vw, 3.4rem);
  font-weight: 700;
  font-stretch: 80%;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.month-compare { color: var(--muted); font-size: 0.92rem; }

.columns { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.columns li { display: flex; flex-direction: column; align-items: stretch; outline-offset: 2px; border-radius: 4px; cursor: default; }
.column-slot { height: 104px; display: flex; align-items: flex-end; }
.column { width: 100%; height: max(var(--bar), 3px); background: #cfd1cb; border-radius: 4px 4px 1px 1px; transition: background-color 0.2s var(--ease); }
.columns li:hover .column, .columns li:focus-visible .column { background: var(--ink-2); }
.columns .current .column { background: var(--l-converted); }
.column-label { padding-top: 6px; text-align: center; font-size: 0.8rem; color: var(--muted); }
.columns .current .column-label { color: var(--ink); font-weight: 650; }

.chart-table { margin-top: 12px; font-size: 0.9rem; }
.chart-table summary { cursor: pointer; color: var(--ink-2); font-weight: 550; }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 6px 0; border-bottom: 1px solid var(--line); text-align: right; }
.chart-table th[scope="row"], .chart-table thead th:first-child { text-align: left; }
.chart-table thead th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

.month-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.month-facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.month-facts dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.month-facts .sub { font-size: 0.85rem; font-weight: 500; color: var(--muted); }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.bar-label { font-weight: 600; }
.bar-value { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; text-align: right; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 8px; background: var(--sunk); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--bar); border-radius: 8px; background: var(--bar-color, var(--ink-2)); }
.bars-converted { --bar-color: var(--l-converted); }
.bars-lost .bar::after { background: repeating-linear-gradient(90deg, var(--ink-2) 0 14px, transparent 14px 19px); }

.seg-cold { --series: #c9cbc5; }
.seg-warm { --series: #7d828a; }
.seg-hot { --series: var(--ink); }
.seg-negotiating { --series: #7d828a; }
.seg-closed { --series: var(--l-converted); }
.seg-lost { --series: #c9cbc5; }

.donut-chart { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: center; }
.donut-figure { position: relative; width: 132px; height: 132px; }
.donut { display: block; width: 100%; height: 100%; }
.donut-segment { fill: none; stroke: var(--series); stroke-width: 6.5; cursor: default; transition: stroke-width 0.2s var(--ease); }
.donut-segment:hover, .donut-segment:focus-visible { stroke-width: 8; outline: none; }
.donut-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; pointer-events: none; }
.donut-total strong { font-size: 1.9rem; font-weight: 700; font-stretch: 80%; line-height: 1; }
.donut-total span { color: var(--muted); font-size: 0.8rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 10px; align-items: center; }
.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--series); }
.legend-label { font-weight: 600; font-size: 0.92rem; }
.legend-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-detail { grid-column: 2 / -1; color: var(--muted); font-size: 0.82rem; }

.viz-tip {
  position: absolute;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--shell);
  color: var(--shell-text);
  font-size: 0.85rem;
  box-shadow: 0 6px 20px rgba(21, 23, 26, 0.25);
  pointer-events: none;
}
.viz-tip[hidden] { display: none; }
.viz-tip strong { font-size: 1rem; }
.viz-tip span { color: var(--shell-muted); }

/* ——— Detalhe ——— */

.convert { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 20px; }
.convert .help { max-width: 36rem; margin: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 28px; margin: 0 0 20px; }
.facts div { margin: 0; min-width: 0; }
.facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.phone-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.phone-links a { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }

.activity { margin-block: 20px; }
.activity h3 { margin: 22px 0 12px; font-size: 1rem; }
.activity form { max-width: 40rem; }
.activity .cards { gap: 0; }
.activity .cards > li + li { border-top: 1px solid var(--line); }

.task-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 0;
}
.task-row > div, .task-row > a { min-width: 0; }
.task-row p { margin: 2px 0; color: var(--ink-2); }
.task-row .actions { margin: 0; gap: 14px; }
.task-row form { margin: 0; }

.done-tasks { margin-top: 12px; }
.done-tasks summary { cursor: pointer; color: var(--ink-2); font-weight: 550; }
.done-tasks .cards { margin-top: 6px; }
.done-description { text-decoration: line-through; color: var(--muted); }

/* O histórico é o trajeto: cada interação é uma parada na cor da etapa. */
.timeline { list-style: none; margin: 22px 0 0; padding: 0; }
.timeline > li { position: relative; padding: 0 0 22px 34px; }
.timeline > li::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 5px solid var(--route);
  background: var(--route);
}
.timeline > li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: -14px;
  width: 6px;
  border-radius: 6px;
  background: var(--route);
}
.timeline > li:last-child::after { display: none; }
.timeline > li.next-stop::before { background: var(--surface); }
.timeline > li.next-stop::after { background: repeating-linear-gradient(180deg, var(--route) 0 8px, transparent 8px 13px); }
.timeline > li.next-stop strong { color: var(--ink); }
.timeline > li.empty { padding-left: 0; }
.timeline > li.empty::before, .timeline > li.empty::after { display: none; }
.timeline .tags { align-items: baseline; gap: 10px; }
.timeline .tags strong { font-weight: 650; }
.timeline time { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.timeline p { margin: 4px 0; max-width: 70ch; }
.timeline .row-links { justify-content: flex-start; margin: 4px 0 0; font-size: 0.9rem; gap: 16px; }

.quick-log { display: none; }

.activity-grid { display: grid; gap: 20px; margin-block: 20px; }
.activity-grid .activity { margin: 0; }
.task-main { display: flex; gap: 12px; align-items: flex-start; }
.task-main .state-ring, .task-main .state-disc { margin-top: 3px; }
.state-disc { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.chart-table > summary::before, .done-tasks > summary::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 10px 2px 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}
.chart-table[open] > summary::before, .done-tasks[open] > summary::before { transform: rotate(45deg); }

.form-drawer { margin-top: 16px; }
.form-drawer > summary { width: fit-content; }
.form-drawer[open] > summary { margin-bottom: 18px; }
.form-drawer[open] > summary.primary { background: var(--surface); color: var(--ink); }

.filters > summary { display: none; }

/* ——— Leads: lista e funil ——— */

.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border-radius: var(--pill);
  background: var(--sunk);
}
.view-toggle a { padding: 8px 18px; border-radius: var(--pill); font-weight: 600; font-size: 0.92rem; text-decoration: none; color: var(--ink-2); }
.view-toggle [aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(21, 23, 26, 0.14); }

.shell main:has(.board-lanes) { min-width: 0; }
.board-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; min-width: 0; }

.lane {
  min-width: 0;
  border-radius: var(--radius);
  background: var(--sunk);
  padding: 0 12px 12px;
  border: 2px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.lane[data-stage="new"] { --route: var(--l-new); }
.lane[data-stage="contacted"] { --route: var(--l-contacted); }
.lane[data-stage="qualified"] { --route: var(--l-qualified); }
.lane::before { content: ""; display: block; height: 8px; margin: 0 -12px; border-radius: 10px 10px 0 0; background: var(--route); }
.lane-head { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 14px 4px 12px; }
.lane-head::before { content: ""; grid-row: span 2; width: 18px; height: 18px; border-radius: 50%; border: 4px solid var(--route); background: var(--surface); }
.lane-head h2 { font-size: 1.05rem; }
.lane-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.lane-cards { list-style: none; padding: 0; margin: 0; min-height: 3rem; display: grid; gap: 10px; }
.board-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
  overflow-wrap: anywhere;
  transition: opacity 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.board-card:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(21, 23, 26, 0.08); }
.board-card[draggable="true"] { cursor: grab; }
.board-card h3 { font-size: 1.02rem; margin: 0; }
.board-card h3 a { text-decoration: none; }
.board-card h3 a:hover { text-decoration: underline; }
.board-card p { margin: 6px 0 0; color: var(--ink-2); font-size: 0.92rem; }
.board-card .tags { margin-top: 8px; }
.board-card form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.board-card button { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.board-card .move-discard { border: 0; background: transparent; margin-left: auto; color: var(--late-ink); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 6px 4px; }
.lane[data-stage="new"] .move-prev, .lane[data-stage="qualified"] .move-next { display: none; }
.lane-empty { display: none; }
.lane-cards:not(:has(> li)) + .lane-empty { display: block; }
.board-card.is-dragging { opacity: 0.45; }
.lane.is-over { border-color: var(--route); background: #e2e4de; }
.board-error { color: var(--late-ink); font-weight: 600; }
.board-error:empty { display: none; }

/* ——— Entrada ——— */

.gate {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: #eef2fa;
  overflow: hidden;
}

/* Eco calmo do vidro líquido do site, só em CSS: manchas azul, violeta e verde-água à deriva. */
.atmosphere {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 18% 28%, rgba(69, 130, 240, 0.55), transparent 70%),
    radial-gradient(34% 30% at 82% 22%, rgba(166, 138, 224, 0.5), transparent 70%),
    radial-gradient(40% 34% at 74% 82%, rgba(89, 186, 189, 0.5), transparent 70%),
    radial-gradient(30% 30% at 22% 86%, rgba(158, 173, 250, 0.45), transparent 70%);
  filter: blur(36px);
  animation: atmosphere-drift 24s ease-in-out infinite alternate;
}
@keyframes atmosphere-drift { to { transform: translate3d(4%, -3%, 0) rotate(7deg) scale(1.06); } }
.gate.atmosphere-off .atmosphere { animation: none; }

.atmosphere-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(21, 23, 26, 0.18);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.atmosphere-toggle svg { fill: currentColor; }
.atmosphere-toggle .play-icon,
.atmosphere-toggle[aria-pressed="true"] .pause-icon { display: none; }
.atmosphere-toggle[aria-pressed="true"] .play-icon { display: block; }

.gate main { position: relative; z-index: 1; width: min(100%, 27rem); }
.gate main:has(.legal) { width: min(100%, 46rem); margin-block: 4vh; }
.gate .panel {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: clamp(24px, 4vw, 36px);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 24px 60px rgba(40, 71, 115, 0.18);
}
@media (prefers-reduced-transparency: reduce) { .gate .panel { background: var(--surface); } }
.gate .messages { margin-bottom: 14px; }

.gate-title { display: flex; align-items: center; gap: 12px; font-size: 1.6rem; margin-bottom: 10px; }
.gate-title .brand-mark { width: 38px; height: 38px; }
.gate-title .wordmark small { font-size: 0.72rem; color: var(--muted); }
.gate .lede { color: var(--ink-2); margin-bottom: 22px; }
.gate form .primary { width: 100%; margin-top: 4px; }
.gate .more { margin: 16px 0 0; text-align: center; }

.legal { max-width: 46rem; line-height: 1.65; }
.legal h2 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
.legal ul { padding-left: 1.25rem; }
.legal li + li { margin-top: 0.35rem; }
.legal-meta { color: var(--muted); }
.legal-links { margin-top: 2rem; }
.legal-note { font-size: 0.85rem; color: var(--muted); margin-top: 14px; text-align: center; }

/* ——— Larguras ——— */

@media (max-width: 1080px) {
  .today-grid { grid-template-columns: 1fr; }
  .account .who { display: none; }
}

@media (max-width: 839px) {
  :root { --nav-h: calc(68px + env(safe-area-inset-bottom)); }

  .topbar { min-height: 56px; gap: 12px; }
  .brand { font-size: 1.02rem; }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--shell);
    border-top: 1px solid #2d3137;
  }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px; border-radius: 12px; font-size: 0.72rem; font-weight: 600; }
  .nav a::before { width: 22px; height: 22px; }
  .nav a[aria-current="page"] { background: var(--shell-2); color: var(--shell-text); }

  .account a, .account button { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }

  .shell main { padding-top: 22px; padding-bottom: 32px; }

  .metro { grid-template-columns: 1fr; --dot: 36px; --rail: 10px; margin-top: 4px; }
  .metro::before { display: none; }
  .station { justify-content: flex-start; }
  .station:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(var(--dot) / 2 - var(--rail) / 2);
    top: calc(6px + var(--dot) / 2);
    width: var(--rail);
    height: 100%;
    background: var(--route);
    animation: rail-draw-down 0.6s var(--ease) both;
  }
  .station-dot { z-index: 1; }
  .station a {
    display: grid;
    grid-template-columns: var(--dot) auto 1fr;
    grid-template-areas: "dot count name" "dot count value";
    column-gap: 14px;
    align-items: center;
    text-align: left;
    width: 100%;
    padding: 6px 0 10px;
  }
  .station-dot { grid-area: dot; border-width: 7px; }
  .station-count { grid-area: count; margin: 0; min-width: 2.2ch; font-size: 2.6rem; }
  .station-name { grid-area: name; margin: 0; align-self: end; }
  .station-value { grid-area: value; align-self: start; }
  .line-panel .more { text-align: left; }

  .support-grid { grid-template-columns: 1fr; }

  .due-row { grid-template-columns: 16px minmax(0, 1fr); grid-template-areas: "ring main" "ring meta" "ring form"; }
  .due-row form { justify-self: start; margin-top: 6px; }

  .board-lanes {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(16rem, 86%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    padding-bottom: 8px;
  }
  .lane { scroll-snap-align: start; }

  .quick-log {
    position: fixed;
    right: 16px;
    bottom: calc(var(--nav-h) + 14px);
    z-index: 25;
    display: inline-flex;
    box-shadow: 0 8px 24px rgba(21, 23, 26, 0.3);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .quick-log.is-hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }

  .search-field.narrow-field { flex: 1 1 10rem; }

  .filters > summary { display: inline-flex; margin-bottom: 14px; }
  .filters:not([open]) { margin-bottom: 14px; }
  .page-head .lede { font-size: 0.98rem; }
}

@media (max-width: 480px) {
  .donut-chart { grid-template-columns: 112px 1fr; gap: 14px; }
  .donut-figure { width: 112px; height: 112px; }
  .month-facts { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Detalhe do lead: a linha percorrida até aqui. */
.lead-route { --rail: 8px; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 22px; padding: 0; position: relative; max-width: 44rem; }
.lead-route li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 0.85rem; color: var(--muted); font-weight: 550; }
.lead-route li::before { content: ""; position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 5px solid var(--route); background: var(--surface); }
.lead-route li::after { content: ""; position: absolute; left: 12px; right: -12px; top: calc(12px - var(--rail) / 2); height: var(--rail); background: var(--route); opacity: 0.3; }
.lead-route li:last-child::after { display: none; }
.lead-route .is-passed::after { opacity: 1; }
.lead-route .is-passed::before { background: var(--route); }
.lead-route .is-current { color: var(--ink); font-weight: 700; }
.lead-route .is-current::before { border-width: 8px; }
.lead-route .is-current::after { background: var(--line-strong); opacity: 1; }
.lead-route .is-ahead::before { border-color: var(--line-strong); }
.lead-route .is-ahead::after { background: var(--line-strong); opacity: 1; }
.lead-route.is-stopped li::before { border-color: var(--l-discarded); }
.lead-route.is-stopped li::after { background: var(--l-discarded); opacity: 0.35; }
