/*
 * FLEXclima CRM — dashboard na porta 8080.
 * NÃO confundir com app/javascript/dashboard/ (Rails/Vue, porta 3000).
 * Guia: /opt/crm/docs/frontends.md
 * Após editar, incremente ?v= em views/layout.php
 */
:root {
  --slate-1: #fcfcfd;
  --slate-2: #f9f9fb;
  --slate-3: #f0f0f3;
  --slate-4: #e8e8ec;
  --slate-5: #e0e1e6;
  --slate-8: #b9bbc6;
  --slate-10: #80838d;
  --slate-11: #60646c;
  --slate-12: #1c2024;
  --n-brand: #2781f6;
  --n-brand-hover: #1073e9;
  --n-background: #f7f7f7;
  --n-surface: #fefefe;
  --n-surface-2: #ffffff;
  --n-solid: #ffffff;
  --n-weak: #eaeaea;
  --n-strong: #e2e3e7;
  --n-container: #ececec;
  --slate-6: #d9d9e0;
  --n-alpha-2: rgb(196 197 198 / 22%);
  --n-solid-blue: #daecff;
  --n-solid-amber: #ffe4b5;
  --n-amber-9: #ef9f27;
  --n-amber-10: #d97706;
  --n-amber-12: #4f3422;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgb(28 32 36 / 6%);
  --shadow: 0 1px 3px rgb(28 32 36 / 8%), 0 8px 24px rgb(28 32 36 / 6%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Barras de rolagem finas e discretas (3px).
   Não usar scrollbar-width no Chromium: ele ignora ::-webkit-scrollbar width. */
*::-webkit-scrollbar {
  width: 3px !important;
  height: 3px !important;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgb(128 131 141 / 40%);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgb(128 131 141 / 60%);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
html.dark *::-webkit-scrollbar-thumb,
body.dark *::-webkit-scrollbar-thumb {
  background: rgb(255 255 255 / 22%);
}
html.dark *::-webkit-scrollbar-thumb:hover,
body.dark *::-webkit-scrollbar-thumb:hover {
  background: rgb(255 255 255 / 38%);
}
/* Firefox (não tem ::-webkit-scrollbar) */
@-moz-document url-prefix() {
  * {
    scrollbar-width: thin;
    scrollbar-color: rgb(128 131 141 / 40%) transparent;
  }
  html.dark *, body.dark * {
    scrollbar-color: rgb(255 255 255 / 22%) transparent;
  }
}

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--n-background);
  color: var(--slate-12);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: var(--app-font-size, 14px);
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: var(--n-background);
}
.app--cw .topbar { display: none; }
.app--cw .main { background: var(--n-surface); overflow: hidden; height: 100%; min-height: 0; }
.app--inbox .inbox { height: 100%; }

/* Sidebar — sidebar: bg-n-background, 200px, border-n-weak */
.sidebar {
  background: var(--n-background);
  border-right: 1px solid var(--n-weak);
  display: flex; flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.sb-top { padding: 4px 8px 12px; display: grid; gap: 8px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 4px; min-width: 0; height: 32px; }
.sb-toggle {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; padding: 0; margin: 0;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--slate-11); cursor: pointer; flex-shrink: 0;
}
.sb-toggle:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.sb-toggle .ico { width: 16px; height: 16px; }
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  object-position: center;
  display: block;
  background: none;
}
.brand-divider { width: 1px; height: 12px; background: var(--slate-5); flex-shrink: 0; }
.brand-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-tools { display: flex; flex-direction: column; gap: 8px; }
.sb-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: 32px; padding: 0 10px;
  outline: 1px solid var(--n-weak); border-radius: 8px;
  color: var(--slate-10); font-size: 13px; background: var(--n-solid);
}
.sb-search .ico { width: 16px; height: 16px; flex-shrink: 0; }
.sb-search input,
.sb-search input[type=search] {
  flex: 1; border: 0 !important; padding: 0; height: 30px; background: transparent;
  min-width: 0; outline: none; box-shadow: none; width: auto; font-size: 13px;
}
.sb-search input:focus,
.sb-search input[type=search]:focus { outline: none; border: 0 !important; box-shadow: none; }
.sb-search kbd { display: none; }
.sb-compose {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 36px; padding: 0 12px;
  border-radius: 8px; border: 0; outline: none; cursor: pointer;
  background: var(--n-brand) !important; color: #fff !important;
  font-size: 13px; font-weight: 600; text-decoration: none;
  box-sizing: border-box;
}
.sb-compose:hover { filter: brightness(1.08); color: #fff !important; }
.sb-compose .ico { width: 14px; height: 14px; color: #fff; flex-shrink: 0; }
.sb-compose span { white-space: nowrap; }
.compose-page {
  min-height: 100%; display: grid; place-items: start center; padding: 28px 16px 48px;
  background:
    radial-gradient(1200px 420px at 12% -10%, rgb(39 129 246 / 14%), transparent 55%),
    radial-gradient(900px 360px at 100% 0%, rgb(18 165 148 / 10%), transparent 50%),
    var(--n-surface);
}
.compose-dlg {
  width: min(42rem, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--n-solid);
  color: var(--slate-12);
  overflow: auto;
}
.compose-dlg::backdrop {
  background: rgb(8 10 14 / 62%);
  backdrop-filter: blur(4px);
}
.compose-card {
  width: min(100%, 42rem);
  border: 1px solid color-mix(in srgb, var(--n-strong) 80%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--n-solid) 92%, transparent);
  backdrop-filter: blur(10px);
  padding: 22px 24px 20px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 18px 40px rgb(0 0 0 / 8%);
}
.compose-card--dlg {
  width: 100%;
  margin: 0;
  box-shadow: 0 8px 40px rgb(0 0 0 / 28%);
}
.compose-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--n-weak);
}
.compose-head-copy { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.compose-badge {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgb(39 129 246 / 22%), rgb(18 165 148 / 16%));
  color: var(--n-brand);
  box-shadow: inset 0 0 0 1px rgb(39 129 246 / 18%);
}
.compose-badge .ico { width: 20px; height: 20px; }
.compose-head h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.compose-head p { margin: 4px 0 0; font-size: 13px; color: var(--slate-11); line-height: 1.4; }
.compose-close {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--slate-11);
  background: transparent; border: 0; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.compose-close:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.compose-close .ico { width: 16px; height: 16px; }
.compose-form.cw-form { gap: 18px; }
.compose-section {
  display: grid; gap: 14px; padding: 14px;
  border-radius: 14px; background: var(--n-alpha-2);
  border: 1px solid color-mix(in srgb, var(--n-strong) 55%, transparent);
}
.compose-section-label {
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--slate-10); margin: 0 0 2px;
}
.compose-field { margin: 0; }
.compose-field > .ibox-label,
.compose-form label.compose-field {
  display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--slate-12);
}
.compose-form .ibox-field { margin-bottom: 0; gap: 6px; }
.compose-form .ibox-help { margin: 0; font-size: 12px; color: var(--slate-10); line-height: 1.35; }
.compose-form.cw-form input,
.compose-form.cw-form select,
.compose-form.cw-form textarea {
  height: 40px; padding: 0 12px; margin: 0;
  border-radius: 11px; border: 1px solid var(--n-strong);
  background: var(--n-solid); color: var(--slate-12);
  box-shadow: 0 1px 0 rgb(0 0 0 / 2%);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.compose-form.cw-form textarea {
  height: auto; min-height: 120px; padding: 12px; resize: vertical; line-height: 1.45;
}
.compose-form.cw-form input:focus,
.compose-form.cw-form select:focus,
.compose-form.cw-form textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--n-brand) 55%, var(--n-strong));
  box-shadow: 0 0 0 3px rgb(39 129 246 / 18%);
}
.compose-contact-wrap { position: relative; }
.compose-contact-wrap > .compose-field-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--slate-10); pointer-events: none; z-index: 1;
}
.compose-contact-wrap > .compose-field-ico .ico { width: 16px; height: 16px; display: block; }
.compose-contact-wrap > input {
  width: 100%; padding-left: 38px !important; box-sizing: border-box;
}
.compose-contact-wrap > input.has-picked { padding-left: 52px !important; }
.compose-picked {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%); z-index: 2;
  display: grid; place-items: center; pointer-events: none;
}
.compose-picked .avatar { width: 28px; height: 28px; font-size: 10px; }
.compose-contact-wrap:has(.compose-picked:not([hidden])) > .compose-field-ico { display: none; }
.compose-select-wrap { position: relative; }
.compose-select-wrap select { width: 100%; appearance: none; padding-right: 36px; cursor: pointer; }
.compose-select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid var(--slate-10); border-bottom: 1.5px solid var(--slate-10);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.compose-contact-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  background: var(--n-solid); border: 1px solid var(--n-strong); border-radius: 14px;
  max-height: 280px; overflow: auto; box-shadow: 0 12px 32px rgb(0 0 0 / 16%);
  padding: 6px;
}
.compose-hit {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--slate-12); cursor: pointer;
}
.compose-hit:hover { background: var(--n-alpha-2); }
.compose-hit .avatar { width: 36px; height: 36px; font-size: 12px; }
.compose-hit-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.compose-hit strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-hit-text > span { font-size: 12px; color: var(--slate-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-empty { padding: 14px 12px; font-size: 12px; color: var(--slate-11); text-align: center; }
.compose-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding-top: 4px; margin-top: 2px;
}
.compose-actions .btn { min-height: 38px; padding: 0 16px; border-radius: 11px; display: inline-flex; align-items: center; gap: 8px; }
.compose-actions .btn .ico { width: 15px; height: 15px; }
.compose-actions .btn.ghost { background: transparent; }
html.dark .compose-card,
body.dark .compose-card {
  background: color-mix(in srgb, var(--n-solid) 88%, #0b0c0e);
  border-color: rgb(255 255 255 / 8%);
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 22px 48px rgb(0 0 0 / 35%);
}
html.dark .compose-section,
body.dark .compose-section {
  background: rgb(255 255 255 / 3%);
  border-color: rgb(255 255 255 / 6%);
}

.nav { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0 8px 20px; display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav details summary {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 4px 6px; border-radius: 8px;
  color: var(--slate-11); font-size: 14px;
  cursor: pointer; list-style: none;
  position: relative;
}
.nav details summary::-webkit-details-marker,
.nav details summary::marker { display: none; content: ''; }
.nav a:hover, .nav details summary:hover { background: var(--n-alpha-2); }
.nav a.active, .nav details summary.active {
  background: var(--n-alpha-2); color: var(--slate-12); font-weight: 500;
}
.nav .ico { width: 16px; height: 16px; flex-shrink: 0; }
.nav .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-alert-dot {
  width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0;
  background: #e5484d; box-shadow: 0 0 0 2px var(--n-surface, #fff);
  margin-left: auto;
}
.nav details summary .nav-alert-dot { margin-left: 0; }
.nav details summary .chev { margin-left: auto; }
.nav .chev { width: 12px; height: 12px; margin-left: auto; opacity: 0; display: grid; place-items: center; }
.nav .chev .ico { width: 12px; height: 12px; }
.nav details[open] > summary .chev { opacity: .7; }
.nav details summary.is-open { color: var(--slate-12); font-weight: 500; }
.nav .sub a.active { background: var(--n-alpha-2); color: var(--slate-12); }
.nav-subhead {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 4px 8px; margin: 4px 0 0;
  color: var(--slate-10); font-size: 14px; font-weight: 500;
  cursor: pointer; list-style: none; border-radius: 8px;
}
.nav-subhead::-webkit-details-marker,
.nav-subhead::marker { display: none; content: ''; }
.nav-subhead .ico { width: 16px; height: 16px; }
.nav-subhead .chev { margin-left: auto; opacity: .5; display: grid; place-items: center; }
.nav-subhead .chev .ico { width: 12px; height: 12px; }
.nav .sub details.nav-nested { display: grid; }
.nav .sub details.nav-nested > a { padding-left: 16px; }
.page-lead { max-width: 40.625rem; margin: 0 0 20px; }
.notif-empty { display: grid; place-items: center; gap: 8px; text-align: center; padding: 48px 16px; }
.notif-empty .ico { width: 40px; height: 40px; color: var(--slate-11); }
.notif-note .empty { display: grid; place-items: center; gap: 8px; height: 100%; text-align: center; color: var(--slate-11); }
.notif-note .empty .ico { width: 40px; height: 40px; }
.conv.unread b { font-weight: 600; color: var(--slate-12); }
.conv.unread p { color: var(--slate-12); }
.conv-unread {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: #e5484d; color: #fff;
  font-size: 11px; font-weight: 600; line-height: 1; flex-shrink: 0;
}
.list-head-actions form { display: inline-flex; }
.nav .sub a.sub-leaf { padding-left: 16px; gap: 8px; }
.nav-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; display: inline-block; }
.nav .sub { margin: 0 0 4px 12px; padding: 0 0 0 8px; position: relative; display: grid; }
.nav .sub::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 16px; width: 2px;
  background: var(--slate-4); border-radius: 2px;
}
.nav .sub a {
  height: 32px; padding: 4px 8px; font-size: 14px; color: var(--slate-11); position: relative;
}
.nav .sub a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .sub a:hover { background: linear-gradient(90deg, transparent, rgb(240 240 243 / 70%)); }
.nav .sub a.active { background: var(--n-alpha-2); color: var(--slate-12); }

.sidebar-foot {
  display: flex; align-items: center; flex-shrink: 0; flex-wrap: wrap;
  padding: 6px 4px; border-top: 1px solid var(--n-weak);
  box-shadow: 0 -2px 4px rgb(27 28 29 / 2%);
  overflow: visible;
  position: relative;
  z-index: 30;
  gap: 4px;
}
.sb-version {
  flex: 1 1 100%;
  margin: 2px 4px 4px;
  font-size: 11px;
  color: var(--slate-10);
  letter-spacing: .03em;
  text-align: center;
  opacity: .85;
}
html.sb-collapsed .sb-version,
.app.app--sb-collapsed .sb-version {
  font-size: 9px;
  margin: 0 2px 2px;
}
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--n-background); }
.topbar {
  min-height: 52px; display: flex; align-items: center;
  padding: 0 24px; background: transparent;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 500; }
.userchip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate-11); }
.avatar {
  width: 24px; height: 24px; border-radius: 999px;
  background: #dbeafe; color: var(--slate-12);
  display: grid; place-items: center; font-weight: 600; font-size: 10px; flex-shrink: 0;
  position: relative;
}
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.md { width: 32px; height: 32px; font-size: 12px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar .dot {
  position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px;
  border-radius: 999px; background: #12a594; border: 1.5px solid var(--n-background);
}
.avatar.status-online .dot, .status-pip.status-online { background: #12a594; }
.avatar.status-away .dot, .avatar.status-busy .dot,
.status-pip.status-away, .status-pip.status-busy { background: #f59e0b; }
.avatar.status-meeting .dot, .status-pip.status-meeting { background: #7c5cff; }
.avatar.status-offline .dot, .status-pip.status-offline { background: #94a3b8; }
.content { padding: 0 24px 24px; flex: 1; min-height: 0; }
.cw-page .content { padding: 0; }
.cw-page .settings { display: block; }
.cw-page .snav { display: none; }
.cw-page .card {
  background: transparent; border: 0; box-shadow: none; padding: 0; outline: 0;
}
.cw-page h3 { font-size: 16px; font-weight: 500; margin: 0 0 16px; }
.cw-page form { max-width: 40.625rem; }
.cw-page form.macro-builder { max-width: none; width: 100%; }
.cw-page table { margin-top: 16px; }
.cw-page th { font-size: 13px; color: var(--slate-11); border-bottom: 1px solid var(--n-strong); }
.cw-page td { border-bottom: 1px solid var(--n-strong); font-size: 14px; }
.cw-page .grid { margin-bottom: 8px; }
.cw-page .stat { padding: 16px; outline: 1px solid var(--n-container); outline-offset: -1px; border-radius: 12px; background: var(--n-solid); }
.cw-page .stat b { font-size: 24px; }

/* Inbox 3-col */
.inbox {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: var(--n-surface);
}
.inbox.is-panel-open,
html.inbox-panel-open .inbox {
  grid-template-columns: 360px minmax(0, 1fr) 320px;
}
.col { background: var(--n-surface); overflow: auto; }
.col.list { border-right: 1px solid var(--n-weak); overflow-x: hidden; overflow-y: auto; }
.col.chat { overflow: hidden; display: flex; flex-direction: column; border-right: 0; background: var(--n-surface); position: relative; min-width: 0; isolation: isolate; }
.col.chat.is-pane-loading { pointer-events: none; }
.col.chat.is-pane-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--n-surface) 55%, transparent);
  pointer-events: none;
}
.col.contact {
  display: none;
  border-left: 1px solid var(--n-weak);
  background: var(--n-surface);
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.inbox.is-panel-open .col.contact,
html.inbox-panel-open .inbox .col.contact { display: flex; }

/* Painel de contato vira overlay antes de comprimir o chat/composer */
@media (max-width: 1280px) {
  .inbox,
  .inbox.is-panel-open,
  html.inbox-panel-open .inbox {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }
  .inbox .col.contact,
  html.inbox-panel-open .inbox .col.contact {
    display: none;
  }
  .inbox.is-panel-open .col.contact,
  html.inbox-panel-open .inbox .col.contact {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(100vw, 24rem);
    max-width: 100%;
    z-index: 40;
    box-shadow: var(--shadow);
    background: var(--n-surface);
  }
  .inbox.is-panel-open::before,
  html.inbox-panel-open .inbox::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgb(0 0 0 / 38%);
    pointer-events: auto;
  }
}

/* Suaviza troca de conversa (navegação MPA) — desativado no inbox: evita piscada ao trocar conversa */
@view-transition {
  navigation: auto;
}
html:not(.inbox-no-vt) ::view-transition-old(root),
html:not(.inbox-no-vt) ::view-transition-new(root) {
  animation-duration: 0.12s;
}

.list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px; height: 52px;
}
.list-head-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.list-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
select.status-pill {
  width: auto; border: 0; background: var(--slate-3); padding: 4px 8px; border-radius: 6px;
  font-size: 11px; color: var(--slate-12); cursor: pointer;
}
select.status-pill:focus { outline: none; border: 0; box-shadow: none; }
.chat-head select {
  width: auto; border: 0; background: var(--slate-3); padding: 6px 10px; border-radius: 8px; font-size: 13px;
}
.list-head-actions { display: flex; gap: 4px; color: var(--slate-11); }
.icon-ghost {
  width: 28px; height: 28px; border: 0; background: transparent; border-radius: 8px;
  display: grid; place-items: center; color: var(--slate-11); cursor: pointer;
}
.icon-ghost:hover { background: var(--n-alpha-2); }
.icon-ghost .ico { width: 16px; height: 16px; }

.assignee-tabs {
  display: flex; gap: 0; padding: 0 12px; height: 40px;
  border-bottom: 1px solid var(--n-weak);
}
.conv-search {
  position: relative; display: flex; align-items: center;
  margin: 0 12px 8px; flex-shrink: 0;
}
.conv-search > .ico {
  position: absolute; left: 10px; width: 15px; height: 15px;
  color: var(--slate-11); pointer-events: none; z-index: 1;
}
.conv-search input[type=search] {
  width: 100%; height: 34px; padding: 6px 32px 6px 34px;
  border: 0 !important; border-radius: 8px;
  background: var(--n-alpha-2); color: var(--slate-12);
  font-size: 13px; box-shadow: none;
}
.conv-search input[type=search]::placeholder { color: var(--slate-10); }
.conv-search input[type=search]:focus {
  outline: none; border: 0 !important; box-shadow: none;
  background: var(--n-alpha-3, var(--n-alpha-2));
}
.conv-search input[type=search]::-webkit-search-cancel-button { display: none; }
.conv-search-clear {
  position: absolute; right: 6px; width: 24px; height: 24px;
  display: grid; place-items: center; border-radius: 6px; color: var(--slate-11);
  z-index: 1;
}
.conv-search-clear:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.conv-search-clear .ico { width: 14px; height: 14px; }
.conv-search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 40; max-height: min(420px, 55vh); overflow: auto;
  border-radius: 10px; border: 1px solid var(--n-weak);
  background: var(--n-surface, #fff);
  box-shadow: 0 12px 32px rgb(0 0 0 / 18%);
  padding: 6px 0;
}
.conv-search-suggest[hidden] { display: none !important; }
.conv-search-section { padding: 4px 0 8px; }
.conv-search-section + .conv-search-section { border-top: 1px solid var(--n-weak); }
.conv-search-section-title {
  padding: 6px 12px 4px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--slate-10);
}
.conv-search-item {
  display: grid; gap: 2px; width: 100%; padding: 8px 12px;
  text-align: left; text-decoration: none; color: inherit; border: 0;
  background: transparent; cursor: pointer; font: inherit;
}
.conv-search-item:hover { background: var(--n-alpha-2); }
.conv-search-item-top {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.conv-search-item-top b {
  font-size: 13px; font-weight: 600; color: var(--slate-12);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-search-item-top .pill {
  flex-shrink: 0; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  background: var(--n-alpha-2); color: var(--slate-11);
}
.conv-search-item-top .pill.is-resolved {
  background: rgb(34 197 94 / 15%); color: #4ade80;
}
.conv-search-item-preview {
  font-size: 12px; color: var(--slate-11);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-search-item-preview mark {
  background: color-mix(in srgb, #eab308 45%, transparent);
  color: inherit; border-radius: 2px; padding: 0 1px;
}
.conv-search-empty {
  padding: 16px 12px; font-size: 13px; color: var(--slate-10); text-align: center;
}
.composer-resolved-lock {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 12px 14px; width: 100%;
}
.composer-resolved-lock p {
  margin: 0; font-size: 13px; color: var(--slate-11); line-height: 1.4;
}
.btn.conv-open-new,
button.conv-open-new {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 40px; border: 0; border-radius: 10px;
  background: #f76b15; color: #fff;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn.conv-open-new:hover,
button.conv-open-new:hover { filter: brightness(1.06); }
.btn.conv-open-new:disabled,
button.conv-open-new:disabled { opacity: .6; cursor: wait; }
.assignee-tabs a {
  position: relative; padding: 8px 12px 10px; font-size: 14px; font-weight: 500;
  color: var(--slate-11);
}
.assignee-tabs a.on { color: var(--n-brand); }
.assignee-tabs a.on::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--n-brand); border-radius: 2px 2px 0 0;
}
.assignee-tabs .count {
  margin-left: 6px; font-size: 12px; color: var(--slate-10); font-weight: 500;
}

.conv-view-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px 8px; flex-shrink: 0;
}
.conv-view-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--slate-6); background: transparent;
  color: var(--slate-11); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.conv-view-chip:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.conv-view-chip.is-on {
  border-color: transparent;
  background: color-mix(in srgb, var(--n-brand) 18%, transparent);
  color: var(--n-brand);
}
.conv-view-chip-count { font-variant-numeric: tabular-nums; }
.conv-view-chip.is-on .conv-view-chip-count { opacity: .95; }

.conv-bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--slate-5);
  background: color-mix(in srgb, var(--n-brand) 8%, var(--slate-1));
  flex-shrink: 0;
}
.conv-bulk-all {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--slate-11); cursor: pointer; user-select: none;
}
.conv-bulk-count { font-size: 13px; color: var(--slate-10); margin-right: auto; }
.conv-bulk-resolve { height: 30px; padding: 0 12px; font-size: 13px; }
.conv-bulk-resolve:disabled { opacity: .45; cursor: not-allowed; }

.col.list.is-groups-bulk .conv {
  grid-template-columns: 22px 24px minmax(0, 1fr) minmax(72px, auto);
}
.conv-check {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 24px; margin-top: 2px;
}
.conv-check input {
  width: 16px; height: 16px; accent-color: var(--n-brand); cursor: pointer;
}
.conv-check[hidden] { display: none !important; }

.conv {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(72px, auto);
  gap: 10px;
  align-items: start;
  padding: 12px;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.conv:hover { background: var(--slate-2); }
.conv.active { background: rgb(39 129 246 / 6%); }
.conv-body { min-width: 0; display: grid; gap: 2px; overflow: hidden; }
.conv-inbox {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%;
  color: var(--slate-11); font-size: 11px; line-height: 1.2; margin-bottom: 2px;
}
.conv-inbox .ico { width: 14px; height: 14px; flex-shrink: 0; color: var(--slate-10); }
.conv-inbox > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-assignee {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  max-width: 132px; height: auto; min-height: 18px; max-height: none; padding: 2px 7px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, #f76b15 45%, transparent);
  background: color-mix(in srgb, #f76b15 16%, transparent);
  color: #f76b15;
  font-size: 10px; font-weight: 600; line-height: 1;
  overflow: hidden; box-sizing: border-box;
}
.conv-assignee .ico,
.conv-assignee svg {
  width: 11px !important;
  height: 11px !important;
  min-width: 11px;
  min-height: 11px;
  max-width: 11px;
  max-height: 11px;
  flex: 0 0 11px;
  display: block;
  opacity: .95;
}
.conv-assignee > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 108px; }
.conv-assignees {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  max-width: 110px;
}
.dark .conv-assignee {
  border-color: color-mix(in srgb, #ffa057 50%, transparent);
  background: color-mix(in srgb, #ffa057 18%, transparent);
  color: #ffa057;
}
.conv-meta {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start;
  gap: 6px; min-width: 72px; max-width: 120px;
}
.conv-meta-top {
  display: inline-flex; align-items: flex-start; justify-content: flex-end; gap: 2px;
  width: 100%;
}
.conv-card-menu { position: relative; flex-shrink: 0; }
.conv-more-btn {
  display: none; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--slate-11); cursor: pointer;
}
.conv-more-btn .ico { width: 14px; height: 14px; }
.conv:hover .conv-more-btn,
.conv:focus-within .conv-more-btn,
.conv.is-menu-open .conv-more-btn { display: inline-flex; }
.conv-more-btn:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.conv-card-menu-panel {
  position: absolute; top: 100%; right: 0; z-index: 40;
  min-width: 190px; padding: 4px; margin-top: 2px;
  border-radius: 10px; border: 1px solid var(--slate-6);
  background: var(--n-surface, #fff); box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}
.conv-card-menu-panel[hidden] { display: none !important; }
.conv-card-menu-panel button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--slate-12);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.conv-card-menu-panel button:hover { background: var(--n-alpha-2); }
.conv-card-menu-panel button .ico { width: 15px; height: 15px; flex-shrink: 0; opacity: .9; }
.conv-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv-company {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 400; color: var(--slate-11);
}
.conv-company .ico { width: 14px; height: 14px; color: var(--slate-10); flex-shrink: 0; }
.conv-title b { font-size: 13px; font-weight: 500; color: var(--slate-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.conv-phone {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 400;
  color: var(--slate-10);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-priority {
  display: inline-flex; align-items: center; flex-shrink: 0;
  height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: .01em;
}
.conv-priority.is-compact { height: 18px; padding: 0 6px; font-size: 10px; }
.conv-priority.is-urgent { background: rgb(229 72 77 / 16%); color: #e5484d; }
.conv-priority.is-high { background: rgb(247 107 21 / 16%); color: #f76b15; }
.conv-priority.is-medium { background: rgb(245 166 35 / 16%); color: #ab6400; }
.conv-priority.is-low { background: rgb(39 129 246 / 14%); color: #2781f6; }
.dark .conv-priority.is-urgent { color: #ff9592; }
.dark .conv-priority.is-high { color: #ffa057; }
.dark .conv-priority.is-medium { color: #ffca16; }
.dark .conv-priority.is-low { color: #70b8ff; }
.conv b { font-size: 13px; font-weight: 500; color: var(--slate-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .time {
  font-size: 11px; color: var(--slate-10); flex-shrink: 0;
  width: 100%; text-align: center; white-space: nowrap; line-height: 1.2;
}
.conv p {
  margin: 0; font-size: 12px; line-height: 1.45; color: var(--slate-11);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-width: 0; word-break: break-word;
}

.chat-head {
  padding: 8px 12px; min-height: 48px;
  border-bottom: 1px solid var(--n-weak);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--n-surface);
}
.chat-head-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-head-user b { font-size: 14px; font-weight: 500; display: block; }
.chat-head-name-row {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap;
}
.chat-head-name-row > b {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-head-user .muted { font-size: 12px; }
.contact-rating {
  display: inline-flex; align-items: center; gap: 4px;
  flex-shrink: 0; user-select: none;
}
.contact-rating-stars { display: inline-flex; align-items: center; gap: 1px; }
.contact-rating-star {
  position: relative;
  width: 18px; height: 18px;
  display: inline-grid; place-items: center;
  color: var(--slate-8, #64748b);
}
.contact-rating-icon {
  width: 16px; height: 16px;
  pointer-events: none;
  display: block;
}
.contact-rating-icon .cr-poly-full { fill: currentColor; opacity: 0.28; }
.contact-rating-icon .cr-poly-half { display: none; }
.contact-rating-star.is-full { color: #f59e0b; }
.contact-rating-star.is-full .cr-poly-full { opacity: 1; }
.contact-rating-star.is-half { color: #f59e0b; }
.contact-rating-star.is-half .cr-poly-full { display: none; }
.contact-rating-star.is-half .cr-poly-half { display: block; }
.contact-rating-star.is-preview { color: #fbbf24; }
.contact-rating-star.is-preview .cr-poly-full { opacity: 1; }
.contact-rating-star.is-preview-half { color: #fbbf24; }
.contact-rating-star.is-preview-half .cr-poly-full { display: none; }
.contact-rating-star.is-preview-half .cr-poly-half { display: block; }
.contact-rating-hit {
  position: absolute; top: 0; bottom: 0; width: 50%;
  border: 0; padding: 0; margin: 0;
  background: transparent; cursor: pointer; z-index: 1;
}
.contact-rating-hit.is-left { left: 0; }
.contact-rating-hit.is-right { right: 0; }
.contact-rating-label {
  font-size: 11px; font-weight: 600; color: var(--slate-11, #94a3b8);
  min-width: 1.6em; line-height: 1;
}
.contact-rating.is-saving { opacity: 0.65; pointer-events: none; }
.contact-rating-star:hover { filter: brightness(1.08); }
.chat-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.head-icon-btn {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--slate-12);
  display: grid; place-items: center; cursor: pointer;
}
.head-icon-btn:hover { background: var(--n-alpha-2); }
.head-icon-btn .ico { width: 16px; height: 16px; }
.head-icon-btn.is-active { background: var(--n-alpha-2); color: var(--n-brand, #3b82f6); }
.contact-msg-search {
  border-bottom: 1px solid var(--n-weak);
  background: var(--n-surface);
  padding: 8px 12px 10px;
  display: grid; gap: 8px;
}
.contact-msg-search[hidden] { display: none !important; }
.contact-msg-search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px 0 10px;
  height: 36px;
  border: 1px solid var(--n-strong);
  border-radius: 10px;
  background: var(--n-solid);
}
.contact-msg-search-bar > .ico { width: 16px; height: 16px; color: var(--slate-11); flex-shrink: 0; }
.contact-msg-search-bar input {
  flex: 1; min-width: 0; border: 0; outline: 0;
  background: transparent; color: var(--slate-12);
  font: inherit; font-size: 13px; height: 100%;
}
.contact-msg-search-meta {
  font-size: 11px; color: var(--slate-11); white-space: nowrap; flex-shrink: 0;
}
.contact-msg-search-results {
  max-height: min(320px, 42vh); overflow: auto;
  display: grid; gap: 4px;
  padding: 2px;
}
.contact-msg-search-results[hidden] { display: none !important; }
.contact-msg-search-item {
  display: grid; gap: 2px; text-align: left;
  width: 100%; border: 0; border-radius: 10px;
  padding: 8px 10px; cursor: pointer;
  background: transparent; color: inherit; font: inherit;
}
.contact-msg-search-item:hover { background: var(--n-alpha-2); }
.contact-msg-search-item-top {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--slate-11);
}
.contact-msg-search-item-top b { color: var(--slate-12); font-weight: 600; }
.contact-msg-search-item-top .pill {
  margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: var(--n-alpha-2); color: var(--slate-11);
}
.contact-msg-search-item-top .pill.is-resolved { background: rgb(34 197 94 / 15%); color: #4ade80; }
.contact-msg-search-item-preview {
  font-size: 13px; color: var(--slate-12); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.contact-msg-search-item mark {
  background: color-mix(in srgb, #eab308 45%, transparent);
  color: inherit; border-radius: 2px; padding: 0 1px;
}
.contact-msg-search-empty, .contact-msg-search-hint {
  font-size: 12px; color: var(--slate-11); padding: 8px 4px;
}
.bubble.is-search-flash {
  outline: 2px solid #eab308;
  outline-offset: 2px;
  transition: outline-color .25s ease;
}
.bubble mark.search-hit,
.bubble-body mark.search-hit {
  background: color-mix(in srgb, #eab308 55%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.cw-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -4px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--n-weak);
}
.cw-dialog-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.cw-dialog .kitem > form, .cw-dialog .kitem > p { background: var(--n-solid); }
.resolve-actions { display: flex; align-items: stretch; position: relative; flex-shrink: 0; }
.resolve-btn {
  height: 32px; padding: 0 12px; border: 1px solid var(--n-strong);
  background: var(--n-solid); color: var(--slate-12);
  border-radius: 8px 0 0 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.resolve-btn.is-solo { border-radius: 8px; }
.resolve-btn:hover { background: var(--slate-3); }
.resolve-more { position: relative; display: flex; }
.resolve-more-btn {
  width: 32px; height: 32px; border: 1px solid var(--n-strong); border-left: 0;
  border-radius: 0 8px 8px 0; background: var(--n-solid); color: var(--slate-12);
  display: grid; place-items: center; cursor: pointer;
}
.resolve-more-btn:hover { background: var(--slate-3); }
.resolve-more-btn .ico { width: 16px; height: 16px; }
.resolve-more .cw-pop { right: 0; left: auto; top: calc(100% + 4px); min-width: 10rem; }
.transfer-actions { position: relative; flex-shrink: 0; }
.transfer-btn {
  height: 32px; padding: 0 10px; border: 1px solid var(--n-strong);
  border-radius: 8px; background: var(--n-solid); color: var(--slate-12);
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.transfer-btn:hover { background: var(--slate-3); }
.transfer-btn .ico { width: 14px; height: 14px; color: var(--slate-11); }
.transfer-pop {
  right: 0; left: auto; top: calc(100% + 4px);
  min-width: 14rem; max-height: 280px; overflow: auto;
}
.transfer-pop .cw-pop-head { padding: 4px 10px 8px; }
.transfer-pop form { margin: 0; }
.transfer-pop .transfer-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 500;
}
.transfer-pop .transfer-meta {
  display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0;
}
.transfer-pop .transfer-status {
  font-size: 11px; color: var(--slate-11);
}
.transfer-pop .transfer-status-online { color: #12a594; }
.transfer-pop .transfer-status-busy,
.transfer-pop .transfer-status-away { color: #f59e0b; }
.transfer-pop .transfer-status-meeting { color: #7c5cff; }
.transfer-pop .transfer-status-offline { color: var(--slate-10); }
.agent-status-text-online { color: #12a594; }
.agent-status-text-busy,
.agent-status-text-away { color: #f59e0b; }
.agent-status-text-meeting { color: #7c5cff; }
.agent-status-text-offline { color: var(--slate-10); }
.transfer-pop .transfer-you {
  font-size: 11px; color: var(--slate-10); font-weight: 400;
}
.transfer-pop .avatar.xs.agent-avatar .dot {
  width: 7px; height: 7px; border-width: 1.5px;
}
.transfer-empty {
  margin: 0; padding: 8px 10px; font-size: 13px; color: var(--slate-11);
}
.transfer-unassign {
  margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--n-weak);
}
.transfer-pop .transfer-pick {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  color: var(--slate-12); font-size: 14px; cursor: pointer; text-align: left;
}
.transfer-pop .transfer-pick:hover { background: var(--n-alpha-2); }
.transfer-error {
  margin: 0 12px 8px; padding: 8px 12px; border-radius: 8px;
  background: rgb(229 72 77 / 12%); color: #e5484d; font-size: 13px;
}
.transfer-dlg-to { margin: 0 0 12px; font-size: 14px; }
.transfer-dlg-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.transfer-dlg-note {
  width: 100%; min-height: 96px; resize: vertical;
  border: 1px solid var(--n-strong); border-radius: 10px;
  background: var(--n-surface); color: var(--slate-12);
  padding: 10px 12px; font: inherit; line-height: 1.4;
}
.transfer-dlg-note:focus { outline: 2px solid rgb(39 129 246 / 35%); border-color: var(--n-brand); }
.transfer-dlg-hint { margin: 8px 0 0; font-size: 12px; color: var(--slate-11); line-height: 1.4; }

.msgs-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.msgs {
  position: relative;
  flex: 1; min-height: 0; overflow: auto; padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 8px; background: var(--n-surface);
  overflow-anchor: none;
  scroll-behavior: auto;
}
.msgs.is-scroll-pending {
  visibility: hidden;
}
.msgs-new-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  color: var(--n-brand, #1f93ff);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.msgs-new-divider::before,
.msgs-new-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--n-brand, #1f93ff) 35%, var(--n-weak));
}
/* Separador de dia estilo WhatsApp */
.msgs-date-pill {
  display: flex;
  justify-content: center;
  align-self: center;
  width: 100%;
  margin: 8px 0 4px;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}
.msgs-date-pill > span {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--slate-12, #f4f4f5);
  background: color-mix(in srgb, var(--slate-3, #27272a) 88%, var(--n-solid, #18181b));
  box-shadow: 0 1px 1px rgb(0 0 0 / 18%);
}
.msgs-new-pill {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--n-brand, #1f93ff);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgb(0 0 0 / 22%);
  white-space: nowrap;
  pointer-events: auto;
}
.msgs-new-pill[hidden] {
  display: none !important;
  pointer-events: none !important;
}
.msgs-new-pill:hover { filter: brightness(1.06); }
.msgs-older {
  display: flex; justify-content: center; padding: 4px 0 12px;
}
.msgs-older a {
  font-size: 12px; color: var(--n-brand); padding: 6px 12px;
  border: 1px solid var(--n-weak); border-radius: 999px; background: var(--n-solid);
}
.msgs-older a:hover { background: var(--n-alpha-2); }
.bubble {
  max-width: 32rem; min-width: 0; padding: 8px 12px; font-size: 14px; line-height: 1.5;
  border-radius: 12px;
  overflow-wrap: anywhere; word-break: break-word;
}
.bubble-body {
  min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.bubble-time {
  float: right;
  margin: 4px 0 -2px 10px;
  padding: 0;
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: none;
  opacity: 0.72;
  color: var(--slate-11, #a1a1aa);
}
.bubble.out .bubble-time {
  color: rgb(226 232 240 / 78%);
  opacity: 1;
}
.bubble.note .bubble-time {
  color: var(--n-amber-11, #a16207);
  opacity: 0.85;
}
.bubble .msg-reactions,
.bubble .sticker-fav-btn {
  clear: both;
}
.bubble-body .msg-link {
  color: var(--n-brand, #3b82f6); text-decoration: underline; text-underline-offset: 2px;
}
.bubble-body .msg-link:hover { opacity: 0.88; }
.bubble-body .msg-phone { cursor: pointer; }
.bubble.out .bubble-body .msg-link { color: #bfdbfe; }
.bubble.out .bubble-body .msg-link:hover { color: #fff; }

/* Phone number action popover */
.phone-popover {
  position: fixed; z-index: 80;
  min-width: 11rem; max-width: 16rem;
  padding: 6px; border-radius: 10px;
  background: var(--slate-2, #1e1e22);
  border: 1px solid var(--slate-6, #3f3f46);
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  display: grid; gap: 4px;
}
.phone-popover[hidden] { display: none !important; }
.phone-popover-num {
  padding: 4px 8px 6px; font-size: 12px; font-weight: 600;
  color: var(--slate-11, #a1a1aa); word-break: break-all;
}
.phone-popover-btn {
  appearance: none; border: 0; border-radius: 8px;
  background: transparent; color: var(--slate-12, #fafafa);
  text-align: left; padding: 8px 10px; font-size: 13px; cursor: pointer;
}
.phone-popover-btn:hover { background: var(--slate-4, #27272a); }

/* Shared contact card in bubbles */
.wa-contact-card {
  min-width: 12rem; max-width: 18rem;
  padding: 10px 12px; border-radius: 10px;
  background: rgb(255 255 255 / 92%);
  color: #111b21;
}
.bubble.out .wa-contact-card { background: rgb(255 255 255 / 88%); }
.wa-contact-card-top { display: flex; gap: 10px; align-items: flex-start; }
.wa-contact-card-ico {
  flex: 0 0 auto; width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%; background: #e9edef; color: #54656f;
}
.wa-contact-card-ico .ico { width: 18px; height: 18px; }
.wa-contact-card-meta { min-width: 0; display: grid; gap: 2px; }
.wa-contact-card-meta b { font-size: 14px; line-height: 1.3; }
.wa-contact-card-meta span { font-size: 12px; color: #667781; }
.wa-contact-card-meta .msg-phone {
  font-size: 13px; color: #027eb5; text-decoration: none; cursor: pointer;
}
.wa-contact-card-meta .msg-phone:hover { text-decoration: underline; }

/* Composer: send contact panel */
.contact-share-panel {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--slate-3, #222); border: 1px solid var(--slate-6, #3f3f46);
  display: grid; gap: 8px;
}
.contact-share-panel[hidden] { display: none !important; }
.contact-share-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.contact-share-head strong { font-size: 13px; }
.contact-share-panel input[type="search"],
.contact-share-panel input[type="text"],
.contact-share-panel input[type="tel"] {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--slate-6, #3f3f46);
  background: var(--slate-2, #18181b); color: var(--slate-12);
}
.contact-share-hits { display: grid; gap: 4px; max-height: 10rem; overflow: auto; }
.contact-share-hit {
  appearance: none; border: 0; border-radius: 8px; cursor: pointer;
  text-align: left; padding: 8px 10px;
  background: var(--slate-4, #27272a); color: var(--slate-12);
  display: grid; gap: 2px;
}
.contact-share-hit:hover { background: var(--slate-5, #3f3f46); }
.contact-share-hit b { font-size: 13px; }
.contact-share-hit span { font-size: 12px; color: var(--slate-11); }
.contact-share-empty { margin: 0; font-size: 12px; }
.contact-share-manual {
  display: grid; gap: 6px; padding-top: 6px;
  border-top: 1px solid var(--slate-6, #3f3f46);
}
.contact-share-manual label { font-size: 12px; color: var(--slate-11); }

/* WhatsApp formatting markers (* _ ~ ```) rendered in the CRM bubble */
.bubble-body .wa-fmt.wa-bold { font-weight: 700; }
.bubble-body .wa-fmt.wa-italic { font-style: italic; }
.bubble-body .wa-fmt.wa-strike { text-decoration: line-through; }
.bubble-body .wa-fmt.wa-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.05em 0.28em;
  border-radius: 4px;
  background: rgb(0 0 0 / 8%);
}
.bubble.out .bubble-body .wa-fmt.wa-mono { background: rgb(255 255 255 / 14%); }
.bubble.note .bubble-body .wa-fmt.wa-mono { background: rgb(0 0 0 / 6%); }
.bubble.in {
  background: var(--slate-4); color: var(--slate-12);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.bubble.out {
  background: var(--n-solid-blue); color: var(--slate-12);
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.bubble.bubble-audio-pending {
  opacity: 0.85;
  min-width: 0;
}
.bubble-audio-pending-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.3;
  color: inherit;
}
.bubble-audio-pending-spin {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: rgb(255 255 255 / 90%);
  border-radius: 50%;
  animation: bubble-audio-pending-spin 0.7s linear infinite;
}
@keyframes bubble-audio-pending-spin {
  to { transform: rotate(360deg); }
}
.bubble.note {
  background: var(--n-solid-amber); color: var(--n-amber-12);
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.bubble-agent {
  display: flex; align-items: center; gap: 6px; width: fit-content;
  margin: 0 0 6px; padding: 3px 8px 3px 3px;
  border-radius: 999px; font-size: 12px; line-height: 1.2; font-weight: 600;
  background: rgb(0 0 0 / 10%); color: var(--slate-12); max-width: 100%;
}
.bubble.out .bubble-agent { background: rgb(0 0 0 / 14%); }
.bubble.note .bubble-agent { background: rgb(0 0 0 / 8%); color: var(--n-amber-12); }
.bubble-agent .avatar { width: 18px; height: 18px; font-size: 8px; }
.bubble-agent > span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.bubble-external {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 8px; padding: 6px 8px;
  border-radius: 8px; font-size: 12px; line-height: 1.3;
  background: rgb(0 0 0 / 12%); color: var(--slate-11);
}
.bubble.out .bubble-external { background: rgb(0 0 0 / 14%); }
.bubble-external .ico { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.85; }
.bubble.is-wa-deleted {
  border: 1.5px solid #e5484d;
  box-shadow: 0 0 0 1px rgb(229 72 77 / 25%);
  background: color-mix(in srgb, #e5484d 12%, var(--n-solid-1, #1a1d24));
}
.bubble.out.is-wa-deleted {
  background: color-mix(in srgb, #e5484d 18%, #1e3a5f);
}
.bubble-wa-deleted {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 8px; padding: 6px 8px;
  border-radius: 8px; font-size: 12px; line-height: 1.3; font-weight: 500;
  background: rgb(229 72 77 / 18%); color: #ff8d8d;
}
.bubble-wa-deleted .ico { width: 14px; height: 14px; flex-shrink: 0; }
.bubble.is-wa-edited {
  border: 1.5px solid #e2a336;
  box-shadow: 0 0 0 1px rgb(226 163 54 / 22%);
}
.bubble-wa-edited {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 8px; padding: 6px 8px;
  border-radius: 8px; font-size: 12px; line-height: 1.3; font-weight: 500;
  background: rgb(226 163 54 / 16%); color: #f0c674;
}
.bubble-wa-edited.is-pending {
  background: rgb(226 100 54 / 16%); color: #f0a070;
}
.bubble-wa-edited .ico { width: 14px; height: 14px; flex-shrink: 0; }
.bubble.is-sticker {
  background: transparent !important;
  padding: 4px 6px;
  box-shadow: none;
}
.bubble.is-sticker .att.is-sticker { margin-top: 0; }
.bubble.is-sticker .att.is-sticker img {
  max-width: 148px; max-height: 148px; width: auto; height: auto;
  border-radius: 0; background: transparent;
}
.att-lottie-sticker {
  width: 148px; height: 148px; max-width: 100%;
  display: grid; place-items: center;
  background: transparent;
}
.att-lottie-sticker svg { width: 100% !important; height: 100% !important; }
.att-lottie-sticker.is-fallback {
  font-size: 12px; color: var(--slate-11);
  border: 1px dashed var(--n-alpha-3); border-radius: 12px;
}
.bubble.is-sticker .bubble-agent,
.bubble.is-sticker .bubble-external { margin-bottom: 4px; }
.sticker-panel {
  position: absolute; left: 12px; right: 12px; bottom: 58px; z-index: 25;
  background: var(--n-solid); border: 1px solid var(--n-weak); border-radius: 12px;
  box-shadow: var(--shadow-md, 0 8px 24px rgb(0 0 0 / 18%));
  padding: 10px; max-height: 260px; display: flex; flex-direction: column; gap: 8px;
}
.composer { padding: 0 8px 8px; background: var(--n-surface); position: relative; z-index: 30; flex-shrink: 0; pointer-events: auto; }
.sticker-panel[hidden] { display: none !important; }
.sticker-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sticker-panel-head strong { font-size: 13px; font-weight: 600; }
.sticker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px; overflow: auto; min-height: 0; flex: 1;
}
.sticker-tabs {
  display: flex; gap: 4px; padding: 0 2px;
}
.sticker-tabs button {
  flex: 1; border: 0; background: transparent; color: var(--slate-11);
  font-size: 12px; font-weight: 600; padding: 6px 8px; border-radius: 8px; cursor: pointer;
}
.sticker-tabs button.on { background: var(--n-alpha-2); color: var(--slate-12); }
.sticker-cell {
  position: relative; border: 0; background: var(--n-alpha-2); border-radius: 10px;
  padding: 6px; cursor: pointer; aspect-ratio: 1; display: grid; place-items: center;
}
.sticker-cell:hover { background: var(--n-alpha-3, var(--n-alpha-2)); outline: 1px solid var(--n-brand); }
.sticker-cell img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.sticker-cell .sticker-star {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px;
  border: 0; border-radius: 999px; background: rgb(0 0 0 / 45%); color: #fbbf24;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.sticker-cell .sticker-star .ico { width: 12px; height: 12px; }
.sticker-cell .sticker-star.is-on { color: #f59e0b; background: rgb(0 0 0 / 55%); }
.sticker-cell .sticker-star:hover { background: rgb(0 0 0 / 70%); }
.bubble.is-sticker { position: relative; }
.sticker-fav-btn {
  position: absolute; top: 2px; left: 2px; width: 26px; height: 26px;
  border: 0; border-radius: 999px; background: rgb(0 0 0 / 40%); color: #fbbf24;
  display: none; place-items: center; cursor: pointer; z-index: 2;
}
.bubble.is-sticker:hover .sticker-fav-btn { display: grid; }
.sticker-fav-btn .ico { width: 13px; height: 13px; }
.sticker-fav-btn.is-on { display: grid; color: #f59e0b; }
.sticker-grid button {
  border: 0; background: var(--n-alpha-2); border-radius: 10px; padding: 6px;
  cursor: pointer; aspect-ratio: 1; display: grid; place-items: center;
}
.sticker-grid button:hover { background: var(--n-alpha-3, var(--n-alpha-2)); outline: 1px solid var(--n-brand); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sticker-empty { margin: 8px 0; font-size: 12px; grid-column: 1 / -1; }
.bubble .att { margin-top: 8px; display: grid; gap: 8px; min-width: 0; }
.bubble .att:first-child { margin-top: 0; }
.bubble .att img { max-width: 100%; max-height: 240px; border-radius: 8px; display: block; }
/* Native <audio> collapses into a tiny pill when the bubble only sizes to "[áudio]". */
.bubble:has(.att audio),
.bubble:has(.att .audio-player) { min-width: min(17.5rem, 100%); }
.audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 15rem;
  max-width: 17.5rem;
}
.audio-transcript {
  margin-top: 6px;
  max-width: 17.5rem;
  font-size: 12.5px;
  line-height: 1.4;
  color: inherit;
  opacity: 0.88;
}
.audio-transcript.is-pending {
  opacity: 0.7;
  font-style: italic;
}
.audio-transcript-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.audio-transcript.is-clamped .audio-transcript-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.audio-transcript.is-expanded .audio-transcript-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.audio-transcript-toggle {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.audio-transcript-toggle:hover { opacity: 1; }
.bubble.out .audio-transcript { opacity: 0.9; }
.audio-speed {
  flex: 0 0 auto;
  height: 28px;
  min-width: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--n-alpha-2);
  color: var(--slate-12);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  line-height: 1;
  user-select: none;
}
.audio-speed:hover { background: var(--n-alpha-3, var(--n-alpha-2)); }
.bubble.out .audio-speed,
.ichat-msg.is-mine .audio-speed {
  background: rgb(0 0 0 / 14%);
  color: inherit;
}
.bubble.out .audio-speed:hover,
.ichat-msg.is-mine .audio-speed:hover {
  background: rgb(0 0 0 / 22%);
}
.bubble .att audio,
.bubble .att .audio-player audio {
  display: block;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  height: 2.5rem;
}
.bubble .att video {
  display: block;
  width: 100%;
  max-width: 280px;
}
.bubble .att-file {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px; background: var(--n-alpha-2);
  font-size: 13px; font-weight: 500;
  color: inherit; text-decoration: none; word-break: break-all;
}
.bubble .att-pdf {
  display: grid; grid-template-rows: auto auto; gap: 0;
  width: min(220px, 70vw); max-width: 100%;
  border-radius: 10px; overflow: hidden;
  background: var(--n-alpha-2);
  border: 1px solid var(--n-weak);
  text-decoration: none; color: inherit;
}
.bubble .att-pdf-thumb {
  position: relative; display: block; width: 100%;
  aspect-ratio: 3 / 4; max-height: 280px;
  background: #1a1d21; overflow: hidden;
}
.bubble .att-pdf-thumb img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  background: #fff;
}
.bubble .att-pdf-fallback {
  display: none; position: absolute; inset: 0;
  align-items: center; justify-content: center;
  color: #e5484d; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(160deg, #2a2f36, #1a1d21);
}
.bubble .att-pdf-fallback .ico { width: 36px; height: 36px; color: #e5484d; }
.bubble .att-pdf-thumb.is-fallback img { display: none; }
.bubble .att-pdf-thumb.is-fallback .att-pdf-fallback { display: flex; }
.bubble .att-pdf-meta {
  display: grid; gap: 2px; padding: 8px 10px;
  min-width: 0; background: color-mix(in srgb, var(--n-solid) 70%, transparent);
}
.bubble .att-pdf-name {
  font-size: 12px; font-weight: 500; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bubble .att-pdf-type {
  font-size: 11px; color: var(--slate-11); font-weight: 600; letter-spacing: .02em;
}
.pdf-viewer-dialog,
.media-viewer-dialog {
  width: min(960px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: min(90vh, 920px);
  max-height: calc(100vh - 24px);
  padding: 0;
  flex-direction: column;
  overflow: hidden;
}
.pdf-viewer-dialog[open],
.media-viewer-dialog[open] { display: flex; }
.pdf-viewer-head,
.media-viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin: 0; border-bottom: 1px solid var(--n-weak);
  flex-shrink: 0;
}
.pdf-viewer-head h2,
.media-viewer-head h2 {
  margin: 0; font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.pdf-viewer-actions,
.media-viewer-actions {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.pdf-viewer-actions .btn .ico,
.pdf-viewer-actions .icon-btn .ico,
.media-viewer-actions .btn .ico,
.media-viewer-actions .icon-btn .ico { width: 15px; height: 15px; }
.pdf-viewer-frame-wrap,
.media-viewer-body {
  flex: 1 1 auto; min-height: 0; background: #111;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
}
.pdf-viewer-frame-wrap iframe,
.media-viewer-body iframe {
  display: block; width: 100%; height: 100%; border: 0; background: #525659;
}
.media-viewer-body img {
  display: block; max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain;
  margin: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.media-viewer-dialog.is-image .media-viewer-body {
  padding: 16px;
  background: #0b0d10;
  overflow: hidden;
  cursor: default;
  touch-action: none;
}
.media-viewer-dialog.is-image .media-viewer-body.is-zoomed {
  display: block;
  overflow: auto;
  padding: 0;
  scrollbar-width: none;
}
.media-viewer-dialog.is-image .media-viewer-body.is-zoomed::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}
.media-viewer-dialog.is-image .media-viewer-body.is-zoomed img {
  margin: 0;
  max-width: none;
  max-height: none;
  object-fit: fill;
}
.bubble .att-image {
  display: block; max-width: 100%;
  border-radius: 8px; overflow: hidden;
  cursor: zoom-in;
}
.bubble .att-image img {
  display: block; max-width: 100%; height: auto;
}
.bubble.can-react { position: relative; padding-bottom: 10px; overflow: visible; }
.bubble .msg-react-btn {
  position: absolute; top: -8px; right: 22px;
  width: 22px; height: 22px; border-radius: 999px;
  border: 1px solid var(--n-weak); background: var(--n-solid);
  color: var(--slate-11); font-size: 14px; line-height: 1;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); z-index: 3;
}
.bubble.in .msg-react-btn { right: auto; left: 22px; }
.bubble .msg-menu-btn {
  position: absolute; top: -8px; right: -6px;
  width: 22px; height: 22px; border-radius: 999px;
  border: 1px solid var(--n-weak); background: var(--n-solid);
  color: var(--slate-11); line-height: 1;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); z-index: 3;
}
.bubble .msg-menu-btn .ico { width: 14px; height: 14px; }
.bubble.in .msg-menu-btn { right: auto; left: -6px; }
.bubble.can-react:hover .msg-react-btn,
.bubble.can-react:focus-within .msg-react-btn,
.bubble.can-react.is-picking .msg-react-btn,
.bubble.can-react:hover .msg-menu-btn,
.bubble.can-react:focus-within .msg-menu-btn,
.bubble.can-react.is-menu-open .msg-menu-btn,
.bubble.can-react.is-picking .msg-menu-btn { display: inline-flex; }
.msg-menu {
  position: absolute; top: 18px; right: -4px; bottom: auto; z-index: 8;
  min-width: 168px; padding: 6px;
  background: var(--n-solid); border: 1px solid var(--n-weak);
  border-radius: 12px; box-shadow: 0 10px 28px rgb(0 0 0 / 28%);
  display: grid; gap: 2px;
}
.bubble.in .msg-menu { right: auto; left: -4px; }
.bubble.menu-dir-up .msg-menu { top: auto; bottom: 18px; }
.bubble.menu-dir-up .msg-menu-btn .ico { transform: rotate(180deg); }
.msg-menu[hidden] { display: none !important; }
.msg-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: transparent;
  color: var(--slate-12); font: inherit; font-size: 14px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left;
}
.msg-menu button:hover { background: var(--n-alpha-2); }
.msg-menu button .ico { width: 16px; height: 16px; flex-shrink: 0; opacity: .9; }
.bubble-quote {
  display: grid; gap: 2px; margin: 0 0 8px; padding: 6px 8px 6px 10px;
  border-left: 3px solid var(--n-brand, #3b82f6);
  border-radius: 6px; background: rgb(0 0 0 / 16%);
  font-size: 12px; line-height: 1.35; cursor: pointer;
}
.bubble.out .bubble-quote { background: rgb(0 0 0 / 18%); border-left-color: #93c5fd; }
.bubble-quote b { font-weight: 600; color: var(--n-brand, #60a5fa); }
.bubble-quote span {
  color: var(--slate-11);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pix-card {
  min-width: 220px; max-width: 280px;
  border-radius: 10px; overflow: hidden;
  background: #fff;
  border: 1px solid var(--n-weak, #eaeaea);
  color: #111b21;
}
.bubble.out .pix-card {
  background: #fff;
  border-color: rgb(0 0 0 / 8%);
}
.pix-card-top {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 10px;
}
.pix-card-ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: #00a884; color: #fff;
}
.pix-card-meta { min-width: 0; display: grid; gap: 2px; color: #111b21; }
.pix-card-meta b {
  font-size: 14px; font-weight: 600; line-height: 1.25;
  overflow-wrap: anywhere; color: #111b21;
}
.pix-card-meta span {
  font-size: 12px; color: #667781;
  overflow-wrap: anywhere;
}
.pix-card-copy {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-top: 1px solid #e9edef;
  background: #f0f2f5; color: #008069;
  padding: 10px 12px; cursor: pointer; font-size: 14px; font-weight: 700;
}
.pix-card-copy .ico { width: 16px; height: 16px; color: #008069; }
.pix-card-copy:hover { background: #e9edef; color: #006653; }
.quote-bar {
  display: flex; align-items: stretch; gap: 8px;
  margin: 0 12px 8px; padding: 8px 10px;
  border-radius: 10px; background: var(--n-alpha-2);
  border-left: 3px solid var(--n-brand, #3b82f6);
}
.quote-bar[hidden] { display: none !important; }
.quote-bar-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.quote-bar-body b { font-size: 12px; font-weight: 600; color: var(--n-brand, #60a5fa); }
.quote-bar-body span {
  font-size: 12px; color: var(--slate-11);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quote-bar-clear {
  border: 0; background: transparent; color: var(--slate-11);
  width: 28px; display: grid; place-items: center; cursor: pointer; border-radius: 8px;
}
.quote-bar-clear:hover { background: var(--slate-4); }
.bubble.is-quote-flash {
  outline: 2px solid var(--n-brand, #3b82f6);
  outline-offset: 2px;
  transition: outline-color .2s ease;
}
.msg-react-picker {
  position: absolute; bottom: calc(100% + 6px); top: auto; left: 0;
  display: flex; gap: 2px; padding: 4px;
  background: var(--n-solid); border: 1px solid var(--n-weak);
  border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.12); z-index: 6;
}
.bubble.out .msg-react-picker { left: auto; right: 0; }
.bubble.menu-dir-down .msg-react-picker { top: calc(100% + 6px); bottom: auto; }
.msg-react-picker[hidden] { display: none !important; }
.msg-react-picker button {
  width: 32px; height: 32px; border: 0; background: transparent;
  border-radius: 999px; font-size: 18px; cursor: pointer; line-height: 1;
}
.msg-react-picker button:hover { background: var(--n-alpha-2); }
.msg-react-picker button.is-replace-target {
  background: color-mix(in srgb, var(--n-brand, #3b82f6) 22%, transparent);
  outline: 2px solid var(--n-brand, #3b82f6);
}
.msg-react-picker .msg-react-more {
  font-size: 18px; font-weight: 600; color: var(--slate-11);
  background: var(--n-alpha-2);
}
.msg-react-picker .msg-react-more:hover { background: var(--slate-4); color: var(--slate-12); }
.msg-react-emoji-grid {
  position: absolute; bottom: calc(100% + 46px); top: auto; left: 0; z-index: 7;
  width: min(280px, 70vw); max-height: 220px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px; background: var(--n-solid); border: 1px solid var(--n-weak);
  border-radius: 12px; box-shadow: 0 10px 28px rgb(0 0 0 / 22%);
}
.bubble.out .msg-react-emoji-grid { left: auto; right: 0; }
.bubble.menu-dir-down .msg-react-emoji-grid { top: calc(100% + 52px); bottom: auto; }
.msg-react-emoji-grid[hidden] { display: none !important; }
.msg-react-emoji-hint {
  font-size: 11px; color: var(--slate-11); line-height: 1.3; padding: 0 2px;
}
.msg-react-emoji-list {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  overflow: auto; min-height: 0;
}
.msg-react-emoji-list button {
  width: 100%; aspect-ratio: 1; border: 0; background: transparent;
  border-radius: 8px; font-size: 18px; cursor: pointer; line-height: 1;
}
.msg-react-emoji-list button:hover { background: var(--n-alpha-2); }
.msg-reactions {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 2px; margin-bottom: -4px;
}
.msg-reaction {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px 1px 4px; border-radius: 999px;
  background: var(--n-solid); border: 1px solid var(--n-weak);
  font-size: 13px; line-height: 1.2; cursor: default;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.msg-reaction.is-mine {
  border-color: var(--n-brand);
  background: color-mix(in srgb, var(--n-brand) 12%, var(--n-solid));
}
.msg-reaction i {
  font-style: normal; font-size: 11px; color: var(--slate-11); font-weight: 600;
}
.bubble.out .msg-reactions { justify-content: flex-end; }

.assign-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 8px; padding: 10px 12px;
  border-radius: 10px; background: var(--n-alpha-2);
  border: 1px solid var(--n-weak);
}
.assign-banner[hidden] { display: none !important; }
.assign-banner p {
  margin: 0; font-size: 13px; color: var(--slate-12); line-height: 1.4;
}
.assign-banner .btn { flex-shrink: 0; white-space: nowrap; }
.reply-box {
  border: 1px solid var(--n-weak); border-radius: 12px; background: var(--n-solid); overflow: visible;
}
.reply-box.is-private { background: var(--n-solid-amber); border-color: rgb(79 52 34 / 8%); }
.reply-top {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 8px 0 12px; gap: 8px;
}
.reply-top-left {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
}
.reply-labels-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px;
  padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--n-alpha-2); color: var(--slate-12);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.reply-labels-btn:hover { background: var(--n-alpha-3, rgba(255,255,255,.08)); }
.reply-labels-btn .ico { width: 14px; height: 14px; color: var(--slate-11); }
.reply-order-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px;
  padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: #f97316; color: #fff;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 2px rgb(249 115 22 / 35%);
}
.reply-order-btn:hover { background: #ea580c; }
.reply-order-btn:disabled { opacity: .65; cursor: wait; }
.reply-order-btn .ico { width: 14px; height: 14px; color: #fff; }
.cw-tags.is-composer {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  position: relative;
}
.canned-manage-dialog { width: min(40rem, calc(100vw - 32px)); max-height: min(90vh, 720px); overflow: auto; }
.canned-manage-list { max-height: 240px; overflow: auto; margin-bottom: 8px; border: 1px solid var(--n-alpha-2); border-radius: 12px; }
.canned-manage-table { margin: 0; }
.canned-manage-table td, .canned-manage-table th { padding: 8px 12px; }
.canned-manage-empty { margin: 0; padding: 16px; text-align: center; }
.canned-manage-error { color: var(--red-9, #e5484d); margin: 0 0 12px; }
.canned-manage-form label { display: block; margin: 10px 0 6px; font-size: 13px; font-weight: 500; }
.canned-manage-form input[type="text"],
.canned-manage-form textarea {
  width: 100%; box-sizing: border-box;
}
.cw-pop-labels.is-composer { min-width: 240px; max-height: 280px; }
.reply-labels-chips {
  display: inline-flex; align-items: center; gap: 4px;
}
.reply-label-dot {
  width: 8px; height: 8px; border-radius: 999px; display: inline-block;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 12%);
}
.reply-label-more {
  font-size: 11px; color: var(--slate-11); font-weight: 550;
}
.mode-toggle {
  display: flex; align-items: center; height: 32px; padding: 4px;
  border: 0; border-radius: 999px; background: var(--n-alpha-2);
  position: relative; cursor: pointer;
}
.mode-toggle span {
  padding: 0 8px; height: 24px; display: flex; align-items: center;
  font-size: 13px; font-weight: 500; z-index: 1; color: var(--slate-12); white-space: nowrap;
}
.mode-toggle .slider {
  position: absolute; top: 4px; left: 4px; height: 24px; border-radius: 999px;
  background: var(--n-solid); box-shadow: var(--shadow-sm); transition: transform .2s, width .2s; z-index: 0;
}
.reply-editor { position: relative; }
.reply-box textarea {
  width: 100%; border: 0; padding: 0 12px 8px; min-height: 64px; resize: none;
  outline: none; background: transparent; color: var(--slate-12);
}
.reply-box textarea::placeholder { color: var(--slate-10); }
.reply-box textarea:focus { outline: none; border: 0; box-shadow: none; }
.mention {
  display: inline; color: var(--n-brand); font-weight: 600;
}
.mention-pop {
  position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px);
  z-index: 30; background: var(--n-solid); border: 1px solid var(--n-weak);
  border-radius: 12px; box-shadow: var(--shadow-md, 0 8px 24px rgb(27 28 29 / 12%));
  overflow: hidden; max-height: 280px; display: flex; flex-direction: column;
}
.mention-pop-tabs {
  display: flex; gap: 4px; padding: 8px 8px 0; flex-shrink: 0;
}
.mention-pop-tabs button {
  border: 0; background: none; padding: 6px 8px; border-radius: 8px;
  font-size: 12px; font-weight: 500; color: var(--slate-11); cursor: pointer;
}
.mention-pop-tabs button.on { background: var(--n-alpha-2); color: var(--slate-12); }
.mention-pop-list { overflow: auto; padding: 4px; }
.mention-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px; border: 0; border-radius: 8px; background: none;
  text-align: left; cursor: pointer; color: var(--slate-12);
}
.mention-item:hover, .mention-item.is-on { background: var(--n-alpha-2); }
.mention-item .avatar { width: 24px; height: 24px; font-size: 10px; }
.mention-item b { font-size: 14px; font-weight: 500; display: block; }
.mention-item small { font-size: 12px; color: var(--slate-11); }
.mention-pop-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--slate-11); }
.reply-tools {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 12px; gap: 8px;
}
.reply-tools .left { display: flex; gap: 8px; align-items: center; }
.send-btn {
  border: 0; border-radius: 8px; background: var(--n-brand); color: #fff;
  height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.send-btn:hover { background: var(--n-brand-hover); }
.send-btn.is-note { background: var(--n-amber-9); color: #1c2024; }
.send-btn.is-note:hover { background: var(--n-amber-10); }
.schedule-row { display: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; cursor: pointer; color: var(--slate-11); margin: 0; font-weight: 400; border: 0; background: transparent; border-radius: 8px; }
.icon-btn:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.reply-tools .icon-btn { background: var(--n-alpha-2); }
.reply-tools .icon-btn:hover { background: var(--slate-4); }
.icon-btn.is-on { background: var(--n-solid-blue); color: var(--n-brand); }
.icon-btn .ico { width: 16px; height: 16px; }
.emoji-pop {
  position: absolute; left: 12px; bottom: calc(100% - 4px); z-index: 32;
  width: 280px; max-height: 220px; overflow-x: hidden; overflow-y: auto;
  background: var(--n-solid); border: 1px solid var(--n-weak);
  border-radius: 12px; box-shadow: var(--shadow-md, 0 8px 24px rgb(27 28 29 / 12%));
  padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
}
.emoji-pop button {
  border: 0; background: none; width: 32px; height: 32px; border-radius: 8px;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.emoji-pop button:hover { background: var(--n-alpha-2); }
.canned-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none;
  text-align: left; cursor: pointer; color: var(--slate-12);
}
.canned-item:hover, .canned-item.is-on { background: var(--n-alpha-2); }
.canned-item b { font-size: 14px; font-weight: 500; color: var(--n-brand); }
.canned-item small { font-size: 12px; color: var(--slate-11); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 12px 8px; max-width: min(100% - 24px, 28rem);
  padding: 6px 10px 6px 6px; border-radius: 8px; background: var(--n-alpha-2);
  font-size: 12px; color: var(--slate-12); box-sizing: border-box;
}
.attach-chip .attach-preview {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  flex-shrink: 0; background: var(--slate-3);
}
.attach-chip.has-preview { align-items: flex-start; }
.attach-chip .attach-clear {
  margin: 0; border: 0; background: none; color: var(--slate-11);
  width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; border-radius: 6px;
  flex-shrink: 0;
}
.attach-chip .attach-clear:hover { background: var(--slate-4); color: var(--slate-12); }
.attach-chip .ico { width: 14px; height: 14px; }
.attach-chip [data-attach-name] {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reply-box.is-drop-target {
  outline: 2px dashed var(--n-brand, #3b82f6);
  outline-offset: -4px;
  background: color-mix(in srgb, var(--n-brand, #3b82f6) 8%, transparent);
}
.reply-box.is-drop-target::after {
  content: 'Solte para anexar a imagem';
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--n-brand, #3b82f6);
  padding: 4px 8px 8px;
}
.col.chat.is-drop-target::before {
  content: 'Solte para anexar a imagem';
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--n-brand, #3b82f6);
  background: color-mix(in srgb, var(--n-brand, #3b82f6) 12%, rgb(0 0 0 / 35%));
  border: 2px dashed var(--n-brand, #3b82f6);
  border-radius: 0;
}
.rec-bar {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 12px 8px; padding: 4px 6px 4px 8px;
  border-radius: 8px; background: var(--n-alpha-2);
  font-size: 13px; color: var(--slate-12); max-width: fit-content;
}
.rec-bar.is-paused .rec-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgb(245 158 11 / 18%);
  animation: none;
}
.rec-dot {
  width: 8px; height: 8px; border-radius: 999px; background: #e54666;
  box-shadow: 0 0 0 4px rgb(229 70 102 / 18%);
  animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}
.rec-bar .btn.ghost.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.rec-cancel {
  margin: 0; border: 0; background: none; color: var(--slate-11);
  width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; border-radius: 6px;
  flex-shrink: 0;
}
.rec-cancel:hover { background: var(--slate-4); color: var(--slate-12); }
.rec-cancel .ico { width: 14px; height: 14px; }

.panel { padding: 16px 12px; font-size: 13px; }
.panel h3 {
  margin: 16px 0 8px; font-size: 13px; font-weight: 500; color: var(--slate-12);
  text-transform: none; letter-spacing: 0;
  padding: 8px 0; border-top: 1px solid var(--n-weak);
}
.panel h3:first-of-type { border-top: 0; margin-top: 0; }
.kv { display: grid; gap: 8px; }
.kv div { padding: 4px 0; background: transparent; border: 0; }
.label-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.inline-form { display: flex; gap: 8px; align-items: end; }
.inline-form select { flex: 1; }
.note-line { margin: 0 0 8px; font-size: 12px; color: var(--slate-11); }

.btn {
  background: var(--n-brand); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 14px;
}
.btn:hover { background: var(--n-brand-hover); }
.btn.ghost { background: var(--n-solid); color: var(--slate-12); border: 1px solid var(--n-weak); }
.btn.ghost:hover { background: var(--slate-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.slate { background: var(--slate-3); color: var(--slate-12); }
.btn.slate:hover { background: var(--slate-4); }
.btn.ruby { background: #e54666; color: #fff; }
.btn.ruby:hover { background: #dc3b5d; }
.btn .ico { width: 16px; height: 16px; }
.btn.block { width: 100%; padding: 10px 14px; font-size: 15px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.card { background: var(--n-solid); border: 1px solid var(--n-weak); border-radius: 12px; box-shadow: none; padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat b { font-size: 28px; display: block; letter-spacing: -.03em; }
.stat span { color: var(--slate-11); font-size: 12px; }

label { display: block; font-size: 14px; color: var(--slate-12); font-weight: 500; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=datetime-local], input[type=date], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--n-weak); border-radius: 8px; padding: 9px 12px;
  background: var(--n-solid); color: var(--slate-12);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgb(39 129 246 / 25%); border-color: var(--n-brand); }

/* Native select popup — color-scheme drives OS menu; option fills gaps on some browsers */
select { color-scheme: light; }
html.dark select,
body.dark select {
  color-scheme: dark;
  background-color: var(--n-solid);
  color: var(--slate-12);
}
html.dark select option,
body.dark select option {
  background-color: var(--n-solid);
  color: var(--slate-12);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 8px; color: var(--slate-11); font-weight: 500; border-bottom: 1px solid var(--n-weak); }
td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--slate-3); }

/* Kanban board (full-page CRM) */
.app--kanban .main { padding: 0; overflow: hidden; height: 100vh; background: var(--n-bg); }
.app--ichat .main { padding: 0; overflow: hidden; height: 100vh; background: var(--n-surface); }
.app--ichat .ichat-app { height: 100%; }
.kb-page { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--n-solid-1, var(--n-bg)); color: var(--slate-12); }
.kb-head {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 8px 12px; border-bottom: 1px solid var(--n-weak);
}
.kb-view-tabs {
  display: flex; align-items: center; gap: 2px; padding: 2px;
  border-radius: 8px; background: var(--n-alpha-2);
}
.kb-view-tabs button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 0; border-radius: 6px; background: transparent; color: var(--slate-11);
  font-size: 14px; cursor: pointer;
}
.kb-view-tabs button.on { background: var(--n-solid-3, var(--n-solid)); color: var(--slate-12); box-shadow: var(--shadow-sm); }
.kb-view-tabs .ico { width: 16px; height: 16px; }
.kb-select {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--n-weak); border-radius: 8px; background: var(--n-solid-2, var(--n-solid));
  font-size: 14px; color: var(--slate-12); cursor: pointer;
}
.kb-select .ico { width: 14px; height: 14px; color: var(--slate-10); }
.kb-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.kb-head-spacer { flex: 1; min-width: 8px; }
.kb-search {
  position: relative; display: flex; align-items: center;
}
.kb-search .ico {
  position: absolute; left: 8px; width: 16px; height: 16px; color: var(--slate-10); pointer-events: none;
}
.kb-search input {
  width: 192px; height: 34px; padding: 0 10px 0 32px; margin: 0;
  border: 1px solid var(--n-weak); border-radius: 8px; background: var(--n-solid-2, var(--n-solid));
  font-size: 14px;
}
.kb-updated { font-size: 12px; color: var(--slate-11); white-space: nowrap; }
.kb-board { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.kb-columns { display: flex; gap: 12px; height: 100%; min-height: 420px; align-items: stretch; }
.kb-col {
  width: 288px; flex-shrink: 0; display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden; border: 1px solid rgb(0 0 0 / 20%);
}
.kb-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; color: #fff;
}
.kb-col-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kb-col-dot { width: 10px; height: 10px; border-radius: 999px; background: rgb(255 255 255 / 90%); flex-shrink: 0; }
.kb-col-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-col-count { font-size: 14px; opacity: .85; flex-shrink: 0; }
.kb-col-body {
  flex: 1; min-height: 120px; min-width: 0; overflow: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.kb-card {
  border-radius: 8px; padding: 10px 10px 9px; background: #15171d;
  border: 1px solid rgb(255 255 255 / 14%); box-shadow: var(--shadow-sm);
  cursor: grab; text-align: left; display: grid; gap: 8px;
  width: 100%; max-width: 100%; min-width: 0;
  box-sizing: border-box; overflow: hidden;
}
.kb-card[draggable="true"]:active { cursor: grabbing; }
.kb-card[data-card-id] { cursor: pointer; }
.kb-card.is-hidden { display: none !important; }
.kb-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0; max-width: 100%;
}
.kb-card-kicker {
  font-size: 12px; color: #6ea8ff; font-weight: 600;
  min-width: 0; max-width: 100%; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-card-title-input {
  width: 100%; min-width: 0; padding: 2px 6px; border-radius: 4px;
  border: 1px solid #2781f6; background: #0f1117; color: #fff; font-size: 12px; font-weight: 600;
}
.kb-card-actions {
  display: inline-flex; align-items: center; gap: 6px; color: #cbd5e1;
  flex-shrink: 0; max-width: 55%;
}
.kb-card-age { font-size: 12px; color: #d1d5db; }
.kb-card-action {
  border: 0; background: transparent; color: #94a3b8; padding: 0;
  width: 16px; height: 16px; display: inline-grid; place-items: center; cursor: pointer;
  text-decoration: none; flex-shrink: 0;
}
.kb-card-action .ico { width: 13px; height: 13px; }
.kb-card-action.is-disabled { opacity: .35; cursor: default; }
.kb-card-action-static { cursor: default; opacity: .75; }
.kb-card-more {
  width: 22px; height: 18px; border-radius: 4px; background: rgb(255 255 255 / 8%);
}
.kb-card-schedule {
  width: 22px; height: 18px; border-radius: 4px; background: rgb(255 255 255 / 8%);
}
.kb-card-schedule:hover { background: rgb(20 184 166 / 25%); color: #5eead4; }
.kb-card-menu { position: relative; display: inline-flex; }
.kb-card-menu.is-open .kb-card-more { background: rgb(255 255 255 / 16%); color: #fff; }
.kb-card-menu-pop {
  /* fixed + JS placement: evita clipping de .kb-card / .kb-col-body (overflow) */
  position: fixed; z-index: 80;
  min-width: 11.5rem; padding: 6px; border-radius: 8px;
  background: #1b1e26; border: 1px solid rgb(255 255 255 / 12%);
  box-shadow: 0 10px 28px rgb(0 0 0 / 45%);
}
.kb-card-menu-pop[hidden] { display: none !important; }
.kb-card-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; color: #e5e7eb; font-size: 13px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: left;
}
.kb-card-menu-item:hover { background: rgb(255 255 255 / 6%); }
.kb-card-menu-item.danger { color: #f87171; }
.kb-card-menu-item.danger:hover { background: rgb(248 113 113 / 10%); }
.kb-card-menu-item .ico { width: 14px; height: 14px; flex-shrink: 0; }
.kb-card-contact { display: flex; align-items: flex-start; gap: 8px; min-width: 0; max-width: 100%; }
.kb-card-avatar {
  width: 28px; height: 28px; border-radius: 999px; background: #2781f6;
  color: #fff; font-weight: 600; font-size: 13px; display: inline-grid; place-items: center;
  flex-shrink: 0; margin-top: 1px;
}
.kb-card-name {
  font-size: 13px; line-height: 1.25; font-weight: 600; color: #fff;
  flex: 1 1 auto; min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word; white-space: normal;
}
.kb-card-tags { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.kb-card-tag {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  border: 1px solid rgb(255 255 255 / 16%); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; color: #d4d8df; background: rgb(255 255 255 / 3%);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-card-tag .ico { width: 12px; height: 12px; color: #9aa8bb; }
.kb-card-preview {
  margin-top: 8px; font-size: 12px; line-height: 1.35; color: rgb(255 255 255 / 72%);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.kb-detail-source-quote {
  display: grid; gap: 4px; margin: 10px 0 14px; padding: 10px 12px;
  border-left: 3px solid var(--brand, #1f93ff); border-radius: 8px;
  background: var(--n-solid-2, rgb(0 0 0 / 4%));
}
.kb-detail-source-quote b { font-size: 12px; }
.kb-detail-source-quote span { font-size: 13px; color: var(--slate-11); }
.kb-empty {
  margin-top: 4px; padding: 32px 12px; border: 1px dashed rgb(255 255 255 / 20%);
  border-radius: 8px; text-align: center; font-size: 14px; color: rgb(255 255 255 / 70%);
}
.kb-empty[hidden] { display: none !important; }
.kb-empty-page { display: grid; place-content: center; gap: 12px; min-height: 320px; text-align: center; color: var(--slate-11); }
.kb-agenda { flex: 1; min-height: 0; overflow: auto; padding: 20px; display: grid; gap: 8px; align-content: start; }
.kb-agenda[hidden] { display: none !important; }
.kb-agenda-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--n-weak); background: var(--n-solid-2, var(--n-solid));
}
.kb-pop-create button, .kb-pop-more button, .kb-pop-more a {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px !important; white-space: normal;
}
.kb-pop-create b, .kb-pop-more b { display: block; font-weight: 500; }
.kb-pop-create small, .kb-pop-more small { display: block; font-size: 12px; color: var(--slate-11); margin-top: 2px; }
.kb-pop-create .ico, .kb-pop-more .ico { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.kb-contact-pick {
  display: grid; gap: 0; max-height: 160px; overflow: auto;
  border: 1px solid var(--n-weak); border-radius: 8px;
}
.kb-contact-pick button {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: 0; background: transparent; cursor: pointer; font-size: 14px;
}
.kb-contact-pick button:hover { background: var(--n-alpha-2); }
.kb-menu { position: relative; }
.kb-menu .cw-pop { min-width: 14rem; }
.kb-menu .cw-pop a, .kb-menu .cw-pop button { display: block; width: 100%; text-align: left; }
.kb-menu[data-kb-inbox-menu] .cw-pop button.on { color: var(--n-brand); font-weight: 500; }

.kb-date-pop { min-width: 15rem; padding: 12px !important; }
.kb-date-pop-title { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--slate-11); margin-bottom: 8px; }
.kb-date-presets { display: grid; gap: 2px; margin-bottom: 10px; }
.kb-date-presets a { display: block; padding: 6px 8px; border-radius: 6px; font-size: 14px; color: var(--slate-12); text-decoration: none; }
.kb-date-presets a:hover, .kb-date-presets a.on { background: var(--n-alpha-2); color: var(--n-brand); }
.kb-date-pop-sub { font-size: 12px; color: var(--slate-11); margin: 8px 0 6px; padding-top: 8px; border-top: 1px solid var(--n-weak); }
.kb-date-custom { display: grid; gap: 8px; }
.kb-date-custom label { display: grid; gap: 4px; font-size: 12px; color: var(--slate-11); }
.kb-date-custom input[type="date"] { font-size: 13px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--n-weak); background: var(--n-solid); color: var(--slate-12); }
.kb-date-clear { display: block; margin-top: 8px; font-size: 12px; color: var(--n-brand); text-align: center; }
.icon-btn.on { color: var(--n-brand); background: var(--n-alpha-2); }

.kb-project-bar, .kb-bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--n-weak); background: var(--n-solid-2, var(--n-solid));
}
.kb-project-bar[hidden], .kb-bulk-bar[hidden] { display: none !important; }
.kb-project-bar button {
  border: 0; background: transparent; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; cursor: pointer; color: var(--slate-11);
}
.kb-project-bar button.on { background: var(--n-brand); color: #fff; }
.kb-bulk-bar select { font-size: 13px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--n-weak); background: var(--n-solid); color: var(--slate-12); }
.kb-card-check { display: flex; margin-bottom: 4px; }
.kb-card-check[hidden] { display: none !important; }
.kb-page.is-bulk .kb-card { cursor: default; }
.kb-page.is-bulk .kb-card[data-href] { pointer-events: auto; }

.kb-cal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.kb-cal-head h2 { margin: 0; font-size: 20px; font-weight: 600; flex: 1; }
.kb-cal-nav { display: flex; gap: 4px; }
.kb-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  margin: 0 20px; border: 1px solid var(--n-weak); border-radius: 8px; overflow: hidden;
  background: var(--n-weak);
}
.kb-cal-dow, .kb-cal-cell {
  background: var(--n-solid); min-height: 88px; padding: 6px 8px; font-size: 13px;
}
.kb-cal-dow { min-height: auto; text-align: center; font-size: 12px; font-weight: 500; color: var(--slate-11); padding: 8px; }
.kb-cal-cell.muted { color: var(--slate-9); background: var(--n-solid-2, var(--slate-2)); }
.kb-cal-cell.today .kb-cal-day {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px; background: var(--n-brand); color: #fff;
}
.kb-cal-day { font-weight: 500; margin-bottom: 4px; display: block; }
.kb-cal-event {
  display: flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 0;
  color: var(--slate-12); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-cal-dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.kb-cal-event.status-pending .kb-cal-dot { background: #f97316; }
.kb-cal-event.status-sent .kb-cal-dot { background: #14b8a6; }
.kb-cal-event.status-failed .kb-cal-dot { background: #ec4899; }
.kb-cal-event.status-cancelled .kb-cal-dot { background: #94a3b8; }
.kb-cal-legend {
  display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 20px 20px; font-size: 12px; color: var(--slate-11);
}
.kb-cal-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 4px; vertical-align: middle; }
.kb-cal-legend .dot.pending { background: #f97316; }
.kb-cal-legend .dot.sent { background: #14b8a6; }
.kb-cal-legend .dot.failed { background: #ec4899; }
.kb-cal-legend .dot.cancelled { background: #94a3b8; }

.kb-funnels-page { padding: 20px 24px; max-width: 960px; }
.kb-funnels-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.kb-funnels-head h1 { margin: 8px 0 0; font-size: 22px; font-weight: 600; }
.kb-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--slate-11); text-decoration: none; }
.kb-back:hover { color: var(--slate-12); }
.kb-funnels-list { display: grid; gap: 8px; }
.kb-funnel-row { background: var(--n-solid); border: 1px solid var(--n-weak); border-radius: 10px; overflow: hidden; }
.kb-funnel-main { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.kb-funnel-toggle { border: 0; background: transparent; cursor: pointer; color: var(--slate-11); padding: 4px; }
.kb-funnel-toggle .ico { width: 16px; height: 16px; transition: transform .15s; }
.kb-funnel-row.is-open .kb-funnel-toggle .ico { transform: rotate(90deg); }
.kb-funnel-info { flex: 1; min-width: 0; }
.kb-funnel-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.kb-funnel-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.kb-funnel-stages { padding: 0 14px 12px 44px; display: grid; gap: 6px; }
.kb-funnel-stages[hidden] { display: none !important; }
.kb-funnel-stage { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate-11); }
.kb-dot.sm { width: 6px; height: 6px; }
.kb-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.kb-badge-muted { background: var(--slate-4); color: var(--slate-11); }
.kb-badge-teal { background: #ccfbf1; color: #0f766e; }
.dark .kb-badge-teal { background: rgb(20 184 166 / 20%); color: #5eead4; }
.kb-badge-iris { background: #ede9fe; color: #6d28d9; }
.dark .kb-badge-iris { background: rgb(109 40 217 / 25%); color: #c4b5fd; }
.kb-badge-green { background: #dcfce7; color: #15803d; }
.dark .kb-badge-green { background: rgb(34 197 94 / 20%); color: #86efac; }
.kb-badge-blue { background: #dbeafe; color: #1d4ed8; }
.dark .kb-badge-blue { background: rgb(59 130 246 / 20%); color: #93c5fd; }
.kb-switch { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.kb-switch input { opacity: 0; width: 0; height: 0; }
.kb-switch span {
  position: absolute; inset: 0; background: var(--slate-6); border-radius: 999px; transition: .2s;
}
.kb-switch span::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 2px; bottom: 2px;
  background: #fff; border-radius: 999px; transition: .2s;
}
.kb-switch input:checked + span { background: #22c55e; }
.kb-switch input:checked + span::before { transform: translateX(16px); }
.kb-switch-brand input:checked + span { background: var(--n-brand, #2781f6); }
.kb-del { color: #ef4444 !important; }
.kb-stage-edit-list { display: grid; gap: 8px; margin: 8px 0; }
.kb-stage-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-stage-edit-head .cw-form-title { margin: 0; }
.kb-stage-edit-rows { display: grid; gap: 8px; }
.kb-stage-edit-row { display: grid; grid-template-columns: 40px 1fr 36px; gap: 8px; align-items: center; }
.kb-stage-edit-row input[type="color"] { width: 36px; height: 32px; padding: 0; border: 0; background: transparent; }
.kb-stage-edit-row .icon-btn { width: 36px; height: 32px; }

.kb-settings-page { padding: 20px 24px; max-width: 720px; }
.kb-settings-form { display: grid; gap: 16px; }
.kb-settings-card {
  background: var(--n-solid); border: 1px solid var(--n-weak); border-radius: 10px; padding: 16px 18px;
}
.kb-settings-card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.kb-settings-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-top: 1px solid var(--n-weak);
}
.kb-settings-row:first-of-type { border-top: 0; padding-top: 0; }
.kb-settings-row b { display: block; font-size: 14px; margin-bottom: 4px; }
.kb-settings-row small { display: block; font-size: 12px; color: var(--slate-11); line-height: 1.4; }
.kb-settings-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 4px; flex-shrink: 0; }

.kb-detail-dialog {
  width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: #12141a; color: #e5e7eb;
}
.kb-detail-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.kb-detail-loading { padding: 48px; text-align: center; color: #94a3b8; }
.kb-detail[hidden], .kb-detail-loading[hidden] { display: none !important; }
.kb-detail-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #2781f6; color: #fff;
}
.kb-detail-head .kb-card-avatar { width: 36px; height: 36px; font-size: 16px; }
.kb-detail-head-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-detail-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kb-detail-head-actions .btn { background: rgb(255 255 255 / 15%); border: 1px solid rgb(255 255 255 / 25%); color: #fff; font-size: 13px; padding: 6px 12px; }
.kb-detail-head-actions .btn:hover { background: rgb(255 255 255 / 25%); }
.kb-detail-close { border: 0; background: transparent; color: #fff; cursor: pointer; padding: 4px; margin-left: 4px; }
.kb-detail-close .ico { width: 20px; height: 20px; }
.kb-detail-body { padding: 16px; max-height: calc(100vh - 140px); overflow: auto; display: grid; gap: 12px; }
.kb-detail-status { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #166534; color: #bbf7d0; }
.kb-detail-status.resolved { background: #374151; color: #d1d5db; }
.kb-detail-section {
  border: 1px solid rgb(255 255 255 / 10%); border-radius: 10px; padding: 12px 14px; background: #1a1d24;
}
.kb-detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.kb-detail-section-head h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kb-detail-section-head .count { font-size: 12px; color: #94a3b8; font-weight: 400; }
.kb-detail-section-head .btn-link { border: 0; background: transparent; color: #a78bfa; font-size: 13px; cursor: pointer; padding: 0; }
.kb-detail-section-head .btn-link.blue { color: #60a5fa; }
.kb-detail-order {
  border-color: color-mix(in srgb, #f97316 45%, rgb(255 255 255 / 10%));
  background: color-mix(in srgb, #f97316 8%, rgb(15 17 23));
}
.kb-detail-order .kb-detail-section-head h3 { color: #fdba74; }
.kb-order-number-badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: #f97316; color: #fff; white-space: nowrap;
}
.kb-order-number-badge.is-pending {
  background: rgb(255 255 255 / 10%); color: #94a3b8; font-weight: 500;
}
.kb-detail-order-status { background: #c2410c; color: #ffedd5; margin-left: 6px; }
.kb-detail-order-form { display: grid; gap: 10px; }
.kb-order-notes-label {
  display: grid; gap: 6px; font-size: 12px; color: #94a3b8; font-weight: 500;
}
.kb-order-notes-label textarea {
  width: 100%; min-height: 180px; resize: vertical; padding: 12px;
  border-radius: 8px; border: 1px solid rgb(255 255 255 / 15%);
  background: #0b0d12; color: #f8fafc; font-size: 13px; line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.kb-detail-order-actions { display: flex; justify-content: flex-end; }
.kb-detail-empty { font-size: 13px; color: #94a3b8; padding: 8px 0; }
.kb-detail-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; }
.kb-detail-row .label { color: #94a3b8; }
.kb-detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid rgb(255 255 255 / 10%); padding-bottom: 0; overflow-x: auto; }
.kb-detail-tabs button {
  border: 0; background: transparent; color: #94a3b8; font-size: 13px; padding: 8px 12px;
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.kb-detail-tabs button.on { color: #60a5fa; border-bottom-color: #60a5fa; }
.kb-detail-tab-panel { padding-top: 12px; }
.kb-detail-tab-panel[hidden] { display: none !important; }
.kb-detail-task-form { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.kb-detail-task-form input[type="text"] { flex: 1; min-width: 140px; padding: 8px 10px; border-radius: 6px; border: 1px solid rgb(255 255 255 / 15%); background: #0f1117; color: #fff; font-size: 13px; }
.kb-detail-task-form input[type="date"] { padding: 8px; border-radius: 6px; border: 1px solid rgb(255 255 255 / 15%); background: #0f1117; color: #fff; font-size: 13px; }
.kb-detail-task-form .btn { padding: 8px 12px; }
.kb-detail-upload-form, .kb-detail-sched-form, .kb-detail-other-form {
  display: grid; gap: 8px; margin-bottom: 12px;
}
.kb-detail-upload-form input[type="file"],
.kb-detail-sched-form textarea,
.kb-detail-sched-form input,
.kb-detail-other-form input,
.kb-detail-other-form textarea {
  width: 100%; padding: 8px 10px; border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 15%); background: #0f1117; color: #fff; font-size: 13px;
}
.kb-detail-other-form label { display: grid; gap: 4px; font-size: 12px; color: #94a3b8; }
.kb-detail-other-form textarea { min-height: 80px; resize: vertical; }
.kb-detail-row-item { display: flex; align-items: center; gap: 8px; }
.kb-detail-row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: inherit; text-decoration: none; }
.kb-detail-row-item.is-done .kb-detail-row-text { text-decoration: line-through; opacity: .65; }
.kb-check {
  width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgb(255 255 255 / 25%);
  background: transparent; color: #86efac; cursor: pointer; flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 11px; padding: 0;
}
.kb-check:hover { border-color: #86efac; }
.kb-mini-del {
  border: 0; background: transparent; color: #94a3b8; cursor: pointer;
  font-size: 12px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}
.kb-mini-del:hover { color: #f87171; background: rgb(248 113 113 / 10%); }
.kb-detail-sched-form textarea { min-height: 64px; resize: vertical; }

.kb-detail-list { display: grid; gap: 6px; }
.kb-detail-list-item { font-size: 13px; padding: 8px 10px; border-radius: 6px; background: rgb(255 255 255 / 4%); border: 1px solid rgb(255 255 255 / 8%); }
.kb-detail-link-form { display: grid; gap: 8px; margin-top: 8px; }
.kb-detail-link-form select { padding: 8px; border-radius: 6px; border: 1px solid rgb(255 255 255 / 15%); background: #0f1117; color: #fff; font-size: 13px; }
.kb-detail-subview { display: grid; gap: 10px; }
.kb-detail-subview[hidden] { display: none !important; }
.kb-detail-subview textarea, .kb-detail-subview input[type="datetime-local"], .kb-detail-subview input[type="text"] {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid rgb(255 255 255 / 15%);
  background: #0f1117; color: #fff; font-size: 13px;
}
.kb-detail-subview textarea { min-height: 72px; resize: vertical; }
.kb-detail-subview h3 { margin: 0 0 10px; font-size: 24px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.kb-detail-subview h3 .count { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #3b82f6; color: #fff; }
.kb-detail-msg-list { display: grid; gap: 10px; max-height: 56vh; overflow: auto; padding-right: 4px; }
.kb-detail-msg-item {
  border: 1px solid #d28a11; border-radius: 10px; padding: 12px;
  background: rgb(210 138 17 / 10%); text-align: center;
}
.kb-detail-msg-name { font-size: 14px; color: #9ca3af; margin-bottom: 4px; }
.kb-detail-msg-content { font-size: 20px; color: #fff; font-weight: 500; margin-bottom: 4px; }
.kb-detail-msg-date { font-size: 13px; color: #9ca3af; }
.kb-ticket-card { border: 1px solid rgb(255 255 255 / 10%); border-radius: 12px; background: #1a1d24; overflow: hidden; }
.kb-ticket-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid rgb(255 255 255 / 10%);
}
.kb-ticket-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kb-ticket-ico {
  width: 34px; height: 34px; border-radius: 8px; background: #14b8a6; flex-shrink: 0;
  position: relative;
}
.kb-ticket-ico::before {
  content: ''; position: absolute; inset: 8px;
  background:
    linear-gradient(#fff, #fff) 0 2px / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 3px 0 / 2px 6px no-repeat,
    linear-gradient(#fff, #fff) calc(100% - 3px) 0 / 2px 6px no-repeat,
    linear-gradient(transparent, transparent) 0 0 / 100% 100% no-repeat;
  border: 2px solid #fff; border-radius: 3px;
}
.kb-ticket-head strong { font-size: 22px; display: block; line-height: 1.1; }
.kb-ticket-head small { color: #9ca3af; font-size: 13px; }
.kb-ticket-form { display: grid; gap: 8px; padding: 14px 16px; }
.kb-ticket-form label { font-size: 13px; color: #cbd5e1; }
.kb-ticket-form input, .kb-ticket-form select, .kb-ticket-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid rgb(255 255 255 / 12%);
  background: #2a2d37; color: #fff; font-size: 14px;
}
.kb-ticket-form input[readonly] { opacity: .95; }
.kb-ticket-form textarea { min-height: 72px; resize: vertical; }
.kb-ticket-reminder {
  margin-top: 4px; padding: 12px; border-radius: 8px;
  border: 1px solid rgb(20 184 166 / 35%); background: rgb(20 184 166 / 8%);
  display: grid; gap: 8px;
}
.kb-ticket-reminder.is-off input[type="text"],
.kb-ticket-reminder.is-off input[type="datetime-local"],
.kb-ticket-reminder.is-off > label:not(.kb-ticket-reminder-toggle),
.kb-ticket-reminder.is-off > small { opacity: .4; pointer-events: none; }
.kb-ticket-reminder-toggle {
  display: flex; align-items: center; gap: 8px; font-weight: 600; color: #5eead4 !important;
}
.kb-ticket-reminder-toggle input { width: auto !important; }
.kb-ticket-actions {
  display: flex; justify-content: flex-end; gap: 12px; padding: 12px 16px;
  border-top: 1px solid rgb(255 255 255 / 10%); background: #2a2d37;
}
.kb-ticket-actions .btn { padding: 9px 16px; }
.kb-ticket-actions .btn.sm { font-size: 14px; }
.kb-ticket-actions .btn:not(.ghost) { background: #14b8a6; border-color: #14b8a6; color: #fff; }

@font-face {
  font-family: Sora;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/sora-600.woff2") format("woff2");
}
@font-face {
  font-family: Sora;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/sora-700.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/figtree-400.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/figtree-500.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/figtree-600.woff2") format("woff2");
}

html:has(.login-wrap),
html:has(.login-wrap) body {
  height: auto;
  min-height: 100%;
  overflow: auto;
  background: #0b2140;
}
.login-wrap {
  --login-navy: #0b2140;
  --login-ink: #10243f;
  --login-paper: #f3f7fb;
  --login-gold: #e8a317;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(24rem, 32rem);
  background: var(--login-paper);
  font-family: Figtree, "Avenir Next", "Segoe UI", sans-serif;
}
.login-stage {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--login-navy);
}
.login-stage-art {
  position: absolute;
  inset: 0;
}
.login-art {
  display: block;
  width: 100%;
  height: 100%;
}
.login-sun { transform-origin: 940px 188px; animation: login-sun 10s ease-in-out infinite; }
.login-cloud--a { animation: login-cloud 48s linear infinite; }
.login-cloud--b { animation: login-cloud 64s linear infinite reverse; }
.login-air--a { animation: login-air 11s ease-in-out infinite; }
.login-air--b { animation: login-air 13s ease-in-out 1.4s infinite; }
.login-air--c { animation: login-air 9s ease-in-out .6s infinite; }
.login-stage-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: 48px 64px 9vh 8%;
  max-width: 42rem;
  background: linear-gradient(180deg, transparent 18%, rgb(217 230 242 / 78%) 78%);
  animation: login-rise .85s cubic-bezier(.2, .8, .2, 1) both;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.login-brand img {
  display: block;
  width: min(248px, 100%);
  height: auto;
  max-height: 28px;
  object-fit: contain;
  object-position: left center;
  background: none;
}
.login-title {
  margin: 18px 0 0;
  font-family: Sora, Figtree, sans-serif;
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.04em;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgb(255 255 255 / 55%);
}
.login-lead {
  margin: 12px 0 0;
  max-width: 22rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: rgb(11 33 64 / 78%);
  text-shadow: 0 1px 0 rgb(255 255 255 / 45%);
}
.login-panel {
  display: flex;
  align-items: center;
  background: var(--login-paper);
  border-left: 1px solid rgb(11 33 64 / 8%);
}
.login-panel-inner {
  width: 100%;
  padding: 40px 40px 48px;
  animation: login-rise .7s .12s cubic-bezier(.2, .8, .2, 1) both;
}
.login-panel-title {
  margin: 0;
  font-family: Sora, Figtree, sans-serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--login-ink);
}
.login-panel-lead {
  margin: 6px 0 22px;
  color: #5a6b7c;
  font-size: 15px;
}
.login-form { display: grid; gap: 0; }
.login-form label {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--login-ink);
}
.login-form label:first-of-type { margin-top: 0; }
.login-form input[type=email],
.login-form input[type=password],
.login-form input[type=text] {
  height: 46px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
  color: var(--login-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-form input:focus {
  outline: none;
  border-color: var(--login-navy);
  box-shadow: 0 0 0 3px rgb(11 33 64 / 12%);
}
.login-code {
  letter-spacing: .42em;
  text-align: center;
  font-family: Sora, Figtree, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}
.login-pass { position: relative; }
.login-pass input { padding-right: 44px; }
.login-pass-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #5a6b7c;
  cursor: pointer;
  border-radius: 8px;
}
.login-pass-toggle:hover { background: rgb(11 33 64 / 6%); color: var(--login-navy); }
.login-pass-toggle .ico { width: 18px; height: 18px; }
.login-form .btn {
  margin-top: 20px;
  height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--login-navy);
  font-family: Sora, Figtree, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background .15s ease, transform .15s ease;
}
.login-form .btn:hover {
  background: #163761;
  transform: translateY(-1px);
}
.login-form .btn:active { transform: none; }
.login-version {
  margin: 28px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: #7a8a9a;
}
.field-link { margin: 10px 0 0; font-size: 13px; }
.field-link a, .login-wrap .text-link { color: var(--login-navy); font-weight: 600; }
.field-link a:hover, .login-wrap .text-link:hover { text-decoration: underline; }
.login-split {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: #7a8a9a;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.login-split::before,
.login-split::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d5dee8;
}
.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #cfd8e3;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  color: var(--login-ink);
  transition: background .15s ease, border-color .15s ease;
}
.btn-sso:hover { background: #eaf1f8; border-color: #b7c5d4; }
.btn-sso .ico { width: 18px; height: 18px; color: var(--login-navy); }
.login-back { margin: 20px 0 0; font-size: 14px; }
.login-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e7f3e8;
  color: #1f5c2e;
  font-size: 13px;
}
.login-wrap .alert {
  margin: 0 0 16px;
  border: 1px solid #f0c7c7;
}
@keyframes login-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes login-cloud {
  from { transform: translateX(-8%); }
  to { transform: translateX(18%); }
}
@keyframes login-air {
  0%, 100% { transform: translate(0, 0); opacity: .28; }
  50% { transform: translate(14px, -18px); opacity: .55; }
}
@keyframes login-sun {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@media (max-width: 900px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }
  .login-stage { min-height: 38vh; }
  .login-stage-copy {
    min-height: 38vh;
    justify-content: flex-end;
    padding: 28px 24px 22px 24px;
    max-width: none;
    background: linear-gradient(180deg, transparent 8%, rgb(217 230 242 / 82%) 70%);
  }
  .login-brand img { width: min(200px, 72vw); max-height: 24px; }
  .login-title { font-size: 1.45rem; margin-top: 16px; }
  .login-lead { font-size: .95rem; }
  .login-panel { border-left: 0; align-items: stretch; }
  .login-panel-inner { padding: 28px 24px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-sun, .login-cloud--a, .login-cloud--b,
  .login-air--a, .login-air--b, .login-air--c,
  .login-stage-copy, .login-panel-inner {
    animation: none;
  }
}
.muted { color: var(--slate-11); font-size: 13px; }
.alert { background: #fee2e2; color: #991b1b; padding: 8px 10px; border-radius: 8px; font-size: 13px; }

.settings { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.snav { padding: 0; }
.snav-group { margin-bottom: 16px; }
.snav-title {
  font-size: 12px; font-weight: 500; color: var(--slate-11); padding: 4px 8px 6px;
  text-transform: none; letter-spacing: 0;
}
.snav a { display: flex; align-items: center; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 14px; color: var(--slate-11); }
.snav a.active { background: var(--n-alpha-2); color: var(--slate-12); font-weight: 500; }
.snav a:hover { background: var(--n-alpha-2); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: var(--slate-3); color: var(--slate-12); }
.badge.green { background: #d1fae5; color: #065f46; }
.badge.gray { background: var(--slate-3); color: var(--slate-12); }
.empty { padding: 48px 24px; text-align: center; color: var(--slate-11); }
.empty-chat { display: grid; place-items: center; height: 100%; gap: 8px; }

.profile-menu { position: relative; width: 100%; overflow: visible; }
.profile-menu > summary { list-style: none; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu > summary:hover { background: var(--n-alpha-2); }
.profile-pop {
  position: absolute; left: 8px; bottom: calc(100% + 6px); width: 20rem;
  background: var(--n-solid); border: 1px solid var(--n-weak); border-radius: 12px;
  box-shadow: var(--shadow); padding: 4px; z-index: 50;
  overflow: visible;
}
.profile-pop-head {
  padding: 8px 10px 6px; font-size: 12px; color: var(--slate-11);
  border-bottom: 1px solid var(--n-weak); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-pop a,
.profile-pop button,
.profile-pop details > summary {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  color: var(--slate-12); font-size: 14px; line-height: 1.25;
}
.profile-pop a:hover,
.profile-pop button:hover,
.profile-pop details > summary:hover { background: var(--n-alpha-2); }
.profile-pop details > summary::-webkit-details-marker { display: none; }
.profile-pop details > summary::marker { display: none; content: ''; }
.profile-pop .ico { width: 16px; height: 16px; flex-shrink: 0; color: var(--slate-11); }
.profile-pop form { margin: 0; }
.profile-pop form button { color: var(--slate-12); font-weight: 400; }
.profile-status {
  padding: 4px 0 8px; margin-bottom: 4px;
  border-bottom: 1px solid var(--n-weak);
}
.profile-status-label {
  padding: 4px 10px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .02em; text-transform: uppercase; color: var(--slate-11);
}
.profile-status-btn { justify-content: flex-start; }
.profile-status-btn.is-on { background: var(--n-alpha-2); font-weight: 600; }
.status-pip {
  width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--n-solid);
}
.kv .ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

.people { display: grid; }
.person {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--slate-3);
}
.person .avatar { width: 32px; height: 32px; font-size: 12px; }

.agent-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.agent-person-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-avatar { overflow: hidden; }
.agent-avatar .dot {
  position: absolute; right: 0; bottom: 0; width: 10px; height: 10px;
  border-radius: 999px; border: 2px solid var(--n-surface, var(--n-background));
  background: #12a594;
}
.agent-avatar.status-busy .dot,
.agent-avatar.status-away .dot { background: #f59e0b; }
.agent-avatar.status-meeting .dot { background: #7c5cff; }
.agent-avatar.status-offline .dot { background: #94a3b8; }
.agent-avatar.status-online .dot { background: #12a594; }

/* Contacts — sidebar list */
.cw {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0; background: var(--n-surface);
}
.cw-head { position: sticky; top: 0; z-index: 20; padding: 0 24px; background: var(--n-surface); }
.cw-head-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; max-width: 64rem; margin: 0 auto; padding: 24px 0;
}
.cw-title { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.01em; min-width: 0; }
.cw-head-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.cw-search {
  position: relative; display: flex; align-items: center; width: 280px;
}
.cw-search .ico {
  position: absolute; left: 8px; width: 16px; height: 16px; color: var(--slate-11); pointer-events: none;
}
.cw-search input,
.cw-search input[type=search] {
  height: 32px; padding: 4px 10px 4px 32px; width: 100%;
  border: 0 !important; background: var(--n-alpha-2); border-radius: 8px;
  box-shadow: none;
}
.cw-search input:focus,
.cw-search input[type=search]:focus {
  outline: none; border: 0 !important; box-shadow: none;
}
.cw-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn.xs { width: 24px; height: 24px; }
.icon-btn.xs .ico { width: 14px; height: 14px; }
.cw-vdiv { width: 1px; height: 16px; background: var(--n-strong); }
.cw-menu { position: relative; }
.cw-pop {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 40;
  min-width: 208px; padding: 6px;
  background: var(--n-solid); border: 1px solid var(--n-weak); border-radius: 12px;
  box-shadow: var(--shadow);
}
.cw-pop button, .cw-pop a {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  color: var(--slate-12); font-size: 14px; cursor: pointer; text-align: left;
}
.cw-pop button:hover, .cw-pop a:hover { background: var(--n-alpha-2); }
.cw-pop .ico { width: 16px; height: 16px; color: var(--slate-11); }
.cw-pop-sort { width: 288px; padding: 16px; display: grid; gap: 16px; }
.cw-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cw-pop-row > span { font-size: 14px; color: var(--slate-12); }
.cw-select { display: grid; min-width: 140px; border: 1px solid var(--n-weak); border-radius: 8px; overflow: hidden; }
.cw-select a { padding: 6px 10px; font-size: 13px; border-radius: 0; }
.cw-select a.on { background: var(--n-alpha-2); font-weight: 500; }
.icon-btn:disabled { opacity: .45; cursor: default; }
.icon-btn.is-disabled { opacity: .35; pointer-events: none; }
.cw-body { flex: 1; overflow: auto; padding: 0 24px 24px; }
.cw-body-inner { max-width: 64rem; margin: 0 auto; }
.cw-list { display: flex; flex-direction: column; gap: 16px; }
.cw-card {
  outline: 1px solid var(--n-container); outline-offset: -1px;
  border-radius: 12px; background: var(--n-solid);
}
.cw-card-row {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px;
}
.cw-avatar {
  width: 42px; height: 42px; font-size: 16.8px; font-weight: 500;
  border-radius: 12px; overflow: hidden;
  outline: 1px solid rgb(0 0 0 / 3%); outline-offset: -1px;
}
.cw-avatar img, .cw-avatar-lg img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}
.cw-card-main { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.cw-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cw-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.cw-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.cw-card-name { font-size: 16px; font-weight: 500; color: var(--slate-12); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-company { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--slate-11); }
.cw-company .ico { width: 16px; height: 16px; color: var(--slate-10); }
.cw-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--slate-11); }
.cw-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18rem; }
.cw-sep { width: 1px; height: 12px; background: var(--slate-6); flex-shrink: 0; max-width: none !important; }
.cw-link { color: var(--n-brand); font-size: 12px; font-weight: 500; }
.cw-link:hover { text-decoration: underline; }
.cw-expand { flex-shrink: 0; }
.cw-card.is-link { cursor: pointer; }
.cw-card.is-link:hover { background: var(--n-alpha-2); }
.cw-meta-ico { display: inline-flex; align-items: center; gap: 6px; }
.cw-meta-ico .ico { width: 14px; height: 14px; color: var(--slate-10); }
.cw-card-edit { padding: 0 24px 24px; border-top: 1px solid var(--n-strong); }
.cw-card-edit form { padding-top: 24px; display: grid; gap: 16px; }
.cw-form { display: flex; flex-direction: column; gap: 24px; }
.cw-form-block { display: flex; flex-direction: column; gap: 8px; }
.cw-form-title { display: block; padding: 4px 0; font-size: 14px; font-weight: 500; }
.cw-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cw-form input, .cw-form select, .cw-form textarea {
  height: 32px; padding: 4px 12px; margin: 0;
  background: var(--n-alpha-2); border: 0; box-shadow: none;
}
.cw-form textarea { height: auto; min-height: 72px; padding: 8px 12px; resize: vertical; }
.cw-form input:focus, .cw-form select:focus, .cw-form textarea:focus {
  outline: 2px solid rgb(39 129 246 / 25%);
}
.cw-form.is-details input, .cw-form.is-details select {
  background: var(--n-alpha-2);
}
.cw-social { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-social-chip {
  display: flex; align-items: center; gap: 8px; height: 32px;
  padding: 0 8px; border-radius: 8px; background: var(--n-alpha-2); margin: 0;
  font-weight: 400;
}
.ico-fill { fill: currentColor; stroke: none !important; }
.cw-social-chip .ico.ico-fill { color: #25D366; }
.cw-social-chip input {
  width: auto; min-width: 100px; height: 28px; padding: 0;
  background: transparent !important; border: 0 !important; outline: none !important; box-shadow: none !important;
}
.cw-delete { padding: 16px 0 8px; border-top: 1px solid var(--n-strong); margin-top: 8px; }
.btn-link {
  background: none; border: 0; padding: 0; color: var(--n-brand);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-link.ruby { color: #ca244d; }
.btn-link:hover { text-decoration: underline; }
.cw-foot {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 12px 24px; border-top: 1px solid var(--n-weak);
  background: var(--n-surface); color: var(--slate-11); font-size: 14px; flex-shrink: 0;
}
.cw-foot::before {
  content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px;
  background: linear-gradient(to top, var(--n-surface), transparent); pointer-events: none;
}
.cw-pager { display: flex; align-items: center; gap: 8px; }
.cw-page-num {
  padding: 2px 12px; border-radius: 6px;
  background: rgb(0 0 0 / 3%); color: var(--slate-12); font-variant-numeric: tabular-nums;
}
.cw-page-of { color: var(--slate-11); }
.cw-flash {
  background: #e8f4ff; color: #0b3265; padding: 8px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 13px;
}
.cw-flash.is-error { background: #fee2e2; color: #991b1b; }
.cw-empty { position: relative; min-height: 28rem; }
.cw-empty-back { display: grid; gap: 16px; opacity: .45; pointer-events: none; }
.cw-empty-copy {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding-bottom: 80px; gap: 12px;
  background: linear-gradient(to top, var(--n-surface) 25%, transparent);
  text-align: center;
}
.cw-empty-copy h2 { margin: 0; font-size: 30px; font-weight: 500; }
.cw-empty-copy p { margin: 0; max-width: 36rem; font-size: 16px; color: var(--slate-11); }
.cw-empty-text { text-align: center; padding: 80px 24px; color: var(--slate-11); font-size: 16px; }
.cw-dialog {
  width: min(48rem, calc(100vw - 32px));
  border: 0; border-radius: 16px; padding: 24px;
  background: var(--n-solid); color: var(--slate-12); box-shadow: var(--shadow);
}
.cw-dialog-sm { width: min(28rem, calc(100vw - 32px)); }
#dlg-msg-to-kanban {
  max-height: min(90vh, 720px);
  overflow: auto;
}
.kb-stage-picker { position: relative; display: grid; gap: 8px; }
.kb-stage-picker-trigger {
  width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--n-weak, #2a2f3a); background: var(--n-solid, #0f1117);
  color: var(--slate-12, #fff); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.kb-stage-picker-trigger:focus,
.kb-stage-picker.is-open .kb-stage-picker-trigger {
  outline: none; border-color: var(--n-brand, #2781f6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--n-brand, #2781f6) 28%, transparent);
}
.kb-stage-picker-swatch {
  width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0;
  background: var(--pipe-color, #2781f6);
}
.kb-stage-picker-swatch[hidden] { display: none !important; }
.kb-stage-picker-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-stage-picker-caret { opacity: .65; font-size: 12px; margin-left: auto; }
.kb-stage-picker.is-open .kb-stage-picker-caret { transform: rotate(180deg); }
.kb-stage-picker-menu {
  position: static;
  max-height: min(280px, 42vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--n-weak, #2a2f3a);
  background: #12151c;
}
.kb-stage-picker-menu[hidden] { display: none !important; }
.kb-stage-picker-group { margin: 4px 0 8px; padding: 4px 0 2px; border-left: 3px solid var(--pipe-color, #2781f6); }
.kb-stage-picker-group:last-child { margin-bottom: 2px; }
.kb-stage-picker-group-label {
  padding: 4px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--pipe-color, #60a5fa);
}
.kb-stage-picker-option {
  display: block; width: 100%; border: 0; background: transparent; cursor: pointer;
  text-align: left; padding: 8px 12px; border-radius: 6px; margin: 0 2px;
  color: #e5e7eb; font: inherit; font-size: 14px;
}
.kb-stage-picker-option:hover,
.kb-stage-picker-option.is-active {
  background: color-mix(in srgb, var(--pipe-color, #2781f6) 22%, transparent);
  color: #fff;
}
.cw-dialog::backdrop { background: rgb(0 0 0 / 32%); }
.cw-dialog h2 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.cw-dialog-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; gap: 12px;
}
.cw-detail { flex-direction: row; overflow: hidden; }
.cw-detail-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.cw-detail .cw-head { position: static; flex-shrink: 0; }
.cw-detail-head { max-width: 40.625rem; width: 100%; padding-top: 28px; padding-bottom: 28px; }
.cw-detail .cw-head-actions { gap: 8px; }
.cw-detail .cw-body { display: flex; justify-content: center; }
.cw-detail-inner { width: 100%; max-width: 40.625rem; display: flex; flex-direction: column; gap: 32px; padding: 16px 0 24px; }
.cw-detail-inner > form { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.cw-crumb { display: flex; align-items: center; gap: 0; min-width: 0; font-size: 14px; color: var(--slate-11); font-weight: 500; }
.cw-crumb a { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-crumb a:hover { color: var(--slate-12); }
.cw-crumb .ico { width: 16px; height: 16px; margin: 0 8px; flex-shrink: 0; color: var(--slate-11); }
.cw-crumb-now { color: var(--slate-12); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-profile { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cw-profile-meta { display: flex; flex-direction: column; gap: 4px; }
.cw-profile h2 { margin: 0; font-size: 16px; font-weight: 500; }
.cw-profile-lines { display: flex; flex-direction: column; gap: 6px; }
.cw-profile-lines span { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--slate-11); }
.cw-profile-lines .ico { width: 16px; height: 16px; color: var(--slate-10); flex-shrink: 0; }
.cw-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cw-tags .cw-pop { left: 0; right: auto; }
.cw-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px;
  border-radius: 6px; background: var(--n-alpha-2); font-size: 13px; color: var(--slate-12); margin: 0;
}
.cw-tag i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; display: inline-block; }
.cw-tag.is-smooth {
  background: transparent; border: 1px solid var(--n-strong, var(--slate-6)); color: var(--slate-11);
}
.cw-tag.is-smooth i { width: 12px; height: 12px; border-radius: 2px; }
.cw-tag.is-hover-x button {
  width: 0; overflow: hidden; opacity: 0; pointer-events: none;
  transition: width .2s ease, opacity .2s ease;
}
.cw-tag.is-hover-x:hover button { width: 16px; opacity: 1; pointer-events: auto; }
.cw-pop-labels { min-width: 220px; max-height: 220px; overflow: auto; }
.cw-menu.is-composer-labels > .cw-pop.cw-pop-labels.is-composer {
  left: 0; right: auto; top: auto; bottom: calc(100% + 8px); z-index: 1000;
}
.cw-pop.is-above {
  top: auto; bottom: calc(100% + 4px);
}
.cw-pop.is-fixed {
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  z-index: 1000 !important;
}
.cw-pop-head { font-size: 13px; font-weight: 500; color: var(--slate-12); margin: 0 2px 6px; }
.cw-pop-labels input[type=search] {
  height: 28px; margin: 0 0 6px; padding: 4px 8px;
  background: var(--n-alpha-2); border: 0; width: 100%;
}
.cw-pop-labels form button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px;
}
.cw-label-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 1px 2px;
  border-radius: 8px;
  transition: background .12s ease;
}
.cw-label-row:hover,
.cw-label-row:focus-within { background: var(--n-alpha-2); }
.cw-label-row [data-label-submit] {
  min-width: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  overflow: hidden;
}
.cw-label-edit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--n-weak);
  border-radius: 6px;
  background: var(--n-alpha-2);
  color: var(--slate-11);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}
.cw-label-edit-btn .ico { width: 14px; height: 14px; }
.cw-label-row:hover .cw-label-edit-btn,
.cw-label-edit-btn:hover {
  background: var(--slate-4);
  border-color: var(--slate-7);
  color: var(--slate-12);
}
.cw-label-edit-btn:focus-visible {
  outline: 2px solid var(--n-brand);
  outline-offset: 1px;
}
.cw-label-edit-btn:active { transform: scale(0.96); }
.cw-label-edit-panel {
  border-top: 1px solid var(--n-weak); margin-top: 6px; padding-top: 8px;
  display: grid; gap: 8px;
}
.cw-label-edit-label {
  font-size: 12px; color: var(--slate-11); margin: 0;
}
.cw-label-edit-panel input[type=text] {
  height: 32px; padding: 0 10px; border: 1px solid var(--n-weak); border-radius: 8px;
  background: var(--n-alpha-2); color: var(--slate-12); width: 100%;
}
.cw-label-edit-color input[type=color] {
  width: 100%; height: 36px; padding: 2px; border: 1px solid var(--n-weak);
  border-radius: 8px; background: var(--n-alpha-2); cursor: pointer;
}
.cw-label-edit-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px;
}
.cw-label-edit-error { margin: 0; font-size: 12px; color: var(--ruby-11, #e5484d); }
.cw-label-opt { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.cw-label-opt .nav-dot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 999px; outline: 1px solid var(--n-weak); }
.cw-label-opt [data-label-name] {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.2;
}
.cw-label-check { flex-shrink: 0; color: var(--slate-11); font-size: 12px; }
.cw-label-create { border-top: 1px solid var(--n-weak); margin-top: 4px; padding-top: 4px; }
.cw-label-create button { justify-content: flex-start !important; color: var(--slate-11); }
.conv-labels {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; overflow: hidden; height: 22px; margin-top: 2px;
}
.conv-labels span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--slate-10); white-space: nowrap; flex-shrink: 0;
}
.conv-labels i { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.conv-labels-more { color: var(--slate-11); font-size: 12px; flex-shrink: 0; }
.conv-kanban {
  display: flex; align-items: center; gap: 6px;
  min-width: 0; overflow: hidden; margin-top: 4px;
}
.conv-kanban-pill {
  display: inline-flex; align-items: center; max-width: 46%;
  height: 20px; padding: 0 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pill, #22c55e) 55%, transparent);
  color: var(--pill, #22c55e);
  background: color-mix(in srgb, var(--pill, #22c55e) 12%, transparent);
  font-size: 11px; font-weight: 500; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-kanban-sep {
  flex-shrink: 0; color: var(--slate-10); font-size: 12px; opacity: .8;
}
.lbl-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.lbl-toolbar .cw-search { width: 240px; }
.lbl-toolbar .muted { margin-right: auto; }
.lbl-table th:last-child, .lbl-table td:last-child { text-align: right; }
.lbl-color { display: inline-flex; align-items: center; gap: 8px; }
.lbl-color i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--n-weak); }
.lbl-actions { display: flex; justify-content: flex-end; gap: 4px; }
.lbl-actions form { margin: 0; }
.lbl-color-row { display: flex; align-items: center; gap: 12px; }
.lbl-color-row input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--n-weak); border-radius: 8px; }
.lbl-check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 16px 0; }
.lbl-check input { width: auto; }
.team-name-cell { display: inline-flex; align-items: center; gap: 10px; }
.team-avatar {
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; place-content: center;
  font-size: 11px; font-weight: 650; line-height: 1; overflow: hidden; text-align: center;
  background: color-mix(in srgb, var(--n-brand) 22%, transparent); color: var(--n-brand);
}
.team-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.team-avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.team-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.team-avatar-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; }
.team-avatar-actions { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.team-avatar-actions .profile-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-tag button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--slate-11); display: grid; place-items: center; }
.cw-tag .ico { width: 12px; height: 12px; }
.cw-add-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border: 0; border-radius: 6px; background: transparent; color: var(--slate-11);
  outline: 1px dashed var(--slate-6); cursor: pointer; font-size: 14px;
}
.cw-add-tag:hover { background: var(--n-alpha-2); }
.cw-add-tag .ico { width: 14px; height: 14px; }
.cw-avatar-lg {
  width: 72px; height: 72px; font-size: 24px; font-weight: 500;
  border-radius: 16px; overflow: hidden;
  outline: 1px solid rgb(0 0 0 / 3%); outline-offset: -1px;
}
.cw-phone {
  display: flex; align-items: center; height: 32px; padding: 0 4px 0 8px; gap: 6px;
  background: var(--n-alpha-2); border-radius: 8px;
}
.cw-phone-cc {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 13px; color: var(--slate-12); padding-right: 8px;
  border-right: 1px solid var(--n-strong); white-space: nowrap;
}
.cw-phone-cc b { font-weight: 500; }
.cw-phone-cc .ico { width: 12px; height: 12px; color: var(--slate-11); }
.cw-phone input {
  flex: 1; min-width: 0; height: 28px !important; padding: 0 8px !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.cw-danger { padding-top: 24px; border-top: 1px solid var(--n-strong); display: grid; gap: 8px; }
.cw-danger h3 { margin: 0; font-size: 16px; font-weight: 500; }
.cw-danger p { margin: 0; font-size: 14px; color: var(--slate-11); }
.cw-detail-side {
  display: flex; flex-direction: column;
  width: 100%; max-width: 28rem; min-width: 13rem;
  border-left: 1px solid var(--n-weak); background: var(--n-solid);
}
.cw-tabs { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.cw-tabbar {
  display: flex; align-items: center; height: 32px; margin: 24px 24px 12px;
  padding: 0; border-radius: 8px; background: var(--n-alpha-2); position: relative;
}
.cw-tabbar button {
  flex: 1; height: 32px; border: 0; background: transparent; color: var(--slate-10);
  font-size: 13px; border-radius: 8px; cursor: pointer; position: relative; z-index: 1;
  padding: 0 8px; white-space: nowrap;
}
.cw-tabbar button:hover { color: var(--n-brand); }
.cw-tabbar button.on {
  background: var(--n-solid); color: var(--n-brand);
  box-shadow: var(--shadow-sm); outline: 1px solid var(--n-container);
}
.cw-tabpanes { flex: 1; overflow: auto; min-height: 0; }
.cw-side-empty { margin: 0; padding: 40px 24px; text-align: center; font-size: 14px; line-height: 1.6; color: var(--slate-11); }
.cw-hist { display: grid; }
.cw-hist-item {
  display: flex; justify-content: space-between; gap: 8px; padding: 12px 24px;
  border-bottom: 1px solid var(--n-strong); font-size: 14px;
}
.cw-hist-item:hover { background: var(--n-alpha-2); }
.cw-note-form { padding: 0 24px 8px; display: grid; gap: 8px; }
.cw-note-form textarea {
  min-height: 96px; background: transparent; border: 0; resize: vertical; padding: 8px 0;
}
.cw-note-form .btn-link { justify-self: end; }
.cw-notes { padding: 0 24px 24px; display: grid; gap: 16px; }
.cw-note { display: grid; gap: 4px; padding: 16px 0; border-top: 1px solid var(--n-strong); }
.cw-note p { margin: 0; font-size: 14px; }
.cw-merge { padding: 8px 24px 24px; display: grid; gap: 16px; }
.cw-merge > .muted { margin: 0; font-size: 14px; line-height: 1.5; }
.cw-merge-row label { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; font-weight: 400; }
.cw-merge-row em {
  font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 6px;
  background: var(--n-alpha-2); color: #008573;
}
.cw-merge-row em.ruby { color: #ca244d; }
.cw-merge-card {
  display: flex; align-items: center; gap: 8px; height: 60px; padding: 12px;
  border: 1px solid var(--n-strong); border-radius: 12px;
}
.cw-merge-arrows { display: flex; justify-content: center; gap: 12px; height: 32px; }
.cw-merge-arrows span { width: 1px; height: 100%; background: var(--n-strong); position: relative; }
.cw-merge-arrows span::before {
  content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-bottom-color: var(--n-strong); border-top: 0;
}

.toolbar { margin-bottom: 16px; }
.hc { min-height: 100%; background: var(--n-background); }
.hc-hero { background: rgb(39 129 246 / 5%); text-align: center; padding: 56px 24px 40px; }
.hc-hero img { height: 32px; }
.hc-hero h1 { margin: 16px 0 8px; font-size: 28px; font-weight: 500; }
.hc-hero p { margin: 0; color: var(--slate-11); }
.hc-list { max-width: 720px; margin: -12px auto 40px; padding: 0 24px; display: grid; gap: 12px; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 16px; border-bottom: 1px solid var(--n-weak); flex-shrink: 0;
}
.panel-head span { font-size: 14px; font-weight: 500; color: var(--slate-12); }
.panel-body { overflow: auto; flex: 1; padding: 0; }
.contact-hero { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 8px; padding: 16px; }
.contact-hero b { font-size: 16px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.contact-name-row { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.contact-name-row b { flex: 1; }
.contact-name-tools { display: flex; align-items: center; gap: 8px; color: var(--slate-10); flex-shrink: 0; }
.contact-name-tools a { color: inherit; display: grid; place-items: center; }
.contact-name-tools .ico { width: 14px; height: 14px; }
.contact-erp-id {
  width: 100%;
  margin-top: -2px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--slate-11);
  font-variant-numeric: tabular-nums;
}
.cinfo { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.cinfo-row {
  display: flex; align-items: center; gap: 8px; min-height: 20px;
  font-size: 14px; color: var(--slate-11); text-decoration: none; width: 100%; min-width: 0;
}
.cinfo-row .ico { width: 14px; height: 14px; flex-shrink: 0; }
.cinfo-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cinfo-row .is-empty { color: var(--slate-11); }
.contact-company-card {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 10px; text-decoration: none;
  background: var(--n-alpha-2); outline: 1px solid var(--n-weak); outline-offset: -1px;
  transition: background .15s ease;
}
.contact-company-card:hover { background: var(--n-alpha-3); }
.contact-company-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.contact-company-top {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 14px; font-weight: 500; color: var(--slate-12);
}
.contact-company-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.contact-company-top .ico { width: 12px; height: 12px; color: var(--slate-10); flex-shrink: 0; }
.contact-company-meta {
  font-size: 12px; color: var(--slate-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-company-foot {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--slate-10);
}
.contact-company-dot { width: 3px; height: 3px; border-radius: 999px; background: var(--slate-8); flex-shrink: 0; }
.cacts { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.cacts form { margin: 0; }
.cact {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: var(--n-alpha-2); color: var(--slate-12);
  display: grid; place-items: center; cursor: pointer; text-decoration: none;
}
.cact:hover { filter: brightness(1.08); }
.cact .ico { width: 16px; height: 16px; }
.cact.ruby { background: color-mix(in srgb, #e5484d 22%, transparent); color: #ff9592; }
.acc-list { display: flex; flex-direction: column; gap: 12px; padding: 0 8px 32px; }
.acc { margin: 0; }
.acc > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 16px; border-radius: 8px; background: var(--slate-2);
  outline: 1px solid var(--n-weak); cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--slate-12); user-select: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc[open] > summary { border-radius: 8px 8px 0 0; }
.acc-body { outline: 1px solid var(--n-weak); border-top: 0; border-radius: 0 0 8px 8px; padding: 12px 8px 16px; }
.acc-toggle { display: grid; place-items: center; width: 16px; flex-shrink: 0; }
.acc .acc-ico { width: 16px; height: 16px; color: var(--n-brand); }
.acc:not([open]) .acc-minus { display: none; }
.acc[open] .acc-plus { display: none; }
.cfield { margin: 0 0 12px; }
.cfield > span, .cfield-head span { display: block; font-size: 13px; color: var(--slate-11); margin-bottom: 6px; }
.cfield-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cfield-head .btn-link { font-size: 12px; }
.cfield select, .acc-body select, .acc-body textarea, .acc-body input[type=text], .acc-body input[type=number], .acc-body input[type=datetime-local] {
  width: 100%; margin: 0 0 8px;
}
.contact-attrs-form .cfield { margin-bottom: 10px; }
.contact-attrs-form .btn { margin-top: 4px; }
.kanban-now {
  background: color-mix(in srgb, #12a594 16%, transparent);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 8px;
}
.kmenu { display: flex; flex-direction: column; gap: 8px; }
.kitem > summary {
  list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--n-weak); border-radius: 16px;
  background: var(--n-solid); cursor: pointer;
}
.kitem > summary::-webkit-details-marker { display: none; }
.kitem > summary > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kitem > summary b { font-size: 14px; font-weight: 600; }
.kitem > summary small { font-size: 12px; color: var(--slate-11); }
.kitem > summary .ico:last-child { width: 16px; height: 16px; color: var(--slate-10); }
.kico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--n-solid-blue); color: var(--n-brand);
}
.kitem[open] > summary { border-radius: 16px 16px 0 0; }
.kitem > form, .kitem > p, .kitem > .sched-row { padding: 8px 12px 12px; border: 1px solid var(--n-weak); border-top: 0; }
.kitem > .sched-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0; font-size: 12px; color: var(--slate-11); }
.kitem > .sched-row + .sched-row, .kitem > .sched-row + form { border-top: 0; }
.kitem > form { border-radius: 0 0 16px 16px; }
.kitem > p { border-radius: 0 0 16px 16px; }
.macro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.macro-list li, .macro-item {
  padding: 10px 12px; border-radius: 10px; background: var(--n-alpha-2); font-size: 13px;
  border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.macro-item:hover { border-color: var(--n-weak); background: var(--n-solid); }
.macro-item-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.macro-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.macro-item-tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.macro-item-tools .icon-ghost.sm { width: 28px; height: 28px; padding: 0; }
.macro-run-form { margin: 0; display: inline-flex; }
.macro-preview { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--n-weak); }
.macro-preview ol { margin: 0; padding-left: 18px; color: var(--slate-11); font-size: 12px; display: grid; gap: 4px; }
.macro-actions-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.macro-actions-edit { display: grid; gap: 8px; margin: 8px 0 12px; }
.macro-actions-edit .macro-action-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: start; }
.macro-action-row .macro-param-input { width: 100%; }
.macro-action-param small { display: block; margin-top: 4px; }
@media (max-width: 720px) {
  .macro-actions-edit .macro-action-row { grid-template-columns: 1fr; }
}
.note-card { padding: 8px 0 12px; border-bottom: 1px solid var(--n-weak); }
.note-card b { font-size: 13px; margin-right: 6px; }
.note-card p { margin: 6px 0 0; font-size: 13px; }
.prev-convs { display: grid; gap: 8px; }
.prev-convs a {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px;
  border-radius: 8px; background: var(--n-alpha-2); text-decoration: none; color: inherit;
}
.prev-convs small { color: var(--slate-11); font-size: 12px; }
.part-assigned {
  list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px;
}
.part-assigned-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 8px; border-radius: 8px; background: var(--n-alpha-2);
}
.part-assigned-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.part-assigned-status {
  font-size: 11px; color: var(--slate-11); flex-shrink: 0;
}
.part-remove-form { margin: 0; flex-shrink: 0; }
.part-self-form { margin: 0 0 8px; }
.part-add { position: relative; margin-top: 4px; }
.part-add-btn {
  display: inline-flex; align-items: center; gap: 6px;
}
.part-add-btn .ico { width: 14px; height: 14px; }
.part-picker {
  left: 0; right: 0; min-width: 260px; max-height: 320px;
  overflow: hidden; display: flex; flex-direction: column;
}
.part-picker-list {
  display: grid; gap: 2px; overflow-y: auto; max-height: 280px; padding: 4px 0;
}
.part-picker-form { margin: 0; }
.part-picker-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; padding: 8px 10px; border-radius: 8px;
  color: var(--slate-12); cursor: pointer; text-align: left;
}
.part-picker-item:hover { background: var(--n-alpha-2); }
.part-picker-meta {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.part-picker-meta b {
  font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.part-picker-meta small { font-size: 11px; color: var(--slate-11); }
.part-picker-empty { padding: 8px 10px; font-size: 12px; margin: 0; }
.part-avatars { display: flex; align-items: center; gap: 4px; margin: 8px 0; }
.part-list { display: grid; gap: 4px; margin-top: 8px; }
.part-list form { margin: 0; }
.part-list button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; padding: 6px 8px; border-radius: 8px;
  color: var(--slate-12); cursor: pointer; text-align: left; font-size: 13px;
}
.part-list button:hover, .part-list button.on { background: var(--n-alpha-2); }
.kv.compact { display: grid; gap: 10px; }
.kv.compact .muted { font-size: 12px; }

.side-switch {
  position: absolute; top: 96px; right: 8px; z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  padding: 6px; gap: 6px;
  background: color-mix(in srgb, var(--n-solid) 90%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--n-weak) 50%, transparent);
  border-radius: 999px; box-shadow: var(--shadow-sm);
}
.side-switch button {
  width: 32px; height: 32px; border: 0; border-radius: 999px;
  background: transparent; color: var(--slate-11); display: grid; place-items: center; cursor: pointer;
}
.side-switch button:hover { background: var(--n-alpha-2); }
.side-switch button.on { background: var(--n-alpha-2); color: var(--slate-12); }
.side-switch .ico { width: 16px; height: 16px; }

.theme-menu { padding: 0 0 4px 24px; display: grid; gap: 2px; }
.theme-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  color: var(--slate-12); font-size: 14px;
}
.theme-menu button:hover { background: var(--n-alpha-2); }
.theme-menu button.on { background: var(--n-alpha-2); font-weight: 500; }
.theme-menu .ico { width: 16px; height: 16px; flex-shrink: 0; color: var(--slate-11); }

html.dark, html.dark body, body.dark {
  --slate-1: #111113;
  --slate-2: #18191b;
  --slate-3: #212225;
  --slate-4: #272a2d;
  --slate-5: #2e3135;
  --slate-8: #5a6169;
  --slate-10: #777b84;
  --slate-11: #b0b4ba;
  --slate-12: #edeeef;
  --n-background: #1c1d20;
  --n-surface: #141517;
  --n-surface-2: #16171a;
  --n-solid: #17171a;
  --n-weak: #1f1f25;
  --n-strong: #2e2d32;
  --n-container: #2a2b31;
  --n-alpha-2: rgb(147 153 176 / 12%);
  --n-solid-blue: #0f3966;
  --n-solid-amber: #383229;
  --n-amber-9: #ef9f27;
  --n-amber-10: #f3b64a;
  --n-amber-12: #ffe7b3;
  color-scheme: dark;
}
html.dark .login-wrap, body.dark .login-wrap {
  --login-paper: #141922;
  --login-ink: #edeeef;
  background: #141922;
}
html.dark .login-panel, body.dark .login-panel {
  background: #141922;
  border-left-color: rgb(255 255 255 / 8%);
}
html.dark .login-panel-title, body.dark .login-panel-title { color: #edeeef; }
html.dark .login-panel-lead, body.dark .login-panel-lead { color: #b0b4ba; }
html.dark .login-form label, body.dark .login-form label { color: #edeeef; }
html.dark .login-form input[type=email],
html.dark .login-form input[type=password],
html.dark .login-form input[type=text],
body.dark .login-form input[type=email],
body.dark .login-form input[type=password],
body.dark .login-form input[type=text] {
  background: #1c212b;
  border-color: #2e3542;
  color: #edeeef;
}
html.dark .login-form input:focus,
body.dark .login-form input:focus {
  border-color: #8ec6ee;
  box-shadow: 0 0 0 3px rgb(142 198 238 / 18%);
}
html.dark .login-form .btn, body.dark .login-form .btn { background: #3d8fd4; }
html.dark .login-form .btn:hover, body.dark .login-form .btn:hover { background: #5ba8e8; }
html.dark .field-link a, html.dark .login-wrap .text-link,
body.dark .field-link a, body.dark .login-wrap .text-link { color: #8ec6ee; }
html.dark .btn-sso, body.dark .btn-sso {
  background: #1c212b;
  border-color: #2e3542;
  color: #edeeef;
}
html.dark .btn-sso:hover, body.dark .btn-sso:hover { background: #252c38; }
html.dark .login-split, body.dark .login-split { color: #7a8494; }
html.dark .login-split::before, html.dark .login-split::after,
body.dark .login-split::before, body.dark .login-split::after { background: #2e3542; }
html.dark .login-pass-toggle, body.dark .login-pass-toggle { color: #b0b4ba; }
html.dark .login-notice, body.dark .login-notice { background: #1a3322; color: #b6e0c0; }
html.dark .cw-avatar, html.dark .cw-avatar-lg,
body.dark .cw-avatar, body.dark .cw-avatar-lg {
  background: var(--dark-bg) !important; color: var(--dark-text) !important;
  outline-color: rgb(255 255 255 / 4%);
}
html.dark .nav .sub a:hover, body.dark .nav .sub a:hover { background: var(--n-alpha-2); }

.cap-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cap-asst-name { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-switch-pop { left: 0; right: auto; min-width: 220px; }
.cap-switch-pop a.on { background: var(--n-alpha-2); font-weight: 500; }
.cap-switch-label { padding: 6px 10px; font-size: 12px; color: var(--slate-11); }
.cap-range select { width: auto; height: 32px; padding: 4px 10px; }
.cap-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; background: var(--n-solid-amber); color: var(--n-amber-12);
  border-radius: 12px; margin-bottom: 16px;
}
.cap-welcome { margin-bottom: 16px; }
.cap-welcome p { margin: 8px 0 0; font-size: 15px; }
.cap-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--n-weak); border: 1px solid var(--n-weak);
  border-radius: 12px; overflow: hidden; margin-bottom: 24px;
}
.cap-metric { background: var(--n-solid); padding: 20px; }
.cap-metric b { font-size: 28px; letter-spacing: -.03em; display: block; margin: 8px 0; }
.cap-metric p { margin: 0; font-size: 12px; color: var(--slate-11); }
.cap-knowledge { margin-bottom: 16px; }
.cap-knowledge h3 { margin: 0 0 16px; font-size: 16px; font-weight: 500; }
.cap-know-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cap-know-row b { font-size: 24px; display: block; }
.cap-know-row span { color: var(--slate-11); font-size: 13px; }
.cap-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cap-links a { display: flex; flex-direction: column; gap: 4px; }
.cap-links b { font-size: 14px; font-weight: 500; }
.cap-links span { font-size: 13px; color: var(--slate-11); }
.cap-empty { text-align: center; padding: 64px 24px; max-width: 36rem; margin: 0 auto; }
.cap-empty h2 { margin: 0 0 8px; font-size: 24px; font-weight: 500; }
.cap-empty p { margin: 0 0 20px; color: var(--slate-11); font-size: 16px; }
.cap-faq .cw-card-name { white-space: normal; }
.cap-faq .cw-card-meta span {
  white-space: normal; max-width: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cap-play { display: flex; flex-direction: column; min-height: calc(100vh - 8rem); }
.cap-play-lead { margin: 0 0 8px; }
.cap-play-thread { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 0; }
.cap-play-form { display: flex; gap: 8px; align-items: center; }
.cap-play-form input[type=text] { flex: 1; width: auto; }
.cap-play-reset { margin-top: 8px; }
.cap-settings { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 32px; align-items: start; }
.cap-settings-nav { display: flex; flex-direction: column; gap: 4px; }
.cap-settings-nav a { padding: 8px 10px; border-radius: 8px; color: var(--slate-11); }
.cap-settings-nav a.active { background: var(--n-alpha-2); color: var(--slate-12); font-weight: 500; }
.cap-settings-body h2 { margin: 0 0 8px; font-size: 16px; font-weight: 500; }
.cap-features { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.cap-features legend { font-weight: 500; margin-bottom: 4px; }
.cap-check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
.cap-check input { width: auto; }
.cap-radio {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px;
  padding: 16px; border: 1px solid var(--n-weak); border-radius: 12px; cursor: pointer; font-weight: 400;
}
.cap-radio.on { outline: 1px solid var(--n-brand); }
.cap-radio input { width: auto; margin-top: 3px; }
.cap-radio small { display: block; font-weight: 400; color: var(--slate-11); margin-top: 4px; }
.cap-hr { border: 0; border-top: 1px solid var(--n-weak); margin: 24px 0; }
.cap-delete { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.cap-delete h3 { margin: 0 0 4px; font-size: 16px; font-weight: 500; }
.flash.err { color: #e54666; margin: 0 0 16px; }

.calls-page { height: 100%; min-height: 0; }
.calls-head { max-width: none; padding: 24px 24px 16px; }
.calls-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 64rem; }
.calls-filters {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--n-weak);
}
.calls-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.calls-all { font-size: 16px; font-weight: 500; color: var(--slate-11); }
.calls-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px;
  border: 1px solid var(--n-weak); border-radius: 8px; background: var(--n-solid);
  color: var(--slate-11); font-size: 13px; cursor: pointer;
}
.calls-chip .ico { width: 14px; height: 14px; }
.calls-chip:hover, .calls-chip.is-active { color: var(--slate-12); background: var(--n-alpha-2); }
.calls-chip.on { border-color: var(--n-brand); color: var(--n-brand); background: var(--n-solid-blue); }
.calls-chip.is-blue { border-color: var(--n-brand); color: var(--n-brand); }
.calls-list { display: flex; flex-direction: column; }
.calls-row {
  display: grid;
  grid-template-columns: 13rem auto minmax(10rem, 1fr) auto 10rem auto 4.5rem;
  align-items: center; gap: 8px 12px;
  padding: 14px 0; border-bottom: 1px solid var(--n-weak);
}
.calls-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.calls-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calls-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 24px; min-width: 5.5rem; padding: 0 6px; border-radius: 6px; font-size: 12px; flex-shrink: 0;
}
.calls-badge .ico { width: 12px; height: 12px; }
.kind-ongoing { background: #ccfbf1; color: #0f766e; }
.kind-incoming, .kind-outgoing { background: var(--slate-3); color: var(--slate-11); }
.kind-missed, .kind-failed { background: #ffe4e8; color: #e54666; }
.kind-no_reply { background: var(--n-solid-amber); color: var(--n-amber-12); }
.calls-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.calls-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calls-actions { display: flex; align-items: center; gap: 6px; }
.calls-audio { width: 11rem; height: 28px; }
.calls-inbox { display: flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 0; color: var(--slate-11); font-size: 14px; }
.calls-inbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calls-inbox .ico { width: 16px; height: 16px; flex-shrink: 0; }
.calls-conv {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border: 1px solid var(--n-weak); border-radius: 6px; color: var(--slate-11); font-size: 12px; flex-shrink: 0;
}
.calls-conv:hover { background: var(--n-alpha-2); }
.calls-conv .ico { width: 14px; height: 14px; }
.calls-when { text-align: right; font-size: 12px; color: var(--slate-11); font-variant-numeric: tabular-nums; }
.calls-pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 0; color: var(--slate-11); }
.calls-pager a { color: var(--n-brand); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
html.dark .kind-ongoing { background: rgb(15 118 110 / 22%); color: #5eead4; }
html.dark .kind-missed, html.dark .kind-failed { background: rgb(229 70 102 / 18%); color: #fda4af; }

.ex-page { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--n-solid); }
.ex-head { padding: 20px 24px 0; flex-shrink: 0; }
.ex-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ex-title-row .ico { width: 20px; height: 20px; color: var(--slate-11); }
.ex-title-row h1 { margin: 0; font-size: 20px; font-weight: 600; }
.ex-lead { margin: 0 0 16px; font-size: 14px; color: var(--slate-11); }
.ex-tabs { display: flex; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--n-weak); }
.ex-tab { padding: 0 0 12px; border: 0; background: none; color: var(--slate-11); font-size: 14px; text-decoration: none; white-space: nowrap; }
.ex-tab.is-on { color: var(--n-brand); border-bottom: 2px solid var(--n-brand); font-weight: 500; }
.ex-subtabs { display: flex; gap: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--n-weak); }
.ex-body { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px 32px; }
.ex-h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.ex-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ex-narrow { max-width: 42rem; }
.ex-card { border: 1px solid var(--n-weak); background: var(--n-solid); border-radius: 12px; padding: 20px; margin: 16px 0; }
.ex-card h3 { margin: 0 0 8px; font-size: 15px; }
.ex-list { display: grid; gap: 8px; margin-bottom: 16px; }
.ex-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--n-weak); border-radius: 12px; padding: 12px 16px; background: var(--n-solid); }
.ex-item-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.ex-grow { flex: 1; min-width: 0; }
.ex-strong { font-weight: 500; }
.ex-empty { text-align: center; padding: 64px 16px; border: 1px solid var(--n-weak); border-radius: 12px; }
.ex-empty .ico { width: 40px; height: 40px; color: var(--slate-10); margin-bottom: 8px; }
.ex-warn { border: 1px solid #f0c000; background: #fff8e1; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.ex-warn code { display: block; font-size: 12px; word-break: break-all; }
.ex-tip { margin-top: 16px; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.ex-table-wrap { overflow-x: auto; border: 1px solid var(--n-weak); border-radius: 12px; }
.ex-table { width: 100%; min-width: 960px; border-collapse: collapse; font-size: 14px; }
.ex-table th { text-align: left; padding: 12px; background: var(--slate-2); color: var(--slate-11); font-weight: 500; }
.ex-table td { padding: 12px; border-top: 1px solid var(--n-weak); }
.ex-table .center { text-align: center; }
.ex-ok { color: #0f766e; }
.ex-pre { background: var(--slate-2); border: 1px solid var(--n-weak); border-radius: 8px; padding: 12px; font-size: 12px; overflow-x: auto; }
.ex-api-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; color: var(--slate-11); }
.ex-method {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 3.6rem; height: 22px; padding: 0 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  border-radius: 6px; text-align: center; flex-shrink: 0;
}
.ex-method.is-get { background: #2781F6; color: #fff; }
.ex-method.is-post { background: #16a34a; color: #fff; }
.ex-method.is-put, .ex-method.is-patch { background: #f59e0b; color: #111; }
.ex-method.is-del { background: #e54666; color: #fff; }
.ex-kicker { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-11); margin: 16px 0 8px; }
.ex-acc { border: 1px solid var(--n-weak); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.ex-acc summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; background: var(--slate-2); }
.ex-acc summary::-webkit-details-marker { display: none; }
.ex-acc summary > .ico,
.ex-acc summary .ico { width: 16px; height: 16px; flex-shrink: 0; color: var(--slate-11); }
.ex-acc .block { display: block; }
.ex-acc-body { border-top: 1px solid var(--n-weak); padding: 8px 0; }
.ex-ep { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13px; }
.ex-ep code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* API docs (Config Extra) */
.ex-docs { display: flex; flex-direction: column; gap: 16px; max-width: 960px; }
.ex-docs-auth {
  border: 1px solid var(--n-weak); border-radius: 12px;
  background: var(--slate-2); padding: 14px 16px;
  display: grid; gap: 8px;
}
.ex-docs-auth-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px;
}
.ex-docs-auth-row code {
  font-size: 12px; color: var(--slate-12);
  background: var(--n-alpha-2); padding: 2px 6px; border-radius: 4px;
}
.ex-docs-groups { display: flex; flex-direction: column; gap: 12px; }
.ex-doc-group {
  border: 1px solid var(--n-weak); border-radius: 12px;
  background: var(--n-solid); overflow: hidden;
}
.ex-doc-group[open] { border-color: color-mix(in srgb, var(--slate-11) 35%, var(--n-weak)); }
.ex-doc-group-sum {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 16px; cursor: pointer; list-style: none;
}
.ex-doc-group-sum::-webkit-details-marker { display: none; }
.ex-doc-group-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-doc-group-text strong { font-size: 15px; font-weight: 600; color: var(--slate-12); }
.ex-doc-group-text span { font-size: 13px; color: var(--slate-11); line-height: 1.35; }
.ex-doc-group-meta {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; margin-top: 2px;
}
.ex-doc-count {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--n-alpha-2); color: var(--slate-11); white-space: nowrap;
}
.ex-doc-chev {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; color: var(--slate-11); flex-shrink: 0;
  transition: transform .15s ease;
}
.ex-doc-chev .ico { width: 16px; height: 16px; display: block; }
.ex-doc-group[open] > .ex-doc-group-sum .ex-doc-chev { transform: rotate(180deg); }
.ex-doc-eps { border-top: 1px solid var(--n-weak); }
.ex-doc-ep { border-top: 1px solid var(--n-weak); }
.ex-doc-ep:first-child { border-top: 0; }
.ex-doc-ep-sum {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(8rem, 0.9fr) auto;
  align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; list-style: none;
}
.ex-doc-ep-sum::-webkit-details-marker { display: none; }
.ex-doc-ep-sum:hover { background: var(--n-alpha-2); }
.ex-doc-path {
  font-size: 13px; color: var(--slate-12); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ex-doc-desc {
  font-size: 13px; color: var(--slate-11); text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ex-doc-ep[open] > .ex-doc-ep-sum .ex-doc-chev { transform: rotate(180deg); }
.ex-doc-ep-body {
  padding: 0 16px 14px;
  display: grid; gap: 10px;
}
.ex-doc-ep-body p { margin: 0; font-size: 13px; color: var(--slate-11); line-height: 1.45; }
.ex-doc-ep-body .ex-pre { margin: 0; }
@media (max-width: 720px) {
  .ex-doc-ep-sum {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "method path chev"
      "desc desc desc";
  }
  .ex-doc-ep-sum .ex-method { grid-area: method; }
  .ex-doc-path { grid-area: path; }
  .ex-doc-desc { grid-area: desc; text-align: left; white-space: normal; }
  .ex-doc-ep-sum .ex-doc-chev { grid-area: chev; }
}
.ex-form { display: grid; gap: 16px; }
.ex-form label { display: grid; gap: 6px; font-size: 14px; color: var(--slate-11); }
.ex-form input, .ex-form select, .ex-form textarea { width: 100%; max-width: none; }
.ex-key-row { display: flex; gap: 8px; align-items: center; }
.ex-key-row input { flex: 1; }
.ex-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.ex-inst { list-style: none; padding: 0; margin: 0; border: 1px solid var(--n-weak); border-radius: 12px; }
.ex-qr { margin-top: 12px; text-align: center; }
.ex-qr img { width: 260px; height: 260px; object-fit: contain; background: #fff; padding: 12px; border-radius: 12px; border: 1px solid var(--n-weak); }
.ex-inst li { display: flex; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--n-weak); }
.ex-inst li:first-child { border-top: 0; }
.ex-upload { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.ex-thumb { width: 64px; height: 64px; border: 1px solid var(--n-weak); border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: var(--n-solid); }
.ex-thumb img { max-width: 56px; max-height: 56px; object-fit: contain; }
.ex-label { font-size: 14px; font-weight: 500; }
.ex-color { width: 40px; height: 40px; padding: 2px; border-radius: 8px; }
.ex-sys { font-size: 10px; font-weight: 700; background: #e0e7ff; color: #4338ca; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.toggle { width: 44px; height: 24px; border: 0; border-radius: 999px; background: var(--slate-5); position: relative; cursor: pointer; padding: 0; flex-shrink: 0; }
.toggle i { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 4px; left: 4px; transition: left .15s; }
.toggle.is-on { background: var(--n-brand); }
.toggle.is-on i { left: 24px; }
.toggle:disabled { opacity: .45; cursor: not-allowed; }

.agent-dlg { width: min(480px, calc(100vw - 24px)); }
.agents-mgmt-tabs { margin: 0 0 14px; }
.agents-mgmt-tabs .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--n-alpha-2); color: inherit;
}
.lbl-table tr.is-disabled-agent { opacity: .78; }
.agent-active-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 14px 0 4px; padding: 12px; border-radius: 10px; background: var(--n-alpha-2);
}
.agent-active-row b { display: block; font-size: 13px; font-weight: 600; }
.agent-active-row small { display: block; margin-top: 2px; font-size: 12px; color: var(--slate-11); line-height: 1.35; }
.agent-active-row.is-disabled { opacity: .65; }
.agent-avatar-edit {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px; border-radius: 12px; background: var(--n-alpha-2);
}
.agent-avatar-preview {
  width: 64px; height: 64px; font-size: 22px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center;
}
.agent-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-avatar-actions { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: 0; }
.agent-avatar-actions .profile-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.agent-avatar-hint { margin: 4px 0 0; font-size: 12px; line-height: 1.35; }
.agent-dlg-tabs {
  display: flex; gap: 16px; margin: 4px 0 14px;
  border-bottom: 1px solid var(--n-weak);
}
.agent-dlg-tab {
  border: 0; background: none; padding: 0 0 10px; cursor: pointer;
  color: var(--slate-11); font: inherit; font-size: 14px;
}
.agent-dlg-tab.is-on {
  color: var(--n-brand); font-weight: 600;
  border-bottom: 2px solid var(--n-brand); margin-bottom: -1px;
}
.agent-extras-lead { margin: 0 0 12px; font-size: 13px; line-height: 1.4; }
.agent-extras-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.agent-extras-group {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--slate-11); padding: 10px 4px 0;
}
.agent-extras-group:first-child { padding-top: 0; }
.agent-extra-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--n-alpha-2);
  cursor: pointer;
}
.agent-extra-row.is-disabled { opacity: .65; cursor: default; }
.agent-extra-row b { display: block; font-size: 13px; font-weight: 600; }
.agent-extra-row small { display: block; font-size: 11px; color: var(--slate-11); margin-top: 2px; }

.ibox-list { border-top: 1px solid var(--n-weak); }
.ibox-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--n-weak); }
.ibox-row-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ibox-avatar { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--n-strong); background: var(--n-alpha-2); display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--shadow-sm); overflow: hidden; }
.ibox-avatar .ico { width: 22px; height: 22px; color: var(--slate-10); }
.ibox-avatar.lg { width: 64px; height: 64px; border-radius: 999px; }
.ibox-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ibox-avatar-upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ibox-avatar-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ibox-name { font-size: 15px; font-weight: 500; text-transform: capitalize; }
.ibox-row-actions { display: flex; gap: 8px; }
.ibox-del:hover { color: #ca244d; background: #fee2e2; }
.ibox-wizard-page { margin-top: 8px; }
.cw-page .ibox-wizard-page form { max-width: none; }
.ibox-wizard { display: grid; grid-template-columns: 240px minmax(0, 1fr); border: 1px solid var(--n-weak); border-radius: 12px; min-height: 50vh; overflow: hidden; }
.ibox-steps { padding: 32px 24px; border-right: 1px solid var(--n-weak); display: grid; gap: 20px; align-content: start; }
.ibox-step { display: flex; gap: 12px; color: var(--slate-11); font-size: 13px; }
.ibox-step strong { display: block; color: var(--slate-12); font-size: 14px; }
.ibox-step p { margin: 4px 0 0; }
.ibox-step-n { width: 24px; height: 24px; border-radius: 999px; background: var(--slate-3); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.ibox-step.is-on { color: var(--slate-12); }
.ibox-step.is-on .ibox-step-n, .ibox-step.is-done .ibox-step-n { background: var(--n-brand); color: #fff; }
.ibox-wizard-body { min-width: 0; }
.chan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 32px; }
.chan-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px 20px; border: 1px solid var(--n-weak); border-radius: 16px; background: var(--n-solid); text-align: left; }
.chan-card:hover { border-color: var(--n-brand); box-shadow: var(--shadow-sm); }
.chan-card strong { font-size: 15px; }
.chan-card span { font-size: 13px; color: var(--slate-11); }
.chan-ico { width: 36px; height: 36px; display: grid; place-items: center; color: var(--n-brand); }
.chan-ico .ico { width: 28px; height: 28px; }
.ibox-form-wrap { padding: 24px; }
.ibox-form { max-width: 40.625rem; }
.ibox-settings-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.ibox-back { margin: 0 0 8px; }
.ibox-back .ico { width: 14px; height: 14px; vertical-align: -2px; }
.ibox-edit { max-width: 56rem; }
.ibox-edit-title { margin: 0 0 16px; font-size: 28px; font-weight: 620; letter-spacing: -0.02em; }
.ibox-tabs {
  display: flex; gap: 20px; flex-wrap: wrap;
  border-bottom: 1px solid var(--n-weak); margin-bottom: 24px;
}
.ibox-tabs a {
  position: relative; padding: 10px 0; color: var(--slate-11); font-size: 14px; text-decoration: none;
}
.ibox-tabs a:hover { color: var(--slate-12); }
.ibox-tabs a.on { color: var(--n-brand); font-weight: 550; }
.ibox-tabs a.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--n-brand);
}
.ibox-pane { max-width: 44rem; }
.ibox-flash {
  margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; font-size: 13px;
}
.ibox-flash.ok { background: rgba(34,197,94,.12); color: #86efac; }
.ibox-flash.err { background: rgba(239,68,68,.12); color: #fca5a5; }
.ibox-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.ibox-label { font-size: 14px; font-weight: 500; color: var(--slate-12); }
.ibox-help { margin: 4px 0 0; font-size: 12px; color: var(--slate-11); line-height: 1.45; }
.ibox-section { margin: 28px 0; padding-top: 8px; border-top: 1px solid var(--n-weak); }
.ibox-section h3 { margin: 0 0 8px; font-size: 16px; }
.ibox-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.ibox-secret-row { display: flex; gap: 8px; align-items: center; }
.ibox-secret-row input { flex: 1; min-width: 0; }
.ibox-toggle-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 16px;
}
.ibox-radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.ibox-radio-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--n-strong);
  border-radius: 12px; cursor: pointer; background: var(--n-alpha-2);
}
.ibox-radio-card input { margin: 0 0 4px; width: 16px; }
.ibox-radio-card strong { font-size: 14px; color: var(--slate-12); }
.ibox-radio-card span { font-size: 12px; color: var(--slate-11); line-height: 1.4; }
.ibox-radio-card.is-on { border-color: var(--n-brand); box-shadow: inset 0 0 0 1px var(--n-brand); }
.ibox-agent-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px;
  justify-content: space-between;
}
.ibox-agent-list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.ibox-agent-empty { margin: 8px 0; }
.ibox-agent-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 1px solid var(--n-strong); border-radius: 999px; cursor: pointer; font-size: 13px;
  background: var(--n-solid); color: var(--slate-12); user-select: none;
}
.ibox-agent-chip input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.ibox-agent-chip:has(input:checked),
.ibox-agent-chip.is-on {
  border-color: var(--n-brand); background: rgba(31,147,255,.18); color: #fff;
}
.ibox-agent-chip .ibox-agent-check { display: none; width: 14px; height: 14px; }
.ibox-agent-chip:has(input:checked) .ibox-agent-check,
.ibox-agent-chip.is-on .ibox-agent-check { display: grid; place-items: center; }
.ibox-agent-chip .ibox-agent-check .ico { width: 14px; height: 14px; }
.ibox-agent-chip:has(input:not(:checked)) {
  opacity: .55; text-decoration: line-through; border-style: dashed;
}
.ibox-agent-toolbar > .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.ibox-agent-pick {
  display: grid; gap: 6px; max-height: 220px; overflow: auto;
  border: 1px solid var(--n-weak); border-radius: 10px; padding: 8px;
}
.ibox-agent-pick-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer;
}
.ibox-agent-pick-row:hover { background: var(--n-alpha-2); }
.ibox-agent-pick-row input { margin-top: 3px; }
.ibox-agent-pick-row span { display: grid; gap: 2px; }
.ibox-agent-pick-row strong { font-size: 13px; font-weight: 600; }
.ibox-agent-pick-row small { font-size: 12px; color: var(--slate-11); }
.ibox-agent-create { margin-top: 8px; }
.ibox-agent-create-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ibox-agent-create-grid input,
.ibox-agent-create-grid select { width: 100%; }
.ibox-hours { border: 1px solid var(--n-weak); border-radius: 12px; overflow: hidden; }
.ibox-hours-head, .ibox-hours-row {
  display: grid; grid-template-columns: 180px 1fr 120px; gap: 12px; align-items: start;
  padding: 12px 14px; border-bottom: 1px solid var(--n-weak);
}
.ibox-hours-head { font-size: 12px; color: var(--slate-11); background: var(--n-alpha-2); align-items: center; }
.ibox-hours-row:last-child { border-bottom: 0; }
.ibox-hours-day { display: flex; align-items: center; gap: 8px; font-size: 14px; padding-top: 6px; cursor: pointer; }
.ibox-hours-avail { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 32px; }
.ibox-hours-avail .lbl-check { margin: 0; }
.ibox-hours-times { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ibox-hours-times select { width: auto; min-width: 100px; }
.ibox-hours-lunch { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ibox-hours-lunch-times { padding-left: 2px; }
.ibox-hours-row.is-closed .ibox-hours-times,
.ibox-hours-row.is-closed .lbl-check { opacity: .45; }
.ibox-hours-badge { display: flex; justify-content: flex-end; padding-top: 6px; }
.ibox-hours-badge .pill {
  display: inline-flex; padding: 2px 8px; border-radius: 999px; background: rgba(31,147,255,.18);
  color: var(--n-brand); font-size: 12px; font-weight: 600;
}
.ruby-text { color: #f87171 !important; }
.is-hidden { display: none !important; }
@media (max-width: 800px) {
  .ibox-radio-cards { grid-template-columns: 1fr; }
  .ibox-hours-head, .ibox-hours-row { grid-template-columns: 1fr; }
  .ibox-secret-row { flex-wrap: wrap; }
}

@media (max-width: 1100px) {
  .inbox,
  .inbox.is-panel-open,
  html.inbox-panel-open .inbox {
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  }
  .grid.cols-4, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .cap-metrics, .cap-know-row, .cap-links { grid-template-columns: 1fr; }
  .cap-settings { grid-template-columns: 1fr; }
  .cap-delete { flex-direction: column; align-items: flex-start; }
  .calls-row { grid-template-columns: 1fr auto; }
  .calls-inbox, .calls-audio { display: none; }
  .settings { grid-template-columns: 1fr; }
  .cw-head-inner { flex-wrap: wrap; }
  .cw-form-grid { grid-template-columns: 1fr; }
  .cw-search input, .cw-search input[type=search] { width: 160px; }
  .cw-detail-side { display: none; }
  .ibox-wizard { grid-template-columns: 1fr; }
  .ibox-steps { display: none; }
  .chan-grid { grid-template-columns: 1fr 1fr; padding: 16px; }
}

/* Sidebar recolhida — ícones limpos, sem labels/submenus vazando */
html.sb-collapsed .app,
.app.app--sb-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}
html.sb-collapsed .sidebar,
.app.app--sb-collapsed .sidebar {
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  overflow: visible;
}
html.sb-collapsed .brand,
.app.app--sb-collapsed .brand {
  justify-content: center;
  gap: 0;
  padding: 4px 0;
}
html.sb-collapsed .brand-mark,
html.sb-collapsed .brand-name,
html.sb-collapsed .brand-divider,
html.sb-collapsed .sb-search,
html.sb-collapsed .nav span.lbl,
html.sb-collapsed .nav .chev,
html.sb-collapsed .nav .sub,
html.sb-collapsed .nav-subhead,
html.sb-collapsed .sidebar-foot .uname,
.app.app--sb-collapsed .brand-mark,
.app.app--sb-collapsed .brand-name,
.app.app--sb-collapsed .brand-divider,
.app.app--sb-collapsed .sb-search,
.app.app--sb-collapsed .nav span.lbl,
.app.app--sb-collapsed .nav .chev,
.app.app--sb-collapsed .nav .sub,
.app.app--sb-collapsed .nav-subhead,
.app.app--sb-collapsed .sidebar-foot .uname {
  display: none !important;
}
html.sb-collapsed .sb-toggle,
.app.app--sb-collapsed .sb-toggle {
  transform: scaleX(-1);
}
html.sb-collapsed .sb-top,
.app.app--sb-collapsed .sb-top {
  padding: 4px 6px 12px;
}
html.sb-collapsed .sb-compose,
.app.app--sb-collapsed .sb-compose {
  width: 40px; height: 40px; padding: 0; margin: 0 auto; gap: 0;
}
html.sb-collapsed .sb-compose span,
.app.app--sb-collapsed .sb-compose span {
  display: none;
}
html.sb-collapsed .nav,
.app.app--sb-collapsed .nav {
  padding: 0 8px 16px; align-items: stretch;
}
html.sb-collapsed .nav > a,
html.sb-collapsed .nav > details > summary,
.app.app--sb-collapsed .nav > a,
.app.app--sb-collapsed .nav > details > summary {
  justify-content: center;
  padding: 4px 0;
  gap: 0;
}
html.sb-collapsed .nav-alert-dot,
.app.app--sb-collapsed .nav-alert-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  margin: 0;
}
html.sb-collapsed .nav > details,
.app.app--sb-collapsed .nav > details {
  display: block;
}
html.sb-collapsed .sidebar-foot,
.app.app--sb-collapsed .sidebar-foot {
  justify-content: center;
  padding: 8px 4px;
}
html.sb-collapsed .profile-menu > summary.userchip,
.app.app--sb-collapsed .profile-menu > summary.userchip {
  justify-content: center;
  padding: 4px;
}
html.sb-collapsed .profile-pop,
.app.app--sb-collapsed .profile-pop {
  left: calc(100% + 8px);
  right: auto;
  bottom: 0;
  top: auto;
  min-width: 220px;
}

/* —— Relatórios (painel) —— */
.cw-head--wide, .cw-page--wide { max-width: 72rem; }
.cw-page--wide:has(.macro-builder) { max-width: 80rem; }
.rpt { display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }
.rpt-btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  height: 36px; padding: 0 14px; font-size: 14px;
}
.rpt-btn .ico { width: 16px; height: 16px; }
.rpt-live-row {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch;
}
.rpt-live-row > .rpt-card { flex: 1 1 220px; }
.rpt-live-row > .rpt-card--wide { flex: 1.85 1 360px; }
.rpt-card {
  margin: 0; padding: 20px 24px;
  background: var(--n-solid-2, var(--n-solid));
  border: 1px solid var(--n-weak);
  border-radius: 12px;
  color: var(--slate-12);
  min-height: 0;
}
.rpt-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.rpt-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rpt-card-title h2 {
  margin: 0; font-size: 18px; font-weight: 500; color: var(--slate-12);
}
.rpt-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 6px;
  background: color-mix(in srgb, #0d9488 18%, transparent);
  color: #14b8a6; font-size: 12px; font-weight: 500;
}
.rpt-live i {
  width: 4px; height: 4px; border-radius: 50%; background: #14b8a6; display: block;
}
.rpt-metrics { display: flex; gap: 8px 16px; flex-wrap: wrap; width: 100%; }
.rpt-metric { flex: 1 1 0; min-width: 88px; padding-bottom: 4px; }
.rpt-metric-label { display: block; font-size: 14px; color: var(--slate-11); margin-bottom: 4px; }
.rpt-metric-value { display: block; font-size: 30px; font-weight: 500; line-height: 1.15; color: var(--slate-12); }
.rpt-kpi-grid .rpt-metric { flex: 1 1 140px; min-width: 120px; }
.rpt-kpi-grid .rpt-metric small { display: block; margin-top: 4px; font-size: 12px; }
.rpt-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rpt-filters select,
.rpt-entity-form select {
  height: 32px; padding: 0 28px 0 10px; border-radius: 8px;
  border: 0; background: var(--n-alpha-2); color: var(--slate-12);
  font-size: 13px; max-width: 220px;
}
.rpt-empty { margin: 8px 0 0; color: var(--slate-11); font-size: 14px; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rpt-table th {
  text-align: left; font-weight: 500; color: var(--slate-11);
  padding: 10px 8px; border-bottom: 1px solid var(--n-weak);
}
.rpt-table td { padding: 12px 8px; border-bottom: 1px solid var(--n-weak); vertical-align: middle; }
.rpt-table tr:last-child td { border-bottom: 0; }
.rpt-agent { display: flex; align-items: center; gap: 10px; }
.rpt-agent strong { display: block; font-weight: 500; }
.rpt-agent small { color: var(--slate-11); font-size: 12px; }

.rpt-heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }
.rpt-heatmap {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) repeat(24, minmax(18px, 1fr));
  gap: 4px; align-items: center; min-width: 640px;
}
.rpt-heatmap-spacer { grid-column: 1; }
.rpt-heatmap-hours {
  grid-column: 2 / -1; display: grid; grid-template-columns: repeat(24, minmax(18px, 1fr)); gap: 4px;
  color: var(--slate-11); font-size: 11px; text-align: center; margin-bottom: 4px;
}
.rpt-heatmap-label {
  font-size: 12px; color: var(--slate-11); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 8px;
}
.rpt-heatmap-cells {
  grid-column: 2 / -1; display: grid; grid-template-columns: repeat(24, minmax(18px, 1fr)); gap: 4px;
}
.rpt-heat {
  aspect-ratio: 1; border-radius: 3px; border: 1px solid var(--n-weak);
  background: var(--n-alpha-2);
}
.rpt-heat.lvl-0 { background: color-mix(in srgb, var(--slate-2) 70%, transparent); border-color: var(--n-weak); }
.rpt-heat.lvl-1 { background: #1e3a5f; border-color: #234872; }
.rpt-heat.lvl-2 { background: #2563a8; border-color: #2b6cb8; }
.rpt-heat.lvl-3 { background: #2e90fa; border-color: #3b9bff; }
.rpt-heat.lvl-4 { background: #53b1fd; border-color: #84caff; }
.rpt-heat.lvl-5 { background: #84caff; border-color: #b2ddff; }
.rpt-heat.lvl-g1 { background: #134e4a; border-color: #115e59; }
.rpt-heat.lvl-g2 { background: #0f766e; border-color: #0d9488; }
.rpt-heat.lvl-g3 { background: #14b8a6; border-color: #2dd4bf; }
.rpt-heat.lvl-g4 { background: #2dd4bf; border-color: #5eead4; }
.rpt-heat.lvl-g5 { background: #5eead4; border-color: #99f6e4; }
html:not(.dark) .rpt-heat.lvl-1 { background: #dbeafe; border-color: #bfdbfe; }
html:not(.dark) .rpt-heat.lvl-2 { background: #93c5fd; border-color: #60a5fa; }
html:not(.dark) .rpt-heat.lvl-3 { background: #3b82f6; border-color: #2563eb; }
html:not(.dark) .rpt-heat.lvl-4 { background: #2563eb; border-color: #1d4ed8; }
html:not(.dark) .rpt-heat.lvl-5 { background: #1d4ed8; border-color: #1e40af; }

.rpt-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.rpt-toolbar-left { position: relative; }
.rpt-toolbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rpt-range-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 8px; border: 0;
  background: var(--n-alpha-2); color: var(--slate-12); font-size: 14px; cursor: pointer;
}
.rpt-range-btn .ico { width: 16px; height: 16px; color: var(--slate-11); }
.rpt-range-pop { left: 0; right: auto; min-width: 200px; }
.rpt-range-pop a { text-decoration: none; }
.rpt-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--slate-12); }
.rpt-switch {
  width: 36px; height: 20px; border-radius: 999px; background: var(--slate-6);
  position: relative; display: inline-block; text-decoration: none;
}
.rpt-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .15s ease;
}
.rpt-switch.is-on { background: var(--n-brand); }
.rpt-switch.is-on::after { transform: translateX(16px); }

.rpt-charts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; padding-top: 8px;
}
.rpt-chart-card { min-width: 0; position: relative; padding: 4px 0 8px; }
.rpt-chart-head { margin-bottom: 12px; }
.rpt-chart-name { display: block; font-size: 13px; color: var(--slate-11); margin-bottom: 4px; }
.rpt-chart-value-row { display: flex; align-items: flex-end; gap: 12px; }
.rpt-chart-value { font-size: 22px; font-weight: 500; color: var(--slate-12); line-height: 1.2; }
.rpt-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; margin-bottom: 2px;
}
.rpt-trend.is-up { color: #12a594; }
.rpt-trend.is-down { color: #e54666; }
.rpt-trend-arrow {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
}
.rpt-trend-arrow.up { border-bottom: 7px solid currentColor; }
.rpt-trend-arrow.down { border-top: 7px solid currentColor; }
.rpt-chart-body {
  display: grid; grid-template-columns: 28px 1fr; gap: 6px; align-items: stretch;
}
.rpt-y {
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 10px; color: var(--slate-11); text-align: right; padding: 8px 0 22px;
}
.rpt-bars {
  display: flex; align-items: flex-end; gap: 6px; height: 160px;
  padding: 8px 0 0; border-bottom: 1px solid var(--n-weak);
  position: relative;
}
.rpt-bars::before {
  content: ""; position: absolute; left: 0; right: 0; top: 8px; bottom: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(25% - 1px),
    var(--n-weak) calc(25% - 1px),
    var(--n-weak) 25%
  );
  pointer-events: none; opacity: .7;
}
.rpt-bar-col {
  flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; z-index: 1;
  position: relative; padding-bottom: 18px;
}
.rpt-bar {
  width: 70%; max-width: 28px; min-height: 2px; border-radius: 3px 3px 0 0;
  background: var(--n-brand);
}
.rpt-bar-col span {
  font-size: 10px; color: var(--slate-11); white-space: nowrap;
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
}

@media (max-width: 900px) {
  .rpt-charts { grid-template-columns: 1fr; }
  .rpt-live-row > .rpt-card, .rpt-live-row > .rpt-card--wide { flex: 1 1 100%; }
}

/* —— Filtro avançado de conversas —— */
.icon-ghost.is-on,
.icon-ghost.is-open { background: var(--n-alpha-2); color: var(--n-brand); }
.icon-ghost .filter-dot {
  position: absolute; top: 2px; right: 2px;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 999px; background: var(--n-brand); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 14px; text-align: center;
}
.list-head-actions .icon-ghost { position: relative; }
.conv-filter-panel {
  position: fixed; z-index: 80;
  width: min(44rem, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
}
.conv-filter-card {
  border: 1px solid var(--n-weak); border-radius: 14px;
  background: var(--n-solid-2, var(--n-solid));
  box-shadow: 0 16px 48px rgb(0 0 0 / 35%), var(--shadow);
  padding: 18px 20px 16px; display: grid; gap: 14px;
  max-height: min(75vh, 560px); overflow: auto;
  color: var(--slate-12);
}
.conv-filter-card h3 {
  margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em;
  color: var(--slate-12);
}
.conv-filter-card > .muted {
  margin: -6px 0 0; font-size: 13px; line-height: 1.4; color: var(--slate-11);
}
.conv-filter-rows { display: grid; gap: 12px; }
.conv-filter-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(9rem, 1.2fr) minmax(8rem, 1fr) minmax(8rem, 1.2fr) 32px;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--n-alpha-2);
  border: 1px solid var(--n-weak);
}
.conv-filter-query { min-width: 0; }
.conv-filter-where {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; font-size: 13px; color: var(--slate-11); font-weight: 600;
}
.conv-filter-row select,
.conv-filter-row input[type=text],
.conv-filter-row input[type=date] {
  width: 100%; min-width: 0; height: 36px; border: 1px solid var(--n-weak);
  border-radius: 8px; background: var(--n-solid); color: var(--slate-12);
  padding: 0 10px; font-size: 13px; line-height: 1.3;
  text-overflow: ellipsis;
}
.conv-filter-row select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.conv-filter-row select:focus,
.conv-filter-row input:focus {
  outline: 2px solid color-mix(in srgb, var(--n-brand) 35%, transparent);
  border-color: var(--n-brand);
}
.conv-filter-value[hidden] { visibility: hidden; }
.conv-filter-row .icon-ghost {
  width: 32px; height: 32px; font-size: 18px; line-height: 1;
  color: var(--slate-11);
}
.conv-filter-row .icon-ghost:hover { color: #e54666; background: color-mix(in srgb, #e54666 12%, transparent); }
.conv-filter-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 4px; border-top: 1px solid var(--n-weak);
}
.conv-filter-actions-right { display: flex; gap: 8px; flex-wrap: wrap; }
.conv-filter-actions .btn.ghost,
.conv-filter-actions a.btn.ghost {
  border: 1px solid var(--n-weak); background: var(--n-solid);
  color: var(--slate-12); height: 34px; padding: 0 12px;
}
.conv-filter-actions .btn.ghost:hover,
.conv-filter-actions a.btn.ghost:hover { background: var(--n-alpha-2); }
.conv-filter-actions .btn.sm:not(.ghost) {
  height: 34px; padding: 0 14px; font-weight: 600;
}
@media (max-width: 720px) {
  .conv-filter-panel { width: calc(100vw - 24px); left: 8px; right: 8px; }
  .conv-filter-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .conv-filter-query { grid-column: 1 / -1; justify-self: start; }
  .conv-filter-row > select:nth-of-type(1) { grid-column: 1 / -1; }
  .conv-filter-row .icon-ghost { grid-column: 2; justify-self: end; }
}

/* —— Chatbot Flows —— */
.bf-lead { margin: 0 0 20px; }
.bf-btn-creds {
  background: #7c3aed !important;
  color: #fff !important;
}
.bf-btn-creds:hover { background: #6d28d9 !important; }
.bf-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
  min-height: 22rem; padding: 48px 24px;
  border: 1px solid var(--n-weak); border-radius: 16px;
  background: var(--n-solid);
}
.bf-empty-icon {
  width: 72px; height: 72px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--n-alpha-2); color: var(--slate-10); margin-bottom: 8px;
}
.bf-empty-icon .ico { width: 36px; height: 36px; }
.bf-empty h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--slate-12); }
.bf-empty p { margin: 0 0 8px; color: var(--slate-11); font-size: 14px; }
.bf-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.bf-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; border: 1px solid var(--n-weak); border-radius: 14px;
  background: var(--n-solid);
}
.bf-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bf-kind {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.bf-kind--bot { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #f59e0b; }
.bf-kind--sequence { background: color-mix(in srgb, #2781F6 18%, transparent); color: #2781F6; }
.bf-status { font-size: 12px; font-weight: 500; }
.bf-status.is-on { color: #22c55e; }
.bf-status.is-off { color: var(--slate-10); }
.bf-card-title {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--slate-12);
  overflow-wrap: anywhere; word-break: break-word;
}
.bf-card-desc {
  margin: 0; font-size: 13px; color: var(--slate-11); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bf-card-meta { font-size: 12px; color: var(--slate-10); }
.bf-card-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px;
}
.bf-dialog { width: min(36rem, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; }
.bf-dialog .cw-dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.bf-dialog .cw-dialog-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.bf-creds-title-ico { color: #2781F6; display: inline-flex; }
.bf-creds-title-ico .ico { width: 18px; height: 18px; }
.bf-hint { margin: -2px 0 8px; font-size: 12px; color: var(--slate-11); }
.bf-kind-pick {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px;
}
.bf-kind-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left; padding: 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--n-weak); background: var(--slate-2); color: inherit;
}
.bf-kind-card strong { font-size: 14px; }
.bf-kind-card small { font-size: 12px; color: var(--slate-11); line-height: 1.35; }
.bf-kind-card.is-selected {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
  background: color-mix(in srgb, #22c55e 8%, var(--n-solid));
}
.bf-kind-ico {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
}
.bf-kind-ico .ico { width: 16px; height: 16px; }
.bf-kind-ico--bot { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #f59e0b; }
.bf-kind-ico--seq { background: color-mix(in srgb, #2781F6 22%, transparent); color: #2781F6; }
.bf-inbox-select { min-height: 96px; }
.bf-steps-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px;
}
.bf-steps-head label { margin: 0; }
.bf-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bf-step-row {
  display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; align-items: start;
  padding: 10px; border: 1px solid var(--n-weak); border-radius: 10px; background: var(--slate-2);
}
.bf-step-delay { margin: 0; font-size: 12px; color: var(--slate-11); }
.bf-step-delay input { margin-top: 4px; }
.bf-creds-dialog { width: min(40rem, calc(100vw - 24px)); }
.bf-creds-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--n-weak); margin: 8px 0 16px; overflow-x: auto;
}
.bf-creds-tab {
  appearance: none; background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--slate-11); padding: 10px 12px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.bf-creds-tab.is-active { color: #2781F6; border-bottom-color: #2781F6; }
.bf-creds-panel { display: none; flex-direction: column; gap: 12px; }
.bf-creds-panel.is-active { display: flex; }
.bf-creds-info {
  padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4;
  border: 1px solid color-mix(in srgb, #2781F6 40%, transparent);
  background: color-mix(in srgb, #2781F6 10%, transparent); color: var(--slate-12);
}
.bf-creds-info--blue { border-color: color-mix(in srgb, #2781F6 45%, transparent); }
.bf-creds-info--violet {
  border-color: color-mix(in srgb, #7c3aed 45%, transparent);
  background: color-mix(in srgb, #7c3aed 10%, transparent);
}
.bf-creds-warn {
  padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4;
  border: 1px solid color-mix(in srgb, #f59e0b 50%, transparent);
  background: color-mix(in srgb, #f59e0b 12%, transparent); color: var(--slate-12);
}
.bf-provider {
  padding: 14px; border: 1px solid var(--n-weak); border-radius: 12px; background: var(--slate-2);
}
.bf-provider--oauth { border-color: color-mix(in srgb, #14b8a6 45%, transparent); }
.bf-oauth-note { margin: 0 0 12px; font-size: 13px; color: var(--slate-11); }
.bf-oauth-live { margin: 0 0 12px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, #14b8a6 8%, transparent); }
.bf-oauth-code-label { margin: 0 0 4px; font-size: 12px; color: var(--slate-11); text-transform: uppercase; letter-spacing: .04em; }
.bf-oauth-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 28px; font-weight: 600; letter-spacing: .12em; color: var(--slate-12);
  margin-bottom: 8px;
}
.bf-oauth-status { margin: 0 0 10px; font-size: 13px; }
.bf-provider-head {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.bf-provider-head strong { display: block; font-size: 14px; }
.bf-provider-head small { display: block; font-size: 12px; color: var(--slate-11); margin-top: 2px; line-height: 1.35; }
.bf-provider-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
}
.bf-provider-mark--violet { background: #7c3aed; }
.bf-provider-mark--blue { background: #2781F6; }
.bf-provider-mark--orange { background: #ea580c; }
.bf-provider-mark--teal { background: #0d9488; }
.bf-configured {
  margin-left: auto; font-size: 11px; font-weight: 600; color: #22c55e;
  white-space: nowrap; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, #22c55e 14%, transparent);
}
.bf-provider-form { display: flex; flex-direction: column; gap: 8px; }
.bf-clear-form { margin-top: 8px; }
.bf-oauth-note { margin: 0 0 10px; font-size: 12px; color: #14b8a6; line-height: 1.4; }
.bf-save--violet { background: #7c3aed !important; }
.bf-save--violet:hover { background: #6d28d9 !important; }
.bf-save--blue { background: #2781F6 !important; }
.bf-save--blue:hover { background: #1d6fd6 !important; }
.bf-save--orange { background: #ea580c !important; }
.bf-save--orange:hover { background: #c2410c !important; }
.bf-save--teal { background: #0d9488 !important; }
.bf-save--teal:hover { background: #0f766e !important; }
.bf-save--teal:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 640px) {
  .bf-kind-pick { grid-template-columns: 1fr; }
  .bf-step-row { grid-template-columns: 1fr; }
}

/* ===== Projetos ===== */
.proj-page { max-width: 1200px; }
.proj-list-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.proj-page-title { margin:0; font-size:1.6rem; }
.proj-list-actions { display:flex; align-items:center; gap:8px; }
.proj-list-actions .icon-btn { width:36px; height:36px; display:grid; place-items:center; border:1px solid var(--n-weak); border-radius:10px; color:var(--slate-11); }
.proj-list-actions .icon-btn.on { background:var(--n-alpha-2); color:var(--slate-12); }
.proj-filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.proj-filter { padding:6px 12px; border-radius:10px; color:var(--slate-11); text-decoration:none; font-size:13px; }
.proj-filter.on, .proj-filter:hover { background:var(--n-alpha-2); color:var(--slate-12); }
.proj-cards.is-grid { display:grid; gap:16px; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); }
.proj-cards.is-list { display:grid; gap:12px; }
.proj-card { background:var(--n-solid-2, var(--bg-elevated, #1c1f26)); border:1px solid var(--n-weak); border-radius:16px; overflow:hidden; }
.proj-card-stripe { height:4px; }
.proj-card-body { padding:16px; display:grid; gap:12px; }
.proj-card-top { display:flex; justify-content:space-between; gap:8px; }
.proj-card-top h3 { margin:0; font-size:1.05rem; }
.proj-card-tools { display:flex; gap:2px; }
.proj-card-link { display:inline-flex; align-items:center; gap:6px; color:var(--slate-11); text-decoration:none; font-size:13px; }
.proj-card-link:hover { color:var(--slate-12); }
.proj-card-link .ico,
.proj-card-meta .ico,
.proj-card-tools .ico,
.proj-list-actions .ico { width:16px; height:16px; flex-shrink:0; display:block; }
.proj-card-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; }
.proj-card-meta > .muted { display:inline-flex; align-items:center; gap:4px; min-width:0; }
.proj-card-meta > .muted:last-child {
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:42%;
  font-variant-numeric: tabular-nums;
}
.proj-badge { display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; }
.proj-badge.is-active { background:color-mix(in srgb, #14b8a6 22%, transparent); color:#5eead4; }
.proj-badge.is-done { background:color-mix(in srgb, #22c55e 22%, transparent); color:#86efac; }
.proj-badge.is-cancelled { background:color-mix(in srgb, #ef4444 22%, transparent); color:#fca5a5; }

.proj-show { max-width: 1100px; }
.proj-crumb { font-size:12px; margin-bottom:8px; }
.proj-show-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.proj-show-title { display:flex; align-items:center; gap:10px; min-width:0; }
.proj-show-title h1 { margin:0; font-size:1.6rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.proj-tabs { display:flex; gap:16px; overflow-x:auto; border-bottom:1px solid var(--n-weak); margin-bottom:20px; }
.proj-tabs a { padding:10px 2px 12px; color:var(--slate-11); text-decoration:none; white-space:nowrap; font-size:14px; border-bottom:2px solid transparent; }
.proj-tabs a.on { color:var(--slate-12); border-bottom-color:var(--n-brand); }
.proj-section { display:grid; gap:16px; }
.proj-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.proj-section-head h2 { margin:0; font-size:1.15rem; }
.proj-stat-grid { display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); }
.proj-stat-card { background:var(--n-solid-2, #1c1f26); border:1px solid var(--n-weak); border-radius:16px; padding:16px; }
.proj-stat-card h3 { margin:0 0 12px; font-size:15px; }
.proj-stat-rows { display:grid; gap:6px; font-size:13px; }
.proj-stat-rows > div { display:flex; justify-content:space-between; gap:8px; }
.proj-stat-rows .ok, .proj-stat-solo .ok, .ok { color:#34d399; }
.proj-stat-rows .info, .info { color:#60a5fa; }
.proj-stat-rows .warn, .warn { color:#fbbf24; }
.proj-stat-card--solo .proj-stat-solo { display:flex; align-items:baseline; justify-content:space-between; }
.proj-stat-solo b { font-size:1.8rem; }
.proj-progress { margin-top:10px; height:8px; border-radius:999px; background:var(--n-alpha-2); overflow:hidden; }
.proj-progress.tall { height:10px; margin-top:14px; }
.proj-progress > i { display:block; height:100%; background:var(--n-brand); border-radius:999px; }
.proj-progress > i.ok { background:#34d399; }
.proj-progress > i.bad { background:#f87171; }
.proj-progress > i.purple { background:#a78bfa; }

.proj-task-list { display:grid; gap:8px; }
.proj-task-row { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border-radius:14px; background:var(--n-solid-2, #1c1f26); border:1px solid var(--n-weak); }
.proj-task-main { flex:1; min-width:0; }
.proj-task-main b.is-done { text-decoration:line-through; color:var(--slate-11); }
.proj-check { width:28px; height:28px; border-radius:8px; border:1px solid var(--n-weak); background:transparent; color:var(--slate-11); display:grid; place-items:center; cursor:pointer; }
.proj-check.on { background:color-mix(in srgb, #22c55e 25%, transparent); color:#86efac; border-color:transparent; }
.proj-empty-box { border:1px solid var(--n-weak); border-radius:16px; background:var(--n-solid-2, #1c1f26); padding:40px 16px; text-align:center; }
.proj-conv-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; text-align:left; }
.proj-conv-list li { display:flex; justify-content:space-between; gap:8px; align-items:center; padding:8px 10px; border-radius:10px; background:var(--n-alpha-2); }
.proj-upload-form input[type=file] { display:none; }
.proj-discuss { display:grid; grid-template-columns:280px 1fr; gap:16px; min-height:480px; }
.proj-discuss-side { display:grid; gap:6px; align-content:start; }
.proj-discuss-item { display:grid; gap:4px; padding:10px 12px; border-radius:12px; background:var(--n-solid-2, #1c1f26); border:1px solid var(--n-weak); color:inherit; text-decoration:none; font-size:13px; }
.proj-discuss-item b { font-weight:600; color:var(--slate-12); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.proj-discuss-item .muted { font-size:11px; }
.proj-discuss-item.on { outline:1px solid var(--n-brand); }
.proj-discuss-main { border:1px solid var(--n-weak); border-radius:16px; background:var(--n-solid-2, #1c1f26); display:flex; flex-direction:column; min-height:480px; min-width:0; overflow:hidden; }
.proj-discuss-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:16px 20px; border-bottom:1px solid var(--n-weak); }
.proj-discuss-head h3 { margin:0; color:var(--slate-12); font-size:16px; }
.proj-discuss-head .muted { margin:4px 0 0; font-size:12px; }
.proj-discuss-thread { flex:1; overflow:auto; padding:16px 20px; display:grid; gap:16px; align-content:start; }
.proj-discuss-post { display:flex; gap:12px; align-items:flex-start; }
.proj-discuss-avatar { flex-shrink:0; width:36px; height:36px; border-radius:999px; display:grid; place-content:center; background:var(--n-alpha-2); color:var(--slate-11); font-size:11px; font-weight:700; text-transform:uppercase; }
.proj-discuss-post.is-op .proj-discuss-avatar { background:color-mix(in srgb, var(--n-brand) 22%, transparent); color:var(--n-brand); }
.proj-discuss-post-body { min-width:0; flex:1; }
.proj-discuss-meta { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; font-size:12px; }
.proj-discuss-meta b { color:var(--slate-12); font-size:13px; }
.proj-discuss-meta time { color:var(--slate-11); font-size:11px; }
.proj-discuss-tag { font-size:10px; text-transform:uppercase; letter-spacing:.04em; color:var(--slate-11); background:var(--n-alpha-2); border-radius:4px; padding:2px 6px; }
.proj-discuss-content { margin-top:6px; white-space:pre-wrap; color:var(--slate-12); font-size:14px; line-height:1.45; word-break:break-word; }
.proj-discuss-reply-del { margin:0 0 0 auto; }
.proj-discuss-reply-del .link-danger { background:none; border:0; color:var(--ruby-11, #e5484d); cursor:pointer; font-size:11px; padding:0; }
.proj-discuss-empty { margin:0; padding-top:4px; border-top:1px solid var(--n-weak); }
.proj-discuss-empty-state { flex:1; display:grid; place-content:center; padding:32px; text-align:center; }
.proj-discuss-composer { display:flex; gap:10px; align-items:flex-end; padding:12px 16px; border-top:1px solid var(--n-weak); }
.proj-discuss-composer textarea { flex:1; min-height:44px; max-height:120px; resize:vertical; border-radius:12px; border:1px solid var(--n-weak); background:var(--n-solid-1, #12151c); color:var(--slate-12); padding:10px 12px; font:inherit; font-size:13px; }
.proj-discuss-composer .btn { flex-shrink:0; }
.proj-discuss-body { margin-top:12px; white-space:pre-wrap; color:var(--slate-12); }
.proj-member-grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); }
.proj-member-card { position:relative; padding:16px; border-radius:16px; background:var(--n-solid-2, #1c1f26); border:1px solid var(--n-weak); }
.proj-member-remove { position:absolute; top:8px; right:8px; margin:0; }
.proj-role { display:inline-block; margin-top:10px; padding:2px 8px; border-radius:999px; background:var(--n-alpha-2); font-size:11px; }
.proj-add-member select { background:var(--n-brand); color:#fff; border:0; border-radius:10px; padding:8px 12px; }
.proj-activity-list { display:grid; gap:8px; }
.proj-activity { display:flex; gap:12px; padding:12px 14px; border-radius:16px; background:var(--n-solid-2, #1c1f26); border:1px solid var(--n-weak); }
.proj-activity-ico { width:32px; height:32px; border-radius:999px; display:grid; place-items:center; background:color-mix(in srgb, var(--n-brand) 20%, transparent); color:#fbbf24; flex-shrink:0; }

.proj-report-dlg { padding:0; max-width:920px; width:calc(100vw - 32px); }
.proj-report-dlg .ico { width: 16px; height: 16px; flex-shrink: 0; }
.proj-report-head { display:flex; justify-content:space-between; gap:12px; padding:18px 20px; background:linear-gradient(90deg,#6d28d9,#3b82f6); color:#fff; border-radius:12px 12px 0 0; }
.proj-report-head h2 { margin:0; font-size:1.2rem; }
.proj-report-head p { margin:4px 0 0; opacity:.9; font-size:13px; }
.proj-report-head .icon-ghost { color:#fff; }
.proj-report-head .icon-ghost .ico { width:18px; height:18px; }
.proj-report-body { padding:18px 20px; display:grid; gap:16px; max-height:70vh; overflow:auto; }
.proj-report-body h3 { margin:0; font-size:15px; }
.proj-report-body h4 { margin:0 0 10px; font-size:13px; color:var(--slate-11); }
.proj-report-exec { display:grid; gap:10px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.proj-report-exec article { position:relative; border-radius:14px; padding:14px 44px 14px 14px; border:1px solid transparent; }
.proj-report-exec article > span:first-child { display:block; font-size:12px; margin-bottom:6px; }
.proj-report-exec article b { font-size:1.4rem; }
.proj-report-exec article small { display:block; margin-top:4px; opacity:.8; font-size:11px; }
.proj-report-ico {
  display:inline-grid; place-items:center; width:28px; height:28px; border-radius:999px;
  flex-shrink:0;
}
.proj-report-exec .proj-report-ico { position:absolute; top:12px; right:12px; }
.proj-report-ico .ico { width:14px; height:14px; }
.proj-report-ico.is-blue { background:color-mix(in srgb,#3b82f6 28%,transparent); color:#93c5fd; }
.proj-report-ico.is-green { background:color-mix(in srgb,#22c55e 28%,transparent); color:#86efac; }
.proj-report-ico.is-purple { background:color-mix(in srgb,#8b5cf6 28%,transparent); color:#c4b5fd; }
.proj-report-ico.is-orange { background:color-mix(in srgb,#f59e0b 28%,transparent); color:#fcd34d; }
.proj-report-exec .is-blue { background:color-mix(in srgb,#3b82f6 18%,transparent); border-color:color-mix(in srgb,#3b82f6 35%,transparent); }
.proj-report-exec .is-green { background:color-mix(in srgb,#22c55e 18%,transparent); border-color:color-mix(in srgb,#22c55e 35%,transparent); }
.proj-report-exec .is-purple { background:color-mix(in srgb,#8b5cf6 18%,transparent); border-color:color-mix(in srgb,#8b5cf6 35%,transparent); }
.proj-report-exec .is-orange { background:color-mix(in srgb,#f59e0b 18%,transparent); border-color:color-mix(in srgb,#f59e0b 35%,transparent); }
.proj-report-analysis { display:grid; gap:16px; grid-template-columns:1fr 1fr; padding:14px; border-radius:14px; background:var(--n-alpha-2); }
.proj-dist { list-style:none; margin:0; padding:0; display:grid; gap:8px; font-size:13px; }
.proj-dist li { display:flex; align-items:center; gap:8px; }
.proj-dist li b { margin-left:auto; }
.proj-dist i { width:10px; height:10px; border-radius:3px; display:inline-block; flex-shrink:0; }
.proj-dist i.ok { background:#22c55e; }
.proj-dist i.info { background:#3b82f6; }
.proj-dist i.warn { background:#eab308; }
.proj-dist i.bad { background:#ef4444; }
.proj-kpi { margin-bottom:12px; }
.proj-kpi span { display:block; font-size:12px; color:var(--slate-11); margin-bottom:4px; }
.proj-kpi b.bad { color:#f87171; }
.proj-kpi b.purple { color:#a78bfa; }
.proj-report-res { display:grid; gap:10px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.proj-report-res article {
  display:flex; align-items:center; gap:12px; padding:14px;
  border-radius:14px; background:var(--n-alpha-2); font-size:13px;
}
.proj-report-res article > div { display:grid; gap:2px; min-width:0; }
.proj-report-res article b { font-size:1.15rem; line-height:1.2; }
.proj-report-res article span { color:var(--slate-11); font-size:12px; }
.proj-report-finance {
  display:grid; gap:10px; grid-template-columns:repeat(3,minmax(0,1fr));
  padding:14px; border-radius:14px; background:var(--n-alpha-2);
}
.proj-report-finance article { display:grid; gap:4px; }
.proj-report-finance article > span { font-size:12px; color:var(--slate-11); }
.proj-report-finance article b { font-size:1.35rem; }
.proj-report-finance article small { font-size:11px; color:var(--slate-11); }
.proj-report-finance .ok { color:#34d399; }
.proj-report-finance .info { color:#60a5fa; }
.proj-report-finance .purple { color:#a78bfa; }
.proj-report-foot { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:14px 20px; border-top:1px solid var(--n-weak); }
.proj-activity-ico .ico { width:16px; height:16px; }
.proj-stat-card .ico, .proj-section .btn .ico { width:16px; height:16px; }
@media (max-width: 900px) {
  .proj-report-exec, .proj-report-analysis, .proj-report-res, .proj-report-finance, .proj-discuss { grid-template-columns:1fr; }
}

/* Modal Novo / Editar Projeto */
.proj-form-dlg { padding: 0; width: min(480px, calc(100vw - 24px)); border-radius: 16px; overflow: hidden; }
.proj-form-dlg::backdrop { background: rgba(0,0,0,.55); }
.proj-form { display: flex; flex-direction: column; margin: 0; }
.proj-form-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 4px;
}
.proj-form-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.proj-form-title h2 { margin: 0; font-size: 1.15rem; font-weight: 650; }
.proj-form-ico {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--n-brand) 22%, transparent); color: var(--n-brand); flex-shrink: 0;
}
.proj-form-ico .ico { width: 18px; height: 18px; }
.proj-form-body { padding: 12px 20px 8px; display: grid; gap: 6px; }
.proj-form-label { margin: 8px 0 0; font-size: 13px; font-weight: 500; color: var(--slate-12); }
.proj-form-label .req { color: #f87171; }
.proj-form-body input[type="text"],
.proj-form-body input[type="date"],
.proj-form-body select,
.proj-form-body textarea {
  width: 100%; box-sizing: border-box; margin: 0;
  border-radius: 10px; border: 1px solid var(--n-weak);
  background: var(--n-alpha-2, rgba(255,255,255,.04));
  color: var(--slate-12); padding: 10px 12px; font: inherit;
}
.proj-form-body textarea { resize: vertical; min-height: 72px; }
.proj-form-body input::placeholder,
.proj-form-body textarea::placeholder { color: var(--slate-10); }
.proj-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.proj-color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.proj-color-swatch {
  width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
.proj-color-swatch:hover { transform: scale(1.06); }
.proj-color-swatch.on { border-color: #fff; box-shadow: 0 0 0 2px color-mix(in srgb, var(--n-brand) 55%, transparent); }
.proj-form-foot {
  display: flex; justify-content: flex-end; gap: 10px; align-items: center;
  padding: 14px 20px 18px;
}
.proj-form-foot .btn .ico { width: 15px; height: 15px; }
@media (max-width: 520px) {
  .proj-form-row { grid-template-columns: 1fr; }
}

.proj-link-forms { display: grid; gap: 12px; }
.proj-link-card {
  margin: 0; padding: 14px; border-radius: 14px; border: 1px solid var(--n-weak);
  background: var(--n-solid-2, #1c1f26);
}
.proj-link-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.proj-link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.proj-link-row select, .proj-link-row input[type="number"] {
  flex: 1; min-width: 140px; border-radius: 10px; border: 1px solid var(--n-weak);
  background: var(--n-alpha-2); color: var(--slate-12); padding: 8px 10px;
}
.proj-link-subtitle { margin: 12px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-11); }
.proj-link-tag {
  display: inline-flex; align-items: center; margin-right: 6px; padding: 1px 6px;
  border-radius: 999px; font-size: 10px; font-weight: 650;
  background: color-mix(in srgb, var(--n-brand) 22%, transparent); color: var(--n-brand);
}
.proj-link-tag.is-internal {
  background: color-mix(in srgb, #14b8a6 22%, transparent); color: #5eead4;
}
.proj-conv-list a { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: inherit; text-decoration: none; }

.ichat { min-height: 420px; }
.ichat-head { padding: 12px 16px; border-bottom: 1px solid var(--n-weak); }
.ichat-projects { border-left: 1px solid var(--n-weak); background: var(--n-solid-2, #16181d); overflow: auto; }
.ichat-side-head { padding: 14px 12px 8px; }
.ichat-side-head h3 { margin: 0; font-size: 14px; }
.ichat-side-head p { margin: 4px 0 0; font-size: 12px; }
.ichat-link-form { display: grid; gap: 8px; padding: 0 12px 12px; }
.ichat-link-form select {
  width: 100%; border-radius: 10px; border: 1px solid var(--n-weak);
  background: var(--n-alpha-2); color: var(--slate-12); padding: 8px 10px;
}
.ichat-project-list { list-style: none; margin: 0; padding: 0 8px 16px; display: grid; gap: 6px; }
.ichat-project-list li {
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px;
  border-radius: 12px; background: var(--n-alpha-2);
}
.ichat-project-list a {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none; font-size: 13px;
}
.ichat-project-list a i { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.ichat-project-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichat-project-list form { margin: 0; }
@media (max-width: 980px) {
  .content.inbox.ichat { grid-template-columns: 220px 1fr !important; }
  .ichat-projects { display: none; }
}

/* ===== Chats internos (layout dedicado) ===== */
.ichat-app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: var(--n-surface);
  overflow: hidden;
}
.ichat-toast {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 8px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--n-brand) 22%, var(--n-surface));
  border: 1px solid color-mix(in srgb, var(--n-brand) 40%, transparent);
  color: var(--slate-12);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-sm, 0 4px 16px rgba(0,0,0,.2));
  transition: opacity .35s, transform .35s;
  pointer-events: none;
  white-space: nowrap;
}
.ichat-toast.is-hide { opacity: 0; transform: translate(-50%, -8px); }
.ichat-toast.is-error {
  background: color-mix(in srgb, #e11d48 18%, var(--n-surface));
  border-color: color-mix(in srgb, #e11d48 45%, transparent);
}
.ichat-main { position: relative; }
.ichat-members-link {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 2px;
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--n-brand);
}
.ichat-members-link:hover { text-decoration: underline; }
.ichat-members-link.is-static {
  cursor: default;
  color: var(--slate-11, var(--muted, #64748b));
}
.ichat-members-link.is-static:hover { text-decoration: none; }
.ichat-member-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 16px; border-bottom: 1px solid var(--n-weak);
}
.ichat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px; border-radius: 999px;
  background: var(--n-alpha-2); font-size: 12px; color: var(--slate-12);
}
.ichat-chip.muted { padding: 4px 8px; color: var(--slate-11); }
.ichat-chip i {
  width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center;
  font-size: 9px; font-style: normal; font-weight: 700; line-height: 1;
  overflow: hidden; text-align: center;
  background: color-mix(in srgb, var(--n-brand) 25%, transparent); color: var(--n-brand);
}
.ichat-avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.ichat-members-dlg { width: min(440px, calc(100vw - 24px)); }
.ichat-member-pick {
  display: grid; gap: 4px; max-height: 320px; overflow: auto;
  margin: 4px 0 0; padding: 4px; border-radius: 12px; border: 1px solid var(--n-weak);
}
.ichat-member-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; cursor: pointer;
}
.ichat-member-row:hover { background: var(--n-alpha-2); }
.ichat-member-row input { margin: 0; flex-shrink: 0; }
.ichat-member-meta { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ichat-member-meta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichat-member-meta small { font-size: 11px; color: var(--slate-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichat-member-row em {
  font-style: normal; font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, #14b8a6 22%, transparent); color: #5eead4;
}
.ichat-rail, .ichat-main {
  min-height: 0; display: flex; flex-direction: column;
  background: var(--n-surface);
}
.ichat-rail { border-right: 1px solid var(--n-weak); }
.ichat-rail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 16px 14px 12px; border-bottom: 1px solid var(--n-weak);
}
.ichat-rail-head h1 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.ichat-rail-head p { margin: 4px 0 0; font-size: 12px; color: var(--slate-11); }
.ichat-rail-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ichat-dm-tag {
  font-style: normal; font-weight: 550; font-size: 10px; letter-spacing: .02em;
  color: var(--slate-11); background: var(--n-alpha-2); border-radius: 999px;
  padding: 1px 6px; margin-left: 4px; vertical-align: middle;
}
.ichat-role-tag {
  font-style: normal; font-weight: 550; font-size: 10px; letter-spacing: .02em;
  color: var(--slate-11); background: var(--n-alpha-2); border-radius: 999px;
  padding: 1px 6px; margin-left: 4px; vertical-align: middle;
}
.ichat-role-tag.is-admin {
  color: #93c5fd;
  background: rgba(59, 130, 246, .18);
}
.ichat-dm-tag.is-team {
  color: #86efac;
  background: rgba(34, 197, 94, .16);
}
.ichat-blank-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.ichat-member-pick input[type="radio"] { accent-color: var(--brand, #3b82f6); }
.ichat-icon-btn {
  position: relative;
  width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; background: var(--n-alpha-2); color: var(--slate-11);
}
.ichat-icon-btn:hover { background: var(--n-alpha-3, rgba(255,255,255,.08)); color: var(--slate-12); }
.ichat-icon-btn.ruby { color: #f87171; }
.ichat-icon-btn .ico { width: 16px; height: 16px; }
.ichat-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--n-brand); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.ichat-project-link { margin: 0 0 14px; display: grid; gap: 6px; }
.ichat-project-link-row { display: flex; gap: 8px; align-items: center; }
.ichat-project-link-row select {
  flex: 1; min-width: 0; border-radius: 10px; border: 1px solid var(--n-weak);
  background: var(--n-alpha-2); color: var(--slate-12); padding: 9px 10px;
}
.ichat-proj-list.in-dialog { padding: 0; margin-top: 6px; }
.ichat-projects-dlg { width: min(440px, calc(100vw - 24px)); }
.ichat-rail-list { flex: 1; overflow: auto; padding: 8px; display: grid; gap: 4px; align-content: start; }
.ichat-rail-item {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 12px; text-decoration: none; color: inherit;
}
.ichat-rail-item:hover { background: var(--n-alpha-2); }
.ichat-rail-item.on { background: color-mix(in srgb, var(--n-brand) 16%, transparent); }
.ichat-rail-item.has-unread .ichat-rail-meta b { font-weight: 700; }
.ichat-unread-dot {
  width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0;
  background: #e5484d; margin-left: auto;
  box-shadow: 0 0 0 2px var(--n-surface);
}
.ichat-avatar {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; place-content: center;
  font-size: 12px; font-weight: 650; line-height: 1;
  overflow: hidden; text-align: center;
  background: color-mix(in srgb, var(--n-brand) 22%, transparent); color: var(--n-brand);
}
.ichat-avatar.lg { width: 40px; height: 40px; font-size: 13px; }
.ichat-avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.ichat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.ichat-avatar-btn {
  border: 0; padding: 0; background: none; cursor: pointer; border-radius: 999px;
  position: relative; flex-shrink: 0;
}
.ichat-avatar-btn:hover .ichat-avatar-edit,
.ichat-avatar-btn:focus-visible .ichat-avatar-edit { opacity: 1; }
.ichat-avatar-edit {
  position: absolute; inset: 0; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(0,0,0,.45); color: #fff; opacity: 0;
  transition: opacity .15s ease; pointer-events: none;
}
.ichat-avatar-edit .ico { width: 16px; height: 16px; }
.ichat-edit-avatar-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.ichat-edit-avatar-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ichat-edit-avatar-actions p { margin: 0; font-size: 12px; color: var(--slate-11); }
.ichat-rail-meta { min-width: 0; display: grid; gap: 2px; }
.ichat-rail-meta b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichat-rail-meta small { font-size: 12px; color: var(--slate-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichat-empty-hint { margin: 12px; font-size: 13px; color: var(--slate-11); line-height: 1.4; }

.ichat-main-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--n-weak); min-height: 64px;
}
.ichat-main-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ichat-main-title strong { display: block; font-size: 15px; }
.ichat-main-actions { display: flex; align-items: center; gap: 4px; }
.ichat-main-actions form { margin: 0; }

.ichat-thread {
  flex: 1; overflow: auto; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.ichat-blank {
  flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px;
  text-align: center; padding: 24px; color: var(--slate-11);
}
.ichat-blank.soft { place-content: center; }
.ichat-blank h2 { margin: 0; color: var(--slate-12); font-size: 1.1rem; }
.ichat-blank p { margin: 0 0 8px; max-width: 280px; }
.ichat-blank-ico {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--n-alpha-2); color: var(--n-brand); margin-bottom: 4px;
}
.ichat-blank-ico .ico { width: 24px; height: 24px; }
.ichat-msg { display: flex; flex-direction: column; max-width: min(72%, 28rem); }
.ichat-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.ichat-msg.is-theirs { align-self: flex-start; align-items: flex-start; }
.ichat-msg-author { font-size: 11px; color: var(--slate-11); margin: 0 4px 4px; }
.ichat-bubble {
  padding: 8px 12px 6px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  position: relative;
  width: fit-content;
  max-width: 100%;
  align-self: auto;
}
.ichat-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.ichat-msg.is-mine .ichat-bubble {
  background: var(--n-brand); color: #fff; border-bottom-right-radius: 6px;
}
.ichat-msg.is-theirs .ichat-bubble {
  background: var(--n-alpha-2); color: var(--slate-12); border-bottom-left-radius: 6px;
}
.ichat-thread .ichat-bubble.bubble.out,
.ichat-thread .ichat-bubble.bubble.in {
  align-self: auto;
  max-width: 100%;
}
.ichat-thread .ichat-bubble.can-react {
  padding-bottom: 6px;
}
.ichat-bubble time {
  display: block; margin-top: 4px; font-size: 10px; text-align: right; opacity: .7; line-height: 1;
}
.ichat-bubble.has-media { padding: 8px; }
.ichat-bubble.has-media .ichat-bubble-text { padding: 4px 6px 0; white-space: pre-wrap; }
.ichat-media-img { display: block; border-radius: 10px; overflow: hidden; max-width: 280px; }
.ichat-media-img img { display: block; max-width: 100%; max-height: 320px; object-fit: cover; }
.ichat-audio { display: block; flex: 1 1 auto; width: auto; min-width: 0; height: 36px; margin: 0; }
.ichat-bubble .audio-player {
  min-width: 0;
  max-width: min(280px, 100%);
  margin: 2px 0;
}
.ichat-file {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 10px; text-decoration: none; font-size: 13px; max-width: 100%;
  background: rgba(0,0,0,.12); color: inherit;
}
.ichat-msg.is-theirs .ichat-file { background: var(--n-alpha-3, rgba(255,255,255,.08)); }
.ichat-file .ico { width: 14px; height: 14px; flex-shrink: 0; }
.ichat-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ichat-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--n-weak); margin: 0;
}
.ichat-composer-tools { display: flex; gap: 4px; flex-shrink: 0; padding-bottom: 5px; }
.ichat-composer-tools .ichat-icon-btn.is-on {
  background: color-mix(in srgb, #ef4444 28%, transparent); color: #fca5a5;
}
.ichat-composer-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ichat-composer textarea {
  width: 100%; min-height: 44px; max-height: 140px; resize: none;
  border-radius: 14px; border: 1px solid var(--n-weak);
  background: var(--n-alpha-2); color: var(--slate-12);
  padding: 12px 14px; font: inherit; line-height: 1.4; box-sizing: border-box;
}
.ichat-composer .btn { flex-shrink: 0; }
.ichat-composer .btn .ico { width: 15px; height: 15px; }
.ichat-pending {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 10px; background: var(--n-alpha-2); font-size: 12px; color: var(--slate-11);
}
.ichat-pending span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichat-pending-clear {
  border: 0; background: transparent; color: var(--slate-11); cursor: pointer;
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px;
}
.ichat-pending-clear:hover { background: var(--n-alpha-3, rgba(255,255,255,.08)); color: var(--slate-12); }
.ichat-pending-clear .ico { width: 14px; height: 14px; }
.ichat-recording {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 6px 10px; border-radius: 14px; border: 1px solid color-mix(in srgb, #ef4444 40%, var(--n-weak));
  background: color-mix(in srgb, #ef4444 10%, transparent); font-size: 13px;
}
.ichat-rec-dot {
  width: 8px; height: 8px; border-radius: 999px; background: #ef4444;
  animation: ichat-pulse 1s ease-in-out infinite;
}
@keyframes ichat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
#ichat-rec-timer { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3.2em; }

.ichat-proj-list { list-style: none; margin: 0; display: grid; gap: 6px; }
.ichat-proj-list li {
  display: flex; align-items: center; gap: 4px; padding: 8px 6px 8px 10px;
  border-radius: 12px; background: var(--n-alpha-2);
}
.ichat-proj-list a {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none; font-size: 13px;
}
.ichat-proj-list a i { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.ichat-proj-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichat-proj-list form { margin: 0; }

@media (max-width: 760px) {
  .ichat-app { grid-template-columns: 1fr; }
  .ichat-rail { display: none; }
  .ichat-app:not(:has(.ichat-main-head)) .ichat-rail { display: flex; }
}

/* Caixa de Entrada (notificações) */
.notif-page { height: 100%; min-height: 0; }
.notif-inbox { height: 100%; }
.notif-filters {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--n-weak);
}
.notif-filter {
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  color: var(--slate-11); text-decoration: none;
}
.notif-filter.on, .notif-filter:hover {
  background: var(--n-alpha-2); color: var(--slate-12);
}
.notif-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 6px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--n-brand); color: #fff; vertical-align: middle;
}
.notif-item { position: relative; }
.notif-avatar {
  display: grid; place-items: center;
  background: var(--n-alpha-2); color: var(--slate-11);
}
.notif-avatar .ico { width: 16px; height: 16px; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--n-brand); flex-shrink: 0; margin-right: 4px;
}
.notif-empty .ico, .notif-note .empty .ico {
  width: 40px; height: 40px; color: var(--slate-10); margin-bottom: 8px;
}
.notif-note .empty b { display: block; margin-bottom: 6px; color: var(--slate-12); }
.notif-note .empty span { max-width: 22rem; }

/* Assignment / capacity policies */
.ap-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
}
.ap-badge.is-on { background: #e6f4ea; color: #137333; }
.ap-badge.is-off { background: #f1f3f4; color: #5f6368; }
.ap-dialog { width: min(40rem, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.ap-fieldset {
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  padding: 12px 14px 14px; margin: 14px 0 0;
}
.ap-fieldset legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--slate-12); }
.ap-fair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ap-inbox-block {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.ap-inbox-block h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.ap-inbox-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ap-inbox-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
}
.ap-link-form { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.ap-link-form select { flex: 1; }
.ap-limits { display: flex; flex-direction: column; gap: 8px; }
.ap-limit-row {
  display: grid; grid-template-columns: 1fr 7rem; gap: 10px; align-items: center;
}
.ap-limit-row input { margin: 0; }
@media (max-width: 640px) {
  .ap-fair-row, .ap-limit-row { grid-template-columns: 1fr; }
}

/* Profile settings (alinhado) */
.profile-page { max-width: 42rem; display: flex; flex-direction: column; gap: 28px; }
.profile-sec {
  padding-top: 8px;
  border-top: 1px solid var(--n-strong);
  display: flex; flex-direction: column; gap: 12px;
}
.profile-sec:first-child { border-top: 0; padding-top: 0; }
.profile-sec h2 { margin: 0; font-size: 16px; font-weight: 600; }
.profile-form { max-width: 100%; gap: 12px; }
.profile-avatar-row { display: flex; gap: 16px; align-items: center; }
.profile-avatar-preview {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; flex-shrink: 0;
  outline: 1px solid var(--n-weak); background: var(--n-alpha-2);
}
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-preview span {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-weight: 600; font-size: 22px; color: #fff;
}
.profile-avatar-actions strong { display: block; font-size: 14px; }
.profile-btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.profile-hotkeys { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-hotkey {
  display: flex; flex-direction: column; gap: 6px; padding: 14px;
  border: 1px solid var(--n-weak); border-radius: 12px; cursor: pointer;
}
.profile-hotkey input { margin: 0; width: auto; }
.profile-hotkey strong { font-size: 14px; }
.profile-hotkey span { font-size: 12px; color: var(--slate-11); line-height: 1.4; }
.profile-hotkey.is-on { border-color: var(--n-brand); box-shadow: inset 0 0 0 1px var(--n-brand); }
.profile-mfa-setup { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.profile-token {
  display: inline-block; max-width: 100%; overflow-wrap: anywhere;
  padding: 8px 10px; border-radius: 8px; background: var(--n-alpha-2);
  font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.profile-token-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.profile-notif-table th:nth-child(2),
.profile-notif-table th:nth-child(3),
.profile-notif-table td:nth-child(2),
.profile-notif-table td:nth-child(3) { text-align: center; width: 72px; }
@media (max-width: 720px) {
  .profile-hotkeys { grid-template-columns: 1fr; }
}

/* Kanban auto-feed + hidden cards */
.kb-feed-box {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--n-weak, #e5e7eb);
  display: flex; flex-direction: column; gap: 8px;
}
.kb-feed-inboxes {
  max-height: 10rem; overflow: auto;
  border: 1px solid var(--n-weak, #e5e7eb);
  border-radius: 8px; padding: 8px 10px;
}
.kb-card.is-card-hidden { opacity: 0.72; border-style: dashed; }

/* Automation condition builder */
.auto-conditions-edit { display: grid; gap: 8px; margin: 8px 0 12px; }
.auto-cond-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr 0.7fr auto;
  gap: 8px;
  align-items: start;
}
.auto-cond-row select,
.auto-cond-row input { width: 100%; }
.audit-changes {
  margin: 0;
  max-width: 280px;
  max-height: 120px;
  overflow: auto;
  font-size: 11px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (max-width: 900px) {
  .auto-cond-row { grid-template-columns: 1fr; }
}

/* Account settings (Conta) */
.acct-settings { max-width: 40.625rem; }
.acct-section-title { margin: 0 0 16px; font-size: 18px; font-weight: 600; }
.acct-form label { margin-top: 16px; }
.acct-hint { margin: 6px 0 0; font-size: 13px; color: var(--slate-11); line-height: 1.45; }
.acct-id-block { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border, #e5e7eb); }
.acct-id-row { display: flex; gap: 8px; align-items: center; max-width: 20rem; }
.acct-id-row input { flex: 1; margin: 0; font-family: ui-monospace, monospace; }
.acct-version { margin: 48px 0 0; text-align: center; font-size: 12px; color: var(--slate-10); }

/* Bots dialog */
.bot-avatar {
  display: inline-flex; width: 36px; height: 36px; border-radius: 10px;
  align-items: center; justify-content: center; color: #fff;
}
.bot-avatar .ico { width: 18px; height: 18px; }
.bot-avatar-pick {
  width: 72px; height: 72px; border-radius: 14px; margin: 4px 0 12px;
  display: grid; place-items: center;
  background: var(--n-surface, #f4f4f5); border: 1px solid var(--border, #e5e7eb);
  color: var(--slate-11);
}
.bot-avatar-pick .ico { width: 32px; height: 32px; }

/* Automation rule dialog */
.auto-dlg { width: min(42rem, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.auto-box {
  margin-top: 16px; padding: 12px; border-radius: 12px;
  background: var(--n-surface, #f8f9fa); border: 1px solid var(--border, #e5e7eb);
}
.auto-box-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px;
}
.auto-box-head strong { font-size: 14px; }
.auto-add-link { font-size: 13px; color: var(--n-brand, #1f93ff); font-weight: 500; background: none; border: 0; cursor: pointer; padding: 0; }
.auto-cond-row, .macro-actions-edit .macro-action-row {
  display: grid; grid-template-columns: 1.1fr 1fr 1.2fr auto; gap: 8px; align-items: center; margin-bottom: 8px;
}
.auto-conditions-edit .auto-cond-row { grid-template-columns: 1.1fr 1fr 1.3fr auto; }

/* Macro list */
.macro-list-page { max-width: 56rem; }
.macro-empty {
  text-align: center; padding: 64px 24px;
  border: 1px dashed var(--n-weak); border-radius: 16px;
  background: var(--n-alpha-2);
}
.macro-empty-icon {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--n-solid-blue); color: var(--n-brand);
}
.macro-empty-icon .ico { width: 22px; height: 22px; }
.macro-empty h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.macro-empty p { margin: 0 auto 18px; max-width: 28rem; color: var(--slate-11); font-size: 14px; line-height: 1.5; }
.macro-cards { display: grid; gap: 12px; }
.macro-card {
  border: 1px solid var(--n-weak); border-radius: 12px;
  background: var(--n-solid); padding: 14px 16px;
  display: grid; gap: 8px;
}
.macro-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.macro-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.macro-card-title h3 { margin: 0; font-size: 15px; font-weight: 600; }
.macro-card-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.macro-card-actions form { margin: 0; }
.macro-card-summary {
  margin: 0; font-size: 13px; line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.macro-card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--slate-11);
}
.macro-vis-pill {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.macro-vis-pill.is-public { background: var(--n-solid-blue); color: var(--n-brand); }
.macro-vis-pill.is-private { background: var(--slate-3); color: var(--slate-11); }

/* Macro flow builder — matches MacroForm layout */
.macro-builder {
  margin: 0;
  display: flex; flex-direction: column; gap: 0;
  min-height: min(72vh, 42rem);
}
.macro-builder-top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding: 0; flex-shrink: 0;
}
.macro-builder-top h1 {
  margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
}
.macro-back {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--n-brand); font-size: 14px; font-weight: 500;
}
.macro-back:hover { text-decoration: underline; }
.macro-back .ico { width: 16px; height: 16px; }
.macro-builder-body {
  display: flex; flex-direction: row; align-items: stretch;
  gap: 20px; flex: 1; min-height: 0;
  border: 0; border-radius: 0; overflow: visible;
  background: transparent;
}
.macro-canvas {
  position: relative; flex: 1; min-width: 0; min-height: 28rem;
  padding: 24px 20px 28px 48px; overflow: auto;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--slate-11) 22%, transparent) 1.15px, transparent 1.15px) 0 0 / 16px 16px,
    var(--n-surface, #f4f5f6);
  border: 1px solid var(--n-weak); border-radius: 12px;
}
.macro-flow {
  width: 100%; max-width: 50rem;
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
}
.macro-flow-step {
  position: relative; display: flex; justify-content: flex-start;
  padding-bottom: 2rem;
}
.macro-flow-step:not(.is-last)::after {
  content: ""; position: absolute; left: 1.5rem; bottom: 0;
  width: 0; height: 2rem;
  border-left: 1.5px dashed color-mix(in srgb, var(--n-brand) 55%, var(--slate-8));
}
.macro-flow-pill {
  display: inline-flex; padding: 4px 10px; border-radius: 6px;
  background: var(--n-solid-blue); color: var(--n-brand);
  font-size: 13px; font-weight: 500; line-height: 1.2;
}
.macro-flow-nodes {
  width: 100%; display: flex; flex-direction: column; gap: 0;
}
.macro-flow-node {
  position: relative;
  display: block !important;
  width: 100%; margin: 0 0 2rem !important; padding: 0 40px 0 0;
  background: transparent; border: 0; box-shadow: none;
}
.macro-flow-node:not(:last-child)::after {
  content: ""; position: absolute; left: 1.5rem; bottom: -2rem;
  width: 0; height: 2rem;
  border-left: 1.5px dashed color-mix(in srgb, var(--n-brand) 55%, var(--slate-8));
}
.macro-flow-node.is-dragging { opacity: .55; }
.macro-flow-node.is-drop-target .macro-flow-fields {
  outline: 2px solid color-mix(in srgb, var(--n-brand) 55%, transparent);
}
.macro-flow-node.is-single .macro-flow-grip,
.macro-flow-node.is-single .macro-action-remove { display: none !important; }
.macro-flow-grip {
  position: absolute; left: -36px; top: 6px;
  width: 28px; height: 32px;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--slate-10); cursor: grab; padding: 0; user-select: none;
}
.macro-flow-grip:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.macro-flow-grip:active { cursor: grabbing; }
.macro-flow-grip .ico { width: 16px; height: 16px; }
.macro-flow-fields {
  width: 100%; min-width: 0;
  display: grid; grid-template-columns: minmax(11rem, 1fr) minmax(12rem, 1.35fr); gap: 8px;
  align-items: start;
  background: var(--n-solid); border: 1px solid var(--n-weak);
  border-radius: 8px; padding: 8px; box-shadow: var(--shadow-sm);
}
.macro-flow-fields .macro-action-name,
.macro-flow-fields .macro-param-input,
.macro-flow-fields select,
.macro-flow-fields textarea,
.macro-flow-fields input {
  width: 100%; min-width: 0; margin: 0;
}
.macro-action-param { min-width: 0; }
.macro-flow-node .macro-action-remove {
  position: absolute; right: 4px; top: 6px;
}
.macro-add-node {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  background: #0d9488; color: #fff; font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.macro-add-node:hover { background: #0f766e; }
.macro-add-node .ico { width: 14px; height: 14px; }
.macro-side {
  width: min(36%, 28rem); flex-shrink: 0;
  border: 1px solid var(--n-weak); border-radius: 12px;
  background: var(--n-solid); padding: 16px;
  display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto;
  box-shadow: var(--shadow-sm);
}
.macro-side-fields { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.macro-side label { margin: 0; font-size: 13px; font-weight: 500; color: var(--slate-12); }
.macro-side input[type="text"] { margin: 0; }
.macro-vis-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.macro-vis-card {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--n-weak); border-radius: 8px;
  padding: 10px; cursor: pointer; position: relative;
  background: var(--n-solid); transition: border-color .15s, background .15s;
  min-height: 100%;
}
.macro-vis-card:hover { border-color: color-mix(in srgb, var(--n-brand) 35%, var(--n-weak)); }
.macro-vis-card input { position: absolute; opacity: 0; pointer-events: none; }
.macro-vis-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.macro-vis-card strong { display: block; font-size: 14px; font-weight: 600; }
.macro-vis-card > span { font-size: 12px; color: var(--slate-11); line-height: 1.4; }
.macro-vis-check {
  display: none; color: var(--n-brand); flex-shrink: 0;
}
.macro-vis-check .ico { width: 16px; height: 16px; }
.macro-vis-card.is-on {
  border-color: var(--n-brand);
  background: color-mix(in srgb, var(--n-brand) 8%, var(--n-solid));
  box-shadow: inset 0 0 0 1px var(--n-brand);
}
.macro-vis-card.is-on .macro-vis-check { display: inline-grid; }
.macro-side-info {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 2px 0 0; padding: 10px; border-radius: 8px;
  background: var(--n-alpha-2); font-size: 12px; line-height: 1.45; color: var(--slate-11);
}
.macro-side-info .ico { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--slate-10); }
.macro-side-info p { margin: 0; }
.macro-side .btn.block { margin-top: auto; width: 100%; }
@media (max-width: 1100px) {
  .macro-vis-cards { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .macro-builder-body { flex-direction: column; }
  .macro-canvas { padding-left: 24px; min-height: 20rem; }
  .macro-side { width: 100%; }
  .macro-flow-fields { grid-template-columns: 1fr; }
  .auto-cond-row, .macro-actions-edit .macro-action-row { grid-template-columns: 1fr !important; }
  .macro-flow-node { padding-right: 36px; }
}

/* Integrations cards */
.integ-page { max-width: 56rem; }
.integ-lead { max-width: 40rem; margin: 0 0 8px; }
.integ-learn { margin: 0 0 20px; }
.integ-learn a { color: var(--n-brand, #1f93ff); font-size: 14px; font-weight: 500; }
.integ-search { max-width: 22rem; margin-bottom: 20px; }
.integ-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.integ-card {
  border: 1px solid var(--border, #e5e7eb); border-radius: 14px;
  background: var(--n-solid, #fff); padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px; min-height: 10.5rem;
}
.integ-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.integ-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  background: var(--n-surface, #f4f5f6); color: var(--slate-12);
}
.integ-icon svg,
.integ-icon .ico {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  display: block; flex-shrink: 0;
}
.integ-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.integ-badge.is-on { background: #e6f4ea; color: #137333; }
.integ-badge.is-off { background: #f1f3f4; color: #5f6368; }
.integ-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.integ-card-title h3 { margin: 0; font-size: 16px; font-weight: 600; }
.integ-cfg {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--n-brand, #1f93ff); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.integ-cfg svg,
.integ-cfg .ico {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  display: block; flex-shrink: 0;
}
.integ-desc { margin: 0; font-size: 13px; color: var(--slate-11); line-height: 1.45; }
.integ-dash-list { margin-top: 12px; }
.integ-dash-list ul { list-style: none; padding: 0; margin: 8px 0 0; }
.integ-dash-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--border, #e5e7eb);
}

/* Conversation flows */
.wf-page { max-width: 40.625rem; }
.wf-lead { margin: 0 0 20px; }
.wf-card {
  border: 1px solid var(--border, #e5e7eb); border-radius: 14px;
  background: var(--n-solid, #fff); overflow: hidden;
}
.wf-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 18px 20px;
}
.wf-card-head h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.wf-card-head p { margin: 0; font-size: 13px; color: var(--slate-11); line-height: 1.45; max-width: 34rem; }
.wf-card-body { padding: 16px 20px 20px; border-top: 1px solid var(--border, #e5e7eb); }
.wf-duration-row { display: grid; grid-template-columns: 3fr 1fr; gap: 8px; }
.wf-attrs {
  max-height: 12rem; overflow: auto; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; padding: 8px 12px; margin-top: 6px;
}
.wf-attrs .lbl-check { margin: 6px 0; }
@media (max-width: 860px) {
  .integ-grid { grid-template-columns: 1fr; }
  .wf-duration-row { grid-template-columns: 1fr; }
}

/* Security / SAML */
.sec-page { max-width: 40.625rem; }
.sec-lead { margin: 0 0 8px; }
.sec-learn { margin: 0 0 20px; }
.sec-learn a {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--n-brand, #2781f6); text-decoration: none; font-weight: 500;
}
.sec-learn a:hover { text-decoration: underline; }
.sec-learn .ico { width: 14px; height: 14px; }
.sec-card {
  border: 1px solid var(--border, #e5e7eb); border-radius: 14px;
  background: var(--n-solid, #fff); overflow: hidden;
}
.sec-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 18px 20px;
}
.sec-card-head h3 {
  margin: 0 0 6px; font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.sec-beta {
  display: inline-flex; align-items: center; padding: 1px 7px;
  border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: var(--n-solid-blue, rgba(39,129,246,.12)); color: var(--n-brand, #2781f6);
}
.sec-card-head p { margin: 0; font-size: 13px; color: var(--slate-11); line-height: 1.45; max-width: 34rem; }
.sec-card-body { padding: 16px 20px 20px; border-top: 1px solid var(--border, #e5e7eb); }
.sec-info-block { margin-bottom: 16px; }
.sec-info-title {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.sec-info-title h4 { margin: 0; font-size: 13px; font-weight: 600; }
.sec-tip { display: inline-flex; color: var(--slate-10); cursor: help; }
.sec-tip .ico { width: 14px; height: 14px; }
.sec-info-list {
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  background: var(--n-solid-1, var(--n-solid, #fff)); overflow: hidden;
}
.sec-info-row {
  display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 8px; align-items: center;
  padding: 8px 8px 8px 14px; border-top: 1px solid var(--border, #e5e7eb);
  font-size: 13px;
}
.sec-info-row:first-child { border-top: 0; }
.sec-info-label {
  display: inline-flex; align-items: center; gap: 4px; color: var(--slate-11); font-weight: 500;
}
.sec-info-value {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--slate-12); background: transparent; padding: 0;
}
.sec-attr-panel {
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  margin-bottom: 16px; overflow: hidden; background: var(--n-solid-1, var(--n-solid, #fff));
}
.sec-attr-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--slate-12); text-align: left;
}
.sec-attr-toggle:hover { background: var(--n-alpha-2); }
.sec-attr-toggle .ico { width: 16px; height: 16px; transition: transform .15s ease; color: var(--slate-11); }
.sec-attr-toggle.is-open .ico { transform: rotate(180deg); }
.sec-attr-body { padding: 0 14px 14px; }
.sec-attr-body p { margin: 0 0 8px; font-size: 13px; }
.sec-attr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sec-attr-list code {
  display: inline-block; padding: 2px 6px; border-radius: 6px;
  background: var(--n-alpha-2); font-size: 12px;
}
.sec-form label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 500; }
.sec-form input[type="url"],
.sec-form input[type="text"],
.sec-form textarea {
  width: 100%; box-sizing: border-box;
}
.sec-hint { margin: 6px 0 0; font-size: 12px; color: var(--slate-11); line-height: 1.4; }
.sec-form .btn { margin-top: 18px; }

/* Capitão AI in composer */
.reply-top .cap-ai-wrap { margin-left: auto; flex-shrink: 0; }
.reply-top > .cap-ai-btn { margin-left: auto; flex-shrink: 0; }
.cap-ai-wrap { position: relative; display: inline-flex; align-items: center; }
.cap-ai-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
  background: var(--n-solid-blue, rgba(39,129,246,.12));
  color: var(--n-brand, #2781f6); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.cap-ai-btn .ico { width: 16px; height: 16px; }
.cap-ai-btn:hover { filter: brightness(0.96); }
.cap-ai-btn.is-off { opacity: .55; }
.cap-ai-btn.is-on, .cap-ai-btn:hover { color: var(--n-brand, #2781f6); }
.cap-ai-menu {
  position: fixed; z-index: 1200;
  min-width: 240px; padding: 6px; border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb); background: var(--n-solid, #fff);
  box-shadow: 0 12px 28px rgb(15 23 42 / 18%);
  display: grid; gap: 2px;
}
.cap-ai-menu[hidden] { display: none !important; }
.cap-ai-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--slate-12);
}
.cap-ai-menu button:hover { background: var(--n-alpha-2); }
.cap-ai-menu .ico { width: 15px; height: 15px; color: var(--n-brand, #2781f6); }
.cap-ai-sep { height: 1px; background: var(--border, #e5e7eb); margin: 4px 2px; }

/* Preview panel — between editor and tools */
.cap-ai-panel {
  margin: 0 12px 10px;
  border: 1px solid color-mix(in srgb, var(--n-brand, #2781f6) 28%, var(--n-weak, #eaeaea));
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--n-brand, #2781f6) 8%, transparent), transparent 48px),
    var(--n-solid, #fff);
  box-shadow: 0 8px 24px rgb(15 23 42 / 8%);
  overflow: hidden;
  animation: capAiIn .18s ease-out;
}
@keyframes capAiIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.cap-ai-panel[hidden] { display: none !important; }
.cap-ai-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 14px 8px;
}
.cap-ai-panel-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.cap-ai-panel-icon {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
  background: color-mix(in srgb, var(--n-brand, #2781f6) 16%, transparent);
  color: var(--n-brand, #2781f6);
}
.cap-ai-panel-icon .ico { width: 16px; height: 16px; }
.cap-ai-panel-titles {
  display: grid; gap: 1px; min-width: 0;
}
.cap-ai-panel-titles strong {
  font-size: 13px; font-weight: 650; color: var(--slate-12);
  letter-spacing: -.01em;
}
.cap-ai-panel-sub {
  font-size: 11px; color: var(--slate-11); font-weight: 500;
}
.cap-ai-panel-close {
  display: grid; place-items: center;
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--slate-11); cursor: pointer;
}
.cap-ai-panel-close:hover { background: var(--n-alpha-2); color: var(--slate-12); }
.cap-ai-panel-close .ico { width: 15px; height: 15px; }
.cap-ai-panel-body {
  padding: 4px 14px 12px;
  max-height: min(280px, 36vh);
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--slate-12);
}
.cap-ai-loading {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 0; color: var(--slate-11); font-size: 13px;
}
.cap-ai-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--n-brand, #2781f6) 25%, transparent);
  border-top-color: var(--n-brand, #2781f6);
  animation: capAiSpin .7s linear infinite;
}
@keyframes capAiSpin { to { transform: rotate(360deg); } }
.cap-ai-error {
  padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, #ef4444 12%, transparent);
  color: #f87171; font-size: 13px; line-height: 1.45;
}
.cap-ai-result {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--n-alpha-2);
  border: 1px solid color-mix(in srgb, var(--n-weak, #eaeaea) 80%, transparent);
}
.cap-ai-result p { margin: 0 0 10px; }
.cap-ai-result p:last-child { margin-bottom: 0; }
.cap-ai-result ul { margin: 0 0 10px; padding-left: 1.15rem; }
.cap-ai-result strong { font-weight: 650; }
.cap-ai-result code {
  font-size: 12px; padding: 1px 5px; border-radius: 5px;
  background: color-mix(in srgb, var(--n-brand, #2781f6) 12%, transparent);
}
.cap-ai-panel-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 0 12px 12px;
}
.cap-ai-btn-ghost {
  height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--n-weak, #eaeaea);
  background: transparent; color: var(--slate-12);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.cap-ai-btn-ghost:hover { background: var(--n-alpha-2); }
.cap-ai-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border: 0; border-radius: 8px;
  background: var(--n-brand, #2781f6); color: #fff;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cap-ai-btn-primary:hover { background: var(--n-brand-hover, #1073e9); }
.cap-ai-btn-primary kbd {
  font: inherit; font-size: 11px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px;
  background: rgb(255 255 255 / 18%);
}
.reply-box.is-captain-open .reply-editor textarea {
  min-height: 72px;
}
.dark .cap-ai-panel,
html.dark .cap-ai-panel,
body.dark .cap-ai-panel {
  background:
    linear-gradient(180deg, rgba(39,129,246,.14), transparent 52px),
    color-mix(in srgb, var(--n-solid, #1a1d24) 92%, #000);
  border-color: rgba(39,129,246,.28);
  box-shadow: 0 10px 28px rgb(0 0 0 / 28%);
}
.dark .cap-ai-result,
html.dark .cap-ai-result,
body.dark .cap-ai-result {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
}
.dark .cap-ai-btn-ghost,
html.dark .cap-ai-btn-ghost,
body.dark .cap-ai-btn-ghost {
  border-color: rgba(255,255,255,.12);
}

/* —— SweetAlert2 (padrão do sistema) —— */
.swal2-container { z-index: 10000 !important; }
.swal2-popup.app-swal {
  border-radius: 12px !important;
  border: 1px solid var(--n-weak);
  box-shadow: var(--shadow);
  font-family: inherit;
  padding: 1.5rem 1.35rem 1.25rem !important;
}
.swal2-title.app-swal-title {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  color: var(--slate-12) !important;
  line-height: 1.35 !important;
  padding: 0 !important;
}
.swal2-html-container.app-swal-html {
  font-size: 0.9rem !important;
  color: var(--slate-11) !important;
  margin: 0.5rem 0 0 !important;
}
.swal2-actions.app-swal-actions {
  gap: 8px !important;
  margin-top: 1.25rem !important;
}
.swal2-styled.app-swal-confirm,
.swal2-styled.app-swal-cancel,
.swal2-styled.app-swal-deny {
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  padding: 0.55rem 1rem !important;
  box-shadow: none !important;
}
.swal2-styled.app-swal-cancel {
  color: var(--slate-12) !important;
}
.swal2-icon { margin: 0.35rem auto 0.85rem !important; }
.swal2-toast.app-swal {
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
}
html.dark .swal2-popup.app-swal,
body.dark .swal2-popup.app-swal {
  border-color: var(--n-strong);
  box-shadow: 0 10px 28px rgb(0 0 0 / 45%);
}
html.dark .swal2-styled.app-swal-cancel,
body.dark .swal2-styled.app-swal-cancel {
  color: var(--slate-12) !important;
}
