:root {
  --rail: #0b1220;
  --rail-2: #131c2e;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e3e7ee;
  --line-2: #eef1f5;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #1d4ed8;
  --accent-600: #1e40af;
  --accent-soft: #eef3ff;
  --out: #eaf0ff;
  --out-line: #d6e0fb;
  --ok: #15803d;
  --warn: #b45309;
  --warn-soft: #fff7ed;
  --danger: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
.muted { color: var(--muted); margin: 4px 0 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.mark { stroke: none; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
::placeholder { color: var(--faint); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f8fafc; border-color: #d3d9e2; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f1f4f8; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: #991b1b; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 42px; }

/* Marca */
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup .mark { width: 38px; height: 38px; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.wordmark span { font-size: 10.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; margin-top: 4px; opacity: .75; }
.brand-lockup.lg .mark { width: 48px; height: 48px; }
.brand-lockup.lg .wordmark b { font-size: 24px; }
.brand-lockup.lg .wordmark span { font-size: 11.5px; }

/* Login */
.login { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100%; }
.login-brand {
  background: radial-gradient(1200px 500px at -10% -10%, #1e3a8a 0%, transparent 55%), var(--rail);
  color: #e2e8f0; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.login-pitch h1 { font-size: 30px; color: #fff; font-weight: 700; }
.login-pitch p { color: #94a3b8; font-size: 15px; line-height: 1.6; max-width: 420px; }
.login-pitch ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.login-pitch li { display: flex; align-items: center; gap: 10px; color: #cbd5e1; }
.login-pitch li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: #3b82f6; }
.login-foot { color: #475569; }
.login-main { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(380px, 100%); display: grid; gap: 18px; }
.login-card h2 { font-size: 22px; }
.only-mobile { display: none; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.form-error { color: var(--danger); margin: 0; font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

/* Estrutura */
.app { display: grid; grid-template-columns: 72px 1fr; height: 100vh; }
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px; }
.rail-logo { padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid #1e293b; width: 44px; display: grid; place-items: center; }
.rail-logo .mark { width: 34px; height: 34px; }
.rail-btn {
  width: 56px; padding: 8px 0 6px; border: 0; border-radius: 10px; background: transparent; color: #8b9ab3;
  display: grid; justify-items: center; gap: 4px; font-size: 10.5px; font-weight: 500; position: relative;
}
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { background: var(--rail-2); color: #e2e8f0; }
.rail-btn.active { background: #1a2742; color: #fff; }
.rail-btn.active::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #3b82f6; }
.rail-spacer { flex: 1; }
.rail-me { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 12px; margin-top: 10px; box-shadow: 0 0 0 2px var(--rail), 0 0 0 3.5px #334155; }
.view, .inbox, .app > * { min-width: 0; min-height: 0; }

/* Avatares e etiquetas */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: var(--text-2); border: 1px solid transparent; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.free { background: var(--warn-soft); color: var(--warn); border-color: #fde3c4; }
.pill.free .dot { background: #f59e0b; }
.pill.lg { height: 28px; font-size: 12.5px; padding: 0 11px 0 10px; }
.inst-label { font-size: 11px; color: var(--faint); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }

/* Caixa de entrada */
.inbox-view { display: grid; grid-template-columns: 384px 1fr; height: 100vh; }
.inbox { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 18px 12px; }
.inbox-title h1 { font-size: 19px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.conn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--conn, #94a3b8); }
.inbox-tools { padding: 0 18px 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input { width: 100%; padding-left: 34px; background: #f8fafc; }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); background: #f1f4f8; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: transparent; padding: 6px 8px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.segmented button em { font-style: normal; font-size: 11px; color: var(--faint); margin-left: 2px; }
.segmented button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.select-sm { height: 34px; padding: 0 10px; font-size: 13px; color: var(--text-2); }

.chat-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 12px; padding: 11px 18px; cursor: pointer; position: relative; }
.chat-item:hover { background: #f8fafc; }
.chat-item.active { background: var(--accent-soft); }
.chat-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.chat-item .body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.chat-item .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-item .top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-item .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.chat-item .time { font-size: 11.5px; color: var(--faint); flex: none; }
.chat-item .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.has-unread .name { color: var(--text); }
.chat-item.has-unread .preview { color: var(--text-2); font-weight: 500; }
.chat-item.has-unread .time { color: var(--accent); font-weight: 600; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.list-empty { padding: 40px 24px; text-align: center; color: var(--muted); }

/* Conversa */
.conversation { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.empty-state { margin: auto; text-align: center; color: var(--muted); max-width: 320px; padding: 24px; }
.empty-state svg { width: 44px; height: 44px; color: var(--faint); stroke-width: 1.4; margin-bottom: 10px; }
.empty-state h3 { color: var(--text); font-size: 16px; }
.empty-state p { line-height: 1.55; margin: 6px 0 0; }
.chat-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 68px; }
.chat-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-title strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title small { color: var(--muted); font-size: 12.5px; }
.chat-actions { display: flex; gap: 6px; }
.back { display: none !important; }

.messages {
  flex: 1; overflow-y: auto; padding: 22px max(20px, 7%); display: flex; flex-direction: column; gap: 6px;
  background-color: #f6f7fa;
  background-image: radial-gradient(#e6e9ef 1px, transparent 1px); background-size: 22px 22px;
}
.msg { max-width: min(62%, 560px); padding: 8px 12px 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow); white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; font-size: 14px; }
.msg.in { border-top-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--out); border-color: var(--out-line); border-top-right-radius: 4px; }
.msg .by { font-size: 11.5px; font-weight: 600; color: var(--accent-600); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.msg .by .dot { width: 6px; height: 6px; border-radius: 50%; }
.msg .by.phone { color: var(--muted); }
.msg .ts { font-size: 10.5px; color: var(--faint); text-align: right; margin-top: 3px; }
.msg.gap { margin-top: 8px; }
.day { align-self: center; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 500; padding: 3px 12px; border-radius: 999px; margin: 10px 0; text-transform: capitalize; }

.composer { padding: 12px 20px 10px; background: var(--panel); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.composer-box { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 78, 216, .1); }
.composer textarea { flex: 1; resize: none; max-height: 160px; border: 0; padding: 8px 0; box-shadow: none !important; line-height: 1.45; }
.composer .send { width: 38px; height: 38px; padding: 0; border-radius: 9px; }
.composer-hint { color: var(--faint); font-size: 11.5px; padding-left: 2px; }
.lock-banner { display: flex; align-items: center; gap: 10px; background: var(--warn-soft); color: #7c2d12; border: 1px solid #fde3c4; padding: 9px 12px; border-radius: 9px; font-size: 13px; }
.lock-banner svg { color: var(--warn); }
.lock-banner .btn { margin-left: auto; }

/* Páginas */
.page { padding: 32px 40px; overflow-y: auto; height: 100vh; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; max-width: 1100px; }
.page-head h1 { font-size: 22px; }
.page-head .muted { max-width: 560px; line-height: 1.5; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: 240px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.form-card { padding: 22px; display: grid; gap: 16px; max-width: 420px; }
.form-card h3 { font-size: 15px; }

.instances { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; max-width: 1100px; }
.inst-card { padding: 18px; display: grid; gap: 14px; align-content: start; }
.inst-top { display: flex; gap: 12px; align-items: center; }
.inst-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.inst-top strong { display: block; font-size: 15px; }
.inst-top small { color: var(--muted); font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.conectado { color: var(--ok); }
.status.aguardando_qr { color: var(--warn); }
.status.desconectado { color: var(--danger); }
.status.iniciando, .status.reconectando { color: var(--accent); }
.qr-box { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; justify-items: center; background: #fafbfc; }
.qr-box img { width: 100%; max-width: 220px; border-radius: 6px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.qr-box ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.6; align-self: stretch; }
.inst-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 12px; }
.empty-card { padding: 36px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

.table-card { max-width: 1100px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td:last-child { text-align: right; white-space: nowrap; }
.user-cell { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.user-cell .avatar { width: 34px; height: 34px; font-size: 12px; color: #fff; }
.role { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: #f1f5f9; color: var(--text-2); }
.role.admin { background: var(--accent-soft); color: var(--accent-600); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text-2); }

/* Diálogo */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 30; padding: 16px; animation: fade .15s ease; }
.dialog { background: #fff; border-radius: 14px; width: min(440px, 100%); box-shadow: var(--shadow-lg); display: grid; animation: pop .18s ease; }
.dialog header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.dialog header h3 { font-size: 16px; }
.dialog-body { padding: 6px 20px 4px; display: grid; gap: 14px; color: var(--text-2); line-height: 1.55; }
.dialog-body p { margin: 0; }
.dialog .form-error { padding: 4px 20px 0; }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row label { cursor: pointer; }
.color-row input { display: none; }
.color-row span { display: block; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.color-row input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 11px 16px; border-radius: 10px; z-index: 50; font-size: 13.5px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5dbe3; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #b8c1cd; }

/* Responsivo */
@media (max-width: 1100px) {
  .head-assignee { display: none; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .only-mobile { display: flex; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr 60px; height: 100dvh; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 0 6px; }
  .rail-logo, .rail-spacer, .rail-me { display: none; }
  .rail-btn.active::before { display: none; }
  .inbox-view, .page { height: calc(100dvh - 60px); }
  .inbox-view { grid-template-columns: 1fr; }
  .inbox-view.chat-open .inbox { display: none; }
  .inbox-view:not(.chat-open) .conversation { display: none; }
  .back { display: inline-flex !important; }
  .chat-head { padding: 10px 12px; gap: 8px; }
  .chat-head .avatar { display: none; }
  .chat-actions .btn span { display: none; }
  .chat-actions .btn { width: 36px; padding: 0; }
  .msg { max-width: 86%; }
  .page { padding: 20px 16px; }
  .inline-form { width: 100%; }
  .inline-form input { flex: 1; width: auto; }
}

/* Código de pareamento */
.pair-box { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; background: #fafbfc; }
.pair-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.pair-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pair-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 26px; letter-spacing: .12em; color: var(--text); }
.pair-box ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.qr-box .btn.ghost { color: var(--accent); }
.status.aguardando_codigo { color: var(--warn); }
.status.erro_codigo { color: var(--danger); }
.inst-card .form-error { margin: 0; }

/* ============ Tema escuro ============ */
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.login-theme { position: absolute; top: 16px; right: 16px; }
.login-main { position: relative; }

[data-theme="dark"] {
  color-scheme: dark;
  --rail: #060a13;
  --rail-2: #111a2b;
  --bg: #0b1120;
  --panel: #0f172a;
  --line: #1e293b;
  --line-2: #172033;
  --text: #e2e8f0;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #3b82f6;
  --accent-600: #93b4fd;
  --accent-soft: rgba(59, 130, 246, .14);
  --out: #15284a;
  --out-line: #1e3a6b;
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, .12);
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: #0b1324; border-color: var(--line); color: var(--text); }
[data-theme="dark"] .search input { background: #0b1324; }
[data-theme="dark"] .btn { background: #131d31; border-color: #24324a; color: var(--text-2); }
[data-theme="dark"] .btn:hover { background: #1a263d; border-color: #2e3e5a; }
[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .btn.primary:hover { background: #2563eb; border-color: #2563eb; }
[data-theme="dark"] .btn.ghost { background: transparent; border-color: transparent; }
[data-theme="dark"] .btn.ghost:hover { background: #172238; }
[data-theme="dark"] .btn.danger { color: var(--danger); }
[data-theme="dark"] .btn.danger:hover { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); }
[data-theme="dark"] .btn.danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; }
[data-theme="dark"] .login-main { background: var(--bg); }
[data-theme="dark"] .segmented { background: #0b1324; }
[data-theme="dark"] .segmented button.active { background: #1a263d; color: var(--text); }
[data-theme="dark"] .chat-item:hover { background: #131d31; }
[data-theme="dark"] .chat-item.active { background: var(--accent-soft); }
[data-theme="dark"] .pill { background: #1a263d; color: var(--text-2); }
[data-theme="dark"] .pill.free { background: var(--warn-soft); color: var(--warn); border-color: rgba(245, 158, 11, .25); }
[data-theme="dark"] .messages { background-color: #0a1020; background-image: radial-gradient(#162038 1px, transparent 1px); }
[data-theme="dark"] .msg { background: #131d31; border-color: #1c2840; color: var(--text); }
[data-theme="dark"] .msg.out { background: var(--out); border-color: var(--out-line); }
[data-theme="dark"] .day { background: #131d31; border-color: var(--line); }
[data-theme="dark"] .composer-box { background: #0b1324; border-color: var(--line); }
[data-theme="dark"] .composer textarea { background: transparent; }
[data-theme="dark"] .lock-banner { color: #fde68a; border-color: rgba(245, 158, 11, .25); }
[data-theme="dark"] .inst-icon { background: var(--accent-soft); color: #93b4fd; }
[data-theme="dark"] .status.conectado { color: #4ade80; }
[data-theme="dark"] .status.iniciando, [data-theme="dark"] .status.reconectando { color: #60a5fa; }
[data-theme="dark"] .qr-box { background: #0b1324; border-color: var(--line); }
[data-theme="dark"] .qr-box img { background: #fff; border-color: #fff; }
[data-theme="dark"] .table th { background: #0b1324; }
[data-theme="dark"] .role { background: #1a263d; color: var(--text-2); }
[data-theme="dark"] .role.admin { background: var(--accent-soft); color: #93b4fd; }
[data-theme="dark"] .dialog { background: var(--panel); border: 1px solid var(--line); }
[data-theme="dark"] .overlay { background: rgba(2, 6, 15, .65); }
[data-theme="dark"] .color-row input:checked + span { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
[data-theme="dark"] .toast { background: #e2e8f0; color: #0f172a; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: #24324a; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background-color: #33445f; }
[data-theme="dark"] .pair-box { background: #0b1324; border-color: var(--line); }
[data-theme="dark"] .qr-box .btn.ghost { color: #93b4fd; }
