/* ==========================================================================
   WConecta - Design System v4 (corporativo: 80% azul royal + branco azulado / 20% grafite + laranja)
   Tipografia: Manrope (titulos e marca) + Inter (interface)
   Tema: claro por padrao; escuro via <html data-theme="dark">
   A COR DA EQUIPE continua vindo de --h (inbox, campanhas, equipes).
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* sidebar (grafite azulado) */
  --rail: #172033; --rail-ink: #cbd5e1; --rail-strong: #f8fafc;
  --rail-hover: rgba(255,255,255,.06); --rail-on: #356ae6; --rail-line: rgba(255,255,255,.09);

  /* superficies */
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f4f6fa; --surface-3: #e9edf5;
  --ink: #1e293b; --ink-2: #334155; --muted: #64748b;
  --line: #e2e8f0; --line-strong: #cbd5e1;

  /* marca */
  --brand: #356ae6;
  --accent: #356ae6; --accent-hover: #2858cc; --accent-ink: #ffffff; --accent-text: #2858cc;
  --accent-soft: #e8efff; --accent-line: #c5d6fb;
  --attn: #e89543; --attn-ink: #172033; --attn-soft: #fff2e3; --attn-line: #f6d4ad; --attn-text: #94510f;
  --danger: #dc5353; --danger-text: #b83b3b; --danger-soft: #fdeeee; --danger-line: #f5caca;
  --ok: #16a36a; --ok-soft: #e3f6ee; --ok-ink: #0c6b45;
  --warn-soft: #fff2e3; --warn-ink: #94510f;
  --info-soft: #e8efff; --info-ink: #2858cc;
  --focus: #356ae6;

  /* conversa */
  --chat-bg: #eef1f7; --in: #ffffff; --out: #dce7ff; --out-ink: #172a55;
  --note-bg: #fff2e3; --note-line: #e89543; --auto-bg: #f8faff; --auto-line: #8fb0f5;

  /* cor de equipe (hsl(var(--h) ...)) */
  --tm-chip-bg: 70% 95%; --tm-chip-ink: 60% 28%; --tm-chip-line: 52% 85%; --tm-solid: 56% 50%;

  --shadow-xs: 0 1px 2px rgba(23,32,51,.04);
  --shadow-sm: 0 1px 2px rgba(23,32,51,.05), 0 1px 3px rgba(23,32,51,.04);
  --shadow-md: 0 2px 4px rgba(23,32,51,.04), 0 8px 18px -6px rgba(23,32,51,.10);
  --shadow-lg: 0 8px 16px rgba(23,32,51,.07), 0 22px 48px -10px rgba(23,32,51,.20);
  --ring: color-mix(in srgb, var(--focus) 22%, transparent);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --ease: .16s cubic-bezier(.4, 0, .2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --rail: #111827; --rail-ink: #cbd5e1; --rail-hover: rgba(255,255,255,.055); --rail-on: #4b7ff2; --rail-line: #263248;
  --bg: #0f1624; --surface: #172033; --surface-2: #1d283d; --surface-3: #263248;
  --ink: #f1f5f9; --ink-2: #cbd5e1; --muted: #94a3b8;
  --line: #263248; --line-strong: #364562;
  --brand: #4b7ff2;
  --accent: #4b7ff2; --accent-hover: #3d6fe0; --accent-ink: #ffffff; --accent-text: #92b2fa;
  --accent-soft: rgba(75,127,242,.16); --accent-line: rgba(75,127,242,.38);
  --attn: #e89543; --attn-ink: #172033; --attn-soft: rgba(232,149,67,.15); --attn-line: rgba(232,149,67,.36); --attn-text: #f3b878;
  --danger: #dc5353; --danger-text: #f59a9a; --danger-soft: rgba(220,83,83,.15); --danger-line: rgba(220,83,83,.38);
  --ok: #16a36a; --ok-soft: rgba(22,163,106,.18); --ok-ink: #6fd9a9;
  --warn-soft: rgba(232,149,67,.15); --warn-ink: #f3b878;
  --info-soft: rgba(75,127,242,.16); --info-ink: #a9c2fb;
  --focus: #4b7ff2;
  --chat-bg: #0f1624; --in: #1d283d; --out: #27427c; --out-ink: #f1f5f9;
  --note-bg: #35291f; --note-line: #a86f38; --auto-bg: #172542; --auto-line: #4a68a8;
  --tm-chip-bg: 36% 22%; --tm-chip-ink: 72% 80%; --tm-chip-line: 32% 34%; --tm-solid: 56% 58%;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.25);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.18);
  --shadow-md: 0 2px 4px rgba(0,0,0,.2), 0 10px 22px -6px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 16px rgba(0,0,0,.28), 0 26px 52px -10px rgba(0,0,0,.55);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.55; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h4 { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
a { color: var(--accent-text); text-decoration: none; transition: color var(--ease); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
small { color: var(--muted); }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* scrollbars finas */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; border: 2px solid transparent; }

/* icones (estilo Lucide: traco fino, pontas arredondadas) */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }

/* ---------- controles ---------- */
button, input, textarea, select { font: inherit; color: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r-sm); padding: 7px 13px; min-height: 34px; white-space: nowrap; line-height: 1.2; font-weight: 500; font-size: 13.5px;
  box-shadow: var(--shadow-xs);
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease), transform var(--ease), filter var(--ease);
}
button .ic { width: 16px; height: 16px; }
button:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
button:active { transform: translateY(1px) scale(.99); box-shadow: none; }
button:disabled, button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; pointer-events: none; }
button.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(23,32,51,.14);
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); box-shadow: var(--shadow-md); }
button.primary:active { background: var(--accent-hover); }
button.primary.lg { min-height: 44px; padding: 10px 18px; font-size: 14.5px; border-radius: 10px; }
button.danger { color: var(--danger-text); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-text); }
button.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover { background: var(--surface-2); color: var(--ink); }
button.ghost.danger:hover { background: var(--danger-soft); color: var(--danger-text); }
.icon-btn { width: 34px; height: 34px; padding: 0; min-height: 0; border-radius: var(--r-sm); }
.icon-btn .ic { width: 17px; height: 17px; }
button.sm { min-height: 30px; padding: 5px 10px; font-size: 13px; }

input, textarea, select {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 8px 12px; min-height: 38px; box-shadow: var(--shadow-xs);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--muted) 55%, var(--line-strong)); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; cursor: pointer; }
textarea { line-height: 1.5; }
input[type=checkbox] { appearance: none; width: 17px; height: 17px; min-height: 0; padding: 0; border-radius: 5px; box-shadow: none; cursor: pointer; display: inline-grid; place-content: center; flex: none; }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
input[type=file] { padding: 6px 8px; width: 100%; }
input[type=file]::file-selector-button { font: inherit; margin-right: 10px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; }
.check input { margin-top: 2px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
label.field { display: block; margin-top: 14px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
label.field > input, label.field > textarea, label.field > select { display: block; width: 100%; margin-top: 6px; font-weight: 400; font-size: 14.5px; color: var(--ink); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.err { color: var(--danger-text); font-size: 13px; min-height: 18px; margin-top: 8px; font-weight: 500; }
.err:empty { display: none; }
.ok { color: var(--ok); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* campo com icone */
.input-icon { position: relative; display: block; }
label.field > .input-icon { margin-top: 6px; }
.input-icon > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > input { width: 100%; padding-left: 38px; }
.input-icon > .pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--muted); }

/* ---------- badges, chips, pilulas, avatares ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 0 0 1px var(--line); }
.chip button { all: unset; cursor: pointer; display: inline-flex; padding: 1px; border-radius: 50%; opacity: .7; }
.chip button:hover { background: rgba(100,116,139,.22); opacity: 1; }
.chip .ic { width: 12px; height: 12px; }
.badge { background: var(--attn); color: var(--attn-ink); border-radius: 999px; padding: 0 6px; min-width: 20px; text-align: center; font-size: 11.5px; font-style: normal; font-weight: 700; line-height: 20px; }

.tm { --h: 200; }
.chip.team { background: hsl(var(--h) var(--tm-chip-bg)); color: hsl(var(--h) var(--tm-chip-ink)); box-shadow: inset 0 0 0 1px hsl(var(--h) var(--tm-chip-line)); }
.strip { width: 4px; align-self: stretch; border-radius: 3px; background: hsl(var(--h) var(--tm-solid)); flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--h) var(--tm-solid)); flex: none; }

.avatar { --av: 200; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; flex: none; background: hsl(var(--av) 46% 45%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); text-transform: uppercase; user-select: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.avatar.xl { width: 56px; height: 56px; font-size: 21px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { width: 28px; height: 28px; font-size: 11px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-stack .more { background: var(--surface-3); color: var(--muted); }

/* pilula de status com ponto animado */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.bad { background: var(--danger-soft); color: var(--danger-text); }
.pill.info { background: var(--info-soft); color: var(--info-ink); }
.pill.ok::before { animation: pulse-ok 2s ease-out infinite; }
.pill.warn::before { animation: pulse-warn 1.4s ease-out infinite; }
@keyframes pulse-ok { 0% { box-shadow: 0 0 0 0 rgba(22,163,106,.4); } 80%, 100% { box-shadow: 0 0 0 6px rgba(22,163,106,0); } }
@keyframes pulse-warn { 0% { box-shadow: 0 0 0 0 rgba(232,149,67,.45); } 80%, 100% { box-shadow: 0 0 0 6px rgba(232,149,67,0); } }

.role-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.role-badge .ic { width: 12px; height: 12px; }
.role-badge.admin { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-line); }
.role-badge.off { background: var(--danger-soft); color: var(--danger-text); box-shadow: inset 0 0 0 1px var(--danger-line); }

.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }

/* ---------- entrada (login) ---------- */
.login { min-height: 100%; height: 100%; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); background: var(--bg); }
.login-art {
  position: relative; overflow: hidden; color: #f8fafc; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: #172033;
}
.login-art::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at 30% 20%, #000 10%, transparent 70%); }
.login-art > * { position: relative; }
.login-art .brand { padding: 0; font-size: 22px; }
.login-art > p { font-family: var(--font-display); font-size: 30px; line-height: 1.2; font-weight: 700; max-width: 14em; letter-spacing: -.025em; }
.login-art small { color: #a8b5c9; }
.login-badge { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 5px 12px 5px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: #dce7ff; background: rgba(53,106,230,.18); box-shadow: inset 0 0 0 1px rgba(143,176,255,.34); }
.login-badge b { background: var(--attn); color: var(--attn-ink); padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.login-headline { color: #fff; font-family: var(--font-display); font-size: clamp(28px, 3.1vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -.03em; margin-top: 18px; max-width: 14em; }
.login-headline em { font-style: normal; color: var(--attn); }
.login-sub { color: #94a3b8; font-size: 15.5px; max-width: 32em; margin-top: 14px; }
.login-preview { position: relative; max-width: 520px; }
.lp-window { position: relative; z-index: 1; border-radius: 16px; background: #1e2940; box-shadow: inset 0 0 0 1px rgba(255,255,255,.09), 0 24px 48px -22px rgba(0,0,0,.5); overflow: hidden; }
.lp-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.lp-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.16); }
.lp-body { display: grid; grid-template-columns: 170px minmax(0, 1fr); min-height: 230px; }
.lp-list { border-right: 1px solid rgba(255,255,255,.07); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.lp-item { display: flex; gap: 9px; align-items: center; padding: 8px; border-radius: 9px; font-size: 12px; color: #cbd5e1; }
.lp-item.on { background: rgba(53,106,230,.22); box-shadow: inset 0 0 0 1px rgba(143,176,255,.3); color: #fff; }
.lp-item .avatar { width: 26px; height: 26px; font-size: 10.5px; }
.lp-item b { display: block; font-weight: 600; font-size: 12px; }
.lp-item span { display: block; font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.lp-chat { padding: 14px; display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; }
.lp-msg { max-width: 82%; padding: 8px 11px; border-radius: 12px 12px 12px 3px; background: rgba(255,255,255,.08); color: #e2e8f0; font-size: 12px; line-height: 1.4; }
.lp-msg.out { align-self: flex-end; background: #356ae6; color: #fff; font-weight: 500; border-radius: 12px 12px 3px 12px; }
.lp-float { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #222e47; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 18px 36px -10px rgba(0,0,0,.6); font-size: 12px; color: #e2e8f0; animation: float 6s ease-in-out infinite; }
.lp-float b { display: block; font-size: 12.5px; color: #fff; }
.lp-float .ic { color: #e89543; }
.lp-float.a { right: -18px; top: -22px; }
.lp-float.b { left: -22px; bottom: -22px; animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.login-feats { display: flex; flex-wrap: wrap; gap: 8px 20px; color: #94a3b8; font-size: 13px; }
.login-feats span { display: inline-flex; align-items: center; gap: 7px; }
.login-feats .ic { width: 15px; height: 15px; color: #8fb0ff; }

.login-main { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--surface); }
.login-form { width: min(392px, 100%); background: var(--surface); }
.login-main .login-form { padding: 0; }
.login > .login-form { align-self: center; justify-self: center; padding: 0 24px; }
.login-form .brand-mini { display: none; }
.login-form h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.login-form .lead { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.login-form > .hint { margin-top: 6px; }
.login-form > button[type=submit], .login-form > button.primary { width: 100%; margin-top: 22px; }
.login-form .foot { margin-top: 28px; text-align: center; color: var(--muted); font-size: 12.5px; }
.login-err { display: flex; gap: 8px; align-items: center; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger-text); font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--danger-line); }
.login-err:empty { display: none; }

/* ---------- estrutura com sidebar ---------- */
#app { height: 100%; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
#rail { position: relative; background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; padding: 14px 12px 12px; min-height: 0; overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--rail-line); z-index: 2; scrollbar-width: none; }
#rail::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--rail-strong); font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.03em; padding: 6px 8px 18px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .brand-tag { margin-left: 2px; font-family: var(--font); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #f3b878; background: rgba(232,149,67,.16); padding: 1px 6px; border-radius: 5px; }
#rail nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail-label { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: rgba(203,213,225,.55); padding: 16px 12px 6px; }
.rail-label:first-child { padding-top: 4px; }
.nav { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; cursor: pointer; color: var(--rail-ink); font-family: var(--font); font-size: 13.5px; font-weight: 500; position: relative; transition: background var(--ease), color var(--ease), box-shadow var(--ease); }
.nav .ic { transition: color var(--ease); }
.nav:hover { background: var(--rail-hover); color: var(--rail-strong); }
.nav.on { background: var(--rail-on); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.nav.on .ic { color: #fff; }
.nav.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rail-on); }
.nav:focus-visible { outline: 2px solid #a9c2fb; outline-offset: -1px; }
.nav .badge { margin-left: auto; }
.rail-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rail-line); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--rail-line); }
.me .avatar { width: 34px; height: 34px; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.me-info { flex: 1; min-width: 0; line-height: 1.25; }
#who { display: block; color: var(--rail-strong); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { display: block; font-size: 11.5px; color: var(--rail-ink); }
.me .icon-btn { width: 30px; height: 30px; background: transparent; border-color: transparent; color: var(--rail-ink); box-shadow: none; }
.me .icon-btn:hover { background: var(--rail-hover); color: var(--rail-strong); }
.me .icon-btn.danger:hover { color: #f59a9a; }
#views { min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* ---------- conversas ---------- */
.split { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
#side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-top { padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.side-top h2 { font-size: 19px; font-weight: 700; }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding-left: 36px; background: var(--surface-2); border-color: transparent; box-shadow: none; }
.search input:focus { background: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 4px var(--ring); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { padding: 3px 12px; min-height: 28px; font-size: 12.5px; border-radius: 999px; background: transparent; border-color: var(--line); box-shadow: none; color: var(--muted); }
.filters button:hover { color: var(--ink); background: var(--surface-2); }
.filters button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
#teamFilter { width: 100%; }
#list { flex: 1; overflow-y: auto; border-top: 1px solid var(--line); }
.conv { display: flex; gap: 12px; padding: 12px 16px 12px 12px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; transition: background var(--ease); }
.conv:hover { background: var(--surface-2); }
.conv.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--brand); }
.conv .strip { align-self: stretch; margin: -2px 0; }
.conv .strip.none { background: transparent; }
.conv .mid { flex: 1; min-width: 0; }
.conv .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .name { font-weight: 700; }
.conv .time { font-size: 11.5px; color: var(--muted); flex: none; }
.conv.unread .time { color: var(--accent-text); font-weight: 700; }
.conv .prev { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.conv.unread .prev { color: var(--ink); font-weight: 500; }
.conv .meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; min-height: 20px; }
.conv .meta .badge { margin-left: auto; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* estado vazio com icone */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 44px 24px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.empty-state .es-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.empty-state .es-ic .ic { width: 24px; height: 24px; }
.empty-state h3 { font-size: 16px; font-weight: 700; }
.empty-state p { color: var(--muted); max-width: 34em; font-size: 13.5px; }
.empty-state .row { margin-top: 12px; justify-content: center; }

#chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
#chatBox { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#chatEmpty { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--muted); }
#chatEmpty .ic { width: 44px; height: 44px; stroke-width: 1.2; opacity: .7; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: relative; z-index: 1; }
.chat-head .titles { flex: 1 1 220px; min-width: 0; }
.chat-head .t { font-family: var(--font-display); font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .s { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.chat-head .ctl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chat-head .ctl select { max-width: 190px; font-size: 13px; padding: 5px 28px 5px 10px; min-height: 32px; }
.chat-head .ctl button { font-size: 13px; padding: 5px 12px; min-height: 32px; }
#back { display: none; }

#msgs { flex: 1; overflow-y: auto; padding: 20px 26px; display: flex; flex-direction: column; gap: 6px; background: var(--chat-bg); }
.day { align-self: center; margin: 14px 0 8px; padding: 3px 14px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-xs); }
.bubble { max-width: min(74%, 580px); padding: 8px 12px 5px; border-radius: 14px 14px 14px 4px; background: var(--in); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-xs); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble.out { align-self: flex-end; background: var(--out); color: var(--out-ink); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.bubble.auto { align-self: flex-end; background: var(--auto-bg); color: var(--ink); border-color: var(--auto-line); border-left: 3px solid var(--auto-line); border-radius: 14px 14px 4px 14px; }
.bubble.note { align-self: center; max-width: min(86%, 620px); background: var(--note-bg); color: var(--ink); border: 1px dashed var(--note-line); border-radius: 12px; font-size: 13.5px; }
.bubble .who { font-size: 12px; font-weight: 650; color: var(--accent-text); margin-bottom: 2px; }
.bubble.auto .who { color: color-mix(in srgb, var(--auto-line) 55%, var(--ink)); }
.bubble.note .who { color: color-mix(in srgb, var(--note-line) 40%, var(--ink)); }
.bubble .cap { margin-top: 5px; }
.bubble .m { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bubble.out .m { color: color-mix(in srgb, var(--out-ink) 60%, transparent); }
.bubble .m .ic { width: 15px; height: 15px; }
.bubble .m .read { color: var(--accent); }
.bubble .m .bad { color: var(--danger-text); }
.bubble img.media, .bubble video.media { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; cursor: zoom-in; }
.bubble video.media { cursor: default; }
.bubble img.sticker { max-height: 150px; cursor: default; }
.bubble audio { display: block; width: 260px; max-width: 100%; }
.mph { min-width: 190px; min-height: 80px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; background: var(--surface-2); border-radius: 8px; color: var(--muted); font-size: 13px; }
.file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; min-width: 200px; transition: background var(--ease); }
.file:hover { background: var(--surface-2); }
.file small { margin-left: auto; }
#lightbox { position: fixed; inset: 0; background: rgba(15,22,36,.9); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 80; cursor: zoom-out; }
#lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 10px; }

.pending { display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: var(--surface); border-top: 1px solid var(--line); font-size: 14px; }
.pending img { height: 44px; border-radius: 8px; }
.pending span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 20px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; border-radius: var(--r-md); line-height: 1.4; }
.composer .icon-btn { width: 40px; height: 40px; flex: none; }

/* ---------- paginas de administracao ---------- */
.page { flex: 1; overflow-y: auto; padding: 32px 40px 64px; }
.page-inner { max-width: 1120px; margin: 0 auto; }
.page-head { margin-bottom: 26px; display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; }
.page-head .titles { min-width: 0; flex: 1 1 460px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 60em; font-size: 14.5px; }
.page-head .head-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent-text); letter-spacing: .02em; margin-bottom: 8px; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.crumb .ic { width: 13px; height: 13px; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 22px 24px 24px; margin-bottom: 24px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.panel-head h2 { font-size: 16.5px; font-weight: 700; flex: 1; }
.panel .lead { color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }
.fieldset { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.fieldset h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

/* resumo (cartoes de numeros) */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-xs); }
.stat-card .si { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-line); flex: none; }
.stat-card b { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1.1; letter-spacing: -.02em; }
.stat-card span { font-size: 12.5px; color: var(--muted); }

/* atendentes / equipes (legado + novo) */
.agent, .team-card { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-xs); padding: 12px 14px; margin: 10px 0; transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease); }
.agent:hover, .team-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.agent .info { flex: 1; min-width: 180px; }
.agent .info small { display: block; }
.agent.off { opacity: .6; }
.team-card { align-items: stretch; flex-wrap: nowrap; }
.team-body { flex: 1; min-width: 0; }
.team-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.team-head b { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }
.team-opt { display: flex; gap: 9px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; cursor: pointer; }
.team-opt input { margin: 0; }
.members { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; align-items: center; }
.members select { font-size: 13px; padding: 3px 26px 3px 10px; min-height: 28px; border-radius: 999px; }

/* cartoes novos: equipes + atendentes */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.tcard { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease); }
.tcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: hsl(var(--h) var(--tm-solid)); }
.tcard:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); transform: translateY(-1px); }
.tcard-head { display: flex; align-items: center; gap: 12px; }
.tcard-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: hsl(var(--h) var(--tm-chip-ink)); background: hsl(var(--h) var(--tm-chip-bg)); box-shadow: inset 0 0 0 1px hsl(var(--h) var(--tm-chip-line)); }
.tcard-title { flex: 1; min-width: 0; }
.tcard-title h3 { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard-title span { font-size: 12.5px; color: var(--muted); }
.tcard-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: -6px; }
.tcard .members { margin: 0; }
.tcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.switch input { appearance: none; width: 34px; height: 20px; min-height: 0; padding: 0; border-radius: 999px; background: var(--line-strong); border: 0; box-shadow: none; position: relative; cursor: pointer; flex: none; transition: background var(--ease); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(14px); border: 0; width: 16px; height: 16px; }

.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acard { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease); }
.acard:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); transform: translateY(-1px); }
.acard.off { opacity: .62; }
.acard-top { display: flex; gap: 12px; align-items: center; }
.acard-info { flex: 1; min-width: 0; }
.acard-info b { display: block; font-family: var(--font-display); font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acard-foot { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }

/* menu suspenso de acoes */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 216px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .14s ease-out; transform-origin: top right; }
.menu.up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom right; }
.menu-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu button { display: flex; width: 100%; justify-content: flex-start; gap: 10px; min-height: 0; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; font-size: 13.5px; color: var(--ink-2); text-align: left; }
.menu button .ic { color: var(--muted); }
.menu button:hover { background: var(--surface-2); color: var(--ink); }
.menu button:hover .ic { color: var(--ink-2); }
.menu button.danger, .menu button.danger .ic { color: var(--danger-text); }
.menu button.danger:hover { background: var(--danger-soft); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* campanhas */
.camp { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px 18px; margin: 12px 0; transition: box-shadow var(--ease), border-color var(--ease); }
.camp:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.camp .body { flex: 1; min-width: 0; }
.camp h4 { margin: 0; font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status { font-size: 11.5px; font-weight: 650; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.status.running { background: var(--ok-soft); color: var(--ok-ink); }
.status.paused { background: var(--warn-soft); color: var(--warn-ink); }
.status.canceled { background: var(--danger-soft); color: var(--danger-text); }
.status.done { background: var(--info-soft); color: var(--info-ink); }
.camp .settings { color: var(--muted); font-size: 13px; margin-top: 3px; }
.bar { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 12px 0 10px; }
.bar > div { height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s ease; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 12px; }
.stats div { display: flex; align-items: baseline; gap: 5px; }
.stats b { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.stats small { font-size: 13px; }
.note { color: var(--danger-text); margin: 6px 0; font-size: 13px; }
.rec { font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.camp .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.camp .actions button { font-size: 13px; padding: 4px 11px; min-height: 30px; }

/* ---------- avisos, janela de 24 h e modelos ---------- */
.notice { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--danger-soft); color: var(--danger-text); border-bottom: 1px solid var(--danger-line); font-size: 13.5px; font-weight: 500; }
.notice a, .notice button { margin-left: auto; white-space: nowrap; }
.window-bar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--warn-soft); color: var(--warn-ink); border-top: 1px solid var(--line); font-size: 13.5px; }
.window-bar button { margin-left: auto; white-space: nowrap; }
.tpl-panel { padding: 14px 20px 16px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(23,32,51,.12); display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.tpl-panel .tpl-head { display: flex; align-items: center; gap: 8px; }
.tpl-panel .tpl-head b { flex: 1; font-family: var(--font-display); }
.tpl-preview { white-space: pre-wrap; background: var(--out); color: var(--out-ink); border-radius: 12px; padding: 9px 13px; }
.tpl-vars { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }

/* ---------- janelas (modal) ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,22,36,.52); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; animation: fade .16s ease-out; }
.modal-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 92vh; overflow-y: auto; padding: 26px 28px 24px; animation: rise .2s cubic-bezier(.2,.9,.3,1.1); }
.modal-box h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; padding-right: 28px; }
.modal-box > .hint:first-of-type, .modal-box h2 + .hint { margin-bottom: 4px; }
.modal-box .row.end { justify-content: flex-end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.modal-ic.danger { color: var(--danger-text); background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger-line); }
.modal-ic .ic { width: 22px; height: 22px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; padding: 0; min-height: 0; border: 0; background: transparent; box-shadow: none; color: var(--muted); }
.modal-x:hover { background: var(--surface-2); color: var(--ink); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 16px 0 8px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.qr-box img { width: 248px; height: 248px; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.qr-box img:not([src]) { visibility: hidden; }
.steps { margin: 10px 0 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; margin: 8px 0; padding-left: 32px; font-size: 13.5px; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.copy-row { display: flex; gap: 6px; align-items: center; margin: 4px 0 12px; }
.copy-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; font-family: var(--mono); font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--line); }
details.help { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; background: var(--surface-2); }
details.help summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }

/* toasts */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #172033; color: #f8fafc; padding: 11px 18px 11px 14px; border-radius: 12px; box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.08); font-size: 13.5px; font-weight: 500; z-index: 90; max-width: min(92vw, 520px); animation: toast-in .24s cubic-bezier(.2,.9,.3,1.1); }
#toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(53,106,230,.3); flex: none; }
#toast.error::before { background: var(--danger); box-shadow: 0 0 0 4px rgba(220,83,83,.28); }
:root[data-theme="dark"] #toast { background: #263248; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }

/* criar modelo (Meta) */
.tpl-name-preview { margin-top: 6px; word-break: break-all; }
.tpl-name-preview:not(:empty) { font-family: var(--mono); font-size: 12px; }
.tpl-tools { margin-top: 6px; }
.tpl-examples { margin-top: 4px; padding: 4px 14px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.tpl-examples:empty { display: none; }
.tpl-examples .hint { margin-top: 10px; }

/* ---------- conexoes ---------- */
.chan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chan { position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px; transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease); }
.chan:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); transform: translateY(-1px); }
/* Card com o menu "..." aberto: sobe acima dos cards vizinhos (o hover cria um contexto de empilhamento, entao o menu ficava atras do card de baixo) */
.chan.menu-open { position: relative; z-index: 50; overflow: visible; }
.chan-head { display: flex; align-items: flex-start; gap: 12px; }
.chan-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: var(--ok); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.chan-ic.meta { background: #356ae6; }
.chan-ic.ig { background: linear-gradient(135deg, #c13584, #833ab4 60%, #5851db); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.chan-ic.off { background: #64748b; }
.chan-ic .ic { width: 22px; height: 22px; stroke-width: 1.8; }
.chan-title { flex: 1; min-width: 0; }
.chan-title h4 { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-num { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chan .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; padding: 12px 14px; font-size: 13px; background: var(--surface-2); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); }
.chan .kv:empty { display: none; }
.chan .kv dt { color: var(--muted); }
.chan .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; font-family: var(--mono); font-size: 12.5px; }
.chan .note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--danger-soft); font-weight: 500; }
.chan .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.chan .actions .grow { flex: 1; }
.chip.ok { background: var(--ok-soft); color: var(--ok-ink); box-shadow: none; }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); box-shadow: none; }
.chip.bad { background: var(--danger-soft); color: var(--danger-text); box-shadow: none; }
.chip.info { background: var(--info-soft); color: var(--info-ink); box-shadow: none; }
table.tpls { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
table.tpls th, table.tpls td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tpls th { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.tpls small { display: block; max-width: 280px; }

.explain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.explain .panel { margin: 0; }
.explain h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.explain h2 .ic { color: var(--accent-text); }
.explain p { color: var(--muted); font-size: 13.5px; }

.skeleton { border-radius: var(--r-lg); min-height: 190px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- menu lateral recolhivel ---------- */
.rail-toggle { all: unset; box-sizing: border-box; position: absolute; top: 15px; right: 12px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--rail-ink); transition: background var(--ease), color var(--ease); }
.rail-toggle span { display: none; }
.rail-toggle:hover { background: var(--rail-hover); color: var(--rail-strong); }
.rail-toggle:focus-visible { outline: 2px solid #a9c2fb; }
.rail-toggle .ic { width: 16px; height: 16px; }
@media (min-width: 761px) {
  #app.menu-hidden { grid-template-columns: 44px minmax(0, 1fr); }
  #app.menu-hidden #rail { padding: 12px 6px; align-items: center; }
  #app.menu-hidden #rail > :not(.rail-toggle) { display: none; }
  #app.menu-hidden .rail-toggle { position: static; width: 32px; height: 32px; }
}

/* ---------- telas medias e pequenas ---------- */
@media (max-width: 1180px) {
  .chan-grid, .explain { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  #app { grid-template-columns: 72px minmax(0, 1fr); }
  .nav span, .brand span, .brand .brand-tag, #who, .me-info, .rail-label, .me .theme-btn { display: none; }
  .rail-label { display: block; height: 1px; padding: 0; margin: 10px 14px; background: var(--rail-line); font-size: 0; }
  .nav { justify-content: center; padding: 11px 0; }
  .nav .badge { position: absolute; top: 2px; right: 8px; margin: 0; }
  .brand { justify-content: center; padding: 6px 0 16px; }
  .rail-toggle { display: none; }
  .me { flex-direction: column; padding: 8px 0; background: transparent; box-shadow: none; }
  .split { grid-template-columns: 320px minmax(0, 1fr); }
  .cols2 { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 28px 28px 48px; }
  .login { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login-art { padding: 36px; }
  .lp-float { display: none; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 62px; }
  #rail { order: 2; flex-direction: row; padding: 0 6px; align-items: center; border-right: 0; border-top: 1px solid var(--rail-line); overflow: visible; }
  #rail .brand, #rail .rail-label, .me .avatar, .rail-toggle { display: none; }
  #rail nav { flex-direction: row; justify-content: space-around; gap: 0; align-items: center; }
  .nav { flex: 1; padding: 14px 0; border-radius: 12px; }
  .nav.on::before { display: none; }
  .nav.on { box-shadow: none; }
  .rail-foot { margin: 0; padding: 0; border: 0; }
  .me { border: none; padding: 0; flex-direction: row; background: transparent; box-shadow: none; }
  #views { order: 1; }
  .split { grid-template-columns: 1fr; }
  #chat { display: none; }
  .chat-open #side { display: none; }
  .chat-open #chat { display: flex; }
  #app.in-chat { grid-template-rows: minmax(0, 1fr) 0; }
  #app.in-chat #rail { display: none; }
  #back { display: inline-flex; }
  .page { padding: 22px 16px 40px; }
  .page-head h1 { font-size: 22px; }
  .panel { padding: 18px 16px 20px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-main, .login > .login-form { padding: 28px 20px; }
  .login-form .brand-mini { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
  .login-form .brand-mini svg { width: 30px; height: 30px; }
  .camp { flex-direction: column; gap: 8px; }
  .camp .strip { width: auto; height: 4px; align-self: stretch; }
  .bubble { max-width: 88%; }
  #msgs { padding: 16px 12px; }
  .chat-head { padding: 10px 14px; }
  .composer { padding: 10px 12px 14px; }
  .chat-head .ctl { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .chat-head .ctl > * { flex: none; }
  .grid3, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .team-grid, .agent-grid { grid-template-columns: 1fr; }
  .modal-box { padding: 22px 18px 18px; }
  .menu { min-width: 200px; }
  .page-head .head-actions { width: 100%; }
  .page-head .head-actions button { flex: 1 1 auto; }
  .me .icon-btn { margin-right: 4px; }
}

/* utilitarios */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chan-grid > .empty-state, .chan-grid > .skeleton:only-child { grid-column: 1 / -1; }
.input-icon > input { font-size: 14.5px; }

/* ==========================================================================
   Etapa 2: caixa de entrada (inbox)
   ========================================================================== */
.side-top { padding: 20px 16px 10px; gap: 14px; }
.side-title { display: flex; align-items: baseline; gap: 10px; }
.side-title h2 { font-size: 20px; font-weight: 800; }
.side-title small { font-size: 12.5px; }
.search input { border-radius: 999px; min-height: 40px; padding-left: 40px; background: var(--surface-2); border-color: transparent; }
.search .ic { left: 15px; }

/* abas em pilula com contadores */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.tabs button { flex: 1; gap: 7px; min-height: 32px; padding: 4px 10px; border: 0; border-radius: 999px; background: transparent; box-shadow: none; color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs button:hover { background: transparent; color: var(--ink); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.count { font-style: normal; min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 19px; text-align: center; background: var(--surface-3); color: var(--muted); }
.count:empty { display: none; }
.tabs button.on .count { background: var(--accent-soft); color: var(--accent-text); }
.tabs button[data-f="unread"] .count:not(:empty) { background: var(--attn); color: var(--attn-ink); }
.subfilters { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 4px; }
.subfilters button { min-height: 0; padding: 2px 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.subfilters button:hover { background: none; color: var(--ink); }
.subfilters button.on { color: var(--accent-text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--brand); }
#list { border-top: 0; padding: 4px 8px 12px; }
.conv { gap: 12px; margin: 2px 0; padding: 11px 12px; border: 0; border-radius: 14px; align-items: flex-start; }
.conv:hover { background: var(--surface-2); }
.conv.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.conv .avatar { width: 46px; height: 46px; font-size: 16px; }
.conv .top { align-items: center; }
.conv .name { font-size: 14.5px; }
.conv .prev { margin-top: 2px; font-size: 13px; }
.conv .meta { gap: 6px; margin-top: 7px; flex-wrap: nowrap; min-height: 20px; overflow: hidden; }
.conv .meta .hint { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conv .meta .chip { flex: none; max-width: 110px; }
.conv .meta .badge { flex: none; }
.empty-list { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty-list .es-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }

/* centro: chat */
#chat { background: var(--chat-bg); }
#chatBox { background: var(--chat-bg); }
#msgs { background-color: var(--chat-bg); background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--muted) 16%, transparent) 1px, transparent 0); background-size: 22px 22px; padding: 22px 28px 12px; gap: 5px; }
.chat-head { padding: 12px 20px; gap: 14px; box-shadow: var(--shadow-xs); }
.chat-head .avatar { width: 44px; height: 44px; font-size: 16px; }
.chat-head .s { gap: 6px 12px; margin-top: 1px; }
.chat-head .ctl { gap: 8px; }
.chat-head .ctl select { min-height: 34px; border-radius: 999px; padding: 4px 30px 4px 14px; background-color: var(--surface-2); border-color: transparent; font-weight: 500; box-shadow: none; }
.chat-head .ctl select:hover { background-color: var(--surface-3); }
.chat-head .ctl button { min-height: 34px; border-radius: 999px; padding: 4px 14px; }
.bubble { max-width: min(72%, 560px); padding: 9px 13px 6px; border: 0; border-radius: 16px 16px 16px 5px; box-shadow: 0 1px 2px rgba(23,32,51,.07), 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent); }
.bubble.out { border-radius: 16px 16px 5px 16px; box-shadow: 0 1px 2px rgba(40,88,204,.12); }
.bubble.auto { border: 0; border-left: 0; border-radius: 16px 16px 5px 16px; background: var(--auto-bg); box-shadow: inset 3px 0 0 var(--auto-line), 0 1px 2px rgba(23,32,51,.07); }
.bubble.note { border-radius: 12px; box-shadow: none; }
.bubble .who { display: flex; align-items: center; gap: 5px; }
.bubble-tag { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 4px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em; color: color-mix(in srgb, var(--auto-line) 45%, var(--ink)); background: color-mix(in srgb, var(--auto-line) 22%, transparent); }
.bubble-tag .ic { width: 12px; height: 12px; }
.tick { display: inline-flex; align-items: center; gap: 3px; }
.tick.bad { color: var(--danger-text); }
.mph { display: flex; gap: 8px; }
.file { gap: 10px; border-radius: 10px; }
.file .ic { color: var(--accent-text); }

/* barra de composicao flutuante */
.composer { margin: 4px 20px 18px; padding: 8px 8px 8px 10px; gap: 4px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-md); align-items: flex-end; }
.composer:focus-within { border-color: color-mix(in srgb, var(--focus) 55%, var(--line)); box-shadow: var(--shadow-md), 0 0 0 4px var(--ring); }
.composer textarea { border: 0; box-shadow: none; background: transparent; padding: 9px 8px; min-height: 40px; border-radius: 12px; }
.composer textarea:focus { box-shadow: none; }
.composer .icon-btn { width: 38px; height: 38px; border: 0; background: transparent; box-shadow: none; color: var(--muted); border-radius: 12px; }
.composer .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.composer .icon-btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-xs); }
.composer .icon-btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.pending { margin: 0 20px 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.window-bar { margin: 0 20px 8px; border: 0; border-radius: 14px; }
.tpl-panel { margin: 0 20px 8px; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); }
.notice { gap: 10px; }
.notice .ic { flex: none; }

/* estado vazio com ilustracao */
#chatEmpty { gap: 6px; padding: 24px; text-align: center; background: var(--chat-bg); }
#chatEmpty svg.illus { width: min(300px, 70%); height: auto; margin-bottom: 10px; opacity: 1; stroke-width: initial; }
#chatEmpty h3 { font-size: 20px; font-weight: 800; color: var(--ink); }
#chatEmpty p { max-width: 28em; font-size: 14px; color: var(--muted); }
#chatEmpty .row { margin-top: 10px; justify-content: center; gap: 14px; font-size: 12.5px; }
#chatEmpty .row span { display: inline-flex; align-items: center; gap: 6px; }
#chatEmpty .row .ic { width: 14px; height: 14px; stroke-width: 1.75; opacity: 1; color: var(--accent-text); }

/* ==========================================================================
   Etapa 2: campanhas
   ========================================================================== */
.modal-box.wide { width: min(720px, 100%); }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(470px, 1fr)); gap: 16px; }
.ccard { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease); }
.ccard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: hsl(var(--h) var(--tm-solid)); }
.ccard.noteam::before { background: var(--line-strong); }
.ccard:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.ccard-head { display: flex; align-items: flex-start; gap: 12px; }
.ccard-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--attn-text); background: var(--attn-soft); box-shadow: inset 0 0 0 1px var(--attn-line); }
.ccard-ic.paused { color: var(--warn-ink); background: var(--warn-soft); box-shadow: none; }
.ccard-ic.done { color: var(--info-ink); background: var(--info-soft); box-shadow: none; }
.ccard-ic.canceled { color: var(--danger-text); background: var(--danger-soft); box-shadow: none; }
.ccard-ic.draft { color: var(--muted); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.ccard-title { flex: 1; min-width: 0; }
.ccard-title h4 { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cadence { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.cadence span { display: inline-flex; align-items: center; gap: 6px; }
.cadence .ic { width: 14px; height: 14px; color: var(--muted); }
.progress-wrap .p-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; font-size: 13px; color: var(--muted); }
.progress-wrap .p-top b { font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.pbar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.pbar i { display: block; height: 100%; transition: width .4s ease; }
.pbar .p-sent { background: var(--ok); }
.pbar .p-fail { background: var(--danger); }
.pbar .p-skip { background: var(--attn); }
.ccard.running .pbar .p-sent { background-image: linear-gradient(var(--ok), var(--ok)), linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%, transparent 75%); background-size: 100% 100%, 16px 16px; animation: stripes 1s linear infinite; background-blend-mode: normal; }
@keyframes stripes { to { background-position: 0 0, 16px 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.legend .l-sent i { background: var(--ok); } .legend .l-fail i { background: var(--danger); } .legend .l-skip i { background: var(--attn); }
.legend b { color: var(--ink); font-weight: 700; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini-stats div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.mini-stats b { display: block; font-family: var(--font-display); font-size: 16px; line-height: 1.2; }
.mini-stats small { font-size: 11.5px; }
.ccard .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.ccard .actions button { min-height: 32px; font-size: 13px; padding: 4px 12px; }
.ccard .actions select { min-height: 32px; font-size: 13px; padding: 3px 28px 3px 12px; border-radius: 999px; background-color: var(--surface-2); border-color: transparent; box-shadow: none; max-width: 210px; }
.ccard .actions .grow { flex: 1; }
.ccard .note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--danger-soft); font-weight: 500; }
.ccard .rec { padding: 6px 0; }
.rec-box:empty { display: none; }
.rec-box { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }

/* passos da criacao */
.stepper { display: flex; gap: 8px; margin: 16px 0 6px; }
.stepper .st { flex: 1; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; transition: all var(--ease); }
.stepper .st .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--muted); flex: none; }
.stepper .st .n .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.stepper .st.on { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
.stepper .st.on .n, .stepper .st.done .n { background: var(--accent); color: var(--accent-ink); }
.stepper .st.done { color: var(--ink-2); }
.step-pane { animation: fade .18s ease-out; }
.step-pane > h3 { font-size: 15px; font-weight: 700; margin: 14px 0 0; }
.step-pane > .hint:first-of-type { margin-top: 2px; }
.step-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.step-foot .grow { flex: 1; }
.review { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13.5px; }
.review dt { color: var(--muted); } .review dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.drop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); margin-top: 6px; }
.drop .ic { color: var(--accent-text); }
.drop input[type=file] { border: 0; box-shadow: none; background: transparent; padding: 0; min-height: 0; flex: 1; }
label.field > input[type=file] { margin-top: 6px; }
.form-err { min-height: 0; }

@media (max-width: 760px) {
  .camp-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper .st span:not(.n) { display: none; }
  .stepper .st.on span:not(.n) { display: inline; }
  .composer { margin: 4px 10px 12px; }
  .pending, .window-bar, .tpl-panel { margin-left: 10px; margin-right: 10px; }
  .tabs button { padding: 4px 6px; }
  #msgs { padding: 16px 12px 8px; }
}


/* ---------- etiqueta do canal: Instagram x WhatsApp (conexoes e lista de conversas) ---------- */
.ch-badge { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 18px; color: #fff; white-space: nowrap; }
.ch-badge .ic { width: 12px; height: 12px; }
.ch-badge.ig { background: linear-gradient(135deg, #c13584, #833ab4 60%, #5851db); }
.ch-badge.wa { background: #0f7a4f; }
.conv.ig .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #c13584; }
.conv .meta .ch-badge { max-width: none; }

/* ---------- v4: marca e logo ---------- */
.brand, .login-form .brand-mini { font-family: var(--font-display); font-weight: 800; }
[data-logo] { display: inline-flex; flex: none; line-height: 0; }
.brand span[data-logo] + span { line-height: 1.2; }
