/* ZapBot-100k — tema claro (petróleo #196967 + grafite #1E2A32). Fontes: Inter (texto) e Urbanist (títulos), licença SIL OFL. */
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("fonts/urbanist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #1E2A32; --ink-2: #2a3841; --ink-3: #3a4a54;
  --bg: #f6f7f8; --surface: #ffffff; --surface-2: #fafbfb; --surface-3: #f2f4f5;
  --line: #e5e8eb; --line-2: #eef0f2; --line-strong: #d5dade;
  --text: #1E2A32; --text-2: #3c4a54; --muted: #66727c; --muted-2: #79838c;
  --brand: #196967; --brand-600: #145755; --brand-700: #145755; --brand-50: #eef6f5; --brand-100: #d3e8e6; --brand-glow: #2a8e8a; --brand-soft: #5cc2bb;
  --wa: #1f9d55; --wa-2: #178246; --gold: #b7791f;
  --ai: #5b4bc4; --ai-50: #f2f0fc; --ai-100: #dedaf6;
  --note: #fff8e5; --note-line: #f0d68e; --note-text: #6f5200;
  --danger: #cf3f3f; --danger-50: #fdefef; --warn: #b7791f; --warn-50: #fdf4e3; --info: #196967;
  --bubble-out: #e6f2f0; --bubble-in: #ffffff; --chat-bg: #f6f7f8;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16,24,32,.05);
  --shadow: 0 1px 2px rgba(16,24,32,.04), 0 6px 16px -6px rgba(16,24,32,.10);
  --shadow-lg: 0 24px 56px -14px rgba(16,24,32,.22), 0 0 0 1px rgba(16,24,32,.05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Urbanist", "Inter", ui-sans-serif, system-ui, sans-serif;
  --rail: 236px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--brand-700); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; } .ic.xs { width: 14px; height: 14px; } .ic.lg { width: 24px; height: 24px; }
.ic.fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--brand-100); }
.scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
.scroll::-webkit-scrollbar { width: 8px; } .scroll::-webkit-scrollbar-thumb { background: #D5DCE5; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- boot ---------- */
.boot { height: 100vh; display: grid; place-items: center; background: var(--ink); }
.boot-logo { width: 56px; height: 56px; border-radius: 16px; background: url(favicon.svg) center/contain no-repeat; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, box-shadow .15s, color .15s, transform .05s; border: 1px solid transparent; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 1px 2px rgba(8,114,79,.4); }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-outline { border-color: var(--line); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: #CFD6E0; background: var(--surface-2); }
.btn-ai { background: var(--ai); color: #fff; box-shadow: 0 1px 2px rgba(109,91,246,.45); }
.btn-ai:hover { background: #5B49E8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #D63B40; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; height: 44px; font-size: 14.5px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--muted); transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--line-2); color: var(--text); }
.icon-btn.active { background: var(--brand-50); color: var(--brand-700); }

/* ---------- formulários ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14px; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center/16px no-repeat; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,159,110,.15); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.hint { font-size: 12px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.check input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 22px; background: #CBD5E1; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }

/* ---------- chips, badges, avatares ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--c) 13%, white); color: color-mix(in srgb, var(--c) 78%, black); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.chip.lg { height: 28px; padding: 0 10px; font-size: 12.5px; }
.chip .x { margin-left: 2px; margin-right: -3px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: inherit; opacity: .7; }
.chip .x:hover { opacity: 1; background: rgba(0,0,0,.07); }
.chip.more { --c: #94A3B8; }
.chip.more::before { display: none; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.pill .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.pill-bot { background: var(--ai-50); color: var(--ai); }
.pill-queue { background: var(--warn-50); color: #A15C00; }
.pill-open { background: var(--brand-50); color: var(--brand-700); }
.pill-resolved { background: #EEF2F6; color: var(--muted); }
.pill-demo { background: #FFF1D6; color: #8A5300; }
.pill-live { background: var(--brand-50); color: var(--brand-700); }
.avatar { --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 650; font-size: calc(var(--size) * .38); color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 80%, white), var(--c)); position: relative; letter-spacing: -.01em; user-select: none; }
.avatar.sm { --size: 28px; } .avatar.xs { --size: 22px; font-size: 10px; } .avatar.lg { --size: 72px; } .avatar.md { --size: 34px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--muted-2); }
.avatar .dot.on { background: #22C55E; }
.avatar .botmark { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ai); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface); }
.avatar .botmark .ic { width: 11px; height: 11px; stroke-width: 2.4; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.login-art { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at -10% -20%, #1B3A5C 0%, transparent 60%), radial-gradient(800px 500px at 110% 110%, #0E5E47 0%, transparent 60%), var(--ink); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; }
.login-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 30%, transparent); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: url(favicon.svg) center/contain no-repeat; flex: none; }
.brand small { display: block; font-family: var(--font); font-weight: 500; font-size: 12px; color: rgba(255,255,255,.55); letter-spacing: 0; }
.login-hero { margin-top: auto; position: relative; z-index: 1; max-width: 520px; }
.login-hero h1 { font-family: var(--display); font-size: 40px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 800; }
.login-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand-glow), #7DD3FC); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: rgba(255,255,255,.68); font-size: 16px; margin: 0; max-width: 440px; }
.login-mock { position: relative; z-index: 1; margin: 44px 0 40px; display: grid; gap: 10px; max-width: 440px; }
.lm-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(6px); }
.lm-card:nth-child(2) { margin-left: 36px; } .lm-card:nth-child(3) { margin-left: 12px; }
.lm-card b { display: block; font-size: 13.5px; } .lm-card span { font-size: 12.5px; color: rgba(255,255,255,.6); }
.lm-card .avatar { --size: 36px; }
.lm-card .avatar .dot, .lm-card .avatar .botmark { border-color: #17233A; }
.lm-card .meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 11px; color: rgba(255,255,255,.5); }
.login-foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255,255,255,.45); display: flex; gap: 18px; flex-wrap: wrap; }
.login-foot span { display: inline-flex; align-items: center; gap: 6px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 380px; }
.login-box .brand { color: var(--text); display: none; margin-bottom: 28px; }
.login-box h2 { font-family: var(--display); font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.login-box > p { color: var(--muted); margin: 0 0 26px; }
.err { background: var(--danger-50); color: #B4232A; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.demo-users { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.demo-users .label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.demo-user { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-align: left; margin-bottom: 8px; transition: border-color .15s, background .15s; background: var(--surface); }
.demo-user:hover { border-color: var(--brand); background: var(--brand-50); }
.demo-user b { display: block; font-size: 13.5px; } .demo-user span { font-size: 12px; color: var(--muted); }
.demo-user .ic { margin-left: auto; color: var(--muted-2); }

/* ---------- app shell ---------- */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: var(--rail) 1fr; overflow: hidden; }
.rail { background: var(--ink); display: flex; flex-direction: column; align-items: center; padding: 16px 0 14px; gap: 6px; z-index: 30; }
.rail .brand-mark { width: 42px; height: 42px; margin-bottom: 18px; }
.nav-item { position: relative; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #8A97B0; transition: background .15s, color .15s; text-decoration: none; }
.nav-item:hover { background: var(--ink-3); color: #E2E8F0; }
.nav-item.active { background: rgba(46,229,157,.12); color: var(--brand-glow); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-glow); }
.nav-item .ic { width: 22px; height: 22px; }
.nav-item .badge { position: absolute; top: 6px; right: 5px; height: 17px; min-width: 17px; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 2px var(--ink); }
.nav-item .tip { position: absolute; left: 62px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 9px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(-4px); transition: .15s; box-shadow: var(--shadow); }
.nav-item:hover .tip { opacity: 1; transform: none; }
.nav-item .lbl { display: none; }
.rail .spacer { flex: 1; }
.rail .me { margin-top: 6px; border-radius: 50%; position: relative; }
.rail .me .avatar .dot { border-color: var(--ink); }
.view { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.menu { position: fixed; z-index: 80; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .14s ease-out; }
.menu .menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: flex; gap: 10px; align-items: center; }
.menu .menu-head b { display: block; } .menu .menu-head span { font-size: 12px; color: var(--muted); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; color: var(--text-2); text-align: left; }
.menu button:hover { background: var(--line-2); }
.menu button.danger { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }

/* ---------- inbox ---------- */
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.col-list { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list-head { padding: 18px 16px 10px; display: grid; gap: 12px; }
.list-title { display: flex; align-items: center; gap: 10px; }
.list-title h1 { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; margin: 0; font-weight: 750; }
.list-title .pill { margin-left: auto; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-radius: 11px; padding: 3px; gap: 2px; }
.tab { height: 32px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: .15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab .n { font-size: 11px; font-weight: 700; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.tab.active .n { color: var(--brand-700); }
.tab .n.hot { color: #fff; background: var(--brand); border-radius: 99px; padding: 0 5px; line-height: 16px; }
.list-filters { display: flex; gap: 8px; }
.list-filters .input-icon { flex: 1; }
.list-filters .input, .list-filters .select { height: 36px; font-size: 13px; }
.list-filters .select { width: 128px; flex: none; }
.conv-list { flex: 1; min-height: 0; padding: 4px 8px 12px; }
.conv { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 11px 10px; border-radius: 12px; cursor: pointer; position: relative; transition: background .12s; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--brand-50); }
.conv.active::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--brand); }
.conv-main { min-width: 0; display: grid; gap: 3px; }
.conv-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.conv-time { font-size: 11.5px; color: var(--muted-2); flex: none; font-variant-numeric: tabular-nums; }
.conv.unread .conv-time { color: var(--brand-700); font-weight: 650; }
.conv-prev { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.conv.unread .conv-prev { color: var(--text-2); font-weight: 550; }
.conv-prev .who { color: var(--muted-2); font-weight: 500; }
.conv-meta { display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 3px; overflow: hidden; }
.conv-meta .chip { height: 20px; font-size: 11px; padding: 0 7px; }
.conv-meta .end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.sector-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 550; white-space: nowrap; }
.sector-tag i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.timer { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; padding: 0 6px; height: 20px; border-radius: 6px; background: #EEF2F6; color: var(--muted); }
.timer .ic { width: 12px; height: 12px; stroke-width: 2.3; }
.timer.warn { background: var(--warn-50); color: #A15C00; }
.timer.late { background: var(--danger-50); color: #C2272D; }
.empty { display: grid; place-items: center; text-align: center; padding: 40px 24px; color: var(--muted); gap: 8px; }
.empty .art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--brand); margin-bottom: 6px; }
.empty .art .ic { width: 28px; height: 28px; }
.empty h3 { margin: 0; color: var(--text); font-family: var(--display); font-size: 17px; }
.empty p { margin: 0; max-width: 300px; font-size: 13.5px; }

/* ---------- chat ---------- */
.col-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat-bg); position: relative; }
.col-chat.blank { background: var(--bg); }
.blank-state { margin: auto; text-align: center; max-width: 380px; padding: 24px; }
.blank-state .ill { width: 190px; margin: 0 auto 18px; }
.blank-state h2 { font-family: var(--display); margin: 0 0 6px; letter-spacing: -.02em; font-size: 20px; }
.blank-state p { color: var(--muted); margin: 0 0 16px; }
.kbd-hints { display: flex; justify-content: center; gap: 14px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
kbd { font-family: var(--font); font-size: 11.5px; font-weight: 650; background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--text-2); }
.chat-head { height: 68px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 2; }
.chat-head .back { display: none; margin-left: -6px; }
.chat-who { min-width: 0; flex: 1; cursor: pointer; }
.chat-who b { font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-who .sub { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.chat-who .sub .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); flex: none; }
.chat-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.bot-banner { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: linear-gradient(90deg, var(--ai-50), #F7F5FF); border-bottom: 1px solid var(--ai-100); color: #3F2FB8; font-size: 13px; }
.bot-banner .ai-dot { width: 32px; height: 32px; border-radius: 10px; background: var(--ai); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 4px 10px -2px rgba(109,91,246,.5); }
.bot-banner b { display: block; font-size: 13.5px; color: #2A1D96; }
.bot-banner .grow { flex: 1; min-width: 0; }
.typing { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--ai); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.msgs { flex: 1; min-height: 0; padding: 18px 6% 12px; display: flex; flex-direction: column; gap: 3px;
  background-color: var(--chat-bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(15,23,42,.055) 1px, transparent 0);
  background-size: 18px 18px; }
.day { align-self: center; margin: 12px 0 8px; font-size: 11.5px; font-weight: 650; color: var(--muted); background: rgba(255,255,255,.85); padding: 4px 10px; border-radius: 8px; box-shadow: var(--shadow-sm); text-transform: uppercase; letter-spacing: .04em; }
.sys { align-self: center; margin: 6px 0; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.7); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; max-width: 90%; text-align: center; }
.sys .ic { width: 12px; height: 12px; }
.bubble-wrap { display: flex; flex-direction: column; max-width: min(72%, 560px); }
.bubble-wrap.in { align-self: flex-start; }
.bubble-wrap.out { align-self: flex-end; align-items: flex-end; }
.bubble-wrap.gap { margin-top: 8px; }
.author { font-size: 11.5px; font-weight: 650; color: var(--brand-700); margin: 0 8px 3px; display: inline-flex; align-items: center; gap: 4px; }
.author.ai { color: var(--ai); }
.author .ic { width: 12px; height: 12px; }
.bubble { position: relative; padding: 7px 10px 6px; border-radius: 12px; box-shadow: 0 1px 1px rgba(15,23,42,.08); font-size: 14px; line-height: 1.42; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.in .bubble { background: var(--bubble-in); border-top-left-radius: 4px; }
.out .bubble { background: var(--bubble-out); border-top-right-radius: 4px; }
.out.bot .bubble { background: #EAE6FF; }
.bubble .meta { float: right; margin: 6px -2px -3px 10px; font-size: 11px; color: rgba(15,23,42,.45); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bubble .meta .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.bubble .meta .read { color: #2F8CEB; }
.bubble.media { padding: 4px; }
.bubble.media img { display: block; width: 100%; max-width: 300px; max-height: 340px; object-fit: cover; border-radius: 9px; cursor: zoom-in; background: #f1f5f9; }
.bubble.media .cap { padding: 6px 6px 2px; }
.bubble.media .meta.over { position: absolute; right: 10px; bottom: 9px; background: rgba(15,23,42,.45); color: #fff; padding: 1px 6px; border-radius: 8px; margin: 0; }
.bubble.media .meta.over .read { color: #9BD2FF; }
.audio { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 2px 0; }
.audio .play { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.in .audio .play { background: #475569; }
.audio .play .ic { width: 15px; height: 15px; }
.wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: rgba(15,23,42,.22); transition: background .1s; }
.wave i.on { background: var(--brand); }
.audio .dur { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc { display: flex; align-items: center; gap: 10px; padding: 8px; background: rgba(15,23,42,.04); border-radius: 9px; min-width: 230px; }
.doc .fi { width: 38px; height: 44px; border-radius: 7px; background: #E5484D; color: #fff; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; letter-spacing: .03em; flex: none; }
.doc b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.doc span { font-size: 11.5px; color: var(--muted); }
.note { align-self: stretch; max-width: 640px; margin: 8px auto; width: 100%; background: var(--note); border: 1px solid var(--note-line); border-radius: 12px; padding: 9px 12px 9px; color: var(--note-text); font-size: 13.5px; box-shadow: 0 1px 2px rgba(183,121,31,.1); }
.note-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; margin-bottom: 3px; color: #8A6400; }
.note-head .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.note-head time { margin-left: auto; font-weight: 500; color: #A88A3C; }
.note-body { white-space: pre-wrap; color: #4A3700; }

/* composer */
.composer { flex: none; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 14px 12px; position: relative; padding-bottom: calc(12px + var(--safe-b)); }
.composer-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.ctab { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.ctab .ic { width: 14px; height: 14px; }
.ctab:hover { background: var(--line-2); color: var(--text); }
.ctab.active { background: var(--brand-50); color: var(--brand-700); }
.ctab.note-tab.active { background: var(--note); color: var(--note-text); box-shadow: inset 0 0 0 1px var(--note-line); }
.composer-tabs .hint { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.composer-box { display: flex; align-items: flex-end; gap: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 5px 5px 5px 6px; background: var(--surface); transition: border-color .15s, box-shadow .15s, background .15s; }
.composer-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,159,110,.12); }
.composer.note-mode .composer-box { background: var(--note); border-color: var(--note-line); }
.composer.note-mode .composer-box:focus-within { box-shadow: 0 0 0 3px rgba(242,213,124,.35); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; min-height: 36px; max-height: 160px; padding: 8px 6px; line-height: 1.45; font-size: 14px; }
.composer .send { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; transition: background .15s, transform .1s; }
.composer .send:hover { background: var(--brand-600); }
.composer.note-mode .send { background: #D9A514; }
.composer .send .ic { width: 18px; height: 18px; }
.composer .send.mic { background: var(--line-2); color: var(--text-2); }
.composer-lock { flex: none; background: var(--surface); border-top: 1px solid var(--line); padding: 14px 16px; padding-bottom: calc(14px + var(--safe-b)); display: flex; align-items: center; gap: 12px; }
.composer-lock .txt { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-2); }
.composer-lock .txt b { display: block; color: var(--text); }
.composer-lock .txt span { color: var(--muted); font-size: 12.5px; }
.composer-lock .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); color: var(--muted); flex: none; }
.composer-lock.bot .ico { background: var(--ai-50); color: var(--ai); }
.composer-lock.queue .ico { background: var(--warn-50); color: #A15C00; }
.composer-notice { font-size: 12px; color: var(--note-text); background: var(--note); border: 1px solid var(--note-line); border-radius: 9px; padding: 6px 10px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.pop { position: absolute; left: 14px; right: 14px; bottom: calc(100% - 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 10; animation: pop .12s ease-out; }
.pop-title { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; display: flex; justify-content: space-between; }
.qr-list { max-height: 260px; }
.qr-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; }
.qr-item.sel, .qr-item:hover { background: var(--brand-50); }
.qr-item code { grid-row: span 2; align-self: start; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 2px 6px; border-radius: 6px; margin-top: 1px; }
.qr-item b { font-size: 13px; }
.qr-item span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emoji-pop { right: auto; width: 320px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 4px; }
.emoji-grid button { height: 36px; border-radius: 8px; font-size: 20px; line-height: 1; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.emoji-grid button:hover { background: var(--line-2); }
.attach-preview { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface-2); }
.attach-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.attach-preview .fi { width: 44px; height: 52px; border-radius: 8px; background: #3B82F6; color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.attach-preview .grow { flex: 1; min-width: 0; }
.attach-preview b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-preview span { font-size: 12px; color: var(--muted); }

/* ---------- detalhes ---------- */
.col-details { background: var(--surface); border-left: 1px solid var(--line); min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.inbox:not(.details-open) .col-details { border: 0; }
.details-head { height: 68px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.details-head h3 { margin: 0; font-size: 15px; font-family: var(--display); }
.details-body { flex: 1; min-height: 0; }
.contact-card { padding: 22px 18px 18px; text-align: center; border-bottom: 1px solid var(--line-2); }
.contact-card .avatar { margin: 0 auto 10px; }
.contact-card h4 { margin: 0; font-size: 17px; font-family: var(--display); letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 4px; }
.contact-card .ph { color: var(--muted); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.contact-actions { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.kv { display: grid; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.kv-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); min-width: 0; }
.kv-row .ic { width: 16px; height: 16px; color: var(--muted-2); }
.kv-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv-row .muted { color: var(--muted-2); }
.dsec { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.dsec h5 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.dsec .grid2 { display: grid; gap: 10px; }
.dsec .field { margin: 0; }
.dsec .select { height: 36px; font-size: 13px; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-add { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px dashed #CBD5E1; color: var(--muted); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tag-add:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.tag-add .ic { width: 14px; height: 14px; }
.tag-menu { min-width: 220px; }
.tag-menu button .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.hist { display: grid; gap: 6px; }
.hist-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; text-align: left; width: 100%; background: var(--surface); }
.hist-item:hover { border-color: #CFD6E0; background: var(--surface-2); }
.hist-item.current { border-color: var(--brand-100); background: var(--brand-50); }
.hist-item .hi { width: 30px; height: 30px; border-radius: 9px; background: var(--line-2); color: var(--muted); display: grid; place-items: center; }
.hist-item b { font-size: 12.5px; display: block; } .hist-item span { font-size: 11.5px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats-mini div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; }
.stats-mini b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.stats-mini span { font-size: 11.5px; color: var(--muted); }

/* ---------- páginas admin ---------- */
.page { flex: 1; min-height: 0; overflow-y: auto; }
.page-inner { max-width: 1180px; margin: 0 auto; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 26px; letter-spacing: -.025em; margin: 0 0 4px; font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.demo-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #FFF6E3; border: 1px solid #F6D9A0; color: #7A4B00; font-size: 13.5px; margin-bottom: 20px; }
.demo-banner .ic { color: #C77C00; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.card-head h3 { margin: 0; font-size: 15px; font-family: var(--display); letter-spacing: -.01em; }
.card-head span { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 16px 20px 20px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); margin-bottom: 12px; }
.kpi .k-ico .ic { width: 18px; height: 18px; }
.kpi b { display: block; font-family: var(--display); font-size: 28px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi .trend { position: absolute; top: 16px; right: 16px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--brand-50); color: var(--brand-700); }
.kpi .trend.down { background: var(--danger-50); color: #C2272D; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted-2); }
.sector-bars { display: grid; gap: 14px; }
.sbar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.sbar-top b { font-weight: 650; display: inline-flex; gap: 8px; align-items: center; }
.sbar-top b i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.sbar-top span { color: var(--muted); font-size: 12px; }
.sbar { height: 10px; border-radius: 6px; background: var(--line-2); display: flex; overflow: hidden; gap: 2px; }
.sbar i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 16px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table th:first-child { border-top-left-radius: var(--radius-lg); } .table th:last-child { border-top-right-radius: var(--radius-lg); }
.table td { padding: 13px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FBFCFD; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-actions { text-align: right; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person b { display: block; font-weight: 650; } .person span { font-size: 12.5px; color: var(--muted); }
.role { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 6px; background: #EEF2F6; color: var(--text-2); }
.role.admin { background: #EEF0FF; color: #4338CA; }
.role .ic { width: 13px; height: 13px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.status-dot.on i { background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.bar-inline { display: flex; align-items: center; gap: 10px; }
.bar-inline .track { flex: 1; height: 6px; border-radius: 4px; background: var(--line-2); min-width: 60px; overflow: hidden; }
.bar-inline .track i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ent { padding: 18px; display: grid; gap: 12px; }
.ent-top { display: flex; align-items: center; gap: 12px; }
.ent-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); flex: none; }
.ent-top b { font-size: 15px; display: block; } .ent-top span { font-size: 12.5px; color: var(--muted); }
.ent-top .acts { margin-left: auto; display: flex; gap: 2px; }
.ent p { margin: 0; font-size: 13px; color: var(--muted); }
.ent-stats { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line-2); }
.ent-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.qr-card { padding: 16px 18px; display: grid; gap: 8px; }
.qr-card .top { display: flex; align-items: center; gap: 10px; }
.qr-card code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 650; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 2px 7px; border-radius: 7px; }
.qr-card .top b { font-size: 14px; } .qr-card .top .acts { margin-left: auto; display: flex; gap: 2px; }
.qr-card p { margin: 0; font-size: 13px; color: var(--text-2); white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches label { width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; position: relative; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.swatches input { position: absolute; opacity: 0; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input-icon { width: 280px; max-width: 100%; }

/* ---------- modal / toast / lightbox ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11,19,36,.48); backdrop-filter: blur(2px); z-index: 90; display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .16s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: 18px; letter-spacing: -.01em; }
.modal-body { padding: 12px 20px 8px; overflow-y: auto; }
.modal-body > p { margin: 0 0 14px; color: var(--muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); padding: 3px; border-radius: 11px; margin-bottom: 14px; }
.seg button { height: 34px; border-radius: 8px; font-weight: 650; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pick-list { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; margin-bottom: 14px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: .12s; }
.pick:hover { border-color: #CFD6E0; }
.pick:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand) inset; }
.pick input { accent-color: var(--brand); margin: 0 0 0 auto; width: 17px; height: 17px; order: 9; }
.pick b { display: block; font-size: 13.5px; } .pick span { font-size: 12px; color: var(--muted); }
.toasts, #toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; animation: pop .18s ease-out; cursor: pointer; }
.toast .ic { color: var(--brand-glow); margin-top: 1px; }
.toast b { display: block; } .toast span { color: rgba(255,255,255,.7); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.toast.err .ic { color: #FF8A8E; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(5,10,20,.88); display: grid; place-items: center; padding: 40px; animation: fade .15s; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow-lg); background: #fff; }

/* ---------- responsivo ---------- */
@media (max-width: 1279px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1599px) {
  .col-details { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw; z-index: 60; box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .22s ease; }
  .inbox.details-open .col-details { transform: none; }
  .inbox.has-active.details-open::after { content: ""; position: fixed; inset: 0; background: rgba(16,24,32,.28); z-index: 55; }
}
@media (max-width: 1020px) { .dash-grid { grid-template-columns: 1fr; } .chat-actions .btn .lbl { display: none; } .chat-actions .btn { padding: 0 10px; } }
@media (max-width: 860px) {
  :root { --rail: 0px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + var(--safe-b)); gap: 0; border-top: 1px solid var(--ink-3); }
  .rail .brand-mark, .rail .spacer { display: none; }
  .nav-item { width: auto; flex: 1; height: 52px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; }
  .nav-item .lbl { display: block; font-size: 10.5px; font-weight: 600; }
  .nav-item .tip { display: none; }
  .nav-item.active { background: transparent; }
  .nav-item.active::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav-item .badge { top: 3px; right: calc(50% - 22px); }
  .rail .me { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8A97B0; font-size: 10.5px; font-weight: 600; margin: 0; justify-content: center; border-radius: 12px; }
  .rail .me .avatar { --size: 24px; font-size: 10px; }
  .app.in-chat .rail { display: none; }
  .inbox .col-chat { display: none; }
  .inbox.has-active .col-list { display: none; }
  .inbox.has-active .col-chat { display: flex; }
  .chat-head { height: 60px; padding: 0 8px 0 10px; gap: 8px; }
  .chat-head .back { display: inline-grid; margin-left: 0; }
  .chat-head .avatar { --size: 36px; }
  .chat-actions { gap: 2px; }
  .chat-actions .btn { height: 34px; padding: 0 9px; }
  .chat-actions .btn-outline { border-color: transparent; box-shadow: none; background: transparent; }
  .msgs { padding: 12px 10px 10px; }
  .bubble-wrap { max-width: 86%; }
  .bot-banner { padding: 8px 12px; font-size: 12.5px; }
  .bot-banner .ai-dot { display: none; }
  .composer { padding: 6px 8px 8px; padding-bottom: calc(8px + var(--safe-b)); }
  .composer-tabs .hint { display: none; }
  .emoji-pop { left: 8px; right: 8px; width: auto; }
  .pop { left: 8px; right: 8px; }
  .col-details { width: 100%; max-width: 100%; }
  .page-inner { padding: 20px 16px 32px; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; } .kpi b { font-size: 24px; }
  .kpis .kpi:last-child { grid-column: span 2; }
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
  .table.responsive td { padding: 0; border: 0; }
  .table.responsive td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
  .table.responsive td.c-main { grid-column: 1; }
  .table.responsive td.row-actions { grid-column: 2; grid-row: 1; }
  .table.responsive td.c-sub { grid-column: 1 / -1; font-size: 12.5px; }
  .table.responsive tr:hover td { background: none; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .overlay { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: var(--safe-b); }
  #toasts { left: 12px; right: 12px; bottom: 80px; }
  .toast { max-width: none; }
  .toolbar .input-icon { width: 100%; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-box .brand { display: flex; }
  .login-form { align-items: start; padding-top: 56px; }
}


/* ======================= Tema claro ZapBot-100k — camada principal ======================= */
body { background: var(--bg); font-size: 14px; letter-spacing: -.006em; font-feature-settings: "cv11", "ss01", "tnum" 0; }
h1, h2, h3, .page-head h1, .list-title h1, .blank-state h2, .login-box h2, .modal-head h3, .card-head h3, .details-head h3, .contact-card h4, .empty h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.015em; color: var(--text); }
a { color: var(--brand); }
::selection { background: var(--brand-100); }
.scroll { scrollbar-color: #d3d8dc transparent; }
.scroll::-webkit-scrollbar-thumb { background: #d3d8dc; background-clip: padding-box; }
.boot { background: var(--bg); }
.boot-logo { background: url(logo-mark.svg) center/contain no-repeat; border-radius: 12px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* botões */
.btn { font-weight: 600; letter-spacing: -.005em; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(20,87,85,.25), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--brand-600); }
.btn-ai { background: var(--ai); color: #fff; box-shadow: 0 1px 2px rgba(91,75,196,.3); }
.btn-ai:hover { background: #4d3eb3; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--text-2); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: var(--surface-3); border-color: var(--line-strong); color: var(--text); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover, .icon-btn:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b83434; }
.danger-text { color: var(--danger) !important; }
.icon-btn { color: var(--muted); }
.icon-btn.active { background: var(--brand-50); color: var(--brand); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }

/* formulários */
.input, .select, .textarea { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: 0 1px 1px rgba(16,24,32,.02); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input::placeholder, .textarea::placeholder, textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(25,105,103,.14); }
.select { background-color: var(--surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366727c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.check { background: var(--surface); border-color: var(--line); }
.switch i { background: #cfd5da; }
.field.inline { display: flex; align-items: center; gap: 10px; margin: 0; }
.slash { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }

/* chips, pills, avatares */
.chip { background: color-mix(in srgb, var(--c) 10%, white); color: color-mix(in srgb, var(--c) 72%, #1E2A32); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, white); font-weight: 600; }
.chip.more { --c: #8f99a2; }
.badge { background: var(--brand); color: #fff; }
.pill { border-radius: 999px; padding: 0 9px 0 7px; font-weight: 600; }
.pill-bot { background: var(--ai-50); color: var(--ai); box-shadow: inset 0 0 0 1px var(--ai-100); }
.pill-queue { background: var(--warn-50); color: #915d0f; box-shadow: inset 0 0 0 1px #f3e0b8; }
.pill-open { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-100); }
.pill-resolved { background: var(--surface-3); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pill-demo { background: #fdf6e7; color: #8a5a0b; box-shadow: inset 0 0 0 1px #f3e2bd; }
.pill-live { background: #ebf7f0; color: #17713f; box-shadow: inset 0 0 0 1px #cfeadb; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wa); box-shadow: 0 0 0 3px rgba(31,157,85,.18); animation: pulse 1.6s infinite; }
.avatar { font-weight: 600; background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 82%, #1E2A32); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 20%, white); }
.avatar.lg2 { --size: 48px; }
.avatar .dot { border-color: var(--surface); }
.avatar .dot.on { background: var(--wa); }
.avatar .botmark { background: var(--ai); color: #fff; border-color: var(--surface); }
.timer { background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 0 8px; }
.timer.warn { background: var(--warn-50); color: #915d0f; }
.timer.late { background: var(--danger-50); color: #b23232; }

/* login */
.login { background: var(--surface); grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(900px 600px at 0% 0%, #e3f0ee 0%, transparent 60%), radial-gradient(700px 500px at 100% 100%, #eef3f6 0%, transparent 60%), #f4f7f7; color: var(--text); border-right: 1px solid var(--line); padding: 44px 56px; }
.login-art::after { background-image: radial-gradient(rgba(30,42,50,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 20%, transparent 85%); }
.brand { font-family: var(--display); color: var(--text); }
.brand-lockup { height: 34px; width: auto; display: block; }
.login-art .brand-lockup { height: 40px; }
.login-center { position: relative; z-index: 1; margin: 64px 0 40px; }
.login-mock { margin: 0; max-width: 460px; gap: 12px; }
.lm-card { background: rgba(255,255,255,.92); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: none; padding: 14px 16px; }
.lm-card:nth-child(2) { margin-left: 40px; } .lm-card:nth-child(3) { margin-left: 16px; }
.lm-card span { color: var(--muted); }
.lm-card .badge { color: #fff; }
.lm-card .meta { color: var(--muted-2); }
.lm-card .avatar .dot, .lm-card .avatar .botmark { border-color: #fff; }
.login-hero h1 { font-family: var(--display); font-size: 40px; line-height: 1.12; letter-spacing: -.025em; font-weight: 700; color: var(--text); }
.login-hero h1 em { background: none; color: var(--brand); -webkit-text-fill-color: currentColor; }
.login-hero p { color: var(--muted); font-size: 16px; line-height: 1.55; }
.login-foot { color: var(--muted); margin-top: 32px; }
.login-foot .ic { color: var(--brand); }
.login-form { background: var(--surface); }
.login-box { max-width: 392px; }
.login-box h2 { font-size: 28px; margin-bottom: 6px; }
.login-box .seg { margin-bottom: 20px; }
.demo-users { border-top: 1px solid var(--line-2); }
.demo-user { background: var(--surface); border-color: var(--line); }
.demo-user:hover { border-color: var(--brand); background: var(--brand-50); }
.login-alt { margin-top: 20px; text-align: center; font-size: 13px; }
.login-alt a { color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.login-alt a:hover { color: var(--brand); }
.err { background: var(--danger-50); color: #a52c2c; border: 1px solid #f6d3d3; }

/* shell: barra lateral clara */
.rail { background: var(--surface); border-right: 1px solid var(--line); align-items: stretch; padding: 18px 12px 14px; gap: 2px; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.rail .brand-mark { width: 34px; height: 34px; margin: 0; border-radius: 0; box-shadow: none; display: none; }
.rail .brand-lockup { height: 30px; }
.rail-sec { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); padding: 6px 10px 6px; }
.nav-item { width: auto; height: 40px; border-radius: 10px; display: flex; align-items: center; gap: 11px; padding: 0 10px; color: var(--text-2); font-weight: 550; font-size: 14px; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 650; }
.nav-item.active::before { display: none; }
.nav-item .ic { width: 19px; height: 19px; stroke-width: 1.8; }
.nav-item.active .ic { color: var(--brand); }
.nav-item .lbl { display: block; flex: 1; }
.nav-item .tip { display: none; }
.nav-item .badge { position: static; box-shadow: none; height: 20px; min-width: 22px; font-size: 11px; }
.rail .me { margin-top: 8px; border-radius: 12px; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); text-align: left; background: var(--surface-2); }
.rail .me:hover { background: var(--surface-3); }
.rail .me .avatar .dot { border-color: var(--surface-2); }
.me-txt { min-width: 0; display: grid; }
.me-txt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail .me .lbl { display: none; }
.menu { background: var(--surface); border-color: var(--line); }
.menu .menu-head { border-color: var(--line-2); }
.menu button, .menu .menu-link { color: var(--text-2); }
.menu button:hover, .menu .menu-link:hover { background: var(--surface-3); }
.menu .menu-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; text-decoration: none; }
.menu-company { display: flex; align-items: center; gap: 8px; margin: 2px 4px 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-3); font-size: 13px; font-weight: 600; color: var(--text); }
.menu-company em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; }
.sep-top { border-top: 1px solid var(--line-2) !important; margin-top: 4px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }

/* ---------- caixa de entrada em cards ---------- */
.col-list { background: var(--bg); border-right: 1px solid var(--line); }
.inbox:not(.has-active) .col-list { border-right: 0; }
.inbox:not(.has-active) .col-chat, .inbox:not(.has-active) .col-details { display: none; }
.inbox.has-active { grid-template-columns: minmax(330px, 36%) minmax(0, 1fr); }
.list-head { padding: 26px 32px 14px; gap: 14px; }
.inbox.has-active .list-head { padding: 20px 18px 12px; }
.list-title { gap: 12px; }
.list-title h1 { font-size: 26px; font-weight: 700; line-height: 1.1; }
.inbox.has-active .list-title h1 { font-size: 21px; }
.lt-text { min-width: 0; }
.list-title .pill { margin-left: auto; }
.vtoggle { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; flex: none; }
.vtoggle button { width: 32px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.vtoggle button:hover { color: var(--text); }
.vtoggle button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.list-tools { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.list-tools .tabs { flex: 0 1 460px; }
.list-tools .list-filters { flex: 1 1 320px; min-width: 0; }
.inbox.has-active .list-tools .tabs, .inbox.has-active .list-tools .list-filters { flex: 1 1 100%; }
.tabs { background: var(--surface-3); border: 1px solid var(--line); box-shadow: none; border-radius: 11px; }
.tab { color: var(--muted); font-weight: 600; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,32,.08), 0 0 0 1px rgba(16,24,32,.03); }
.tab .n { color: var(--muted-2); }
.tab.active .n { color: var(--brand); }
.tab .n.hot, .tab.active .n.hot { background: var(--brand); color: #fff; }
.list-filters .input, .list-filters .select { height: 38px; }
.list-filters .select { width: 160px; }
.global { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 11px; font-size: 12.5px; font-weight: 600; background: #ebf7f0; box-shadow: inset 0 0 0 1px #cfeadb; color: #17713f; }
.global.off { background: var(--danger-50); box-shadow: inset 0 0 0 1px #f3cccc; color: #a52c2c; }
.global .gdot { width: 8px; height: 8px; border-radius: 50%; background: var(--wa); box-shadow: 0 0 0 3px rgba(31,157,85,.18); }
.global.off .gdot { background: var(--danger); box-shadow: 0 0 0 3px rgba(207,63,63,.18); }
.global span:nth-child(2) { flex: 1; }
.global .btn { height: 28px; }

.conv-list { padding: 4px 32px 32px; }
.inbox.has-active .conv-list { padding: 2px 18px 20px; }
/* cards */
.view-grid .conv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 14px; align-content: start; }
.view-grid.has-active .conv-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.conv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av nm tm" "pv pv pv" "mt mt mt"; gap: 10px 12px; align-items: center; cursor: pointer; position: relative; border-radius: 14px; padding: 15px 16px 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.conv > .avatar { grid-area: av; }
.conv:hover { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.conv.active { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(25,105,103,.12), var(--shadow); }
.conv.active::before { display: none; }
.conv.unread .conv-name { font-weight: 700; }
.c-name { grid-area: nm; min-width: 0; display: grid; gap: 2px; }
.conv-name { font-weight: 600; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.c-line { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; }
.c-line .sector-tag { font-size: 12px; }
.c-time { grid-area: tm; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; align-self: start; }
.conv-time { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.conv.unread .conv-time { color: var(--brand); font-weight: 650; }
.c-prev { grid-area: pv; min-width: 0; }
.conv-prev { font-size: 13.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; min-height: 2.9em; }
.conv.unread .conv-prev { color: var(--text-2); font-weight: 500; }
.conv-prev .who { color: var(--muted-2); font-weight: 500; }
.conv-meta { grid-area: mt; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; padding-top: 11px; border-top: 1px solid var(--line-2); overflow: hidden; }
.conv-meta .chip { height: 22px; font-size: 11px; padding: 0 8px; }
.conv-meta .end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.who-av { display: inline-flex; }
.sector-tag { color: var(--muted); font-weight: 550; }
.sector-tag i { border-radius: 50%; }
/* lista */
.view-list .conv-list { display: block; }
.view-list .conv-list > .conv { margin-bottom: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line-2); box-shadow: none; background: var(--surface); grid-template-areas: "av nm tm" "av pv pv" "av mt mt"; gap: 3px 14px; padding: 13px 16px; transform: none; }
.view-list .conv-list > .conv:first-child { border-top-left-radius: 14px; border-top-right-radius: 14px; }
.view-list .conv-list > .conv:last-child { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; border-bottom: 0; }
.view-list .conv-list { background: transparent; }
.view-list .conv-list:has(.conv) { box-shadow: none; }
.view-list .conv-list > .conv:hover { background: var(--surface-2); }
.view-list .conv-list > .conv.active { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
.view-list .conv > .avatar { align-self: start; margin-top: 2px; }
.view-list .conv-prev { -webkit-line-clamp: 1; min-height: 0; }
.view-list .c-name { display: flex; align-items: baseline; gap: 10px; }
.view-list .conv-name { flex: 0 1 auto; }
.view-list .conv-meta { border-top: 0; padding-top: 4px; }
.view-list .conv-list > .conv { outline-offset: -2px; }
.view-list .conv-list:not(:has(.empty)) { padding-top: 0; }
.view-list .conv-list:not(:has(.empty)) > .conv:first-child { margin-top: 4px; }
.view-list .conv-list:not(:has(.empty)) { filter: drop-shadow(0 1px 2px rgba(16,24,32,.05)); }
.empty { grid-column: 1 / -1; }
.empty .art { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); border: 1px solid var(--line); }

/* chat */
.col-chat, .col-chat.blank { background: var(--chat-bg); }
.blank-state p { color: var(--muted); }
kbd { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.chat-head, .composer, .composer-lock, .details-head { background: var(--surface); border-color: var(--line); }
.chat-head { height: 72px; padding: 0 20px 0 14px; }
.chat-head .back { display: inline-grid; margin-left: 0; }
.chat-who b { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; }
.msgs { background-color: var(--chat-bg); background-image: radial-gradient(circle at 1px 1px, rgba(30,42,50,.05) 1px, transparent 0); background-size: 20px 20px; padding: 22px 7% 14px; }
.day { background: var(--surface); color: var(--muted); box-shadow: var(--shadow-sm); border: 1px solid var(--line); font-weight: 600; letter-spacing: .05em; }
.sys { background: var(--surface); border-color: var(--line); color: var(--muted); }
.bubble { box-shadow: 0 1px 1.5px rgba(16,24,32,.06); color: var(--text); border-radius: 14px; padding: 8px 12px 7px; }
.in .bubble { background: var(--bubble-in); border: 1px solid var(--line); border-top-left-radius: 5px; }
.out .bubble { background: var(--bubble-out); border: 1px solid #d3e8e5; border-top-right-radius: 5px; }
.out.bot .bubble { background: var(--ai-50); border: 1px solid var(--ai-100); box-shadow: 0 1px 1.5px rgba(16,24,32,.05); }
.author { color: var(--brand); }
.author.ai { color: var(--ai); }
.bubble .meta { color: rgba(30,42,50,.45); }
.bubble .meta .read { color: var(--brand-glow); }
.bubble .meta .failed { color: var(--danger); }
.bubble.media img { background: var(--surface-3); }
.audio .play { background: var(--brand); color: #fff; }
.in .audio .play { background: #55636d; color: #fff; }
.wave i { background: rgba(30,42,50,.2); }
.wave i.on { background: var(--brand); }
.doc { background: rgba(30,42,50,.04); }
.doc .fi { background: #d64545; } .doc .fi.alt { background: var(--brand); }
.note { background: var(--note); border-color: var(--note-line); color: var(--note-text); box-shadow: none; }
.note-head { color: #8a6500; } .note-head time { color: #a8893f; } .note-body { color: #4f3b00; }
.bot-banner { background: linear-gradient(90deg, var(--ai-50), #faf9fe); border-color: var(--ai-100); color: var(--text-2); }
.bot-banner b { color: var(--ai); }
.bot-banner .ai-dot { background: var(--ai); color: #fff; box-shadow: 0 4px 10px -3px rgba(91,75,196,.45); }
.typing i { background: var(--ai); }
.human-banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 18px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); color: var(--text-2); font-size: 12.5px; }
.human-banner > .ic { color: var(--brand); }
.human-banner span { flex: 1; min-width: 0; }
.human-banner .btn { color: var(--ai); }
.ctab:hover { background: var(--surface-3); }
.ctab.active { background: var(--brand-50); color: var(--brand-700); }
.ctab[disabled] { opacity: .4; pointer-events: none; }
.composer { padding: 10px 16px 14px; }
.composer-box { background: var(--surface); border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.composer-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(25,105,103,.12); }
.composer textarea { color: var(--text); }
.composer.note-mode .composer-box { background: var(--note); border-color: var(--note-line); }
.composer.note-mode .send { background: #c99a1c; color: #fff; }
.composer .send { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(20,87,85,.3); }
.composer .send:hover { background: var(--brand-600); }
.composer .send.mic { background: var(--surface-3); color: var(--text-2); box-shadow: none; }
.composer-lock .ico { background: var(--surface-3); }
.composer-lock.bot .ico { background: var(--ai-50); color: var(--ai); }
.composer-lock.queue .ico { background: var(--warn-50); color: #915d0f; }
.composer-notice { display: flex; gap: 8px; align-items: flex-start; }
.composer-notice .ic { margin-top: 2px; }
.pop { background: var(--surface); border-color: var(--line); }
.qr-item.sel, .qr-item:hover { background: var(--brand-50); }
.qr-item code, .qr-card code { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.emoji-grid button:hover { background: var(--surface-3); }
.attach-preview { background: var(--surface-2); border-color: var(--line); }
.loading-chat { flex: 1; display: grid; place-items: center; min-height: 200px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* detalhes */
.col-details { background: var(--surface); border-color: var(--line); }
.details-head { height: 72px; }
.contact-card, .kv, .dsec { border-color: var(--line-2); }
.contact-card .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.dsec h5 { color: var(--muted-2); }
.dsec h5 .count { text-transform: none; letter-spacing: 0; font-weight: 600; }
.tag-add { border-color: var(--line-strong); }
.tag-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.hist-item { background: var(--surface); border-color: var(--line); }
.hist-item:hover { background: var(--surface-2); border-color: var(--line-strong); }
.hist-item.current { background: var(--brand-50); border-color: var(--brand-100); }
.hist-item .hi { background: var(--surface-3); }
.stats-mini div { background: var(--surface-2); border-color: var(--line-2); }

/* páginas */
.page-inner { max-width: 1240px; padding: 32px 40px 56px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; font-weight: 700; }
.page-head p { color: var(--muted); }
.card { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.card-head h3 { font-size: 15.5px; font-weight: 700; }
.demo-banner { background: #fdf8ec; border-color: #f1e2bd; color: #6f4d07; }
.demo-banner .ic { color: #b7791f; }
.demo-banner code, .page-head code { background: rgba(30,42,50,.06); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.kpi { padding: 18px 20px; }
.kpi .k-ico { background: color-mix(in srgb, var(--c) 10%, white); color: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, white); }
.kpi b { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.kpi .trend { background: #ebf7f0; color: #17713f; border-radius: 999px; }
.kpi .trend.down { background: var(--danger-50); color: #b23232; }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
.chart text { fill: var(--muted-2); }
.chart .grid { stroke: var(--line-2); }
.chart .future { fill: var(--line); }
.sbar { background: var(--surface-3); }
.table th { background: var(--surface-2); border-color: var(--line); color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.table td { border-color: var(--line-2); }
.table tr:hover td { background: var(--surface-2); }
.table tr.inactive { opacity: .5; }
.role { background: var(--surface-3); color: var(--text-2); }
.role.admin { background: var(--brand-50); color: var(--brand-700); }
.role.superadmin { background: var(--ai-50); color: var(--ai); }
.status-dot.on i { background: var(--wa); box-shadow: 0 0 0 3px rgba(31,157,85,.15); }
.status-dot.trial i { background: #d99a26; }
.status-dot.off i { background: var(--danger); }
.bar-inline .track { background: var(--surface-3); }
.bar-inline .track i { background: var(--brand); }
.ic.star { color: #d99a26; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; align-items: center; }
.stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.stack .avatar + .avatar { margin-left: -8px; }
.ent-ico { background: color-mix(in srgb, var(--c) 10%, white); }
.ent-ico.sm { width: 36px; height: 36px; border-radius: 10px; }
.ent-stats { border-color: var(--line-2); }
.qr-card p { background: var(--surface-2); border-color: var(--line-2); }
.cards-grid.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.muted-code { font-size: 12px; color: var(--muted); }
.swatches label:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.co-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13.5px; background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 82%, #1E2A32); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 20%, white); flex: none; }
.plan { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.plan.starter { background: var(--surface-3); color: var(--text-2); }
.plan.pro { background: var(--brand-50); color: var(--brand-700); }
.plan.business { background: #fdf4e3; color: #8a5a0b; }

/* contatos em cards */
.ctoolbar { align-items: center; margin-bottom: 18px; }
.ctoolbar .input-icon { width: 360px; }
.seg-inline { display: inline-grid; grid-auto-flow: column; grid-template-columns: none; margin: 0; }
.seg-inline button { padding: 0 14px; }
.ctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px; }
.ctile { padding: 18px; display: grid; gap: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; align-content: start; }
.ctile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.ct-top { display: flex; align-items: center; gap: 12px; }
.ct-who { min-width: 0; flex: 1; display: grid; gap: 1px; }
.ct-who b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-who span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-kv { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.ct-kv span { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-kv .ic { color: var(--muted-2); }
.ct-kv .muted { color: var(--muted-2); }
.ct-last { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; }
.ct-last .conv-prev { font-size: 13px; min-height: 2.9em; }
.ct-foot { display: flex; align-items: center; gap: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.ct-foot b { color: var(--text); font-weight: 650; }
.ct-foot .icon-btn { margin-left: auto; width: 32px; height: 32px; color: var(--brand); }

/* modal / toast */
.overlay { background: rgba(16,24,32,.32); backdrop-filter: blur(3px); }
.modal { background: var(--surface); box-shadow: var(--shadow-lg); border-radius: 18px; }
.seg { background: var(--surface-3); border: 1px solid var(--line); box-shadow: none; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,32,.08); }
.pick { border-color: var(--line); background: var(--surface); }
.pick:hover { border-color: var(--line-strong); }
.pick:has(input:checked) { background: var(--brand-50); }
.toast { background: var(--ink); color: #fff; border: 0; }
.toast .ic { color: var(--brand-soft); }
.toast.err .ic { color: #ff9a9a; }
.lightbox { background: rgba(16,24,32,.86); }

/* responsivo */
@media (min-width: 1600px) {
  .inbox.has-active.details-open { grid-template-columns: minmax(330px, 30%) minmax(0, 1fr) 340px; }
}
@media (max-width: 1279px) {
  :root { --rail: 72px; }
  .rail { padding: 16px 10px 14px; align-items: center; }
  .rail-brand { padding: 2px 0 16px; }
  .rail .brand-mark { display: block; }
  .rail .brand-lockup, .rail-sec, .me-txt { display: none; }
  .nav-item { width: 48px; height: 46px; justify-content: center; padding: 0; position: relative; }
  .nav-item .lbl { display: none; }
  .nav-item .tip { display: block; position: absolute; left: 58px; background: var(--ink); color: #fff; border: 0; }
  .nav-item .badge { position: absolute; top: 4px; right: 2px; height: 17px; min-width: 17px; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 2px var(--surface); }
  .rail .me { padding: 4px; border: 0; background: none; justify-content: center; }
  .kpis.four { grid-template-columns: repeat(2, 1fr); }
  .inbox.has-active { grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); }
}
@media (max-width: 1100px) { .login { grid-template-columns: 1fr 1fr; } .login-art { padding: 36px 36px; } .login-hero h1 { font-size: 32px; } }
@media (max-width: 860px) {
  :root { --rail: 0px; }
  .rail { flex-direction: row; justify-content: space-around; align-items: center; padding: 6px 4px calc(6px + var(--safe-b)); border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px -8px rgba(16,24,32,.08); }
  .rail-brand { display: none; }
  .nav-item { width: auto; flex: 1; height: 52px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; }
  .nav-item .lbl { display: block; flex: none; font-size: 10.5px; font-weight: 600; }
  .nav-item .tip { display: none !important; }
  .nav-item.active { background: transparent; color: var(--brand); }
  .nav-item .badge { position: absolute; top: 3px; right: calc(50% - 22px); }
  .rail .me { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; margin: 0; justify-content: center; border: 0; background: none; padding: 0; }
  .rail .me .lbl { display: block; }
  .inbox.has-active { grid-template-columns: 1fr; }
  .list-head { padding: 18px 14px 10px; gap: 12px; }
  .list-title h1 { font-size: 22px; }
  .list-tools .tabs, .list-tools .list-filters { flex: 1 1 100%; }
  .list-filters .select { width: 128px; }
  .conv-list { padding: 2px 14px 18px; }
  .view-grid .conv-list { grid-template-columns: 1fr; gap: 10px; }
  .conv { padding: 13px 14px 12px; }
  .conv:hover { transform: none; }
  .chat-head { height: 62px; padding: 0 8px 0 6px; }
  .msgs { padding: 12px 10px 10px; }
  .human-banner { padding: 4px 6px 4px 12px; }
  .composer-lock .btn .lbl-m { display: inline; }
  .composer-lock .txt span { display: none; }
  .composer-lock { padding: 10px 12px; padding-bottom: calc(10px + var(--safe-b)); }
  .page-inner { padding: 20px 14px 32px; }
  .page-head h1 { font-size: 22px; }
  .kpis.four .kpi:last-child { grid-column: auto; }
  .login-box h2 { font-size: 24px; }
  .ctoolbar .input-icon { width: 100%; }
  .ctiles { grid-template-columns: 1fr; gap: 12px; }
  .m-hide { display: none !important; }
}
[hidden] { display: none !important; }
