/* CRM Vendedor — estilos. Tokens em :root; tema escuro pelo sistema operacional.
   Tudo local (a CSP só aceita recursos do próprio servidor): fonte do sistema, ícones em SVG inline. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f4;
  --border: #e4e7ec;
  --border-strong: #cfd4dc;
  --text: #101828;
  --text-2: #475467;
  --muted: #667085;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #e6f6f4;
  --accent-ring: rgb(13 148 136 / 22%);
  --accent-text: #ffffff;
  --danger: #c4320a;
  --danger-strong: #a02a08;
  --danger-soft: #fef0ec;
  --warn-bg: #fff6e6;
  --warn-text: #7a4100;
  --ok-bg: #e8f7ee;
  --ok-text: #16663a;
  --chat-bg: #f2f4f7;
  --chat-dot: rgb(16 24 40 / 5%);
  --msg-in: #ffffff;
  --msg-human: #dcf5ec;
  --msg-bot: #e6eefc;
  --series-1: #2a78d6;
  --focus: #2563eb;

  /* Menu lateral escuro nos dois temas */
  --side-bg: #0f1a1f;
  --side-bg-2: #15242b;
  --side-text: #c7d3d8;
  --side-muted: #7f939b;
  --side-hover: rgb(255 255 255 / 6%);
  --side-active: rgb(45 212 191 / 14%);
  --side-active-text: #5eead4;
  --side-border: rgb(255 255 255 / 8%);

  --shadow-xs: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-md: 0 4px 8px -2px rgb(16 24 40 / 8%), 0 2px 4px -2px rgb(16 24 40 / 5%);
  --shadow-lg: 0 16px 32px -8px rgb(16 24 40 / 20%), 0 4px 8px -4px rgb(16 24 40 / 6%);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;

  --tone-gray-bg: #eef1f4; --tone-gray-fg: #3f4651;
  --tone-red-bg: #fef0ec; --tone-red-fg: #b42318;
  --tone-orange-bg: #fff2e2; --tone-orange-fg: #93480a;
  --tone-yellow-bg: #fef7d6; --tone-yellow-fg: #6b5500;
  --tone-green-bg: #e5f6ec; --tone-green-fg: #16663a;
  --tone-teal-bg: #e0f4f1; --tone-teal-fg: #0b5e57;
  --tone-blue-bg: #e7effd; --tone-blue-fg: #1d4f99;
  --tone-purple-bg: #f1eafd; --tone-purple-fg: #5b2f9e;
  --tone-pink-bg: #fde8f2; --tone-pink-fg: #9c2560;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1114;
    --surface: #171a1f;
    --surface-2: #1c2026;
    --surface-3: #252a31;
    --border: #2a3038;
    --border-strong: #3c444f;
    --text: #eceff3;
    --text-2: #c1c8d1;
    --muted: #8f99a6;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #12302d;
    --accent-ring: rgb(45 212 191 / 28%);
    --accent-text: #042420;
    --danger: #f97066;
    --danger-strong: #fda29b;
    --danger-soft: #3a1d1b;
    --warn-bg: #36270f;
    --warn-text: #f7c77e;
    --ok-bg: #14301f;
    --ok-text: #8fdcaa;
    --chat-bg: #12151a;
    --chat-dot: rgb(255 255 255 / 4%);
    --msg-in: #20242b;
    --msg-human: #153a2f;
    --msg-bot: #1a2b45;
    --series-1: #3987e5;
    --focus: #6aa1ff;
    --side-bg: #0a1014;
    --side-bg-2: #0f171c;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-md: 0 4px 10px rgb(0 0 0 / 40%);
    --shadow-lg: 0 16px 36px rgb(0 0 0 / 55%);
    --tone-gray-bg: #252a31; --tone-gray-fg: #c9ced6;
    --tone-red-bg: #3a1d1b; --tone-red-fg: #f6a39c;
    --tone-orange-bg: #3a2812; --tone-orange-fg: #f5bf7a;
    --tone-yellow-bg: #35300f; --tone-yellow-fg: #ead57a;
    --tone-green-bg: #14301f; --tone-green-fg: #8fdcaa;
    --tone-teal-bg: #12302d; --tone-teal-fg: #7fd9cd;
    --tone-blue-bg: #172a45; --tone-blue-fg: #9cc0f5;
    --tone-purple-bg: #2b2140; --tone-purple-fg: #c8aef4;
    --tone-pink-bg: #3a1a2b; --tone-pink-fg: #f3a5c9;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#app { height: 100%; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
h4 { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-ring); }
.icon { flex: none; display: inline-block; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 24px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.text-red { color: var(--danger); }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.space-between { justify-content: space-between; gap: 12px; }
.gap { gap: 12px; }
.gap-sm { gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* ---------- controles */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]), select, textarea {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 11px; min-height: 36px; max-width: 100%; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
input:not([type=checkbox]):hover, select:hover, textarea:hover { border-color: var(--muted); }
input:not([type=checkbox]):focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
textarea { resize: vertical; width: 100%; }
input:disabled, select:disabled, textarea:disabled { opacity: .65; cursor: not-allowed; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--radius-sm); padding: 7px 14px; min-height: 36px; cursor: pointer; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 1px 2px rgb(13 148 136 / 30%), inset 0 1px 0 rgb(255 255 255 / 12%); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-strong); border-color: var(--danger-strong); }
.btn-danger-text { color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; padding: 6px; border-radius: var(--radius-sm); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.field-hint { color: var(--muted); font-size: 12px; }
.field-error { color: var(--danger); font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; }
.check { display: flex; gap: 8px; align-items: center; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding-left: 34px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 18px; }
.badge-gray, .chip-gray { background: var(--tone-gray-bg); color: var(--tone-gray-fg); }
.badge-red, .chip-red { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.badge-orange, .chip-orange { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.badge-yellow, .chip-yellow { background: var(--tone-yellow-bg); color: var(--tone-yellow-fg); }
.badge-green, .chip-green { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.badge-teal, .chip-teal { background: var(--tone-teal-bg); color: var(--tone-teal-fg); }
.badge-blue, .chip-blue { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.badge-purple, .chip-purple { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.badge-pink, .chip-pink { background: var(--tone-pink-bg); color: var(--tone-pink-fg); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 14px; line-height: 1; opacity: .7; }
.chip-x:hover { opacity: 1; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; background: var(--tone-teal-bg); color: var(--tone-teal-fg); font-weight: 650; letter-spacing: .02em; }
.avatar-c1 { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.avatar-c2 { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.avatar-c3 { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.avatar-c4 { background: var(--tone-pink-bg); color: var(--tone-pink-fg); }
.avatar-c5 { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.avatar-md { width: 40px; height: 40px; font-size: 13.5px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }

.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-bg); color: var(--ok-text); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); }
.banner { padding: 9px 20px; font-size: 13px; }
.banner-info { background: var(--tone-blue-bg); color: var(--tone-blue-fg); border-bottom: 1px solid var(--border); }
.banner-warn { background: var(--warn-bg); color: var(--warn-text); border-bottom: 1px solid var(--border); }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty strong { color: var(--text); font-weight: 600; font-size: 14.5px; }
.empty p { max-width: 320px; }
.empty-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.spinner { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 24px; }
.spinner-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 12px; }
.card.narrow { max-width: 480px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; background: var(--surface-3); padding: 3px; border-radius: 10px; }
.tab { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-xs); }
.segmented button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; font-weight: 550; }
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }

/* ---------- estrutura */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100%; }
.sidebar {
  background: linear-gradient(180deg, var(--side-bg-2), var(--side-bg)); color: var(--side-text);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 16px; min-height: 0; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none; color: #fff;
  background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: 0 2px 6px rgb(13 148 136 / 40%), inset 0 1px 0 rgb(255 255 255 / 20%);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.sidebar .brand-name { color: #fff; }
.brand-lg .brand-mark { width: 42px; height: 42px; border-radius: 11px; }
.brand-lg .brand-name { font-size: 19px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 550; transition: background .15s, color .15s; }
.nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-active); color: var(--side-active-text); }
.nav-icon { width: 20px; display: inline-flex; justify-content: center; opacity: .9; }
.nav-label { flex: 1; }
.nav-count { background: var(--accent); color: var(--accent-text); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; min-width: 20px; line-height: 18px; text-align: center; }
.sidebar .nav-count { background: #2dd4bf; color: #042420; }
.nav-count-red, .sidebar .nav-count-red { background: #f04438; color: #fff; }
/* Projetos: uma pasta por projeto, com as telas dele dentro. */
.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-section-title { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); padding: 0 10px; }
.project-head {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--side-text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, color .15s;
}
.project-head:hover { background: var(--side-hover); color: #fff; }
.project.current > .project-head { color: #fff; }
.project-head .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-chevron { display: inline-flex; color: var(--side-muted); }
.nav-sub { margin: 2px 0 6px 18px; padding-left: 10px; border-left: 1px solid var(--side-border); }
.nav-sub a { padding: 6px 10px; font-weight: 500; }
.conv-project { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11.5px; }
.project-select { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.project-select select { font-size: 12px; padding: 1px 4px; height: auto; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid var(--side-border); padding-top: 12px; }
.sidebar-foot .icon-btn { color: var(--side-muted); }
.sidebar-foot .icon-btn:hover { background: var(--side-hover); color: #fff; }
.me { display: flex; align-items: center; gap: 9px; color: #fff; min-width: 0; padding: 4px; border-radius: var(--radius-sm); }
.me:hover { background: var(--side-hover); text-decoration: none; }
.me-name { display: flex; flex-direction: column; font-weight: 600; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; }
.me-name small { color: var(--side-muted); font-weight: 450; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { flex: 1; overflow: auto; }
.page-full { display: flex; flex-direction: column; overflow: hidden; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 24px 28px 14px; }
.page-header p { margin-top: 3px; color: var(--muted); }
.page-body { padding: 0 28px 28px; }
.page-pad { padding: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 28px 14px; }
.filters input[type=search] { min-width: 260px; }

/* ---------- assistente no menu lateral */
.ai-widget {
  margin-top: auto; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--side-border); background: rgb(255 255 255 / 3%); color: var(--side-text);
  border-radius: 10px; padding: 9px 10px; transition: background .15s, border-color .15s;
}
.ai-widget:hover { background: var(--side-hover); border-color: rgb(255 255 255 / 14%); }
.ai-widget-icon { position: relative; width: 32px; height: 32px; border-radius: 9px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: rgb(45 212 191 / 12%); color: #5eead4; }
.ai-widget-ping { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: #2dd4bf; box-shadow: 0 0 0 2px var(--side-bg); }
.ai-widget-ping::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #2dd4bf; animation: ping 1.4s cubic-bezier(0, 0, .2, 1) infinite; }
.ai-widget-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.ai-widget-text strong { color: #fff; font-size: 13px; }
.ai-widget-text small { color: var(--side-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-widget.is-busy .ai-widget-text small { color: #5eead4; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

/* ---------- login */
.auth-page {
  min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, rgb(20 184 166 / 18%), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgb(37 99 235 / 12%), transparent 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 24px; }
.auth-card .brand { padding: 0; }

/* ---------- tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
.card .table-wrap { border: 0; box-shadow: none; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding-top: 12px; }

/* ---------- caixa de entrada */
.inbox { flex: 1; display: grid; grid-template-columns: 350px minmax(0, 1fr); min-height: 0; }
.inbox-list { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.inbox-list-head { padding: 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.inbox-list-head input { width: 100%; }
.inbox-items { overflow-y: auto; flex: 1; padding: 6px; }
.conv-item { position: relative; display: flex; gap: 11px; padding: 10px; border-radius: 10px; color: var(--text); transition: background .12s; }
.conv-item + .conv-item { margin-top: 2px; }
.conv-item:hover { background: var(--surface-2); text-decoration: none; }
.conv-item.active { background: var(--accent-soft); }
.conv-item.active::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.conv-item.is-awaiting .conv-name { font-weight: 700; }
.conv-item.is-awaiting .conv-time { color: var(--accent-strong); font-weight: 600; }
.conv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { color: var(--muted); font-size: 11.5px; flex: none; }
.conv-preview { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-tags { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.conv-owner { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11.5px; }
.inbox-chat { min-width: 0; min-height: 0; display: flex; background: var(--chat-bg); }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.chat-title { flex: 1; min-width: 180px; }
.chat-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.chat-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mode-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--tone-blue-fg); background: var(--tone-blue-bg); border-radius: 999px; padding: 1px 8px; }
.back-btn { display: none; }
.settings-group { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.settings-group legend { font-weight: 600; padding: 0 6px; }
.is-disabled { opacity: 0.55; }
.schedule-bar { display: flex; align-items: flex-start; gap: 10px; padding: 9px 18px; font-size: 13px; background: var(--tone-blue-bg); color: var(--tone-blue-fg); border-bottom: 1px solid var(--border); }
.schedule-bar > svg { margin-top: 2px; flex: none; }
.schedule-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.schedule-note { font-style: italic; }
.sched-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--tone-blue-fg); background: var(--tone-blue-bg); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.handoff-bar { display: flex; align-items: center; gap: 8px; padding: 9px 18px; font-size: 13px; background: var(--tone-orange-bg); color: var(--tone-orange-fg); border-bottom: 1px solid var(--border); }
.chat-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 310px; min-height: 0; }
.chat-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.messages {
  flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
  background-image: radial-gradient(var(--chat-dot) 1px, transparent 1px); background-size: 18px 18px;
}
.day-sep { text-align: center; margin: 12px 0 6px; }
.day-sep span { background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 600; padding: 3px 12px; border-radius: 999px; box-shadow: var(--shadow-xs); border: 1px solid var(--border); }
.msg { max-width: min(72%, 560px); padding: 8px 11px 5px; border-radius: 14px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 2px; word-wrap: break-word; overflow-wrap: anywhere; border: 1px solid transparent; }
.msg-in { align-self: flex-start; background: var(--msg-in); border-top-left-radius: 4px; border-color: var(--border); }
.msg-out { align-self: flex-end; background: var(--msg-human); border-top-right-radius: 4px; }
.msg-bot { background: var(--msg-bot); }
.msg-system { align-self: center; max-width: 80%; background: var(--surface-3); box-shadow: none; font-size: 12.5px; color: var(--text-2); }
.msg-label { font-size: 11px; font-weight: 650; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.msg-bot .msg-label { color: var(--tone-blue-fg); }
.msg-text { white-space: pre-wrap; }
.msg-media { font-size: 12px; color: var(--muted); }
.msg-time { align-self: flex-end; font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.msg-unsent { opacity: .9; border: 1px dashed var(--border-strong); }
.msg-failed, .msg-unknown { border: 1px solid var(--danger); }
.msg-cancelled { opacity: .55; }
.msg-status { font-size: 11px; color: var(--muted); align-self: flex-end; }
.msg-failed .msg-status, .msg-unknown .msg-status { color: var(--danger); font-weight: 600; }
.suggestion { margin: 0 16px 10px; padding: 14px; border: 1px solid color-mix(in srgb, var(--tone-purple-fg) 35%, transparent); border-radius: var(--radius); background: var(--tone-purple-bg); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-xs); }
.suggestion-shadow { border-style: dashed; border-color: var(--border-strong); background: var(--surface-2); }
.suggestion-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.suggestion-head strong { display: inline-flex; align-items: center; gap: 6px; }
.suggestion-text { white-space: pre-wrap; background: var(--surface); padding: 7px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.suggestion textarea { background: var(--surface); }
.composer { display: flex; gap: 10px; padding: 12px 18px 14px; border-top: 1px solid var(--border); background: var(--surface); align-items: flex-end; }
.composer textarea { flex: 1; min-height: 46px; max-height: 200px; border-radius: 10px; }
.composer-actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.composer-blocked { color: var(--warn-text); background: var(--warn-bg); font-size: 13px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tick { margin-left: 3px; letter-spacing: -2px; color: var(--muted); display: inline-flex; align-items: center; }
.tick-read { color: var(--series-1); }
.tick-failed { color: var(--danger); letter-spacing: 0; }
.msg-status-error { color: var(--danger); font-weight: 600; align-self: stretch; }
.msg-image { display: block; max-width: min(260px, 100%); max-height: 320px; border-radius: 9px; margin: 2px 0; }
.msg-audio { max-width: 260px; }
.msg-transcript { font-size: 13px; font-style: italic; white-space: pre-wrap; }
.msg-transcript-label { display: block; font-size: 11px; font-style: normal; color: var(--muted); }
.msg-video { max-width: min(320px, 100%); border-radius: 9px; }
.msg-file { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.template-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.template-item { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.template-item:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); }
.template-item:disabled { opacity: .6; cursor: not-allowed; }
.template-body { color: var(--text-2); font-size: 13px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qr { width: 264px; max-width: 100%; background: #fff; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); image-rendering: pixelated; }
.steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.outbound-warning { margin: 0 16px 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-text); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.template-preview { background: var(--msg-human); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-xs); }
.contact-panel { border-left: 1px solid var(--border); background: var(--surface); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.contact-panel section { display: flex; flex-direction: column; gap: 7px; }
.contact-panel section + section { padding-top: 16px; border-top: 1px solid var(--border); }
.contact-panel select, .contact-panel input:not([type=checkbox]) { width: 100%; }
.tag-editor { display: flex; flex-direction: column; gap: 8px; }
.tag-editor form input { flex: 1; min-width: 0; }
.money-input { display: inline-flex; align-items: center; gap: 6px; }
.money-input input { width: 120px; }

/* ---------- assistente na conversa e na lista */
.ai-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; line-height: 18px; white-space: nowrap; background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.ai-pill-processing { background: var(--accent-soft); color: var(--accent-strong); }
.ai-pill-retrying { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.ai-pill-after_hours { background: var(--tone-gray-bg); color: var(--tone-gray-fg); }
.dots { display: inline-flex; gap: 3px; align-items: center; margin-left: 2px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .35; animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.ai-typing {
  align-self: flex-end; display: flex; align-items: center; gap: 10px; max-width: min(78%, 520px); margin-top: 6px;
  padding: 9px 12px; border-radius: 14px; border-top-right-radius: 4px; background: var(--msg-bot); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--tone-blue-fg) 18%, transparent); box-shadow: var(--shadow-xs); animation: rise .25s ease-out;
}
.ai-typing-icon { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--surface); color: var(--tone-blue-fg); }
.ai-typing-processing .ai-typing-icon { color: var(--accent-strong); animation: glow 1.6s ease-in-out infinite; }
.ai-typing-body { display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.35; min-width: 0; }
.ai-typing-body strong { font-size: 13px; }
.ai-typing-body span { color: var(--text-2); }
.ai-typing .dots { color: var(--tone-blue-fg); }
.ai-typing-retrying { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.ai-typing-retrying .ai-typing-icon { color: var(--danger); }
.ai-typing-after_hours { background: var(--surface-3); border-color: var(--border); }
.ai-typing-after_hours .ai-typing-icon { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-ring); } 50% { box-shadow: 0 0 0 5px var(--accent-ring); } }

.ai-log { align-self: center; display: flex; flex-direction: column; align-items: center; max-width: min(90%, 560px); margin: 4px 0; }
.ai-log-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); border-radius: 999px; padding: 3px 11px; font-size: 12px; cursor: pointer; box-shadow: var(--shadow-xs);
  max-width: 100%; transition: border-color .15s, background .15s;
}
.ai-log-chip:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.ai-log-chip:disabled { cursor: default; }
.ai-log-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-log-who { font-weight: 700; color: var(--text); }
.ai-log-time { color: var(--muted); }
.ai-log-caret { transition: transform .15s; color: var(--muted); }
.ai-log.open .ai-log-caret { transform: rotate(180deg); }
.ai-log-success .ai-log-chip .icon:first-child { color: var(--ok-text); }
.ai-log-attention .ai-log-chip { background: var(--tone-orange-bg); border-color: color-mix(in srgb, var(--tone-orange-fg) 25%, transparent); color: var(--tone-orange-fg); }
.ai-log-suggestion .ai-log-chip { background: var(--tone-purple-bg); border-color: color-mix(in srgb, var(--tone-purple-fg) 25%, transparent); color: var(--tone-purple-fg); }
.ai-log-error .ai-log-chip { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.ai-log-attention .ai-log-who, .ai-log-suggestion .ai-log-who, .ai-log-error .ai-log-who { color: inherit; }
.ai-log-details { margin: 6px 0 2px; padding: 10px 12px; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; animation: rise .15s ease-out; }
.ai-log-details div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.ai-log-details dt { color: var(--muted); font-weight: 600; }
.ai-log-details dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* ---------- funil */
.board { flex: 1; display: flex; gap: 14px; overflow-x: auto; padding: 0 28px 28px; align-items: stretch; min-height: 0; }
.column { flex: 0 0 290px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.column.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.column-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.column-won .column-head h2 { color: var(--ok-text); }
.column-lost .column-head h2 { color: var(--danger); }
.column-meta { font-size: 12px; color: var(--muted); }
.column-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, border-color .15s; }
.deal-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.deal-card[draggable=true] { cursor: grab; }
.deal-card.dragging { opacity: .5; }
.deal-open { border: 0; background: transparent; text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; }
.deal-open:hover .deal-title { text-decoration: underline; }
.deal-title { font-weight: 600; }
.deal-sub { font-size: 12px; color: var(--muted); }
.deal-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.deal-meta-left { display: flex; align-items: baseline; gap: 8px; }
.deal-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.deal-move select { width: 100%; font-size: 12px; min-height: 28px; padding: 3px 6px; }
.deal-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.conv-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--text); }

/* ---------- notas, tarefas, histórico */
.notes, .tasks, .timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.notes li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task input[type=checkbox] { margin-top: 2px; }
.task-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.task-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-overdue .task-title { font-weight: 600; }
.task-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-form input:first-child { flex: 1; min-width: 220px; }
.timeline li { position: relative; padding: 8px 0 8px 18px; border-left: 2px solid var(--border); margin-left: 5px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }

/* ---------- painel */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow-xs); }
.tile-label { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.tile-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile-sub { font-size: 12px; color: var(--muted); }
.hero { gap: 4px; }
.hero-value { font-size: 48px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bar-label { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; display: block; }
.bar-fill { display: block; height: 14px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- configurações */
.stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stage-list li { display: flex; gap: 8px; align-items: center; }
.stage-list li input { flex: 1; max-width: 320px; }
.stage-list li.inactive input { opacity: .55; text-decoration: line-through; }
.temp-password { font: 600 22px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-3); padding: 12px; border-radius: var(--radius-sm); text-align: center; letter-spacing: .06em; user-select: all; margin-top: 12px; }

/* ---------- modal, gaveta e avisos */
.modal-backdrop { position: fixed; inset: 0; background: rgb(10 14 20 / 50%); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade .15s ease-out; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal-wide { max-width: 720px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.modal-body { padding: 8px 20px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer-backdrop { position: fixed; inset: 0; background: rgb(10 14 20 / 35%); z-index: 45; display: flex; justify-content: flex-start; animation: fade .15s ease-out; }
.drawer {
  width: min(400px, 100vw); height: 100%; margin-left: 240px; background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; outline: none;
}
@keyframes slide { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.drawer-body section { display: flex; flex-direction: column; gap: 8px; }
.drawer-empty { padding: 6px 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.switch-row > span { display: flex; flex-direction: column; font-size: 13px; }
.switch { position: relative; width: 44px; height: 24px; border-radius: 999px; border: 0; background: var(--border-strong); cursor: pointer; flex: none; transition: background .15s; color: var(--muted); }
.switch .icon { position: absolute; top: 5px; left: 5px; transition: left .15s, color .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 23px; }
.switch.on .icon { left: 6px; color: var(--accent-text); }
.switch:not(.on) .icon { left: 25px; }
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.activity-item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.activity-item:hover { background: var(--surface-2); }
.activity-icon { width: 30px; height: 30px; border-radius: 9px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-2); }
.tone-progress .activity-icon { background: var(--accent-soft); color: var(--accent-strong); }
.tone-success .activity-icon { background: var(--ok-bg); color: var(--ok-text); }
.tone-attention .activity-icon { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.tone-suggestion .activity-icon { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.tone-error .activity-icon { background: var(--danger-soft); color: var(--danger); }
.activity-main { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; line-height: 1.35; gap: 1px; }
.activity-main a { font-weight: 650; color: var(--text); }
.activity-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.activity-title { color: var(--text-2); font-weight: 550; }

.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 60; width: min(380px, calc(100vw - 32px)); }
.toast {
  position: relative; overflow: hidden; display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 12px 12px 14px; box-shadow: var(--shadow-lg); font-size: 13px; animation: toast-in .22s cubic-bezier(.2, .8, .2, 1);
}
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--muted); }
.toast-icon { width: 30px; height: 30px; border-radius: 9px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-2); }
.toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; padding-top: 1px; }
.toast-title { font-weight: 650; font-size: 13.5px; line-height: 1.35; }
.toast-meta { color: var(--muted); font-size: 12px; font-weight: 550; }
.toast-text { color: var(--text-2); line-height: 1.4; overflow-wrap: anywhere; }
.toast-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-weight: 650; font-size: 12.5px; align-self: flex-start; }
.toast-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 6px; display: inline-flex; margin: -2px -2px 0 0; }
.toast-close:hover { background: var(--surface-3); color: var(--text); }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: currentColor; opacity: .25; transform-origin: left; animation: toast-timer linear forwards; }
.toast-info::before { background: var(--series-1); }
.toast-info .toast-icon { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.toast-info .toast-timer { color: var(--series-1); }
.toast-success::before { background: var(--ok-text); }
.toast-success .toast-icon { background: var(--ok-bg); color: var(--ok-text); }
.toast-success .toast-timer { color: var(--ok-text); }
.toast-attention::before { background: var(--tone-orange-fg); }
.toast-attention .toast-icon { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.toast-attention .toast-timer { color: var(--tone-orange-fg); }
.toast-suggestion::before { background: var(--tone-purple-fg); }
.toast-suggestion .toast-icon { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.toast-suggestion .toast-timer { color: var(--tone-purple-fg); }
.toast-error::before { background: var(--danger); }
.toast-error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-error .toast-title { color: var(--danger); }
.toast-error .toast-timer { color: var(--danger); }
.toast-progress::before { background: linear-gradient(180deg, var(--accent), #2563eb); }
.toast-progress .toast-icon { background: var(--accent-soft); color: var(--accent-strong); }
.pulse-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: inherit; animation: glow 1.6s ease-in-out infinite; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- telas menores */
@media (max-width: 1180px) {
  .chat-body { grid-template-columns: minmax(0, 1fr); }
  .contact-panel { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { flex-direction: row; align-items: center; padding: 8px 12px; gap: 8px; overflow-x: auto; overflow-y: hidden; }
  .brand-name, .me-name, .ai-widget-text { display: none; }
  .nav { flex-direction: row; }
  .nav-section-title, .project-chevron { display: none; }
  .nav-section, .nav-projects .project { flex-direction: row; display: flex; }
  .nav-sub { margin: 0; padding: 0; border: 0; }
  .project-head { padding: 7px 9px; width: auto; }
  .nav a { padding: 7px 9px; }
  .nav-label { display: none; }
  .ai-widget { margin: 0 0 0 auto; width: auto; padding: 4px; border: 0; background: transparent; }
  .sidebar-foot { margin: 0; border: 0; padding: 0; }
  .drawer { margin-left: 0; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-selection .inbox-list { display: none; }
  .inbox:not(.has-selection) .inbox-chat { display: none; }
  .back-btn { display: inline-flex; }
  .page-header, .filters, .page-body, .board { padding-left: 16px; padding-right: 16px; }
  .page-pad { padding: 16px; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  .msg { max-width: 88%; }
  .column { flex-basis: 82vw; }
  .chat-head { padding: 10px 12px; }
  .messages { padding: 14px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .toast-timer { display: none; }
}
