:root {
  --navy: #101C4E;
  --navy-2: #1B2A6B;
  --navy-3: #2A3B85;
  --ink: #1C2333;
  --ink-2: #3D4559;
  --muted: #6B7387;
  --line: #E3E7EF;
  --line-2: #EEF1F6;
  --bg: #EDF0F5;
  --surface: #FFFFFF;
  --primary: #2347D9;
  --primary-ink: #FFFFFF;
  --primary-soft: #E7ECFF;
  --green: #1E8E5A;
  --green-soft: #E2F4EA;
  --amber: #C27C00;
  --amber-soft: #FFF2D6;
  --violet: #6D4BD0;
  --violet-soft: #EEE8FF;
  --red: #C9372C;
  --red-soft: #FDE8E6;
  --out: #E4ECFF;
  --note: #FFF5D6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 28, 78, .06), 0 2px 10px rgba(16, 28, 78, .05);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Estrutura ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  height: 64px; padding: 0 20px; flex: none;
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: #fff; color: var(--navy); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.topbar .sep { width: 1px; height: 28px; background: rgba(255, 255, 255, .18); }
.nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; min-width: 36px; padding: 0 9px; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 13px;
  background: rgba(255, 255, 255, .08);
  transition: background .15s;
  white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .16); }
.nav a .lbl { display: none; }
.nav a.on { background: #fff; color: var(--navy); padding: 0 14px 0 11px; }
.nav a.on .lbl { display: inline; }
.nav a .dot { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--amber); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.me { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; padding: 4px 6px; border-radius: 12px; }
.me:hover { background: rgba(255, 255, 255, .08); }
.me .who { text-align: left; line-height: 1.2; }
.me .who b { display: block; font-size: 13px; }
.me .who span { font-size: 11.5px; opacity: .75; }
.page { flex: 1; min-height: 0; padding: 16px; overflow: auto; }
.page.fill { overflow: hidden; display: flex; gap: 16px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.menu-pop { position: fixed; z-index: 60; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 28, 78, .18); padding: 6px; min-width: 200px; }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; text-align: left; }
.menu-pop button:hover { background: var(--line-2); }

/* ---------- Botões e formulários ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: #CBD2E0; background: #FAFBFD; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: #1C3CC0; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--line-2); color: var(--ink); }
.iconbtn.on { background: var(--primary-soft); color: var(--primary); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 13px; }
.field small, .hint { color: var(--muted); font-size: 12.5px; }
.input, textarea.input, select.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.switch:last-child { border-bottom: 0; }
.toggle { position: relative; width: 40px; height: 23px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: #CED4E2; transition: .15s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: .15s; }
.toggle input:checked + i { background: var(--green); }
.toggle input:checked + i::after { transform: translateX(17px); }
.err { background: var(--red-soft); color: #8E2119; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: #6B4500; font-size: 13px; }
.notice svg { margin-top: 1px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.chip .sw { width: 7px; height: 7px; border-radius: 50%; }
.chip.dep { background: var(--line-2); color: var(--ink-2); }
.st-queue { background: var(--amber-soft); color: var(--amber); }
.st-open { background: var(--green-soft); color: var(--green); }
.st-bot { background: var(--violet-soft); color: var(--violet); }
.st-closed { background: var(--line-2); color: var(--muted); }
.st-connected { background: var(--green-soft); color: var(--green); }
.st-qr, .st-connecting { background: var(--amber-soft); color: var(--amber); }
.st-disconnected { background: var(--red-soft); color: var(--red); }

.avatar svg { width: 55%; height: 55%; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.ring { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ring, transparent); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; max-width: 14ch; }
.auth-side p { opacity: .8; max-width: 42ch; font-size: 15px; }
.auth-points { display: grid; gap: 10px; margin-top: 26px; }
.auth-points div { display: flex; gap: 10px; align-items: center; opacity: .9; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; }
.auth-form .sub { color: var(--muted); margin: 0 0 22px; }
.auth-form .btn.primary { width: 100%; height: 44px; font-size: 14px; }
.switch-link { text-align: center; margin-top: 16px; color: var(--muted); }
.switch-link button { border: 0; background: none; color: var(--primary); font-weight: 700; padding: 0; }

/* ---------- Conversas ---------- */
.list-col { width: 330px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
.list-head { padding: 12px 12px 0; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.search .input { padding-left: 36px; background: var(--line-2); border-color: transparent; }
.search .input:focus { background: #fff; }
.search .filter { position: absolute; right: 4px; top: 3px; }
.tabs { display: flex; justify-content: space-between; margin-top: 10px; border-bottom: 1px solid var(--line); }
.tab { position: relative; flex: 1; height: 42px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--primary); }
.tab.on::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.tab .n { position: absolute; top: 4px; left: calc(50% + 5px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; font-weight: 800; display: grid; place-items: center; background: var(--line); color: var(--ink-2); }
.tab .n.hot { background: var(--amber); color: #fff; }
.tab-title { padding: 10px 14px 4px; font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.filters-line { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 6px; }
.conv-list { flex: 1; overflow-y: auto; }
.conv {
  display: flex; gap: 11px; width: 100%; padding: 11px 14px 11px 12px; border: 0; background: none; text-align: left;
  border-left: 3px solid transparent; border-bottom: 1px solid var(--line-2);
}
.conv:hover { background: #F7F8FB; }
.conv.on { background: var(--primary-soft); border-left-color: var(--primary); }
.conv .body { flex: 1; min-width: 0; }
.conv .row1 { display: flex; justify-content: space-between; gap: 8px; }
.conv .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.conv .prev { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.conv .row3 { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-height: 22px; }
.chip.via { background: #E7ECFF; color: #1B2A6B; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.chip.via svg { width: 12px; height: 12px; flex: none; }
.conv .row3 { flex-wrap: wrap; row-gap: 4px; }
.chat-head .conn-line { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--navy-2); }
.chat-head .conn-line svg { width: 13px; height: 13px; }
.conv .agent { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.conv .agent svg { width: 13px; height: 13px; }
.conv .unread { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--green); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.list-foot { padding: 10px; text-align: center; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; stroke-width: 1.4; margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 68px; }
.chat-head .info { flex: 1; min-width: 0; line-height: 1.3; }
.chat-head .info b { font-size: 15px; }
.chat-head .info .sub { color: var(--muted); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.chat-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 22px; background: #F6F7FA; display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; margin: 12px 0 8px; padding: 3px 12px; border-radius: 99px; background: #fff; color: var(--muted); font-size: 11.5px; font-weight: 700; box-shadow: var(--shadow); }
.bubble {
  max-width: min(560px, 78%); padding: 8px 11px 6px; border-radius: 12px; background: #fff; box-shadow: 0 1px 1px rgba(16, 28, 78, .06);
  word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; position: relative;
}
.bubble.in { align-self: flex-start; border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--out); border-top-right-radius: 4px; }
.bubble.auto { background: var(--violet-soft); }
.bubble.phone { background: #EAF6EE; }
.bubble.failed { background: var(--red-soft); }
.bubble.note { align-self: center; background: var(--note); max-width: 80%; font-size: 13px; border-radius: 10px; }
.bubble .by { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; display: flex; gap: 5px; align-items: center; }
.bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.bubble .meta svg { width: 15px; height: 15px; }
.bubble .meta .read { color: #2F80ED; }
.bubble .fail { color: var(--red); font-size: 12px; margin-top: 4px; display: flex; gap: 5px; align-items: flex-start; white-space: normal; }
.bubble img.media { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 2px 0 4px; cursor: zoom-in; background: var(--line-2); }
.bubble video.media { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 2px 0 4px; }
.bubble audio { display: block; max-width: 260px; margin: 2px 0; }
.bubble .file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .7); text-decoration: none; color: var(--ink); margin-bottom: 4px; }
.bubble .file b { font-size: 13px; }
.load-more { align-self: center; margin-bottom: 8px; }

.composer { border-top: 1px solid var(--line); padding: 10px 12px; background: #fff; position: relative; }
.composer.note-mode { background: var(--note); }
.composer .row { display: flex; align-items: flex-end; gap: 6px; }
.composer .tools { display: flex; gap: 2px; padding-bottom: 3px; }
.composer textarea { flex: 1; border: 0; resize: none; max-height: 160px; min-height: 40px; padding: 10px 10px; background: transparent; outline: none; line-height: 1.4; }
.composer .send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.composer .send:disabled { background: #B8C2DC; }
.composer .mode { font-size: 12px; font-weight: 700; color: #7A5A00; margin: 0 0 6px 4px; display: flex; align-items: center; gap: 6px; }
.composer-blocked { padding: 14px 16px; border-top: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); flex-wrap: wrap; }
.pop { position: absolute; bottom: calc(100% + 6px); left: 12px; right: 12px; max-height: 260px; overflow-y: auto; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 28, 78, .18); padding: 6px; z-index: 5; }
.pop .qr { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; }
.pop .qr.on, .pop .qr:hover { background: var(--primary-soft); }
.pop .qr b { color: var(--primary); margin-right: 8px; }
.pop .qr span { color: var(--muted); }
.emojis { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; right: auto; width: 340px; }
.emojis button { border: 0; background: none; font-size: 20px; padding: 4px; border-radius: 6px; }
.emojis button:hover { background: var(--line-2); }

.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); background: #F6F7FA; padding: 24px; }
.chat-empty .big { width: 64px; height: 64px; border-radius: 20px; background: #fff; display: grid; place-items: center; margin: 0 auto 12px; box-shadow: var(--shadow); color: var(--navy); }
.chat-empty .big svg { width: 30px; height: 30px; }

/* ---------- Páginas de gestão ---------- */
.wrap { max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.cols { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.conn { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.conn .top { display: flex; align-items: center; gap: 12px; }
.conn .ph { width: 44px; height: 44px; border-radius: 12px; background: var(--line-2); color: var(--navy); display: grid; place-items: center; }
.conn .ph svg { width: 22px; height: 22px; }
.conn .t b { font-size: 15px; }
.conn .t div { color: var(--muted); font-size: 12.5px; }
.conn .err-line { font-size: 12.5px; color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 8px 10px; }
.conn .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .acts { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 16px 18px; }
.stat .n { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .l i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 10px 4px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 42px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bars .b span { font-size: 11.5px; color: var(--muted); }
.bars .b em { font-style: normal; font-size: 12px; font-weight: 700; }
.section-title { font-size: 14px; font-weight: 800; margin: 0 0 12px; }
.pad { padding: 18px; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row label { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; position: relative; }
.color-row input { position: absolute; opacity: 0; }
.color-row input:checked + i { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }

/* Pré-visualização estilo WhatsApp */
.preview { background: #ECE5DD; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.preview .pb { max-width: 85%; padding: 7px 10px; border-radius: 9px; background: #fff; white-space: pre-wrap; font-size: 13px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.preview .pb.me { align-self: flex-end; background: #D9FDD3; }
.preview .pb.client { align-self: flex-end; background: #D9FDD3; }
.preview .pb.bot { align-self: flex-start; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Modal e avisos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16, 28, 78, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(16, 28, 78, .3); }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-b { padding: 10px 18px 6px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
@keyframes fade { from { opacity: 0; } }
.qrbox { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: center; }
.qrbox .q { width: 240px; height: 240px; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; background: #fff; }
.qrbox .q img { width: 228px; height: 228px; image-rendering: pixelated; }
.qrbox ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.ok-big { text-align: center; padding: 20px 0; }
.ok-big .c { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 12px; }
.ok-big .c svg { width: 32px; height: 32px; stroke-width: 2.4; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; width: min(440px, calc(100vw - 24px)); }
.toast { background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); display: flex; gap: 10px; align-items: flex-start; animation: fade .15s; }
.toast.bad { background: #8E2119; }
.toast.good { background: #14613E; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: grid; place-items: center; z-index: 90; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

/* ---------- Telas menores ---------- */
@media (max-width: 1000px) {
  .me .who { display: none; }
  .brand .name { display: none; }
}
@media (max-width: 820px) {
  .topbar { padding: 0 12px; gap: 10px; height: 58px; }
  .topbar .sep { display: none; }
  .page { padding: 10px; }
  .page.fill { gap: 0; }
  .list-col { width: 100%; }
  .page.fill.has-chat .list-col { display: none; }
  .page.fill:not(.has-chat) .chat-col { display: none; }
  .back { display: inline-grid; }
  .msgs { padding: 12px; }
  .bubble { max-width: 88%; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .two, .qrbox { grid-template-columns: 1fr; }
  .qrbox .q { margin: 0 auto; }
  .chat-actions .btn .lbl { display: none; }
  .chat-head { gap: 8px; padding: 10px; min-height: 0; }
  .chat-head > .avatar { display: none; }
  .chat-head .info b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head .info .chip { display: none; }
  .chat-head .info .sub .opt { display: none; }
  .composer .tools .iconbtn { width: 30px; }
  .composer textarea { padding: 10px 4px; }
  .chat-actions .btn { width: 34px; padding: 0; }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 6px; border-bottom: 1px solid var(--line-2); }
  .table td { border: 0; padding: 4px 8px; }
  .emojis { width: auto; grid-template-columns: repeat(8, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.sm-time { height: 34px; width: 108px; padding: 0 8px; }
.table.hours td { border: 0; }
.section-title { margin: 0 0 6px; }

.billing-bar { display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: var(--amber-soft); color: #6B4500; font-size: 13px; font-weight: 600; flex: none; }
.billing-bar.late { background: var(--red-soft); color: #8E2119; }
.billing-bar span { flex: 1; }

/* Estrela do atendente fixo: maior e em destaque */
#a-owner { width: 38px; height: 38px; color: #E0A100; background: #FFF6D6; border: 1px solid #F3D676; }
#a-owner svg { width: 22px; height: 22px; stroke-width: 2; }
#a-owner:hover { background: #FFEDB0; color: #C28A00; }
#a-owner.on { background: #FFD43B; border-color: #E0A100; color: #7A5300; }
#a-owner.on svg { fill: currentColor; }
.conv .agent .i[viewBox] { flex: none; }
/* X para fechar a conversa: maior e visível */
#a-hide { width: 38px; height: 38px; color: #C9372C; background: #FDE8E6; border: 1px solid #F5B5AE; margin-left: 2px; }
#a-hide svg { width: 22px; height: 22px; stroke-width: 2.4; }
#a-hide:hover { background: #C9372C; color: #fff; border-color: #C9372C; }

/* Respostas rápidas fixadas acima do campo de mensagem */
.composer .pinned { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px 4px; max-height: 64px; overflow-y: auto; }
.qchip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid #C9D4FF; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 700; }
.qchip svg { width: 13px; height: 13px; }
.qchip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.iconbtn.pin.on { color: #E0A100; background: #FFF6D6; }
.iconbtn.pin.on svg { fill: currentColor; }
