/* ========================================================================
   SAQ Coleta — Design System (light clean corporativo)
   ===================================================================== */
:root {
  /* Marca — verde sustentabilidade / limpeza urbana */
  --brand-50:  #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-ink: #064e3b;

  /* Neutros — tema claro suave (off-white, menos glare) */
  --white: #ffffff;
  --bg:    #e7eaf0;
  --surface: #f8fafc;
  --surface-2: #eef1f6;
  --line:  #dde2ea;
  --line-strong: #ccd2dd;
  --text:  #1f2733;
  --text-2: #51607a;
  --muted: #8a94a6;
  --topbar-bg: rgba(248,250,252,.82);

  /* Status */
  --info: #2563eb;
  --warn: #d97706;
  --ok: #059669;
  --danger: #dc2626;
  --info-bg: #eff6ff;
  --warn-bg: #fffbeb;
  --ok-bg: #ecfdf5;
  --danger-bg: #fef2f2;

  /* Forma */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow: 0 4px 12px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 20px 40px rgba(15,23,42,.10), 0 8px 16px rgba(15,23,42,.06);
  --ring: 0 0 0 4px var(--brand-100);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 248px;
}

/* ---- Tema escuro ---- */
:root[data-theme="dark"] {
  --bg:    #0e1217;
  --surface: #161b22;
  --surface-2: #1d232c;
  --line:  #2a313c;
  --line-strong: #3a4250;
  --text:  #e6eaf0;
  --text-2: #a7b1c0;
  --muted: #6e7888;

  --brand-50:  rgba(16,185,129,.12);
  --brand-100: rgba(16,185,129,.20);
  --brand-200: rgba(16,185,129,.34);

  --info: #60a5fa;
  --warn: #fbbf24;
  --ok: #34d399;
  --danger: #f87171;
  --info-bg: rgba(96,165,250,.14);
  --warn-bg: rgba(251,191,36,.14);
  --ok-bg: rgba(52,211,153,.14);
  --danger-bg: rgba(248,113,113,.14);

  --topbar-bg: rgba(22,27,34,.82);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.55), 0 8px 16px rgba(0,0,0,.4);
  --ring: 0 0 0 4px rgba(16,185,129,.28);
}

/* Botão de alternar tema */
.theme-toggle { font-size: 16px; line-height: 1; padding: 8px 10px; }
.theme-toggle .i-light { display: none; }
.theme-toggle .i-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .i-light { display: inline; }
:root[data-theme="dark"] .theme-toggle .i-dark { display: none; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }

/* ---- Botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  transition: all .15s ease; font-size: 14px; line-height: 1;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: var(--r); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---- Badges / status ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-aberto      { color: var(--text-2); background: var(--surface-2); border-color: var(--line); }
.badge-coletando   { color: var(--warn); background: var(--warn-bg); border-color: #fde68a; }
.badge-aguardando  { color: var(--info); background: var(--info-bg); border-color: #bfdbfe; }
.badge-finalizado  { color: var(--ok); background: var(--ok-bg); border-color: var(--brand-200); }
.badge-cancelado   { color: var(--danger); background: var(--danger-bg); border-color: #fecaca; }

/* ---- Inputs ---- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
input, textarea, select {
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong);
  padding: 11px 13px; border-radius: var(--r-sm); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.alert { font-size: 14px; padding: 11px 14px; border-radius: var(--r-sm); }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

/* ========================================================================
   App shell (sidebar + topbar)
   ===================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 800; font-size: 18px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; font-size: 18px;
}
.logo-mark.sm { width: 26px; height: 26px; font-size: 15px; border-radius: 7px; }
.logo b span { color: var(--brand-600); }
.nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 14px; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 2; }
.nav-spacer { flex: 1; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: var(--topbar-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 700; flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.page { padding: 28px; max-width: 1180px; width: 100%; }

/* ---- Cards genéricos ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }

/* ---- KPIs ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi .kpi-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.kpi .kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 10px; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ico-emerald { background: var(--brand-50); color: var(--brand-600); }
.ico-amber { background: var(--warn-bg); color: var(--warn); }
.ico-blue { background: var(--info-bg); color: var(--info); }
.ico-slate { background: var(--surface-2); color: var(--text-2); }

/* ---- Gráfico de barras (CSS puro) ---- */
.chart-card { padding: 20px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chart-head h3 { font-size: 15px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 70%; max-width: 42px; background: linear-gradient(to top, var(--brand-500), var(--brand-200)); border-radius: 6px 6px 0 0; min-height: 4px; transition: height .4s ease; position: relative; }
.bar:hover::after { content: attr(data-v); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.bar-label { font-size: 11px; color: var(--muted); }

/* lista categorias */
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-row { display: grid; grid-template-columns: 130px 1fr 36px; align-items: center; gap: 10px; font-size: 13px; }
.cat-bar-track { background: var(--surface-2); border-radius: 999px; height: 8px; overflow: hidden; }
.cat-bar-fill { height: 100%; background: var(--brand-500); border-radius: 999px; }
.cat-val { text-align: right; font-weight: 700; color: var(--text-2); }

/* ========================================================================
   Auth (login)
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(150deg, var(--brand-700), var(--brand-ink)); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .logo { color: #fff; }
.auth-side h2 { font-size: 30px; margin-top: 40px; max-width: 420px; }
.auth-side p { color: var(--brand-100); margin-top: 14px; max-width: 420px; }
.auth-quote { border-left: 3px solid var(--brand-200); padding-left: 16px; color: var(--brand-100); font-size: 14px; }
.auth-main { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 24px; }
@media (max-width: 880px) { .auth-side { display: none; } .auth-wrap { grid-template-columns: 1fr; } }

/* ========================================================================
   Chamados — lista
   ===================================================================== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13px; font-weight: 600; transition: all .12s; }
.chip:hover { border-color: var(--muted); }
.chip-on { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

.table-card { overflow: hidden; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
table.list td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background .1s; }
table.list tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.proto { font-weight: 700; color: var(--brand-700); }
.cell-contato { font-weight: 600; }
.cell-resumo { color: var(--text-2); max-width: 380px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .emoji { font-size: 40px; margin-bottom: 8px; }

/* ========================================================================
   Detalhe do chamado (conversa + dados + ações)
   ===================================================================== */
.detalhe { display: grid; grid-template-columns: 1fr 340px; gap: 20px; height: calc(100vh - 64px - 56px); }
.conversa { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.conversa-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.conversa-head h2 { font-size: 16px; flex: 1; }
.voltar { color: var(--text-2); font-size: 14px; }
.mensagens { flex: 1; overflow-y: auto; padding: 20px; background: var(--surface-2); }
#msgs { display: flex; flex-direction: column; gap: 12px; }

.bolha { max-width: 72%; padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow-sm); font-size: 14px; }
.bolha-recebida { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bolha-enviada  { align-self: flex-end; background: var(--brand-600); color: #fff; border-bottom-right-radius: 4px; }
.bolha-operador { align-self: flex-end; background: var(--info); color: #fff; border-bottom-right-radius: 4px; }
.bolha-sistema  { align-self: center; background: transparent; color: var(--muted); font-size: 12px; box-shadow: none; max-width: 90%; text-align: center; }
.bolha-meta { font-size: 11px; opacity: .75; margin-bottom: 4px; font-weight: 600; }
.bolha-texto { white-space: pre-wrap; word-break: break-word; }
.bolha-img { max-width: 240px; border-radius: 10px; margin-bottom: 6px; }

.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { resize: none; min-height: 44px; max-height: 120px; }

.painel-lado { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.lado-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.lado-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 14px; }
.dados-dl { display: flex; flex-direction: column; gap: 12px; }
.dados-dl dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.dados-dl dd { margin: 2px 0 0; font-size: 14px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ========================================================================
   Conexão WhatsApp
   ===================================================================== */
.conexao { max-width: 720px; }
.conn-card { padding: 28px; text-align: center; }
.conn-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 999px; margin-bottom: 8px; }
.conn-on { background: var(--ok-bg); color: var(--ok); }
.conn-off { background: var(--danger-bg); color: var(--danger); }
.conn-connecting { background: var(--warn-bg); color: var(--warn); }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.conn-on .conn-dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: inline-block; margin: 16px auto; box-shadow: var(--shadow); }
.qr-box img { width: 256px; height: 256px; }
.conn-steps { text-align: left; max-width: 380px; margin: 20px auto 0; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); font-size: 14px; }
.conn-steps li { display: flex; gap: 10px; }
.step-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* spinner */
.spinner { width: 22px; height: 22px; border: 3px solid var(--brand-100); border-top-color: var(--brand-600); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================================================
   Landing page (marketing)
   ===================================================================== */
.lp-nav { position: sticky; top: 0; z-index: 50; background: var(--topbar-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.lp-nav-inner { max-width: 1140px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 28px; }
.lp-nav .logo { font-size: 18px; }
.lp-nav nav { flex: 1; display: flex; gap: 26px; }
.lp-nav nav a { color: var(--text-2); font-weight: 500; font-size: 14px; }
.lp-nav nav a:hover { color: var(--text); }
.lp-nav-cta { display: flex; gap: 10px; align-items: center; }
@media (max-width: 760px) { .lp-nav nav { display: none; } }

.lp-section { max-width: 1140px; margin: 0 auto; padding: 96px 24px; }
.lp-hero { text-align: center; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-50), transparent); }
.lp-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--brand-200); }
.lp-hero h1 { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; margin: 22px auto 0; max-width: 820px; }
.lp-hero h1 .hl { background: linear-gradient(120deg, var(--brand-600), var(--brand-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p.sub { font-size: 19px; color: var(--text-2); max-width: 620px; margin: 22px auto 0; }
.lp-hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.lp-hero-note { font-size: 13px; color: var(--muted); margin-top: 16px; }
@media (max-width: 760px) { .lp-hero h1 { font-size: 38px; } .lp-section { padding: 64px 24px; } }

.lp-mock { max-width: 1000px; margin: 56px auto 0; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; background: var(--surface); }
.lp-mock-bar { display: flex; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lp-mock-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.lp-mock-body { display: grid; grid-template-columns: 180px 1fr; min-height: 320px; }
.lp-mock-side { background: var(--surface-2); border-right: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.lp-mock-side .mi { height: 30px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); }
.lp-mock-side .mi.on { background: var(--brand-50); border-color: var(--brand-200); }
.lp-mock-main { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.lp-mock-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.lp-mock-kpis .mk { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; height: 72px; }
.lp-mock-chart { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }

.lp-logos { text-align: center; }
.lp-logos p { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.lp-logos-row { display: flex; justify-content: center; gap: 48px; margin-top: 22px; flex-wrap: wrap; opacity: .6; font-weight: 800; font-size: 20px; color: var(--text-2); }

.lp-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.lp-head .lp-eyebrow { margin-bottom: 16px; }
.lp-head h2 { font-size: 38px; font-weight: 800; }
.lp-head p { color: var(--text-2); font-size: 17px; margin-top: 14px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .f-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin-bottom: 16px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: 14px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } .lp-head h2 { font-size: 30px; } }

.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.step .s-n { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 14px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.lp-cta-band { background: linear-gradient(135deg, var(--brand-700), var(--brand-ink)); border-radius: var(--r-xl); padding: 60px; text-align: center; color: #fff; }
.lp-cta-band h2 { font-size: 34px; font-weight: 800; }
.lp-cta-band p { color: var(--brand-100); margin-top: 12px; font-size: 17px; }
.lp-cta-band .btn-primary { background: #fff; color: var(--brand-700); margin-top: 26px; }
.lp-cta-band .btn-primary:hover { background: var(--brand-50); }

.pricing { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; align-items: start; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; box-shadow: var(--shadow-sm); }
.price-card.popular { border-color: var(--brand-500); box-shadow: var(--shadow-lg); position: relative; }
.price-card.popular::before { content: "Mais popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 999px; }
.price-card h3 { font-size: 18px; }
.price-card .price { font-size: 40px; font-weight: 800; margin: 14px 0 2px; letter-spacing: -0.03em; }
.price-card .price span { font-size: 15px; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 12px; }
.price-card li { display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.price-card li svg { color: var(--brand-600); flex: none; }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; } }

.lp-footer { border-top: 1px solid var(--line); background: var(--surface); }
.lp-footer-inner { max-width: 1140px; margin: 0 auto; padding: 48px 24px; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.lp-footer .muted { font-size: 13px; }
.lp-footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.lp-footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.lp-footer-col a { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 8px; }
.lp-footer-col a:hover { color: var(--text); }

/* ---- Editor de campos do agente ---- */
.campos-edit { display: flex; flex-direction: column; gap: 10px; }
.campo-row { display: flex; align-items: center; gap: 10px; }
.campo-row input[type="text"] { flex: 1; }
.campo-obrig { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; font-weight: 600; }
.campo-obrig input { width: auto; }

/* ---- Mídia nas bolhas ---- */
.bolha-audio { width: 240px; max-width: 100%; margin-bottom: 4px; height: 40px; }
.bolha-doc { display: inline-block; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; margin-bottom: 4px; }
.bolha-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--brand-600); background: var(--brand-50); padding: 1px 7px; border-radius: 999px; margin-right: 4px; }
.bolha-enviada .bolha-tag, .bolha-operador .bolha-tag { background: rgba(255,255,255,.2); color: #fff; }

/* ---- Prioridade ---- */
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.prio::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; }
.prio-alta  { color: var(--danger); background: var(--danger-bg); }
.prio-media { color: var(--warn); background: var(--warn-bg); }
.prio-baixa { color: var(--text-2); background: var(--surface-2); }

/* ---- Mapa operacional ---- */
.mapa-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.mapa-legenda { display: flex; gap: 16px; flex-wrap: wrap; }
.mapa-legenda .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.mapa-legenda .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.mapa-box { height: calc(100vh - 210px); min-height: 420px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); z-index: 0; }
.leaflet-container { font-family: var(--font); }

/* ---- Base de conhecimento ---- */
.kb-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kb-q { font-weight: 600; margin-bottom: 4px; }
.kb-a { font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
@media (max-width: 980px) { .mapa-box { height: 60vh; } }

/* ---- Aviso de duplicado ---- */
.dup-aviso { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; border-radius: var(--r); padding: 12px 14px; font-size: 13px; font-weight: 500; }
:root[data-theme="dark"] .dup-aviso { border-color: rgba(251,191,36,.3); }

/* ========================================================================
   Ordem de Serviço (documento A4 imprimível)
   ===================================================================== */
.os-toolbar { max-width: 800px; margin: 20px auto 0; display: flex; justify-content: space-between; gap: 10px; padding: 0 16px; }
.os-doc {
  max-width: 800px; margin: 16px auto 40px; background: #fff; color: #111827;
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 40px 44px;
}
.os-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--brand-600); padding-bottom: 16px; }
.os-brand { display: flex; align-items: center; gap: 10px; }
.os-brand-name { font-weight: 800; font-size: 18px; color: #111827; }
.os-brand-name b { color: var(--brand-600); }
.os-brand-sub { font-size: 12px; color: #6b7280; }
.os-title { text-align: right; }
.os-title-main { font-weight: 800; font-size: 16px; letter-spacing: .04em; color: #111827; }
.os-proto { font-size: 14px; color: #6b7280; margin-top: 2px; }
.os-tags { display: flex; gap: 8px; margin: 16px 0 6px; flex-wrap: wrap; }

.os-sec { margin-top: 22px; page-break-inside: avoid; }
.os-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-700); border-bottom: 1px solid #e5e7eb; padding-bottom: 6px; margin-bottom: 12px; }
.os-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.os-linha { display: flex; flex-direction: column; padding: 4px 0; }
.os-rot { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #9ca3af; font-weight: 600; }
.os-val { font-size: 14px; color: #111827; }
.os-bloco { margin-top: 12px; }
.os-bloco p { font-size: 14px; color: #111827; margin-top: 4px; white-space: pre-wrap; }
.os-link { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--brand-700); word-break: break-all; }

.os-fotos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.os-foto { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; page-break-inside: avoid; }
.os-foto img { width: 100%; height: 230px; object-fit: cover; display: block; }

.os-transc { width: 100%; border-collapse: collapse; }
.os-transc td { border-bottom: 1px solid #f0f1f3; padding: 8px 6px; font-size: 13px; color: #111827; vertical-align: top; }
.os-transc-quem { white-space: nowrap; font-weight: 600; color: #374151; width: 110px; }
.os-transc-hora { font-weight: 400; color: #9ca3af; font-size: 11px; }

.os-foot { margin-top: 40px; display: flex; justify-content: space-between; align-items: flex-end; }
.os-assinatura { text-align: center; }
.os-assina-linha { width: 240px; border-top: 1px solid #374151; margin-bottom: 6px; }
.os-assinatura span { font-size: 12px; color: #6b7280; }
.os-emissao { font-size: 11px; color: #9ca3af; text-align: right; }

@media print {
  body { background: #fff; }
  .os-toolbar { display: none !important; }
  .os-doc { box-shadow: none; border: 0; margin: 0; max-width: none; padding: 0; }
  .os-foto img { height: 200px; }
  @page { margin: 16mm; }
}

/* ---- Handoff humano ---- */
.lado-card.atendimento.modo-humano { border-color: var(--info); background: var(--info-bg); }
.atend-status { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--info); }
.atend-status.atend-ia { color: var(--brand-700); }
.atend-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.chip-humano { margin-left: 6px; font-size: 13px; }

/* ---- Logs do sistema ---- */
.logs-table td { vertical-align: top; }
.log-hora { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.log-msg { font-size: 14px; color: var(--text); }
.log-dados { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.log-nivel { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .03em; }
.lvl-INFO  { color: var(--info); background: var(--info-bg); }
.lvl-WARN  { color: var(--warn); background: var(--warn-bg); }
.lvl-ERROR { color: var(--danger); background: var(--danger-bg); }
.lvl-DEBUG { color: var(--muted); background: var(--surface-2); }

/* ---- SLA / equipe ---- */
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ico-red { background: var(--danger-bg); color: var(--danger); }
.sla-atrasado { color: var(--danger); font-weight: 700; font-size: 13px; white-space: nowrap; }
.atend-resp { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }

/* ---- Tempo real: sininho + toasts ---- */
.sino { position: relative; font-size: 18px; text-decoration: none; padding: 4px; line-height: 1; }
.sino-badge { position: absolute; top: -4px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.toasts { position: fixed; top: 76px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--surface); border: 1px solid var(--brand-200); border-left: 4px solid var(--brand-600); color: var(--text); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: toastIn .35s ease; max-width: 320px; }
.toast.saindo { animation: toastOut .4s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---- Login: vida no painel lateral (split-screen) ---- */
.auth-side { position: relative; overflow: hidden; background: linear-gradient(150deg,#047857,#064e3b 55%,#0e7490); background-size: 200% 200%; animation: authGrad 18s ease infinite; }
@keyframes authGrad { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.auth-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(110,231,183,.35), transparent 70%); top: -120px; right: -120px; filter: blur(20px); animation: authGlow 12s ease-in-out infinite; pointer-events: none; }
@keyframes authGlow { 0%,100%{transform:translate(0,0) scale(1);opacity:.7} 50%{transform:translate(-30px,40px) scale(1.15);opacity:1} }
.auth-side > * { position: relative; z-index: 1; }
.auth-side-mid h2 { font-size: 30px; }
.auth-feats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.auth-feats span { font-size: 13px; font-weight: 600; color: #d1fae5; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 7px 13px; border-radius: 999px; backdrop-filter: blur(6px); }
.auth-card h1 { font-size: 26px; }
