/* Painel Raiar — painéis flutuantes sobre um fundo neutro; o sol âmbar é a marca, índigo = IA, verde = você. */
:root {
  --canvas: #E7EAF0;
  --surface: #FFFFFF;
  --surface-2: #F4F6F9;
  --hover: #EEF1F6;
  --line: #E2E6ED;
  --ink: #161C28;
  --ink-2: #485266;
  --muted: #7C8598;
  --ai: #5260E0;
  --ai-soft: #EDEFFD;
  --ai-line: #D9DDFA;
  --you: #17855A;
  --you-ink: #FFFFFF;
  --you-soft: #E2F3EA;
  --sun: #EBA51A;
  --sun-soft: #FFF3D9;
  --sun-ink: #8A5B00;
  --danger: #C8402B;
  --danger-soft: #FCE9E5;
  --shadow: 0 1px 2px rgba(22, 28, 40, .05), 0 6px 20px rgba(22, 28, 40, .06);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0E1219; --surface: #171C26; --surface-2: #1E2430; --hover: #222937; --line: #2A3140;
    --ink: #E9ECF2; --ink-2: #B4BCCB; --muted: #8590A3;
    --ai: #8B95FF; --ai-soft: #252B4A; --ai-line: #333B66;
    --you: #2FA874; --you-ink: #FFFFFF; --you-soft: #173A2B;
    --sun: #F2B33A; --sun-soft: #3A2E14; --sun-ink: #F5C76A;
    --danger: #F07B66; --danger-soft: #3D1F1A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0E1219; --surface: #171C26; --surface-2: #1E2430; --hover: #222937; --line: #2A3140;
  --ink: #E9ECF2; --ink-2: #B4BCCB; --muted: #8590A3;
  --ai: #8B95FF; --ai-soft: #252B4A; --ai-line: #333B66;
  --you: #2FA874; --you-ink: #FFFFFF; --you-soft: #173A2B;
  --sun: #F2B33A; --sun-soft: #3A2E14; --sun-ink: #F5C76A;
  --danger: #F07B66; --danger-soft: #3D1F1A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* o sol do "raiar" */
.sun { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px var(--sun-soft); margin-right: 10px; vertical-align: -1px; }
.sun.big { width: 24px; height: 24px; margin: 0; box-shadow: 0 0 0 6px var(--sun-soft), 0 0 24px rgba(235, 165, 26, .35); }

/* avatar com iniciais */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; letter-spacing: .02em; flex: none;
  background: hsl(var(--h, 220) 70% 92%); color: hsl(var(--h, 220) 45% 32%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h, 220) 30% 24%); color: hsl(var(--h, 220) 70% 82%); } }
:root[data-theme="dark"] .avatar { background: hsl(var(--h, 220) 30% 24%); color: hsl(var(--h, 220) 70% 82%); }

/* botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: var(--radius-m); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; color: var(--ink); font-weight: 400; font-size: 15px; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--ai); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--ai-soft); }
.form-error { color: var(--danger); font-size: 14px; min-height: 1em; }
.icon-btn { border: 0; background: transparent; width: 38px; height: 38px; border-radius: var(--radius-m); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; transition: background .15s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 50% -10%, var(--sun-soft), transparent 50%), var(--canvas); }
.login-version { margin: 0; text-align: center; font-size: 12px; color: var(--muted, #8a8f98); }
.login-version:empty { display: none; }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 22px; padding: 34px 30px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.brand { font-weight: 700; font-size: 15px; color: var(--ink-2); }

/* estrutura: trilho + painéis flutuantes */
.app { display: grid; grid-template-columns: 80px 1fr; height: 100dvh; padding: 8px 8px 8px 0; }
.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0 6px; color: var(--ink-2); }
.rail .sun { margin-bottom: 22px; }
.rail-btn { position: relative; width: 64px; border: 0; background: transparent; color: inherit; border-radius: 14px; padding: 9px 0 7px; display: grid; justify-items: center; gap: 4px; cursor: pointer; font-size: 11px; font-weight: 500; transition: background .15s, color .15s; }
.rail-btn:hover { background: var(--hover); color: var(--ink); }
.rail-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.rail-btn.active::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 20px; margin-top: -10px; border-radius: 0 4px 4px 0; background: var(--sun); }
.rail-spacer { flex: 1; }
.view { min-width: 0; min-height: 0; }

/* conversas */
.view-conversas { display: grid; grid-template-columns: 350px 1fr auto; gap: 8px; height: calc(100dvh - 16px); }
.list-pane, .chat-pane, .info-pane { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); min-height: 0; overflow: hidden; }
.list-pane { display: flex; flex-direction: column; }
.pane-head { padding: 20px 20px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.search { position: relative; margin: 0 14px 10px; }
.search svg { position: absolute; left: 12px; top: 50%; margin-top: -9px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; border-radius: 999px; font-size: 14px; }
.filters { display: flex; gap: 2px; margin: 0 14px 8px; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.chip { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 6px 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--muted); transition: background .15s, color .15s; }
.chip:hover { color: var(--ink); }
.chip.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(22, 28, 40, .12); }
.conv-list { list-style: none; margin: 0; padding: 4px 8px 12px; overflow-y: auto; flex: 1; display: grid; align-content: start; gap: 2px; }
.conv { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 1px 12px; align-items: center; padding: 11px 12px; border-radius: var(--radius-m); cursor: pointer; transition: background .12s; }
.conv .avatar { grid-row: 1 / 4; align-self: start; }
.conv:hover { background: var(--hover); }
.conv.selected { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.conv.attention::after { content: ""; position: absolute; right: 12px; bottom: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px var(--sun-soft); }
.conv .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.conv .time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.conv.attention .time { color: var(--sun-ink); font-weight: 600; }
.conv .preview { grid-column: 2 / -1; color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 18px; }
.conv .tags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 9px 2px 8px; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tag.ai { color: var(--ai); background: var(--ai-soft); }
.tag.human { color: var(--you); background: var(--you-soft); }
.tag.attention { color: var(--sun-ink); background: var(--sun-soft); }
.tag.closed { color: var(--muted); background: var(--surface-2); }
.tag.fup { color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.tag.fup::before { display: none; }
.tag svg { width: 12px; height: 12px; stroke-width: 2; }
.empty-list { padding: 40px 24px; color: var(--muted); text-align: center; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; }
.empty-chat { margin: auto; text-align: center; display: grid; gap: 10px; justify-items: center; padding: 24px; max-width: 340px; }
.empty-chat .sun { margin-bottom: 10px; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.chat-head .back { display: none; }
.who { display: grid; min-width: 0; flex: 1; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.who span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* quem atende: o coração do painel */
.mode { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; flex: none; }
.mode-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 14px 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.mode-btn svg { width: 16px; height: 16px; }
.mode-btn:hover { color: var(--ink); }
.mode-btn.on[data-mode="ai"] { background: var(--ai); color: #fff; }
.mode-btn.on[data-mode="human"] { background: var(--you); color: var(--you-ink); }

.handoff { margin: 12px 16px 0; padding: 10px 10px 10px 14px; border-radius: var(--radius-m); background: var(--sun-soft); color: var(--sun-ink); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.handoff .grow { flex: 1; min-width: 0; }
.handoff .btn { padding: 6px 12px; font-size: 13px; background: var(--surface); border-color: transparent; }

.messages { list-style: none; margin: 0; padding: 20px 20px 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px;
  background: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px, var(--surface-2); }
.day { align-self: center; margin: 12px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); padding: 3px 12px; border-radius: 999px; box-shadow: 0 1px 2px rgba(22, 28, 40, .06); }
.msg { position: relative; max-width: min(64ch, 76%); padding: 9px 13px 6px; border-radius: 16px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(22, 28, 40, .07); margin-top: 4px; }
.msg .meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.msg.customer { align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.ai { align-self: flex-end; background: var(--ai-soft); border-bottom-right-radius: 5px; box-shadow: inset 0 0 0 1px var(--ai-line); }
.msg.ai .meta { color: var(--ai); }
.msg.agent { align-self: flex-end; background: var(--you); color: var(--you-ink); border-bottom-right-radius: 5px; }
.msg.agent .meta { color: rgba(255, 255, 255, .78); }
.msg.system { align-self: center; background: transparent; box-shadow: none; color: var(--muted); font-size: 12.5px; text-align: center; padding: 4px 8px; max-width: 90%; }
.msg.system .meta { display: none; }

.composer { display: flex; gap: 8px; margin: 10px 14px 4px; padding: 6px 6px 6px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 24px; align-items: flex-end; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--ai); box-shadow: 0 0 0 3px var(--ai-soft); background: var(--surface); }
.composer textarea { max-height: 160px; resize: none; border: 0; background: transparent; padding: 8px 0; box-shadow: none; }
.composer textarea:focus { box-shadow: none; background: transparent; }
.composer .btn { border-radius: 999px; padding: 9px 16px; }
.composer-hint { font-size: 12px; padding: 0 20px 10px; }

.info-pane { width: 300px; overflow-y: auto; }
.stack { display: grid; gap: 14px; padding: 4px 20px 20px; }

/* páginas */
.view-page { overflow-y: auto; height: calc(100dvh - 16px); background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.page { max-width: 820px; margin: 0 auto; padding: 36px 28px 64px; display: grid; gap: 22px; align-content: start; }
.page-head { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.connect { background: var(--surface-2); border-radius: var(--radius-l); padding: 22px; display: grid; gap: 14px; justify-items: start; }
.connect .row, .connect label { width: 100%; }
.connect input, .connect select { background: var(--surface); }
.channel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.channel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.channel .ch-main { flex: 1; display: grid; min-width: 160px; }
.status { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--surface-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.connected { color: var(--you); background: var(--you-soft); } .status.connected::before { background: var(--you); box-shadow: 0 0 0 3px color-mix(in srgb, var(--you) 25%, transparent); }
.status.connecting, .status.pending { color: var(--sun-ink); background: var(--sun-soft); } .status.connecting::before, .status.pending::before { background: var(--sun); }
.status.disconnected { color: var(--danger); background: var(--danger-soft); } .status.disconnected::before { background: var(--danger); }
.qr-box { background: var(--surface); border: 2px solid var(--sun); border-radius: var(--radius-l); padding: 24px; display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: center; }
.qr-box img { width: 260px; height: 260px; max-width: 100%; image-rendering: pixelated; background: #fff; border-radius: var(--radius-m); padding: 8px; }
.qr-steps { display: grid; gap: 12px; }
.qr-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-2); }
.pairing-code { font-size: 30px; font-weight: 700; letter-spacing: .12em; color: var(--ink); font-variant-numeric: tabular-nums; }
.qr-status { font-weight: 600; color: var(--sun-ink); }
.qr-status.ok { color: var(--you); }
.switch { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius-m); }
.switch input { appearance: none; width: 42px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked { background: var(--ai); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus { box-shadow: 0 0 0 3px var(--ai-soft); }
.advanced { background: var(--surface-2); border-radius: var(--radius-m); padding: 14px 16px; }
.advanced summary { cursor: pointer; font-weight: 600; }
.advanced[open] { display: grid; gap: 14px; }
.advanced input, .advanced select { background: var(--surface); }
.save-bar { display: flex; align-items: center; gap: 14px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--surface) 35%); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
td { font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.usage { display: grid; gap: 10px; margin-top: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--surface); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); box-shadow: var(--shadow); z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* telas médias */
@media (max-width: 1100px) {
  .info-pane { position: fixed; right: 8px; top: 8px; bottom: 8px; z-index: 5; }
}
/* celular */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding: 0; }
  .rail { flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); order: 2; background: var(--surface); border-top: 1px solid var(--line); }
  .rail .sun, .rail-spacer { display: none; }
  .rail-btn { width: auto; flex: 1; }
  .rail-btn.active { box-shadow: none; background: var(--surface-2); }
  .rail-btn.active::before { left: 50%; top: -6px; width: 22px; height: 3px; margin: 0 0 0 -11px; border-radius: 0 0 3px 3px; }
  .view-conversas, .view-page { height: calc(100dvh - 66px); }
  .view-conversas { grid-template-columns: 1fr; gap: 0; }
  .list-pane, .chat-pane, .view-page { border-radius: 0; box-shadow: none; }
  .view-conversas.in-chat .list-pane { display: none; }
  .view-conversas:not(.in-chat) .chat-pane { display: none; }
  .chat-head .back { display: grid; margin-left: -6px; }
  .chat-head { flex-wrap: wrap; row-gap: 10px; padding: 10px 12px; }
  .chat-head .avatar { width: 36px; height: 36px; font-size: 13px; }
  .chat-head .mode { order: 10; width: 100%; }
  .mode-btn { flex: 1; justify-content: center; padding: 8px 9px; }
  .messages { padding: 14px 12px 10px; }
  .row, .qr-box { grid-template-columns: 1fr; }
  .qr-box img { justify-self: center; }
  .page { padding: 22px 16px 48px; }
  .msg { max-width: 86%; }
  .info-pane { right: 0; top: 0; bottom: 0; border-radius: 0; width: min(320px, 100%); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* mensagens de sistema com ícone de linha */
.msg.system { display: inline-flex; align-items: flex-start; gap: 7px; text-align: left; background: var(--surface); box-shadow: 0 1px 2px rgba(22, 28, 40, .06); border-radius: 999px; padding: 5px 13px 5px 10px; margin: 6px 0; }
.msg.system svg { width: 15px; height: 15px; margin-top: 1px; color: var(--muted); }
.msg.system span { white-space: pre-wrap; }
.msg.system.sys-bell { background: var(--sun-soft); color: var(--sun-ink); border-radius: var(--radius-m); }
.msg.system.sys-bell svg { color: var(--sun-ink); }
.msg.system.sys-ai svg { color: var(--ai); }
.msg.system.sys-user svg { color: var(--you); }
.msg.system.sys-check svg { color: var(--you); }
.msg.system.sys-alert { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-m); }
.msg.system.sys-alert svg { color: var(--danger); }
.handoff svg { width: 18px; height: 18px; }

/* switch com explicação */
.switch span { display: grid; gap: 2px; }
.switch small { font-size: 13px; font-weight: 400; }

/* painel do cliente: funil e retorno */
.row.tight { gap: 10px; }
.fup-box { border-top: 1px solid var(--line); padding-top: 18px; }
.fup-current { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 12px; border-radius: var(--radius-m); background: var(--surface-2); }
.fup-current.on { background: var(--ai-soft); color: var(--ink); }
.fup-current svg { width: 18px; height: 18px; color: var(--ai); margin-top: 1px; }
.fup-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* funil (kanban) */
.view-funil { display: flex; flex-direction: column; height: calc(100dvh - 16px); background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); overflow: hidden; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 22px 22px 6px; }
.board-search { margin: 0; width: min(280px, 100%); }
.board-hint { padding: 0 22px 12px; }
.board { flex: 1; min-height: 0; display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 16px; scroll-snap-type: x proximity; }
.col { flex: 0 0 276px; display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border-radius: 16px; scroll-snap-align: start; transition: box-shadow .15s, background .15s; }
.col.over { background: var(--hover); box-shadow: inset 0 0 0 2px var(--ai); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-size: 13px; }
.col-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.col-novo .col-head::before { background: var(--ai); }
.col-atendimento .col-head::before { background: var(--you); }
.col-followup .col-head::before { background: var(--sun); }
.col-orcamento .col-head::before { background: #3B9BD8; }
.col-negociacao .col-head::before { background: #9B5DE5; }
.col-fechado .col-head::before { background: #17855A; box-shadow: 0 0 0 3px var(--you-soft); }
.col-perdido .col-head::before { background: var(--danger); }
.col-name { font-weight: 700; color: var(--ink); }
.col-count { font-weight: 600; color: var(--muted); background: var(--surface); padding: 0 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.col-total { margin-left: auto; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.col-cards { flex: 1; min-height: 60px; overflow-y: auto; padding: 2px 8px 10px; display: grid; align-content: start; gap: 8px; }
.col-empty { margin: 4px 2px; padding: 18px 10px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius-m); }
.card { background: var(--surface); border-radius: var(--radius-m); padding: 11px 12px; box-shadow: 0 1px 2px rgba(22, 28, 40, .07); cursor: grab; display: grid; gap: 7px; border: 1px solid transparent; transition: box-shadow .15s, transform .15s, border-color .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card.attention { border-color: var(--sun); }
.card.dragging { opacity: .45; cursor: grabbing; }
.card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-top .avatar { width: 32px; height: 32px; font-size: 12px; }
.card-who { display: grid; min-width: 0; flex: 1; }
.card-who strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-who span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-time { font-size: 11.5px; color: var(--muted); align-self: flex-start; font-variant-numeric: tabular-nums; }
.card-preview { font-size: 13px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.card-value { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--you); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .view-funil { height: calc(100dvh - 66px); border-radius: 0; box-shadow: none; }
  .board-head { padding: 16px 16px 4px; }
  .board-hint { padding: 0 16px 10px; }
  .board { padding: 0 12px 12px; scroll-snap-type: x mandatory; }
  .col { flex-basis: 84vw; }
}

/* assinatura */
.switch.compact { align-self: end; padding: 10px 14px; font-size: 14px; }
.sign-preview { display: grid; gap: 6px; justify-items: start; }
.wa-bubble { background: #D9FDD3; color: #111B21; padding: 8px 12px; border-radius: 10px 10px 10px 3px; font-size: 14.5px; max-width: 380px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.sig-input { padding: 6px 9px; font-size: 14px; max-width: 160px; }

/* integrações */
.int-section { display: grid; gap: 14px; padding-top: 6px; }
.int-section + .int-section { border-top: 1px solid var(--line); padding-top: 22px; }
.int-title { display: grid; gap: 4px; }
.int-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.int-list:empty { display: none; }
.int-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 16px; }
.int-main { flex: 1; min-width: 180px; display: grid; gap: 1px; }
.int-err { color: var(--danger); }
.int-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.int-tile { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-l); padding: 14px; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.int-tile:hover { border-color: var(--ai); box-shadow: 0 0 0 3px var(--ai-soft); }
.int-tile span:last-child { display: grid; gap: 2px; }
.int-tile small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.int-tile.soon { cursor: default; opacity: .65; border-style: dashed; background: transparent; }
.int-tile.soon:hover { border-color: var(--line); box-shadow: none; }
.int-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; background: var(--surface-2); color: var(--ink-2); }
.int-logo.inter { background: #FF7A00; color: #fff; }
.int-logo.fb { background: #FFCA28; color: #5D4037; }
.int-form { width: 100%; }
.int-form-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.int-steps { width: 100%; background: var(--surface); border-radius: var(--radius-m); padding: 10px 14px; }
.int-steps summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.int-steps ol { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 5px; color: var(--ink-2); font-size: 14px; }
.int-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.file-field input[type="file"] { padding: 8px; background: var(--surface); font-size: 13.5px; }
.file-field .file-name { font-weight: 400; }
@media (max-width: 760px) { .int-fields { grid-template-columns: 1fr; } }

.idle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius-m); color: var(--ink); font-size: 15px; }
.idle-row > span:first-child { display: grid; gap: 2px; flex: 1; min-width: 220px; }
.idle-row small { font-size: 13px; font-weight: 400; }
.idle-input { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-2); }
.idle-input input { width: 84px; background: var(--surface); text-align: center; }

.switch.bare { background: transparent; padding: 0; flex: 1; min-width: 240px; }
.idle-input.off { opacity: .45; }

.contact-loc { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 12px; border-radius: var(--radius-m); background: var(--surface-2); }
.contact-loc svg { width: 18px; height: 18px; color: var(--danger); margin-top: 1px; }
.contact-loc a, .msg.system a { color: var(--ai); font-weight: 600; }
.int-tile.soon.on { opacity: 1; border-style: solid; background: var(--surface-2); }
.int-logo.esri { background: #0079C1; color: #fff; }
.int-logo.osm { background: #7EBC6F; color: #fff; }
.msg.system.sys-pin svg { color: var(--danger); }

/* app instalável + avisos */
.bell { position: relative; }
.bell::after { content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px var(--surface); }
.bell.on::after { background: var(--you); }
.device-tip { margin: 0 14px 10px; padding: 10px 10px 10px 12px; border-radius: var(--radius-m); background: var(--sun-soft); color: var(--ink); display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; font-size: 13.5px; }
.device-ico { width: 30px; height: 30px; border-radius: 9px; background: url(/icons/icon-192.png) center / cover, var(--ink); }
.device-actions { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.device-actions .btn { padding: 6px 12px; font-size: 13px; }
.device-actions .icon-btn { width: 32px; height: 32px; }

/* agenda */
.page.wide { max-width: 1040px; }
.agenda-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg-btn { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(22, 28, 40, .12); }
.ok-dot { color: var(--you); font-weight: 600; }
#agenda-summary a { color: var(--ai); font-weight: 600; }
.ag-day h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-item { display: grid; grid-template-columns: 56px 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.ag-item:hover { box-shadow: var(--shadow); }
.ag-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; line-height: 1.2; }
.ag-main { display: grid; gap: 1px; min-width: 0; }
.ag-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-why { color: var(--ink-2); }
.ag-tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ag-item.st-cancelado .ag-time, .ag-item.st-reagendado .ag-time { text-decoration: line-through; color: var(--muted); }
.pill { display: inline-flex; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill.st-pendente { background: var(--sun-soft); color: var(--sun-ink); }
.pill.st-enviado, .pill.st-respondido { background: var(--you-soft); color: var(--you); }
.pill.st-avisado { background: var(--ai-soft); color: var(--ai); }
.pill.st-cancelado, .pill.st-erro { background: var(--danger-soft); color: var(--danger); }
.pill.st-reagendado { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.pill.g { background: #E8F0FE; color: #1A56C9; }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0; }
.cal-nav strong { min-width: 180px; text-align: center; }
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 4px; min-width: 660px; }
.cal-w { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; }
.cal-d { min-height: 92px; background: var(--surface-2); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-d.empty { background: transparent; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--sun); }
.cal-n { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cal-ev { border: 0; text-align: left; font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 6px; border-radius: 6px; cursor: pointer; background: var(--sun-soft); color: var(--sun-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.st-enviado, .cal-ev.st-respondido { background: var(--you-soft); color: var(--you); }
.cal-ev.st-avisado { background: var(--ai-soft); color: var(--ai); }
.cal-ev.st-cancelado, .cal-ev.st-reagendado, .cal-ev.st-erro { background: transparent; color: var(--muted); text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--line); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.fup-history h4 { margin: 6px 0 8px; font-size: 13px; }
.fh-item { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .ag-item { grid-template-columns: 48px 1fr; } .ag-item .avatar { display: none; } .ag-tags { grid-column: 2; flex-direction: row; align-items: center; } }

/* skills */
.skills-box { display: grid; gap: 12px; background: var(--surface-2); border-radius: var(--radius-l); padding: 16px; }
.skills-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.skills-head > div { display: grid; gap: 4px; flex: 1; min-width: 240px; }
.skills-head code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.file-btn { cursor: pointer; }
.skill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.skill { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius-m); padding: 10px 12px; }
.skill.off { opacity: .55; }
.skill-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--ai-soft); color: var(--ai); flex: none; }
.skill-main { flex: 1; min-width: 180px; display: grid; gap: 1px; }
.skill-mode { width: auto; padding: 7px 10px; font-size: 13px; background: var(--surface-2); }
.skill .btn { padding: 6px 12px; font-size: 13px; }
.skill-empty { padding: 6px 2px; }
.mini-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.mini-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.mini-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.mini-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.mini-switch input:checked + span { background: var(--ai); }
.mini-switch input:checked + span::after { transform: translateX(16px); }
.skill-view { background: var(--surface); border-radius: var(--radius-m); padding: 12px 14px; }
.skill-view-head { display: flex; justify-content: space-between; align-items: center; }
.skill-view pre { white-space: pre-wrap; font-size: 13px; max-height: 320px; overflow: auto; margin: 6px 0 0; font-family: ui-monospace, Menlo, Consolas, monospace; }

@media (max-width: 760px) { .rail-btn { font-size: 10px; padding: 8px 0 6px; } .rail-btn svg { width: 19px; height: 19px; } }

/* equipe e conta */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role { background: var(--surface-2); border-radius: var(--radius-m); padding: 12px 14px; display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.role b { color: var(--ink); font-size: 14px; }
.role-sel { width: auto; padding: 6px 9px; font-size: 13.5px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions .btn { padding: 6px 11px; font-size: 13px; }
tr.off td { opacity: .5; }
.pass-row td { background: var(--surface-2); }
.pass-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pass-form label { flex: 1; min-width: 200px; }
.page.narrow { max-width: 620px; }
.acc-head { display: flex; align-items: center; gap: 14px; }
.avatar.big { width: 56px; height: 56px; font-size: 19px; }
.logout-btn { justify-self: start; }
.note { background: var(--ai-soft); color: var(--ink-2); padding: 10px 14px; border-radius: var(--radius-m); font-size: 14px; }
@media (max-width: 760px) { .roles { grid-template-columns: 1fr; } }
.int-logo.google { background: #fff; color: #1A73E8; box-shadow: inset 0 0 0 1px var(--line); }

/* filtro Todos / Meus clientes */
.scope { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; flex: none; }
.scope button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.scope button.on { background: var(--ink); color: var(--surface); }
.scope-list { margin: 0 14px 10px; }
.board-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* imagens na conversa (mapa, fachada) */
.msg.has-img { padding: 5px 5px 6px; }
.msg.has-img .msg-text { display: block; padding: 0 8px; }
.msg-img { display: block; margin-bottom: 6px; }
.msg-img img { display: block; width: 320px; max-width: 100%; aspect-ratio: 640 / 420; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.msg.has-img .meta { padding: 0 8px; }
.msg-img.photo img { width: 300px; max-width: 100%; height: auto; max-height: 380px; aspect-ratio: auto; object-fit: contain; }
.msg-file { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 4px; border-radius: 12px; background: var(--surface-2); color: inherit; text-decoration: none; font-weight: 600; }
.msg-file svg, .msg-fetch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg-geo { display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; font-weight: 600; color: inherit; }
.msg-geo svg { width: 18px; height: 18px; }
.msg-fetch { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 2px; }
.msg.has-file .msg-text, .msg .msg-file + .msg-text { display: block; }

/* orçamentos do sistema no painel do cliente */
.budget-box { border-top: 1px solid var(--line); padding-top: 18px; }
.budget { background: var(--surface-2); border-radius: var(--radius-m); padding: 12px; display: grid; gap: 3px; }
.budget + .budget { margin-top: 8px; }
.budget-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13.5px; }
.budget-value { font-size: 20px; font-weight: 700; color: var(--you); font-variant-numeric: tabular-nums; }
.budget-admin { margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--ink-2); }
.int-logo.firebase { background: #FFCA28; color: #5D4037; }
#budget-list + .btn, #budget-list .btn { margin-top: 10px; }
.rail-btn[hidden] { display: none; }
.lead-data { display: grid; gap: 4px; margin: 4px 0 2px; }
.lead-data h4 { margin: 6px 0 2px; font-size: 13px; }
#budget-draft { width: 100%; margin-top: 6px; }

.view-orc { height: calc(100dvh - 16px); background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); overflow: hidden; }
#orc-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* ---- Sugestões da IA ---- */
.rail-badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--sun, #f5a623); color: #1d1d1f; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.rail-badge[hidden] { display: none; }
.page.wide { max-width: 980px; }
.sug-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.sug-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.sug-bar .filters { flex: 0 1 auto; }
.sug-bulk { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sug-list { display: grid; gap: 14px; }
.sug-empty { padding: 28px 0; text-align: center; }
.sug { border: 1px solid var(--line); border-radius: var(--radius-l, 16px); padding: 16px; display: grid; gap: 10px; background: var(--surface); }
.sug-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sug-who { display: grid; flex: 1; min-width: 180px; }
.sug-summary { margin: 0; color: var(--ink-2); }
.sug-rows { display: grid; gap: 10px; }
.sug-row { border-radius: 12px; background: var(--surface-2); padding: 12px; display: grid; gap: 8px; }
.sug-row.done { opacity: .85; }
.sug-title { display: flex; gap: 8px; align-items: center; }
.sug-title svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sug-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.sug-fields label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); flex: 1; min-width: 160px; }
.sug-row textarea { width: 100%; resize: vertical; font: inherit; }
.sug-btns, .sug-foot, .sug-status { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.pill.temp-quente { background: var(--danger-soft); color: var(--danger); }
.pill.temp-morno { background: var(--sun-soft); color: var(--sun-ink); }
.pill.temp-frio { background: var(--surface-2); color: var(--ink-2); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }

.sug-owner { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sug-owner select { font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.sug-owner.none select { border-color: var(--sun, #f5a623); }

.trial-banner { position: fixed; bottom: 14px; right: 14px; z-index: 50; background: var(--sun-soft, #fff4dc); color: var(--sun-ink, #7a4b00); border: 1px solid var(--sun, #f5a623); padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); pointer-events: none; }
.trial-banner[hidden] { display: none; }

/* primeiro acesso, boas-vindas do teste, clientes da plataforma */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 18, 26, .55); display: grid; place-items: center; padding: 16px; }
.overlay[hidden] { display: none; }
.overlay-card { width: min(460px, 100%); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.overlay-card h2 { margin: 0; }
.overlay-card p { margin: 0; }
.overlay-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.trial-card { text-align: center; justify-items: center; }
.trial-days { font-size: 72px; font-weight: 800; line-height: 1; color: var(--sun-ink, #7a4b00); background: var(--sun-soft, #fff4dc); border-radius: 24px; padding: 12px 28px; }
.trial-steps { text-align: left; margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.trial-banner { font-size: 13.5px; padding: 8px 16px; }
.trial-form .row { display: flex; gap: 12px; flex-wrap: wrap; }
.trial-form .row label { flex: 1; min-width: 160px; }
#trial-msg { width: 100%; font: inherit; font-size: 13.5px; }
.accounts { display: grid; gap: 10px; }
.account { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.acc-main { display: grid; flex: 1; min-width: 220px; }
.acc-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* menu do celular: 4 itens + "Mais" */
.rail-more { display: none; }
.more-sheet { position: fixed; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 60; min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); padding: 6px; display: grid; gap: 2px; }
.more-sheet[hidden] { display: none; }
.more-sheet button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14.5px; font-weight: 500; border-radius: 10px; text-align: left; cursor: pointer; }
.more-sheet button:hover, .more-sheet button.active { background: var(--surface-2); }
.more-sheet svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.more-sheet .more-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sun, #f5a623); color: #1d1d1f; font-size: 11px; display: grid; place-items: center; }
@media (max-width: 760px) {
  .rail-btn.in-more { display: none; }
  .rail-more.show { display: grid; }
}

/* anexos no painel */
.attach-btn { flex: none; display: grid; place-items: center; width: 38px; height: 38px; margin-left: -8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.attach-btn:hover { background: var(--surface); color: inherit; }
.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 14px 0; }
.attach-tray[hidden] { display: none; }
.attach-item { position: relative; display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 30px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.attach-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.attach-pdf { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--surface-2); }
.attach-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-x { position: absolute; top: 4px; right: 6px; border: 0; background: transparent; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.attach-tip { flex-basis: 100%; }
#chat.dropping .messages { outline: 2px dashed var(--ai); outline-offset: -10px; border-radius: 16px; }
.msg.agent .msg-file { background: rgba(255, 255, 255, .18); color: #fff; }
.msg-audio { display: block; width: 280px; max-width: 100%; height: 40px; margin: 2px 0 4px; }

/* "Fazer orçamento" na conversa */
.orc-go { position: relative; flex: none; }
.orc-go .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.orc-go .btn svg { width: 18px; height: 18px; }
.orc-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.orc-menu[hidden] { display: none; }
.orc-menu button { display: grid; width: 100%; gap: 2px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.orc-menu button:hover { background: var(--surface-2); }
.orc-menu small { color: var(--muted); }
.orc-menu p { margin: 4px 12px 6px; }
@media (max-width: 720px) { .orc-go .btn span { display: none; } }
.transfer-note { display: grid; gap: 4px; margin: 6px 12px 8px; }
.transfer-note input { width: 100%; }

/* começar conversa com um novo lead pela busca */
.start-lead { display: grid; gap: 10px; margin: 8px 4px; padding: 16px; border: 1px dashed var(--line); border-radius: 16px; background: var(--surface); list-style: none; }
.start-lead label { display: grid; gap: 4px; }
.start-lead .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.start-lead .btn svg { width: 18px; height: 18px; }
.ch-confirm { flex-basis: 100%; display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ch-confirm p { margin: 0; }
.ch-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* tracinhos de entrega */
.tick { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; vertical-align: -3px; }
.tick svg { width: 15px; height: 15px; stroke-width: 2.2; }
.tick.lido { color: #53bdeb; }
.tick.erro { color: #ffd2cc; font-weight: 600; font-size: 11px; }
.msg.ai .tick.erro { color: #c0392b; }
.tick.erro svg { width: 13px; height: 13px; }

/* meus e-mails */
.email-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.email-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-l, 16px); background: var(--surface); }
.email-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); flex: none; }
.email-who { display: grid; flex: 1; min-width: 0; }
.email-who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-item a.btn { text-decoration: none; }

/* envio de e-mail (Zoho) */
.zoho-box { margin-bottom: 14px; }
.zoho-on, .zoho-off { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-l, 16px); background: var(--surface); }
.zoho-off { display: block; }
.zoho-off p { margin: 0 0 10px; }
.compose label { display: grid; gap: 4px; margin-bottom: 10px; }
.compose textarea { resize: vertical; min-height: 160px; font: inherit; }
.compose-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.compose-files .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.compose-files .chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.compose-attach { cursor: pointer; }
.email-sec { margin: 22px 0 6px; font-size: 15px; }
.email-sent { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.email-sent li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.compose .compose-attach { display: inline-flex; margin: 0; }

/* respostas dos e-mails */
.email-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.email-sent li { display: block; }
.sent-row { display: flex; align-items: center; gap: 10px; }
.reply-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.reply-row.unseen { border-style: solid; border-color: var(--sun, #f5a623); }
.reply-row .email-who .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-tag { flex: none; font-size: 12px; font-weight: 600; }
.reply-row.unseen .reply-tag { color: #b26b00; }
.reply-frame { width: 100%; min-height: 160px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 6px; }
.email-hint { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.reply-frame { height: 360px; resize: vertical; }
.reply-frame { height: 240px; }
.reply-body .btn { margin-top: 8px; }

/* filtro "Sem vendedor" */
.scope .scope-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 5px; padding: 0 4px; border-radius: 999px; background: var(--sun, #f5a623); color: #1d1d1f; font-size: 10.5px; font-weight: 700; }
.scope .scope-count[hidden] { display: none; }
.scope button { padding: 6px 11px; }

.reopen-btn { display: inline-flex; align-items: center; gap: 6px; }
.reopen-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reopen-btn[hidden] { display: none; }
