/* Painel admin Dr. Closer — redesign 2026-07 (referência: Stripe/Linear/Vercel).
   Shell com sidebar fixa, densidade controlada, hierarquia tipográfica clara.
   CSP-safe: sem fontes externas, sem inline. */
:root {
  /* MESMA paleta do CRM/mensageiro aprovado — Dr. Closer coerente de ponta a
     ponta (landing, app do cliente e painel da plataforma). 2026-07-25. */
  --bg: #0a0a0c;
  --bg-2: #111116;
  --surface: #16161c;
  --surface-2: #1d1d26;
  --border: #262630;
  --border-strong: #3a3a4a;
  --fg: #f2f3f5;
  --fg-2: #d1d5db;
  --muted: #9ca3af;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --grad: linear-gradient(120deg, #3b82f6 0%, #60a5fa 100%);
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444;
  --radius: 12px;
  --shadow: 0 10px 36px rgba(0,0,0,.38);
}
/* MESMAS FONTES DO CRM (01/08). O /admin é outra folha e ficaria em system-ui ao
   lado de um CRM em Geist — duas caras do mesmo produto, abertas na mesma tela.
   Os arquivos moram em public/app/fontes, que o estático do CRM serve na RAIZ do
   host app.* — daí `/fontes/…` e não `/app/fontes/…`. O caminho é absoluto porque
   esta folha é servida de /admin/, e relativo cairia em /admin/fontes. */
@font-face {
  font-family: 'Geist';
  src: url('/fontes/geist-variable.woff2') format('woff2-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Noto Serif';
  src: url('/fontes/noto-serif-latin.woff2') format('woff2-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  --fonte: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --fonte-titulo: 'Noto Serif', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--fg); background: var(--bg);
  font: 13.5px/1.55 var(--fonte);
  letter-spacing: -0.1px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--fonte-titulo); font-weight: 300; letter-spacing: -0.2px; }
input, select, textarea, button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.small { font-size: 12px; }
.tc { text-align: center; }
.spacer { flex: 1; }
code { font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

/* ---- marca ---- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 0 18px rgba(59,130,246,.35);
}
.brand-mark::after { content: "↗"; color: #06101f; font-size: 18px; font-weight: 900; }
.brand-name { font-size: 17px; }
.brand-name .thin { font-weight: 300; }
.brand-name .bold { font-weight: 800; }
.brand-name .grad { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.brand.small .brand-mark { width: 28px; height: 28px; }
.brand.small .brand-name { font-size: 15px; }

/* ---- login (split à la Instagram) ---- */
.login-split { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }

.login-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; padding: 40px;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(59,130,246,.16), transparent 60%),
    radial-gradient(800px 500px at 85% 90%, rgba(96,165,250,.12), transparent 60%),
    var(--bg-2);
  border-right: 1px solid var(--border);
}
.hero-title { margin: 0; font-size: 34px; line-height: 1.2; text-align: center; font-weight: 800; }
.hero-title .grad { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { margin: 0; color: var(--muted); font-size: 15px; text-align: center; }

/* cartões flutuantes (mockups CSS puros, sem imagens) */
.hero-cards { position: relative; width: 420px; height: 300px; }
.hero-card {
  position: absolute; width: 216px; border-radius: 16px; padding: 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-strong);
  box-shadow: 0 22px 60px rgba(0,0,0,.55), 0 0 40px rgba(59,130,246,.08);
  animation: hero-float 6s ease-in-out infinite alternate;
}
.hc-chat { left: 6px; top: 26px; transform: rotate(-7deg); z-index: 3; }
.hc-funil { left: 128px; top: 0; transform: rotate(2deg); z-index: 2; animation-delay: 1.3s; }
.hc-placar { left: 218px; top: 96px; transform: rotate(8deg); z-index: 4; animation-delay: 2.4s; }
@keyframes hero-float {
  from { translate: 0 0; }
  to { translate: 0 -12px; }
}
.hc-title { font-size: 12px; font-weight: 700; color: var(--fg-2); margin-bottom: 9px; }
.hc-bubble { border-radius: 11px; padding: 7px 10px; font-size: 11.5px; margin-bottom: 7px;
  max-width: 92%; }
.hc-bubble.in { background: #1b1b22; border: 1px solid var(--border); }
.hc-bubble.out { background: #1c3354; border: 1px solid #2a4a72; margin-left: auto; }
.hc-bubble.sug { border: 1px dashed var(--accent-2); color: var(--accent-2);
  background: rgba(96,165,250,.07); }
.hc-cols { display: flex; align-items: flex-end; gap: 8px; height: 74px; padding: 4px 2px; }
.hc-col { flex: 1; border-radius: 6px 6px 2px 2px; background: rgba(59,130,246,.35); }
.hc-col[data-h="1"] { height: 34%; } .hc-col[data-h="2"] { height: 55%; }
.hc-col[data-h="3"] { height: 72%; } .hc-col[data-h="4"] { height: 96%; }
.hc-col.hot { background: var(--grad); box-shadow: 0 0 14px rgba(96,165,250,.45); }
.hc-foot { font-size: 11px; color: var(--muted); margin-top: 8px; }
.hc-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 2px; }
.hc-row b { color: var(--accent-2); }
.hc-meta { height: 8px; background: var(--bg); border-radius: 5px; overflow: hidden; margin-top: 8px; }
.hc-fill { display: block; height: 100%; width: 68%; background: var(--grad); border-radius: 5px; }

.login-side { display: flex; align-items: center; justify-content: center; padding: 32px;
  background: var(--bg); }
.login-box { width: 350px; display: flex; flex-direction: column; gap: 15px; }
.login-box .brand { justify-content: center; }
.login-box input { padding: 11px 13px; border-radius: 10px; font-size: 14px; }
button.big { padding: 12px; font-size: 14.5px; border-radius: 10px; }
.login-foot { margin-top: 4px; }
/* Ativação das duas etapas (11/11/2026): mesma coluna do login. */
#twofa-passo1, #twofa-passo2 { display: flex; flex-direction: column; gap: 12px; }
#twofa-passo1.hidden, #twofa-passo2.hidden { display: none; }
.twofa-titulo { font-size: 17px; margin: 0; }
.twofa-qr { align-self: center; border-radius: 10px; }
.twofa-segredo { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; letter-spacing: .06em; word-break: break-all; user-select: all; text-align: center; }
.twofa-codigos { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; line-height: 1.7; letter-spacing: .05em; user-select: all; text-align: center; }

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

/* (legado) centralizador simples ainda usado em páginas avulsas */
.card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.login { width: 360px; display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.login .brand { justify-content: center; }

/* ---- controles ---- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
input, select {
  background: var(--surface-2); color: var(--fg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 11px; font-size: 13.5px; font-family: inherit;
}
input:focus, select:focus, button:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
button {
  background: var(--surface); color: var(--fg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 13px; cursor: pointer; font-size: 12.5px;
  font-family: inherit; transition: border-color .15s, background .15s, color .15s;
}
button:hover { border-color: var(--border-strong); color: var(--fg); }
button.primary {
  background: var(--grad); border: none; color: #06101f; font-weight: 700;
  box-shadow: 0 4px 16px rgba(59,130,246,.30);
}
button.primary:hover { filter: brightness(1.07); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: rgba(255,93,108,.35); }
button.danger:hover { background: rgba(255,93,108,.08); border-color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
button.wide { width: 100%; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.sidenav {
  border-right: 1px solid var(--border); background: var(--bg-2);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh;
}
.sidenav .brand { padding: 0 6px; }
#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; border-radius: 8px;
  padding: 8px 10px; color: var(--muted); font-size: 13px; text-align: left;
}
.nav-item svg { width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.4; flex: none; }
.nav-item:hover { background: rgba(59,130,246,.07); color: var(--fg); }
.nav-item.on { background: rgba(59,130,246,.13); color: var(--fg); font-weight: 600; }
.nav-item.on svg { stroke: var(--accent-2); }
.sidenav-foot { margin-top: auto; }

.main { min-width: 0; padding: 0 26px 40px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; gap: 10px; align-items: center; }

/* segmentado de período */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 2px; }
.seg button { border: none; background: none; padding: 5px 12px; border-radius: 7px;
  color: var(--muted); font-size: 12px; }
.seg button.on { background: var(--surface); color: var(--fg); font-weight: 600;
  box-shadow: 0 1px 6px rgba(0,0,0,.35); }

/* ---- views ---- */
.view { display: flex; flex-direction: column; gap: 16px; }

/* KPIs */

/* cards + gráficos */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-head h2, .chart-card h3 { margin: 0; font-size: 13px; font-weight: 650; }
.chart-card h3 { margin-bottom: 8px; color: var(--fg-2); }
.chart svg { width: 100%; height: auto; display: block; }
.svg-chart .grid { stroke: var(--border); stroke-width: 1; }
.svg-chart .axis { fill: var(--muted); font-size: 9.5px; }
.svg-chart .bar.c-accent { fill: var(--accent); }
.svg-chart .bar.c-cyan { fill: var(--accent-2); }
.svg-chart .bar.c-warn { fill: var(--warn); }
.legend { display: flex; gap: 14px; margin-top: 6px; }
.legend-item { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend-item::before { content: ""; width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend-item.c-accent::before { background: var(--accent); }
.legend-item.c-cyan::before { background: var(--accent-2); }
.legend-item.c-warn::before { background: var(--warn); }

/* barras horizontais (storage) */
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hbar-line { display: grid; grid-template-columns: 130px 1fr 66px; gap: 10px; align-items: center; }
.hbar-name { font-size: 12px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: var(--surface-2); border-radius: 6px; height: 9px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.hbar-val { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ---- tabelas ---- */
.toolbar { display: flex; gap: 10px; align-items: center; }
.toolbar .search { width: 280px; }
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 14px; text-align: left; white-space: nowrap; }
thead th {
  font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  position: sticky; top: 0;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
#tenants tbody tr { cursor: pointer; transition: background .12s; }
#tenants tbody tr:hover { background: rgba(59,130,246,.06); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 600; color: var(--fg); }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* status/plan badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  padding: 2px 9px; border-radius: 20px; border: 1px solid var(--border); color: var(--fg-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.badge.active::before { background: var(--ok); box-shadow: 0 0 6px rgba(63,208,138,.6); }
.badge.suspended { color: var(--bad); border-color: rgba(255,93,108,.4); }
.badge.suspended::before { background: var(--bad); }
.badge.deleted { color: var(--warn); border-color: rgba(240,180,41,.4); }
.badge.deleted::before { background: var(--warn); }
.chip { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--muted); }
.chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
/* ---- progresso do deploy ---- */
.dp-bar { height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden;
  margin: 12px 0; }
.dp-fill { display: block; height: 100%; width: 0; border-radius: 5px;
  background: var(--grad); transition: width .5s ease; }
.dp-fill.ok { background: var(--ok); }
.dp-fill.bad { background: var(--bad); }
.dp-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-step { font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); }
.dp-step.on { color: var(--ok); border-color: rgba(34,197,94,.4); }
.dp-step.now { color: var(--fg); border-color: var(--accent); }
#dp-msg { margin-top: 10px; }

/* ---- Home: monitor de recursos ---- */
.res-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin: 12px 0 14px; }
.gauge { display: flex; flex-direction: column; gap: 5px; }
.gauge-top { display: flex; align-items: baseline; justify-content: space-between; }
.gauge-l { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); }
.gauge-n { font-size: 19px; font-weight: 800; }
.gauge-n.ok { color: var(--ok); } .gauge-n.warn { color: var(--warn); } .gauge-n.bad { color: var(--bad); }
.gauge-track { height: 7px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.gauge-fill { display: block; height: 100%; border-radius: 5px; background: var(--ok);
  transition: width .4s ease; }
.gauge-fill.warn { background: var(--warn); } .gauge-fill.bad { background: var(--bad); }

/* ---- Home: planilha de clientes (denso, estilo planilha) ---- */
.sheet-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--border);
  border-radius: 10px; margin-top: 10px; }
.sheet { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sheet thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding: 9px 10px; cursor: pointer;
  border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.sheet thead th:hover { color: var(--fg); }
.sheet thead th.sorted { color: var(--fg); }
.sheet thead th.sorted::after { content: " ▾"; }
.sheet thead th.sorted[data-dir="asc"]::after { content: " ▴"; }
.sheet tbody td { padding: 7px 10px; border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border); white-space: nowrap; }
.sheet tbody td:last-child { border-right: none; }
.sheet tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
.sheet tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .sheet-name { font-weight: 600; color: var(--fg); }
.sheet tfoot td { position: sticky; bottom: 0; background: var(--surface-2);
  padding: 8px 10px; font-weight: 700; border-top: 1px solid var(--border); white-space: nowrap; }
#ov-search { max-width: 220px; }

.chip-ok { color: var(--ok); border-color: rgba(45,212,140,.4); }
.chip-bad { color: var(--bad); border-color: rgba(255,93,108,.4); }

/* AI-CALLER (aba de operações) */
.ac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 12px 0 4px; }
.ac-box { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.ac-n { font-size: 22px; font-weight: 800; line-height: 1.1; }
.ac-l { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); }
.ac-actions { margin: 10px 0 6px; }

/* orçamento do dia (barra de progresso) */
.budget { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.budget-track { flex: 1; height: 7px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.budget-fill { display: block; height: 100%; background: var(--grad); border-radius: 5px; }
.budget.over .budget-fill { background: var(--bad); }
.budget-val { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.budget.over .budget-val { color: var(--bad); font-weight: 600; }

/* ---- drawer (detalhe do cliente) ---- */
.backdrop { position: fixed; inset: 0; background: rgba(5,8,15,.6); z-index: 30;
  backdrop-filter: blur(2px); }
/* Detalhe do cliente: MODAL central grande (era painel lateral — pouca largura
   para tanta informação). Ocupa o centro da tela com folga e rola por dentro. */
.drawer {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(1040px, 94vw); max-height: 90vh; z-index: 40;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  display: flex; flex-direction: column; overflow: hidden;
}
/* A largura maior (1040px) já dá folga aos gráficos, tabelas e listas que ficavam
   espremidos no lateral de 640px. Corpo segue em coluna única (título sempre colado
   ao seu conteúdo) e rola por dentro do modal. */
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.drawer-body { overflow-y: auto; padding: 16px 20px 30px; display: flex;
  flex-direction: column; gap: 14px; }
.drawer-body h3 { margin: 6px 0 0; font-size: 12px; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted); }
.drawer-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drawer-charts .chart-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; gap: 10px; align-items: baseline; padding: 7px 2px;
  border-bottom: 1px solid var(--border); font-size: 12.5px; }
.mini-row:last-child { border-bottom: none; }
.mini-row .who { color: var(--fg); font-weight: 550; }
.mini-row .what { color: var(--muted); }

/* ---- modal ---- */
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(440px, 94vw); z-index: 40; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.modal .drawer-head { padding: 16px 18px 12px; }
.modal form.col { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.modal .invite { margin: 0 18px 18px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input[type=email] { flex: 1; min-width: 180px; }
.invite { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: rgba(96,165,250,.06); border: 1px dashed var(--accent-2);
  border-radius: 10px; padding: 10px 12px; }
.invite code { flex: 1; min-width: 200px; color: var(--accent-2); }

/* ---- provedores ---- */
.providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.provider {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; display: flex; flex-direction: column; gap: 10px;
}
.provider-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.provider-head b { font-size: 13.5px; }
.provider input, .provider textarea { width: 100%; }
.provider textarea { resize: vertical; font-family: inherit; }
.provider-actions { display: flex; gap: 8px; }

/* ---- transcrição de áudio: o que ficou sem texto e o que o provedor respondeu ---- */
.transcricao { max-width: 860px; }
.transcricao-resumo { margin: 0; font-size: 13.5px; line-height: 1.5; }
.transcricao-erros { display: flex; flex-direction: column; gap: 6px; }
.transcricao-erro { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--bad); border-radius: 0 8px 8px 0;
  background: var(--surface-2); }
.transcricao-erro code { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.transcricao table td, .transcricao table th { padding: 6px 10px; }
.transcricao-saida { margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--border); background: var(--surface-2); }
.transcricao-saida.ok { border-color: var(--ok); }
.transcricao-saida.ruim { border-color: var(--bad); }

/* Perda de dado do cliente não entra como chip discreto no meio da tela. */
.aviso-forte { border: 1px solid var(--bad); border-left-width: 4px; border-radius: 0 10px 10px 0;
  background: rgba(239,68,68,.10); padding: 12px 16px; margin-bottom: 14px; font-size: 13.5px; }
.aviso-forte code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; }

/* Separa blocos dentro de uma mesma aba (ex.: chaves de IA × login social). */
.sec-titulo { margin: 26px 0 6px; font-size: 14px; font-weight: 650; }

/* ---- operações / agentes / equipe ---- */
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 6px rgba(63,208,138,.6); }
.dot.bad { background: var(--bad); box-shadow: 0 0 6px rgba(255,93,108,.6); }
.bad-text { color: var(--bad); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }
.ops-scroll { max-height: 460px; overflow-y: auto; }
#dep-filter button { padding: 3px 10px; font-size: 11.5px; }
.dep-subject { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-fail .dep-subject { color: var(--bad); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Seletor de modelo de IA na tabela de agentes: some no meio dos botões. */
.sel-modelo {
  font: inherit; font-size: 12px; padding: 5px 8px; max-width: 200px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--fg); cursor: pointer;
}
.sel-modelo:hover { border-color: var(--accent); }
.sel-modelo option:disabled { color: var(--muted); }
#team-form { margin-top: 12px; }

/* ---- diálogos ---- */
.dlg-backdrop { display: flex; align-items: center; justify-content: center; z-index: 70;
  animation: dlg-fade .12s ease-out; }
.dialog {
  width: min(430px, 92vw); background: var(--bg-2);
  border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 20px 20px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  animation: dlg-pop .14s ease-out;
}
.dialog h3 { margin: 0; font-size: 15px; }
.dlg-msg { margin: 0; color: var(--fg-2); font-size: 13px; white-space: pre-line; }
.dlg-hint { margin: -4px 0 0; color: var(--muted); font-size: 11.5px; }
.dlg-hint b { color: var(--warn); }
.dlg-hint.ok { color: var(--ok); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
button.danger.solid { background: var(--bad); border: none; color: #14060a; font-weight: 700; }
button.danger.solid:hover { filter: brightness(1.08); }
button.danger.solid:disabled { filter: none; }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- toast ---- */
/* AVISOS — faixa no topo, largura inteira, ~5% da altura (2026-07-26).
   Era um balãozinho no rodapé: em tela grande passava despercebido, e os erros
   longos (diagnóstico de provedor de IA) não cabiam. `min-height` em vez de
   `height` porque truncar justamente a mensagem de erro seria o pior resultado
   possível — a faixa cresce quando o texto exige. */
.toast {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  min-height: max(5vh, 40px);
  display: flex; align-items: center; justify-content: center;
  padding: 8px 20px; gap: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; line-height: 1.35; text-align: center;
  background: var(--surface-2); color: var(--fg);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  animation: toast-desce .18s ease-out;
}
.toast.saindo { animation: toast-sobe .18s ease-in forwards; }
.toast-ok  { border-bottom-color: var(--ok);  background: #14251b; color: #d7f7e3; }
.toast-bad { border-bottom-color: var(--bad); background: #2a1618; color: #ffdcdc; }
@keyframes toast-desce { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes toast-sobe  { from { transform: translateY(0); } to { transform: translateY(-100%); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.saindo { animation: none; } }

/* ---- responsivo ---- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidenav { position: static; height: auto; flex-direction: row; align-items: center;
    padding: 10px 12px; gap: 10px; }
  #nav { flex-direction: row; flex: 1; }
  .nav-item { padding: 7px 9px; }
  .sidenav-foot { margin: 0; }
  .grid2, .drawer-charts { grid-template-columns: 1fr; }
  .main { padding: 0 12px 30px; }
  .toolbar .search { width: 100%; }
}

/* Política da IA (só o dono da plataforma vê) — leitura confortável de um texto
   longo dentro do card, sem esticar a página. */
.pol-sum { cursor: pointer; font-size: 13px; color: var(--accent, #3b82f6); }
.pol-texto { max-height: 420px; overflow: auto; margin: 10px 0 0; padding: 14px;
  white-space: pre-wrap; font-size: 12.5px; line-height: 1.6;
  background: rgba(0,0,0,.22); border: 1px solid var(--border, #262630);
  border-radius: 10px; }

/* OLHO NA SENHA (02/10/2026) — botão dentro do campo, à direita. */
.senha-caixa { position: relative; display: block; width: 100%; }
.senha-caixa > input { width: 100%; padding-right: 40px; box-sizing: border-box; }
.senha-olho {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0; margin: 0; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer;
}
.senha-olho:hover { color: var(--fg); }
.senha-olho:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.senha-olho[aria-pressed="true"] { color: var(--accent); }

/* E-mail de envio (02/10/2026) */
.email-card { max-width: 640px; }
.email-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.email-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.email-form .provider-actions { grid-column: 1 / -1; flex-wrap: wrap; }
.email-falha { border: 1px solid var(--border-strong); border-left: 3px solid var(--bad);
  border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--fg); }
@media (max-width: 560px) { .email-form { grid-template-columns: 1fr; } }

/* ---- ASSOCIADOS e ATIVIDADES POR PERFIL (19/11/2026) ---- */
.as-empresas { display: flex; flex-direction: column; gap: 16px; }
.as-empresa .toolbar { flex-wrap: wrap; padding: 14px 16px 10px; }
.as-empresa td { vertical-align: top; }
.as-empresa .cell-sub { display: block; }
.as-medidor { display: block; height: 7px; min-width: 110px; background: var(--surface-2);
  border-radius: 5px; overflow: hidden; margin: 5px 0 3px; }
.as-medidor > span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.as-medidor.verde > span { background: var(--ok); }
.as-funil { display: grid; grid-template-columns: 96px minmax(90px, 1fr) 36px; gap: 2px 8px;
  align-items: center; min-width: 250px; }
.as-funil .as-medidor { margin: 0; min-width: 0; }
.as-funil-l { font-size: 11px; color: var(--muted); white-space: nowrap; }
.as-funil-v { font-size: 11.5px; color: var(--fg-2); text-align: right; font-variant-numeric: tabular-nums; }
.as-c-acoes { white-space: nowrap; text-align: right; }
.as-c-acoes button + button { margin-left: 6px; }
.as-regras { padding: 4px 16px 14px; }
.as-regras-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 14px; margin-top: 12px; }
.as-regras-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.as-regras-form .as-check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); }
.as-regras-form .as-larga { grid-column: 1 / -1; }
.as-convite { flex-wrap: wrap; margin-top: 10px; }
.as-convite select, .as-convite input { min-width: 220px; flex: 1; }
#as-convite-out { margin-top: 12px; }
.at-perfis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.at-perfil { display: flex; flex-direction: column; gap: 6px; }
.at-perfil-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.at-perfil-head b { font-size: 14px; }
.at-num { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--fg-2); }
.at-num b { color: var(--fg); font-variant-numeric: tabular-nums; }
#view-atividades .table-card .toolbar { padding: 14px 16px 10px; flex-wrap: wrap; }
#at-linha .mini-row { align-items: center; flex-wrap: wrap; }
.at-quando { min-width: 108px; font-variant-numeric: tabular-nums; }
.at-frase { color: var(--fg-2); }
.at-frase b { color: var(--fg); font-weight: 600; }
#view-atividades td .cell-title, #view-atividades td .cell-sub { display: block; }
