/* SIL — design system. CSS3 puro, sem framework e sem build.
   Mesma linguagem visual do Desiree Closers: preto profundo, texto creme, dourado
   como acento (não como fundo), cartões discretos com fio dourado e Inter encorpada.
   Tema escuro é o padrão; o claro troca só os tokens em :root[data-theme="light"]. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/inter-latin.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/playfair-display-latin.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #050505;
  --sidebar: #070707;
  --surface: #0d0d0d;
  --surface-2: #111111;
  --surface-3: #161616;
  --column: #0a0a0a;
  --accent-soft: #16130d;
  --accent-deep: #1c160b;
  --text: #f8f6f1;
  --text-2: #d8d3ca;
  --dim: #b7b2a8;
  --muted: #a39e95;
  --faint: #6b665f;
  --gold: #d6a84b;
  --gold-2: #e2b34f;
  --gold-light: #f1cf82;
  --gold-deep: #aa681e;
  --gold-grad: linear-gradient(135deg, #f1cf82 0%, #d6a84b 52%, #aa681e 100%);
  --on-gold: #15100a;
  --gold-tint: rgba(214, 168, 75, .08);
  --gold-tint-2: rgba(214, 168, 75, .15);
  --line: rgba(214, 168, 75, .18);
  --line-strong: rgba(214, 168, 75, .4);
  --hair: rgba(255, 255, 255, .075);
  --hair-2: rgba(255, 255, 255, .12);
  --ok: #48b37f;
  --ok-tint: rgba(72, 179, 127, .12);
  --bad: #ec8f82;
  --bad-tint: rgba(236, 143, 130, .1);
  --warn: #e2b34f;
  --warn-tint: rgba(226, 179, 79, .12);
  --info: #8fb3e8;
  --info-tint: rgba(143, 179, 232, .1);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --shadow-pop: 0 30px 90px rgba(0, 0, 0, .7);
  --glow: radial-gradient(900px 520px at 88% -8%, rgba(214, 168, 75, .07), transparent 60%),
          radial-gradient(700px 480px at -10% 110%, rgba(214, 168, 75, .04), transparent 60%);
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Inter", system-ui, "Segoe UI", Roboto, Arial, sans-serif;

  /* nomes antigos, ainda usados em estilos inline de app.js */
  --panel: var(--surface);
  --card: var(--surface-2);
  --hover: var(--surface-3);
  --gold-dark: var(--gold-deep);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2efe9;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f4ee;
  --surface-3: #efeae1;
  --column: #f7f4ee;
  --accent-soft: #fbf4e3;
  --accent-deep: #fbf2dd;
  --text: #14110d;
  --text-2: #2e2a24;
  --dim: #514a42;
  --muted: #6b645a;
  --faint: #8a8279;
  --gold: #9a761a;
  --gold-2: #8a6a10;
  --gold-light: #7a5d0c;
  --gold-deep: #8a5314;
  --gold-grad: linear-gradient(135deg, #b8912a 0%, #9a761a 52%, #8a5314 100%);
  --on-gold: #ffffff;
  --gold-tint: rgba(154, 118, 26, .08);
  --gold-tint-2: rgba(154, 118, 26, .14);
  --line: rgba(154, 118, 26, .22);
  --line-strong: rgba(154, 118, 26, .45);
  --hair: rgba(23, 19, 16, .09);
  --hair-2: rgba(23, 19, 16, .15);
  --ok: #1f7a55;
  --ok-tint: rgba(31, 122, 85, .1);
  --bad: #b03a27;
  --bad-tint: rgba(176, 58, 39, .08);
  --warn: #8a6a10;
  --warn-tint: rgba(138, 106, 16, .1);
  --info: #2f5f9e;
  --info-tint: rgba(47, 95, 158, .08);
  --shadow: 0 14px 40px rgba(23, 19, 16, .07);
  --shadow-pop: 0 30px 90px rgba(23, 19, 16, .22);
  --glow: radial-gradient(900px 520px at 88% -8%, rgba(154, 118, 26, .07), transparent 60%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { background: var(--glow), var(--bg); background-attachment: fixed; min-height: 100vh; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
code { font-size: .92em; background: var(--surface-3); border: 1px solid var(--hair); border-radius: 5px; padding: 1px 5px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────── Login
   Tela aprovada (22/09/2026): herói à esquerda, formulário à direita. Sempre escura,
   independente do tema escolhido lá dentro. */
.login {
  --text: #f8f6f1; --muted: #a39e95; --gold: #d6a84b; --gold-light: #f1cf82;
  color-scheme: dark;
  min-height: 100vh;
  background: #050505;
  color: #f8f6f1;
  display: grid;
  place-items: center;
  padding: 28px clamp(22px, 4vw, 64px) 34px;
}

.login-grid {
  width: 100%;
  max-width: 1170px;
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 74px);
  align-items: center;
  min-height: min(720px, calc(100svh - 64px));
}

.login-hero {
  min-height: min(650px, calc(100svh - 100px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid rgba(214, 168, 75, .22);
  border-radius: 22px;
  background: radial-gradient(circle at 90% 5%, rgba(214, 168, 75, .15), transparent 42%),
              linear-gradient(155deg, #14110b 0%, #0b0b0b 51%, #080808 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 28px 80px rgba(0, 0, 0, .32);
}

.login-hero::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -210px;
  bottom: -215px;
  border: 1px solid rgba(214, 168, 75, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 78px rgba(214, 168, 75, .025), 0 0 0 156px rgba(214, 168, 75, .018);
  pointer-events: none;
}

.login-hero > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 16px; }
.login-brand svg { width: 56px; height: 56px; filter: drop-shadow(0 0 18px rgba(214, 168, 75, .22)); }
.login-brand strong { display: block; font: 800 1.65rem/1 var(--sans); color: #f8f6f1; letter-spacing: .08em; }
.login-brand span { display: block; margin-top: 6px; font-size: .66rem; font-weight: 700; letter-spacing: .2em; color: #d6a84b; }
.login-hero-copy { max-width: 590px; padding: 50px 0; }
.login .eyebrow { font-size: .72rem; letter-spacing: .23em; color: #d6a84b; }

.login-hero-copy h1 {
  margin: 20px 0 22px;
  font: 800 clamp(2.5rem, 4vw, 3.6rem)/1.08 var(--sans);
  letter-spacing: -.01em;
  color: #b8961e;
}

.login-hero-copy h1 em { font-style: normal; color: #f1cf82; }
.login-hero-copy p { max-width: 370px; margin: 0; font-size: 1rem; line-height: 1.7; color: #b7b2a8; }
.login-hero-foot { display: flex; align-items: center; gap: 16px; }
.login-line { display: block; width: 48px; height: 1px; background: #d6a84b; flex: none; }
.login-hero-foot span:last-child { font-size: .66rem; font-weight: 700; letter-spacing: .15em; color: #8f8a82; }

.login-intro { margin: 0 0 26px; }
.login-intro h2 { margin: 11px 0 8px; font: 800 clamp(1.8rem, 2.5vw, 2.4rem)/1.15 var(--sans); letter-spacing: -.03em; color: #b8961e; }
.login-intro p { margin: 0; font-size: .94rem; line-height: 1.6; color: #a39e95; }

.login-form {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid rgba(214, 168, 75, .22);
  border-radius: 18px;
  background: linear-gradient(180deg, #101010, #0b0b0b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 22px 55px rgba(0, 0, 0, .2);
}

.login-form label.rotulo { display: block; margin: 0 0 7px; color: #d8d3ca; font-size: .84rem; font-weight: 650; }
.login-form .campo-login { margin-bottom: 18px; }

.login-form input[type="text"], .login-form input[type="password"], .login-form input[type="date"] {
  color-scheme: dark;
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, .16);
  color: #f8f6f1;
  font-size: .92rem;
  padding: 0 14px;
  transition: border-color .15s, box-shadow .15s;
}

.login-form input::placeholder { color: #79746e; opacity: 1; }
.login-form input:focus { outline: none; border-color: #d6a84b; box-shadow: 0 0 0 3px rgba(214, 168, 75, .17); }
.senha-wrap { position: relative; }
.senha-wrap input { padding-right: 48px !important; }

.ver-senha {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #8f8a82;
  border-radius: 0 10px 10px 0;
}

.ver-senha:hover { color: #f1cf82; }
.ver-senha svg { width: 17px; height: 17px; }

.check { display: flex; align-items: center; gap: 9px; margin: 4px 0 22px; color: #b7b2a8; font-size: .82rem; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: #d6a84b; margin: 0; }

.btn-login {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f1cf82 0%, #d6a84b 52%, #aa681e 100%);
  color: #15100a;
  font-size: .9rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(214, 168, 75, .18);
  transition: filter .15s, transform .15s, box-shadow .15s;
}

.btn-login:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(214, 168, 75, .25); }
.btn-login:disabled { opacity: .6; cursor: progress; transform: none; }
.login .msg { margin: 14px 0 0; min-height: 1.2em; font-size: .84rem; color: #b7b2a8; text-align: center; }
.login .msg.erro { color: #f2a397; }
.login .msg.ok { color: #9ad7b3; line-height: 1.55; }
.login-copy { margin: 22px 0 0; text-align: center; font-size: .72rem; letter-spacing: .04em; color: #8f8a82; }

/* A mesma tela serve para entrar, criar a senha pessoal e recuperar o acesso:
   só o bloco do modo atual (data-modo em #tela-login) aparece. */
.login [data-so] { display: none; }
.login[data-modo="login"] [data-so="login"],
.login[data-modo="senha"] [data-so="senha"],
.login[data-modo="recuperar"] [data-so="recuperar"] { display: block; }

.login-link {
  display: block;
  margin: 14px auto 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: #d6a84b;
  font-size: .82rem;
  font-weight: 600;
}

.login-link:hover { color: #f1cf82; text-decoration: underline; }
.login-dica { margin: -6px 0 18px; font-size: .76rem; line-height: 1.5; color: #8f8a82; }

/* ─────────────────────────────────────────────── Estrutura do app */
.app { min-height: 100vh; }

/* Menu lateral em botões grandes (padrão pedido pelo usuário em 22/09/2026):
   cartão da marca, cartão de quem está logado, chave de tema, rótulo de seção com
   ponto dourado e cada módulo como um botão com ícone em quadrado dourado e seta. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 22px 16px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.brand-card, .user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent-deep) 0%, var(--surface) 62%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 26px rgba(0, 0, 0, .22);
  color: var(--text);
}

.brand-card:hover { color: var(--text); border-color: var(--gold); }

.brand-ico {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--gold-grad);
  box-shadow: 0 6px 18px rgba(214, 168, 75, .22);
}

.brand-ico svg { width: 32px; height: 32px; fill: #2a1f08; }
.brand-txt b { display: block; font-size: 18px; font-weight: 800; letter-spacing: .1em; line-height: 1.1; }
.brand-txt small { display: block; margin-top: 5px; font-size: 8.5px; font-weight: 700; line-height: 1.4; letter-spacing: .13em; text-transform: uppercase; color: var(--gold-light); }

.user-card .avatar { width: 40px; height: 40px; font-size: 12.5px; box-shadow: 0 0 0 3px var(--gold-tint-2); }
.user-txt { min-width: 0; }
.user-txt b { display: block; font-size: 14px; font-weight: 700; color: var(--gold-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-txt small { display: block; margin-top: 3px; font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tema-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 6px 18px 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tema-toggle:hover { border-color: var(--gold); }
.chave { display: inline-flex; align-items: center; gap: 7px; }
.chave .sol { width: 16px; height: 16px; stroke: var(--gold-2); fill: none; stroke-width: 2; stroke-linecap: round; }
.trilho-chave { position: relative; width: 30px; height: 16px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--hair-2); }
.trilho-chave i { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); transition: transform .18s; }
:root[data-theme="dark"] .trilho-chave i { transform: translateX(14px); background: var(--gold-light); }

.nav-group { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.nav-label { display: flex; align-items: center; gap: 8px; margin: 0 0 2px 4px; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.nav-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint-2); flex: none; }
.nav-list { display: flex; flex-direction: column; gap: 7px; }

.nav-list a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-deep) 70%, var(--surface)) 0%, var(--surface) 70%);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 700;
  transition: border-color .15s, background .15s, color .15s, transform .15s, box-shadow .15s;
}

.nav-ico {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--gold-tint-2);
  color: var(--gold-light);
  transition: background .15s, color .15s;
}

.nav-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-list a .chev { width: 14px; height: 14px; flex: none; stroke: var(--muted); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s, stroke .15s; }

.nav-list a:hover { border-color: var(--line-strong); color: var(--text); transform: translateX(2px); }
.nav-list a:hover .nav-ico { background: var(--gold-grad); color: #2a1f08; border-color: transparent; }
.nav-list a:hover .chev { stroke: var(--gold-light); transform: translateX(2px); }

.nav-list a.active {
  border-color: var(--gold);
  background: linear-gradient(90deg, var(--gold-tint-2) 0%, var(--accent-soft) 75%);
  color: var(--gold-light);
  box-shadow: 0 0 0 3px var(--gold-tint), 0 10px 24px rgba(0, 0, 0, .25);
}

.nav-list a.active .nav-ico { background: var(--gold-grad); color: #2a1f08; border-color: transparent; box-shadow: 0 4px 12px rgba(214, 168, 75, .25); }
.nav-list a.active .chev { stroke: var(--gold-light); }

.side-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }

.btn-sair {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--gold-light);
  font-size: 13.5px;
  font-weight: 700;
  transition: border-color .15s, background .15s;
}

.btn-sair:hover { border-color: var(--gold); background: var(--gold-tint); }
.btn-sair-leve { min-height: 38px; border-color: var(--line); background: transparent; color: var(--dim); font-size: 12.5px; font-weight: 600; }
.versao { margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint-2); }

.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--on-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.avatar.small { width: 32px; height: 32px; font-size: 11px; }

.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  transition: background .14s, color .14s, border-color .14s;
}

.icon-btn:hover { background: var(--gold-tint); color: var(--gold-light); border-color: var(--line); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.body { margin-left: 264px; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }

/* Barra superior: seção em dourado sobre o nome da tela, busca de módulos no centro,
   chips de data/tema/usuário à direita e um fio dourado em degradê embaixo. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 74px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 30px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sidebar) 94%, transparent), color-mix(in srgb, var(--bg) 86%, transparent));
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line) 0%, var(--gold) 28%, var(--gold-light) 50%, var(--gold) 72%, var(--line) 100%);
  opacity: .6;
}

.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar-marca { display: inline-flex; align-items: flex-start; gap: 5px; line-height: 1; }
.topbar-marca b { font-size: 21px; font-weight: 800; letter-spacing: .08em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar-marca sup { margin-top: 2px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; font-size: 8px; font-weight: 800; letter-spacing: .16em; color: var(--muted); }
.topbar-sep { width: 1px; height: 30px; background: linear-gradient(180deg, transparent, var(--line-strong), transparent); }
.topbar-titulo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.topbar-titulo span { font-size: 9.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.topbar-titulo strong { font-size: 15.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }

.busca-global { position: relative; display: flex; align-items: center; flex: 0 1 380px; margin-left: auto; }
.busca-global > svg { position: absolute; left: 14px; width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; pointer-events: none; }

.busca-global input {
  width: 100%;
  height: 42px;
  padding: 0 70px 0 40px;
  border: 1px solid var(--hair-2);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.busca-global input::placeholder { color: var(--faint); }
.busca-global input::-webkit-search-cancel-button { display: none; }
.busca-global input:focus { outline: none; border-color: var(--gold); background: var(--surface-2); box-shadow: 0 0 0 3px var(--gold-tint-2); }
.busca-global kbd { position: absolute; right: 10px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--accent-soft); font: 700 10px/1.2 var(--sans); letter-spacing: .06em; color: var(--muted); pointer-events: none; }

.busca-resultados {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.busca-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-size: 13.5px; font-weight: 600; text-align: left; }
.busca-item .nav-ico { width: 28px; height: 28px; border-radius: 8px; }
.busca-item .nav-ico svg { width: 15px; height: 15px; }
.busca-item small { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.busca-item.ativo, .busca-item:hover { background: var(--gold-tint-2); color: var(--gold-light); }
.busca-item.ativo .nav-ico { background: var(--gold-grad); color: #2a1f08; border-color: transparent; }
.busca-nada { padding: 14px; font-size: 13px; color: var(--muted); text-align: center; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.chip svg { width: 15px; height: 15px; flex: none; stroke: var(--gold); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip-tema { cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.chip-tema:hover { border-color: var(--gold); background: var(--gold-tint); color: var(--gold-light); }
.chip-tema .sol { display: none; }
:root[data-theme="light"] .chip-tema .sol { display: block; }
:root[data-theme="light"] .chip-tema .lua { display: none; }
.chip-usuario { gap: 10px; padding: 0 16px 0 4px; border-color: var(--line-strong); }
.chip-usuario .avatar { width: 34px; height: 34px; }
.chip-usuario-txt b { display: block; max-width: 150px; font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.chip-usuario-txt small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); line-height: 1.3; }
.menu-toggle { display: none; }

.main { width: 100%; max-width: 1640px; margin: 0 auto; padding: 32px 34px 40px; flex: 1; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin: 10px 0 0; font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.page-heading h1 .asterisco { color: var(--gold); font-weight: 300; margin-left: 8px; }
.page-heading p.contexto { margin: 9px 0 0; font-size: 14px; color: var(--muted); max-width: 720px; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.footer { display: flex; justify-content: space-between; gap: 16px; padding: 0 34px 22px; font-size: 11px; color: var(--faint); }
.footer .live { display: inline-flex; align-items: center; gap: 7px; }
.footer .live-dot { margin: 0; width: 5px; height: 5px; }

.secao-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 14px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

.secao-titulo::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#conteudo > .secao-titulo:first-child, .secao-titulo.topo { margin-top: 0; }

/* ─────────────────────────────────────────────── Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: filter .15s, background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s;
}

.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; transform: none; }

.btn-gold { background: var(--gold-grad); color: var(--on-gold); box-shadow: 0 8px 24px rgba(214, 168, 75, .16); }
.btn-gold:hover { filter: brightness(1.07); color: var(--on-gold); box-shadow: 0 10px 28px rgba(214, 168, 75, .24); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--gold-light); }
.btn-ghost:hover { background: var(--gold-tint); border-color: var(--gold); color: var(--gold-light); }
.btn-quiet { background: transparent; border-color: var(--hair-2); color: var(--dim); }
.btn-quiet:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.btn-danger:hover { background: var(--bad-tint); }
.btn-sm { min-height: 34px; padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

/* ─────────────────────────────────────────────── Cartões de indicador */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.kpi {
  position: relative;
  min-width: 0;
  padding: 19px 20px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--bg)));
  box-shadow: var(--shadow);
}

.kpi .topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi .rotulo { font-size: 12.5px; color: var(--muted); }

.kpi .marca {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--gold);
}

.kpi .marca i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kpi .valor { display: block; margin: 14px 0 12px; font-size: 27px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .nota { font-size: 11.5px; color: var(--muted); }
.kpi.verde .marca { color: var(--ok); background: var(--ok-tint); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.kpi.azul .marca { color: var(--info); background: var(--info-tint); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.kpi.vermelho .marca { color: var(--bad); background: var(--bad-tint); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.kpi.vermelho .valor { color: var(--bad); }
.kpi.destaque { background: radial-gradient(circle at 100% 0%, var(--gold-tint-2), transparent 55%), var(--accent-soft); border-color: var(--line-strong); }
.kpi.destaque .valor { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi.destaque .marca { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }

/* ─────────────────────────────────────────────── Painéis */
.painel {
  position: relative;
  margin-bottom: 18px;
  padding: 22px 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
}

.painel h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.painel .nome { font-weight: 600; font-size: 14px; }
.painel .meta, .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.painel.acao { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: radial-gradient(circle at 100% 0%, var(--gold-tint), transparent 50%), var(--surface); }
.painel.acao .cresce { flex: 1; min-width: 220px; }
.painel.acao input { background: var(--surface-2); border: 1px solid var(--hair-2); border-radius: 10px; color: var(--text); padding: 9px 12px; min-height: 40px; }
.painel.acao input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint-2); }
.painel.aviso-suave { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-tint); box-shadow: none; }
.painel-cabeca { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.painel-cabeca h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.painel-cabeca p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); }

.linhas { display: flex; flex-direction: column; gap: 9px; }

.linha {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hair);
  border-radius: 11px;
  background: var(--surface-2);
  transition: border-color .14s;
}

.linha:hover { border-color: var(--line); }
.linha .cresce { flex: 1; min-width: 0; }
.linha .nome { font-weight: 600; font-size: 13.5px; }
.linha .meta { margin-top: 2px; }
.linha.feita .nome { text-decoration: line-through; color: var(--muted); }
/* Select compacto dentro da linha (ex.: situação do processo da empresa). */
.campo-inline { width: auto; min-width: 168px; padding: 8px 11px; font-size: 12.5px; }

/* Fechamento da proposta: o total à direita, com a régua dourada do lado. */
.total-proposta {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 14px;
  margin-top: 14px; padding: 16px 18px; border: 1px solid var(--hair);
  border-right: 3px solid var(--gold); border-radius: 11px; background: var(--surface-2);
}
.total-proposta span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.total-proposta b { font-size: 1.5rem; font-weight: 700; color: var(--gold-light); }

.barra { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.barra > i { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad); }

/* ─────────────────────────────────────────────── Filtros e formulários */
.filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filtros .campo { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.filtros .btn { min-height: 40px; }
.filtros label, .campo-form label { font-size: 12px; font-weight: 600; color: var(--dim); }

.filtros input, .filtros select, .campo-form input, .campo-form select, .campo-form textarea, td select, .sel-papel, .busca input, .sel-toolbar {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--hair-2);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}

.filtros input, .filtros select { min-width: 160px; }
.filtros input::placeholder, .campo-form input::placeholder, .campo-form textarea::placeholder, .busca input::placeholder { color: var(--faint); }

.filtros input:focus, .filtros select:focus, .campo-form input:focus, .campo-form select:focus, .campo-form textarea:focus,
td select:focus, .busca input:focus, .sel-toolbar:focus, .chat-envio textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-tint-2);
}

select option { background: var(--surface-2); color: var(--text); }
input[type="date"], input[type="datetime-local"] { color-scheme: inherit; }
td select, .sel-papel { min-height: 32px; padding: 4px 9px; font-size: 12.5px; }

/* ─────────────────────────────────────────────── Tabelas */
.tabela-wrap {
  overflow: auto;
  max-height: calc(100vh - 300px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 18px;
  text-align: left;
  white-space: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--hair);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

tbody td { padding: 14px 18px; border-bottom: 1px solid var(--hair); color: var(--text-2); vertical-align: middle; }
tbody tr:hover td { background: var(--gold-tint); }
tbody tr:last-child td { border-bottom: 0; }
td.dir { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.forte { font-weight: 600; color: var(--text); }
td .sub { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--muted); }
td.valor-ouro { color: var(--gold-light); font-weight: 650; }
tr.clicavel { cursor: pointer; }

/* ─────────────────────────────────────────────── Etiquetas */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-transform: capitalize;
}

.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.tag.cinza { color: var(--muted); background: var(--surface-3); border-color: var(--hair); }
.tag.ouro { color: var(--gold-light); background: var(--gold-tint-2); border-color: var(--line); }
.tag.verde { color: var(--ok); background: var(--ok-tint); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.tag.vermelha { color: var(--bad); background: var(--bad-tint); border-color: color-mix(in srgb, var(--bad) 26%, transparent); }
.tag.amarela { color: var(--warn); background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.tag.azul { color: var(--info); background: var(--info-tint); border-color: color-mix(in srgb, var(--info) 26%, transparent); }
.contagem { display: inline-grid; place-items: center; min-width: 24px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────── Estados */
.vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 46px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.vazio::before {
  content: "";
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6a84b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 21px no-repeat;
}

.vazio b { color: var(--text); font-size: 14.5px; font-weight: 650; }
.vazio br { display: none; }
.vazio.mini { padding: 22px 12px; border-style: dashed; background: transparent; font-size: 12px; }
.vazio.mini::before { display: none; }

.carregando { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 22px 0; }
.carregando::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: gira .8s linear infinite; flex: none; }

.aviso {
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  border-radius: 11px;
  background: var(--bad-tint);
  color: var(--bad);
  font-size: 13px;
}

/* ─────────────────────────────────────────────── Avisos flutuantes */
#toasts { position: fixed; right: 24px; bottom: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); pointer-events: none; }

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 380px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow-pop);
  animation: entra .2s ease-out;
}

.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.toast.ruim { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.toast.ruim::before { background: var(--bad); }
.toast.sai { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }

/* ─────────────────────────────────────────────── Dashboard */
.banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 220px;
  margin-bottom: 24px;
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: radial-gradient(circle at 85% 20%, var(--gold-tint-2), transparent 42%),
              linear-gradient(180deg, color-mix(in srgb, var(--surface) 80%, var(--accent-soft)), var(--surface));
}

.banner > div:first-child { position: relative; z-index: 1; max-width: 58%; }
.banner-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--gold-tint-2); color: var(--gold-light); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.banner-pill svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.banner h2 { margin: 14px 0 12px; font-size: 30px; line-height: 1.14; font-weight: 800; letter-spacing: -.03em; }
.banner p { margin: 0; max-width: 470px; font-size: 13.5px; line-height: 1.75; color: var(--dim); }
.banner-link { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--gold); }
.banner-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.banner-art { position: absolute; right: 44px; top: 50%; width: 270px; height: 270px; transform: translateY(-50%); pointer-events: none; }
.banner-orbit { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 50%; opacity: .7; }
.banner-orbit::before, .banner-orbit::after { content: ""; position: absolute; border: 1px solid color-mix(in srgb, var(--gold) 20%, transparent); border-radius: 50%; inset: 34px; }
.banner-orbit::after { inset: 68px; }
.banner-mono { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.banner-mono b { font: 700 64px/1 "Playfair Display", Georgia, serif; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .02em; }
.banner-mono span { display: block; margin-top: 8px; font-size: 8px; font-weight: 700; letter-spacing: .34em; color: var(--muted); }
.banner-no { position: absolute; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: var(--accent-soft); color: var(--gold-2); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.banner-no svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.banner-no.a { top: 40px; left: 6px; transform: rotate(-9deg); }
.banner-no.b { top: 58px; right: -6px; transform: rotate(10deg); }
.banner-no.c { bottom: 40px; left: 44px; transform: rotate(-10deg); }

.grade-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.grade-2 > * { min-width: 0; }
/* Dois painéis lado a lado (ex.: receitas x despesas do DRE). */
.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.duas-colunas > * { min-width: 0; }
@media (max-width: 900px) { .duas-colunas { grid-template-columns: 1fr; } }

.estagios { display: grid; gap: 14px; }
.estagio-linha { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; align-items: center; gap: 16px; font-size: 13px; }
.estagio-linha .nome-est { display: flex; align-items: center; gap: 9px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.estagio-linha .trilho { height: 6px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.estagio-linha .trilho i { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad); min-width: 4px; }
.estagio-linha .num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; white-space: nowrap; }
.estagio-linha .num b { color: var(--text); font-size: 14px; margin-right: 6px; }

.cotacao { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--hair); }
.cotacao:last-child { border-bottom: 0; padding-bottom: 0; }
.cotacao:first-of-type { padding-top: 4px; }
.cotacao span { font-size: 12.5px; color: var(--muted); }
.cotacao span b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 2px; }
.cotacao strong { font-size: 18px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--gold-light); }

/* ─────────────────────────────────────────────── CRM */
.crm-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.abas { display: flex; flex-wrap: wrap; gap: 4px; }

.aba {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.aba:hover { background: var(--gold-tint); color: var(--text); }
.aba.ativa { background: var(--gold-tint-2); border-color: var(--line); color: var(--gold-light); }
.aba svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.crm-ferramentas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.busca { position: relative; display: flex; align-items: center; }
.busca svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--muted); stroke: currentColor; fill: none; stroke-width: 1.8; pointer-events: none; }
.busca input { width: 240px; padding-left: 36px; }
.sel-toolbar { min-width: 150px; }
.segmento { display: inline-flex; padding: 3px; border: 1px solid var(--hair-2); border-radius: 10px; background: var(--surface-2); }
.segmento .aba { min-height: 32px; padding: 5px 11px; }
.crm-resumo { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: -4px 2px 14px; font-size: 12.5px; color: var(--muted); }
.crm-resumo b { color: var(--gold-light); font-weight: 650; }

.kanban {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.coluna {
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 290px);
  min-height: 300px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--column);
  transition: border-color .14s, box-shadow .14s, background .14s;
}

.coluna > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 13px 4px; }
.coluna h3 { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.coluna h3 span.txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coluna .cabeca-dir { display: flex; align-items: center; gap: 6px; }
.coluna .add { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--hair); border-radius: 7px; background: none; color: var(--muted); }
.coluna .add:hover { color: var(--gold-light); border-color: var(--line); background: var(--gold-tint); }
.coluna .add svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.bolinha { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.coluna .total { padding: 0 13px 11px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--hair); }
.cards { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.coluna.alvo { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint-2); background: var(--accent-soft); }

.card-op {
  display: block;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: grab;
  transition: border-color .14s, transform .14s, box-shadow .14s, background .14s;
}

.card-op:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 0, 0, .28); }
.card-op.arrastando { opacity: .4; cursor: grabbing; }
.card-op .linha1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-op .titulo { font-weight: 650; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.card-op .num-op { flex: none; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.card-op .cliente { margin-top: 5px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.card-op .rodape { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--hair); }
.card-op .valor { font-size: 13px; font-weight: 700; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.card-op .data { font-size: 11px; color: var(--faint); }
.temp { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.temp::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cor, var(--gold)); }
.card-op .origem { display: inline-flex; margin-top: 8px; padding: 2px 7px; border-radius: 5px; background: var(--gold-tint-2); color: var(--gold-light); font-size: 10px; font-weight: 700; letter-spacing: .06em; }

/* ─────────────────────────────────────────────── Painel lateral (detalhe) */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(640px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.drawer[open] { display: flex; flex-direction: column; animation: desliza .22s ease-out; }
.drawer > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 9px 0 0; font-size: 23px; line-height: 1.2; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 11.5px; color: var(--dim); }
.pill.ouro { color: var(--gold-light); background: var(--gold-tint-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 28px 28px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--surface); }

.trilha { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

.passo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--hair-2);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.passo i { width: 7px; height: 7px; border-radius: 50%; background: var(--cor, var(--faint)); flex: none; }
.passo:hover { border-color: var(--line-strong); color: var(--text); }
.passo.feito { color: var(--dim); border-color: var(--line); }
.passo.atual { color: var(--on-gold); background: var(--gold-grad); border-color: transparent; }
.passo.atual i { background: var(--on-gold); }

.bloco { margin-bottom: 16px; padding: 18px; border: 1px solid var(--hair); border-radius: 12px; background: var(--surface-2); }
.bloco > h4 { margin: 0 0 14px; font-size: 13.5px; font-weight: 700; }
.bloco > h4 small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.grade-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grade-form .inteiro { grid-column: 1 / -1; }
.campo-form { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.campo-form input, .campo-form select, .campo-form textarea { width: 100%; background: var(--surface); }
.campo-form textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 14px; }
.evento { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 14px; }
.evento::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1px; background: var(--hair-2); }
.evento:last-child::before { display: none; }
.evento .ponto { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--accent-soft); }
.evento .ponto i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.evento.etapa .ponto i { background: var(--info); }
.evento .quem { font-size: 12px; color: var(--muted); }
.evento .quem b { color: var(--text-2); font-weight: 600; }
.evento .texto { margin-top: 3px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.compositor { display: grid; gap: 10px; }
.compositor .linha-acoes { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ─────────────────────────────────────────────── Chat de IA e Workspace */
.chat-area { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }

.chat-lista {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.chat-lista button {
  display: block;
  width: 100%;
  margin-bottom: 3px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-lista button:hover { background: var(--gold-tint); color: var(--text); }
.chat-lista button.ativo { background: var(--gold-tint-2); border-color: var(--line); color: var(--gold-light); }

.ws-entry { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.ws-entry.ativo { background: var(--gold-tint-2); }
.chat-lista .ws-entry-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; margin: 0; }
.ws-entry-name svg { width: 16px; height: 16px; flex: none; }
.chat-lista .ws-entry .icon-btn { width: 28px; height: 28px; flex: none; margin: 0; padding: 4px; text-align: center; }
.ws-entry .icon-btn:not(:hover) { opacity: .55; }
.ws-sheet-wrap { max-height: 52vh; margin-top: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.ws-sheet { width: 100%; border-collapse: collapse; }
.ws-sheet th, .ws-sheet td { min-width: 140px; padding: 4px; border: 1px solid var(--hair); }
.ws-sheet th:last-child, .ws-sheet td:last-child { min-width: 40px; width: 40px; }
.ws-sheet input { width: 100%; min-width: 120px; padding: 8px; border: 1px solid transparent; border-radius: 4px; background: var(--surface-2); color: var(--text); }
.ws-sheet input:focus { outline: 2px solid var(--gold); }
.ws-sheet-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.chat-painel { display: flex; flex-direction: column; min-height: 440px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chat-msgs { flex: 1; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 340px); padding: 18px; overflow-y: auto; }
.chat-msgs h3 { font-size: 16px; }
.chat-msgs textarea { background: var(--surface-2) !important; border-color: var(--hair-2) !important; border-radius: 10px !important; }
.bolha { max-width: 78%; padding: 11px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.bolha.eu { align-self: flex-end; background: var(--gold-grad); color: var(--on-gold); border-bottom-right-radius: 4px; }
.bolha.ia { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--hair); border-bottom-left-radius: 4px; }
.bolha .marca { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.chat-envio { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--hair); }
.chat-envio textarea { flex: 1; min-height: 44px; padding: 10px 12px; border: 1px solid var(--hair-2); border-radius: 10px; background: var(--surface-2); color: var(--text); resize: vertical; }

/* ─────────────────────────────────────────────── Tarefas longas */
.job { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 11px; background: var(--surface-2); }
.job .cresce { flex: 1; min-width: 0; }
.job .nome { font-weight: 600; font-size: 13.5px; }
.girando { display: inline-block; width: 14px; height: 14px; flex: none; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: gira .8s linear infinite; }

@keyframes gira { to { transform: rotate(360deg); } }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes desliza { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─────────────────────────────────────────────── Telas médias e celular */
@media (max-width: 1180px) {
  .grade-2 { grid-template-columns: 1fr; }
  .banner-art { opacity: .35; right: -40px; }
  .banner > div:first-child { max-width: 100%; }
}

@media (max-width: 960px) {
  .login-grid { grid-template-columns: 1fr; min-height: 0; gap: 28px; }
  .login-hero { min-height: 340px; padding: 30px; }
  .login-hero-copy { padding: 32px 0; }
  .login-hero-copy h1 { font-size: clamp(2.25rem, 7vw, 3.2rem); }

  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .app.menu-aberto .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .sidebar-fundo { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .5); }
  .body { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; height: 66px; }
  .topbar-marca, .topbar-sep, .chip-data, .chip-usuario-txt, .busca-global kbd { display: none; }
  .busca-global { flex: 1 1 auto; margin-left: 0; }
  .busca-global input { padding-right: 12px; }
  .chip-usuario { padding: 0 4px; }
  .chip-tema span { display: none; }
  .chip-tema { padding: 0 12px; }
  .main { padding: 22px 16px 32px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 16px; }
  .page-heading h1 { font-size: 25px; }
  .footer { padding: 0 16px 18px; }
  .chat-area { grid-template-columns: 1fr; }
  .grade-form { grid-template-columns: 1fr; }
  .busca input { width: 100%; }
  .busca, .crm-ferramentas, .crm-ferramentas > * { width: 100%; }
  .crm-ferramentas .segmento { width: auto; }
  .abas { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .coluna { flex-basis: 250px; max-height: none; }
  .estagio-linha { grid-template-columns: 1fr auto; }
  .estagio-linha .trilho { grid-column: 1 / -1; grid-row: 2; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 18px; padding-right: 18px; }
  .filtros .campo { flex: 1 1 100%; }
  .filtros input, .filtros select { min-width: 0 !important; width: 100%; }
  .kpi .valor { font-size: 23px; }
}

@media (max-width: 520px) {
  .login { padding: 18px 16px 34px; }
  .login-hero { min-height: 320px; padding: 24px; border-radius: 16px; }
  .login-brand svg { width: 46px; height: 46px; }
  .login-brand span { font-size: .55rem; letter-spacing: .13em; }
  .login-hero-copy h1 { font-size: 2.2rem; }
  .login-form { padding: 22px; }
  .banner { padding: 24px 20px; min-height: 0; }
  .banner h2 { font-size: 24px; }
  .banner-art { display: none; }
  .topbar-titulo { display: none; }
}

@media (min-width: 961px) and (max-width: 1260px) {
  .chip-data { display: none; }
  .busca-global { flex-basis: 280px; }
}

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

/* ─────────────────────────────────────────────── CRM: card e detalhe como no SIL antigo */
.card-topo { display: flex; align-items: flex-start; gap: 9px; }
.card-topo .avatar.small { width: 26px; height: 26px; font-size: 9.5px; flex: none; }
.card-meio { min-width: 0; flex: 1; }
.card-etapa { display: flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-etapa i { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.card-op .card-meio .titulo { margin-top: 3px; font-size: 12.5px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.card-op .cliente { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11px; letter-spacing: .02em; color: var(--muted); }
.card-op .cliente svg { width: 13px; height: 13px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; }
.card-op .rodape { gap: 8px; }
.card-op .rodape .temp { width: 8px; height: 8px; padding: 0; border-radius: 50%; background: var(--cor, var(--gold)); flex: none; }
.card-op .rodape .temp::before { display: none; }
.card-op .rodape .data { margin-left: auto; }

.faixa-dados { display: flex; flex-wrap: wrap; border: 1px solid var(--hair); border-radius: 11px; overflow: hidden; background: var(--surface-2); }
.faixa-dados > div { flex: 1 1 130px; padding: 9px 13px; border-right: 1px solid var(--hair); }
.faixa-dados > div:last-child { border-right: 0; }
.faixa-dados span { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.faixa-dados b { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.faixa-dados b.ouro { color: var(--gold-light); font-size: 14px; }

.abas-drawer { margin: 18px 0 14px; border-bottom: 1px solid var(--hair); padding-bottom: 8px; }
.grade-dados { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grade-dados > div { min-width: 0; }
.grade-dados span { display: block; font-size: 11px; color: var(--muted); }
.grade-dados b { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }

.btn-link { border: 0; background: none; padding: 0 2px; color: var(--gold); font-size: 11.5px; font-weight: 600; }
.btn-link:hover { color: var(--gold-light); text-decoration: underline; }
.acoes-ativ { margin-left: 8px; display: inline-flex; gap: 8px; }
.evento .texto { margin-top: 4px; }

@media (max-width: 960px) { .grade-dados { grid-template-columns: 1fr; } .faixa-dados > div { flex-basis: 50%; } }
