/* Atendimento Uai · visual aprovado (claro e escuro, cor da marca por cliente) */
:root {
  --brand: #0071E3;
  --bg: #F5F5F7; --card: #FFFFFF; --soft: #F2F2F7; --ink: #1D1D1F; --ink2: #3A3A3C; --muted: #68686E; --line: #E5E5EA;
  --link: #0066CC;
  --ok-bg: #E3F5E8; --ok: #1E7B34; --wait-bg: #FFF1DC; --wait: #8A5100; --no-bg: #FDE8E7; --no: #B42318;
  --info-bg: #E6EEFF; --info: #1B4FBF; --you-bg: #F1E6FF; --you: #6B21A8;
  --side: color-mix(in srgb, var(--brand) 6%, #F7F7F9);
  --tint: color-mix(in srgb, var(--brand) 9%, #FFFFFF);
  --chat: color-mix(in srgb, var(--brand) 4%, #F7F7F9);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.04);
  --raio: 22px;
  --fonte: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --titulo: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  color-scheme: light;
}
html.escuro {
  color-scheme: dark;
  --bg: #0B0B0C; --card: #1C1C1E; --soft: #2C2C2E; --ink: #F5F5F7; --ink2: #D1D1D6; --muted: #A1A1A6; --line: #38383A;
  --link: #6CB0FF;
  --ok-bg: #16301E; --ok: #7EE2A0; --wait-bg: #3A2A10; --wait: #FFC56B; --no-bg: #3B1A18; --no: #FF9C94;
  --info-bg: #17243F; --info: #9DBBFF; --you-bg: #2A1A3E; --you: #D3A8FF;
  --side: color-mix(in srgb, var(--brand) 10%, #111113);
  --tint: color-mix(in srgb, var(--brand) 20%, #1C1C1E);
  --chat: color-mix(in srgb, var(--brand) 6%, #141416);
  --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--fonte); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--titulo); margin: 0; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
img { max-width: 100%; }

/* ---------- Casca ---------- */
.casca { display: flex; flex-wrap: wrap; min-height: 100vh; }
.lateral {
  flex: 1 1 230px; max-width: 280px; padding: 24px 16px; display: flex; flex-direction: column; gap: 22px;
  background: var(--side); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.lateral.admin { background: #141415; color: #F5F5F7; border-right-color: #232325; --brand: #C2410C; }
.principal { flex: 999 1 560px; min-width: 0; padding: 28px clamp(16px, 4vw, 44px) 56px; display: flex; flex-direction: column; gap: 22px; }
.marca-bloco { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.logo-quad {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font: 700 20px var(--titulo); overflow: hidden;
}
.logo-quad.img { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.logo-quad img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.marca-bloco .rot { font-size: 12px; color: var(--muted); }
.marca-bloco .nome { font: 700 17px var(--titulo); letter-spacing: -0.01em; line-height: 1.15; }
.lateral.admin .marca-bloco .rot { color: #A1A1A6; }
.status-zap { display: flex; align-items: center; gap: 8px; margin: 0 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.status-zap.on { background: var(--ok-bg); color: var(--ok); }
.status-zap.off { background: var(--no-bg); color: var(--no); }
.status-zap.wait { background: var(--wait-bg); color: var(--wait); }
.ponto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-zap.on .ponto { background: #34C759; box-shadow: 0 0 0 4px rgba(52,199,89,.2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.lateral.admin .nav a { color: #F5F5F7; }
.nav a:hover { background: var(--soft); }
.lateral.admin .nav a:hover { background: #2C2C2E; }
.nav a.on, .nav a.on:hover { background: var(--brand); color: #fff; font-weight: 600; }
.nav svg { flex-shrink: 0; }
.selo { margin-left: auto; background: #FF3B30; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.voltar-admin { display: flex; align-items: center; gap: 8px; margin: 0 8px; padding: 8px 12px; border-radius: 10px; background: #1D1D1F; color: #fff; font-size: 13px; font-weight: 600; }
html.escuro .voltar-admin { background: #F5F5F7; color: #1D1D1F; }
.voltar-admin:hover { text-decoration: none; filter: brightness(1.1); }
.rodape-lateral { margin-top: auto; padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.lateral.admin .rodape-lateral { border-top-color: #2C2C2E; }
.rodape-lateral .quem { display: flex; flex-direction: column; font-size: 13px; min-width: 0; flex: 1; }
.rodape-lateral .quem span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rodape-lateral .icone-botao { width: 36px; height: 36px; border-radius: 10px; }
.rodape-lateral .quem span:last-child { color: var(--muted); }
.lateral.admin .rodape-lateral .quem span:last-child { color: #A1A1A6; }
.icone-botao { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lateral.admin .icone-botao { border-color: #3A3A3C; background: #1C1C1E; color: #F5F5F7; }

/* ---------- Avatares ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
  background: color-mix(in srgb, var(--h, #0A84FF) 20%, var(--card)); color: color-mix(in srgb, var(--h, #0A84FF) 55%, var(--ink)); }
.avatar.g { width: 44px; height: 44px; }
.avatar.p { width: 34px; height: 34px; font-size: 13px; }

/* ---------- Tipografia de página ---------- */
.cabeca { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cabeca .sub { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cabeca h1 { font-size: clamp(30px, 4vw, 38px); font-weight: 700; letter-spacing: -0.03em; }
.cartao { background: var(--card); border-radius: var(--raio); box-shadow: var(--shadow); padding: 20px; }
.cartao > h2, .cartao-topo h2 { font-size: 20px; font-weight: 700; }
.cartao-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.cartao-topo a { font-size: 14px; font-weight: 500; }
.linha { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.linha:first-of-type { border-top: 0; }
.linha .meio { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.linha .t { font-weight: 600; font-size: 15px; }
.linha .d { font-size: 14px; color: var(--ink2); }
.linha .m { font-size: 13px; color: var(--muted); }
.hora { font-size: 15px; font-weight: 700; width: 52px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.vazio { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.duas-colunas { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.duas-colunas > * { flex: 1 1 360px; min-width: 0; }
.ajuda { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }

/* ---------- Herói (Hoje) ---------- */
.heroi { position: relative; overflow: hidden; background: var(--brand); color: #fff; border-radius: 26px; padding: clamp(22px, 3vw, 32px); display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.heroi::before, .heroi::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); pointer-events: none; }
.heroi::before { right: -60px; top: -80px; width: 280px; height: 280px; }
.heroi::after { right: 140px; bottom: -120px; width: 220px; height: 220px; background: rgba(255,255,255,.07); }
.heroi > * { position: relative; }
.heroi .texto { display: flex; flex-direction: column; gap: 8px; max-width: 580px; }
.heroi .data { font-size: 14px; font-weight: 500; opacity: .9; }
.heroi h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.heroi p { margin: 0; font-size: 17px; line-height: 1.45; opacity: .96; }
.heroi .acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.botao-branco { background: #fff; color: #1D1D1F; border-radius: 999px; padding: 11px 18px; font-size: 14px; font-weight: 700; border: 0; }
.botao-branco:hover { text-decoration: none; }
.chave-robo { display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 8px 6px 16px; font-size: 14px; font-weight: 600; min-height: 44px; }
.anel { width: 132px; height: 132px; flex-shrink: 0; position: relative; }
.anel .valor { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anel .valor b { font: 700 30px var(--titulo); }
.anel .valor span { font-size: 12px; opacity: .9; }

/* ---------- Interruptor ---------- */
.trilho { width: 44px; height: 26px; border-radius: 13px; padding: 2px; background: rgba(120,120,128,.32); display: inline-flex; transition: background .2s; flex-shrink: 0; }
.trilho::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.trilho.on { background: #34C759; }
.trilho.on::after { transform: translateX(18px); }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; background: none; border: 0; padding: 0; text-align: left; width: 100%; color: var(--ink); }

/* ---------- Métricas ---------- */
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.metrica { background: var(--card); box-shadow: var(--shadow); border-radius: 20px; padding: 18px; display: flex; gap: 14px; align-items: center; }
.metrica b { font: 700 28px var(--titulo); letter-spacing: -0.02em; line-height: 1; display: block; }
.metrica span { font-size: 13px; color: var(--muted); }
.icone-quad { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Chips ---------- */
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--ink2); }
.chip.ok, .icone-quad.ok { background: var(--ok-bg); color: var(--ok); }
.chip.wait, .icone-quad.wait { background: var(--wait-bg); color: var(--wait); }
.chip.no, .icone-quad.no { background: var(--no-bg); color: var(--no); }
.chip.info, .icone-quad.info { background: var(--info-bg); color: var(--info); }
.chip.you, .icone-quad.you { background: var(--you-bg); color: var(--you); }
.chip.marca { background: var(--brand); color: #fff; }

/* ---------- Botões e campos ---------- */
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--brand); color: #fff; border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 700; min-height: 44px; transition: transform .15s, filter .15s; white-space: nowrap; }
.botao:hover { filter: brightness(1.07); text-decoration: none; }
.botao:active { transform: scale(.97); }
.botao.sec { background: var(--soft); color: var(--ink); }
.botao.contorno { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.botao.fantasma { background: transparent; color: var(--link); padding-inline: 8px; }
.botao.perigo { background: transparent; color: var(--no); padding-inline: 10px; }
.botao.peq { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.botao[disabled] { opacity: .55; cursor: default; filter: none; transform: none; }
.botao .giro { width: 16px; height: 16px; border-width: 2px; }
.rotulo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.campo { height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font-size: 15px; color: var(--ink); background: var(--soft); width: 100%; min-width: 0; }
textarea.campo { height: auto; min-height: 120px; padding: 12px; line-height: 1.5; resize: vertical; }
.campo:focus { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 0; border-color: transparent; }
.campo::placeholder { color: var(--muted); }
.grade-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checa { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.checa input { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }
.barra-acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.barra-acoes.fim { justify-content: flex-end; }
.separa { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.giro { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: girar .8s linear infinite; display: inline-block; }
@keyframes girar { to { transform: rotate(360deg); } }
.carregando-tela { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.carregando { padding: 40px; display: flex; justify-content: center; color: var(--muted); }

/* ---------- Abas ---------- */
.abas { display: inline-flex; align-self: flex-start; background: var(--soft); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.abas button { border: 0; background: transparent; color: var(--ink2); border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 600; min-height: 36px; }
.abas button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.filtros button { border: 0; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600; min-height: 36px; background: var(--soft); color: var(--ink); }
.filtros button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* ---------- Conversas ---------- */
.conversas { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; min-height: calc(100vh - 56px); }
.lista-conversas { flex: 1 1 300px; max-width: 390px; min-width: 0; padding: 18px 12px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 56px); }
.lista-conversas .rolagem { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.item-conversa { display: flex; gap: 12px; align-items: flex-start; width: 100%; border: 0; border-radius: 14px; padding: 12px; background: transparent; text-align: left; color: inherit; }
.item-conversa:hover { background: var(--soft); text-decoration: none; }
.item-conversa.on { background: var(--tint); }
.item-conversa .meio { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.item-conversa .topo { display: flex; justify-content: space-between; gap: 8px; }
.item-conversa .nome { font-weight: 600; font-size: 15px; color: var(--ink); }
.item-conversa .quando { font-size: 12px; color: var(--muted); white-space: nowrap; }
.item-conversa .previa { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-conversa .chip { align-self: flex-start; font-size: 11px; padding: 2px 9px; }
.busca { display: flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 12px; padding: 0 12px; height: 42px; color: var(--muted); }
.busca input { border: 0; background: transparent; font-size: 14px; flex: 1; outline: none; color: var(--ink); min-width: 0; }
.conversa-aberta { flex: 999 1 420px; min-width: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; max-height: calc(100vh - 56px); }
.conversa-aberta header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.conversa-aberta header .meio { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 160px; }
.conversa-aberta header .nome { font: 700 18px var(--titulo); }
.conversa-aberta header .m { font-size: 13px; color: var(--muted); }
.faixa-assumida { display: flex; align-items: center; gap: 10px; background: var(--you-bg); color: var(--you); padding: 10px 20px; font-size: 14px; font-weight: 500; }
.corpo-conversa { display: flex; flex-wrap: wrap; flex: 1; min-height: 0; }
.mensagens { flex: 999 1 320px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--chat); overflow-y: auto; max-height: 100%; }
.msg { display: flex; }
.msg.r, .msg.e { justify-content: flex-end; }
.bolha { max-width: 78%; padding: 10px 14px; border-radius: 20px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg.c .bolha { background: var(--card); color: var(--ink); border-bottom-left-radius: 6px; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.msg.r .bolha { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.msg.e .bolha { background: #1D1D1F; color: #fff; border-bottom-right-radius: 6px; }
html.escuro .msg.e .bolha { background: #F5F5F7; color: #1D1D1F; }
.bolha .autor { display: block; font-size: 11px; font-weight: 700; margin-bottom: 3px; opacity: .8; }
.bolha .quando { display: block; text-align: right; font-size: 11px; opacity: .75; margin-top: 4px; }
.info-conversa { flex: 1 1 230px; min-width: 0; padding: 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.bloco-ia { background: var(--tint); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.bloco-ia p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.titulinho { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.bloco-ia .titulinho { color: var(--ink); }
.caminho { display: flex; flex-wrap: wrap; gap: 6px; }
.caminho span { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--ink2); }
.caminho span:last-child { background: var(--brand); color: #fff; }
.escrever { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.escrever textarea { flex: 1; min-height: 44px; max-height: 140px; border: 1px solid var(--line); border-radius: 22px; padding: 11px 16px; font-size: 15px; background: var(--soft); color: var(--ink); resize: none; outline: none; line-height: 1.4; }
.enviar { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.selecione { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 40px; text-align: center; }

/* ---------- Agenda ---------- */
.dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.dia { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; border-radius: 18px; padding: 12px 4px 14px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.dia .s { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.dia .n { font: 700 24px var(--titulo); line-height: 1.1; }
.dia .pontos { display: flex; gap: 3px; height: 6px; }
.dia .pontos i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, #34C759); }
.dia.on { background: var(--brand); color: #fff; }
.dia.on .pontos i { background: #fff; }
.dia.fechado:not(.on) { opacity: .55; }
.item-agenda { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.item-agenda:last-child { border-bottom: 0; }
.item-agenda .h { display: flex; flex-direction: column; width: 60px; }
.item-agenda .h b { font-size: 18px; font-variant-numeric: tabular-nums; }
.item-agenda .h span { font-size: 12px; color: var(--muted); }
.barrinha { width: 4px; align-self: stretch; border-radius: 2px; background: var(--c, #34C759); }
.dias-semana { display: flex; gap: 6px; flex-wrap: wrap; }
.dias-semana button { min-width: 44px; height: 44px; border-radius: 12px; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.dias-semana button[aria-pressed="true"] { border-color: transparent; background: var(--brand); color: #fff; }

/* ---------- Promoções ---------- */
.dica-zap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: var(--tint); border-radius: 18px; padding: 16px 18px; }
.dica-zap .zap { width: 42px; height: 42px; border-radius: 12px; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dica-zap > span:last-child { font-size: 15px; line-height: 1.45; color: var(--ink2); flex: 1; min-width: 220px; }
.grade-itens { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.item { background: var(--card); box-shadow: var(--shadow); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s; }
.item:hover { transform: translateY(-2px); }
.capa { min-height: 150px; padding: 18px; display: flex; flex-direction: column; gap: 6px; background: color-mix(in srgb, var(--h) 22%, var(--card)); color: color-mix(in srgb, var(--h) 60%, var(--ink)); }
.capa.apagada { background: color-mix(in srgb, var(--h) 10%, var(--card)); }
.capa .selo-capa { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.capa .chamada { font: 700 24px var(--titulo); line-height: 1.05; letter-spacing: -0.02em; }
.capa .preco { margin-top: auto; font-size: 13px; font-weight: 600; opacity: .9; }
.item .corpo { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.item .corpo p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.item .corpo h3 { font-size: 18px; font-weight: 700; }
.item .botoes { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.previa-rascunho { border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); }

/* ---------- Base ---------- */
.assunto { display: flex; flex-direction: column; gap: 10px; }
.assunto pre { margin: 0; white-space: pre-wrap; font: 14px/1.5 var(--fonte); color: var(--ink2); max-height: 160px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }

/* ---------- Modal ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: surgir .15s ease; }
.modal { background: var(--card); border-radius: 24px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { font-size: 22px; }
@keyframes surgir { from { opacity: 0; } }
.subir-imagem { display: flex; align-items: center; gap: 14px; border: 1.5px dashed var(--line); border-radius: 16px; padding: 16px; cursor: pointer; }
.subir-imagem:hover { border-color: var(--brand); }
.subir-imagem .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--soft); color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.subir-imagem .ic img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Avisos (toast) ---------- */
.avisos { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(480px, calc(100% - 32px)); pointer-events: none; }
.aviso { background: #1D1D1F; color: #fff; border-radius: 14px; padding: 12px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: subir .2s ease; white-space: pre-line; pointer-events: auto; }
html.escuro .aviso { background: #F5F5F7; color: #1D1D1F; }
.aviso.erro { background: #B42318; color: #fff; }
@keyframes subir { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Entrar ---------- */
.entrar { min-height: 100vh; display: flex; flex-direction: column; align-items: center; background: var(--bg); }
.entrar-topo { position: relative; overflow: hidden; width: 100%; background: var(--brand); color: #fff; padding: 72px 24px 110px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.entrar-topo::before, .entrar-topo::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); }
.entrar-topo::before { left: -70px; top: -60px; width: 240px; height: 240px; }
.entrar-topo::after { right: -50px; bottom: -40px; width: 200px; height: 200px; background: rgba(255,255,255,.08); }
.entrar-topo > * { position: relative; }
.entrar-logo { width: 76px; height: 76px; border-radius: 22px; background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; font: 700 34px var(--titulo); box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; }
.entrar-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.entrar-topo .rot { font-size: 15px; opacity: .9; }
.entrar-topo .nome { font: 700 28px var(--titulo); letter-spacing: -0.02em; }
.entrar-cartao { margin-top: -70px; position: relative; width: min(420px, calc(100% - 32px)); background: var(--card); border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.12); padding: 26px 22px; display: flex; flex-direction: column; gap: 16px; }
html.escuro .entrar-cartao { box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.entrar-cartao h1 { font-size: 24px; }
.entrar-cartao p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.botao-zap { height: 52px; border: 0; border-radius: 16px; background: #25D366; color: #0B3B1E; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.botao-zap[disabled] { opacity: .6; }
.botao-entrar { height: 52px; border-radius: 16px; font-size: 16px; }
.caixas-codigo { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.caixas-codigo input { height: 54px; border-radius: 14px; border: 0; text-align: center; font: 700 24px var(--titulo); background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); width: 100%; min-width: 0; padding: 0; }
.caixas-codigo input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.entrar-rodape { margin: auto 0 28px; padding-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Admin ---------- */
.grade-clientes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cartao-cliente { display: flex; flex-direction: column; gap: 14px; color: inherit; transition: transform .2s; }
.cartao-cliente:hover { transform: translateY(-2px); text-decoration: none; }
.cartao-cliente .topo { display: flex; align-items: center; gap: 12px; }
.cartao-cliente .numeros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cartao-cliente .numeros div { background: var(--soft); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.cartao-cliente .numeros b { font: 700 20px var(--titulo); }
.cartao-cliente .numeros span { font-size: 12px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.progresso { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progresso div { height: 6px; background: var(--brand); border-radius: 3px; transition: width .3s; }
.etapas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.etapas li { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 10px 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.etapas li.atual { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.etapas li.feita { color: var(--ink); }
.etapas .bola { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; background: var(--line); color: var(--ink2); }
.etapas li.atual .bola { background: var(--brand); color: #fff; }
.etapas li.feita .bola { background: #34C759; color: #fff; }
.qr-caixa { position: relative; padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0,0,0,.08); width: 264px; height: 264px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #68686E; }
.qr-caixa img { width: 232px; height: 232px; image-rendering: pixelated; }
.passos-zap { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.passos-zap li { display: flex; gap: 12px; align-items: flex-start; }
.passos-zap li > span:first-child { width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: var(--ink); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.faixa { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; }
.faixa.wait { background: var(--wait-bg); color: var(--wait); }
.faixa.ok { background: var(--ok-bg); color: var(--ok); }
.faixa.no { background: var(--no-bg); color: var(--no); }
.faixa.info { background: var(--info-bg); color: var(--info); }
.opcao { display: flex; gap: 12px; align-items: flex-start; background: var(--soft); border-radius: 16px; padding: 14px 16px; cursor: pointer; border: 2px solid transparent; }
.opcao:has(input:checked) { border-color: var(--brand); }
.opcao input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.opcao .meio { display: flex; flex-direction: column; gap: 2px; }
.opcao .t { font-weight: 700; font-size: 15px; }
.opcao .d { font-size: 13px; color: var(--muted); }
details.setor { background: var(--soft); border-radius: 16px; padding: 14px 16px; }
details.setor summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
details.setor summary::-webkit-details-marker { display: none; }
details.setor[open] summary { margin-bottom: 12px; }

/* ---------- Telas pequenas ---------- */
@media (max-width: 860px) {
  .lateral { position: static; height: auto; max-width: none; flex-basis: 100%; padding: 14px 12px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .lateral .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .lateral .nav a { white-space: nowrap; padding: 8px 12px; }
  .rodape-lateral { margin-top: 0; }
  .status-zap { align-self: flex-start; }
  .conversas, .lista-conversas, .conversa-aberta { max-height: none; min-height: 0; }
  .dias { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .info-conversa { border-left: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
