:root {
  --bg: #1b1b1e; --rail: #161618; --menu: #27262b; --card: #232227; --raised: #323138; --line: #34333a;
  --text: #ffffff; --soft: #b7b6bd; --muted: #8e8c96; --accent: #5a4bff; --accent-soft: #7b70ff; --accent-bg: rgba(90, 75, 255, .14);
  --good: #3dd68c; --warn: #f5a524; --bad: #f04b5a; --out: #dcd8ff; --out-text: #1b1b1e; --in: #2c2b31;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--accent-soft); }
button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button.quiet { background: var(--raised); color: var(--text); font-weight: 500; }
button.ghost { background: transparent; color: var(--soft); font-weight: 500; padding: 6px 8px; }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
button.small { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; filter: none; }
input, select, textarea { width: 100%; background: var(--menu); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-soft); }
label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 4px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); font-size: 14px; }
.error { color: var(--bad); min-height: 1em; margin: 6px 0; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
h1, h2, h3 { margin: 0; }

/* Login */
.login { display: grid; grid-template-columns: 1fr 1fr; height: 100%; }
.login-brand { background: var(--accent); display: grid; place-content: center; text-align: center; padding: 40px; gap: 10px; }
.login-brand h1 { font-size: 26px; }
.login-brand p { color: rgba(255,255,255,.85); margin: 0; }
.login-form { align-self: center; justify-self: center; width: min(340px, 90vw); }
.login-form h2 { font-size: 18px; margin-bottom: 8px; }
.login-form button { width: 100%; margin-top: 16px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.logo.big { width: 64px; height: 64px; font-size: 30px; margin: 0 auto 6px; background: #fff; color: var(--accent); border-radius: 18px; }
@media (max-width: 800px) { .login { grid-template-columns: 1fr; } .login-brand { display: none; } }

/* Estrutura */
#shell { display: grid; grid-template-columns: 56px 230px 1fr; height: 100%; }
#shell.menu-closed { grid-template-columns: 56px 0 1fr; }
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; border-right: 1px solid var(--line); }
.rail .logo { margin-bottom: 14px; }
.rail button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: transparent; color: var(--soft); border-radius: 10px; position: relative; }
.rail button.active { background: var(--raised); color: #fff; }
.rail button svg { width: 20px; height: 20px; }
.rail .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.rail .spacer { flex: 1; }
.menu { background: var(--menu); padding: 18px 12px; overflow: auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.menu h1 { font-size: 18px; padding: 0 8px 12px; }
.menu .item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; color: var(--soft); cursor: pointer; font-size: 14px; }
.menu .item:hover { background: rgba(255,255,255,.04); }
.menu .item.active { background: var(--raised); color: #fff; font-weight: 600; }
.menu .item .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .group { margin: 10px 0 4px; padding: 7px 10px; background: var(--raised); border-radius: 8px; font-weight: 700; color: var(--soft); font-size: 13px; }
.menu .tool { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; background: var(--raised); font-weight: 700; font-size: 13px; cursor: pointer; margin-bottom: 8px; }
.menu .search { margin-bottom: 6px; }
.menu .footer { margin-top: auto; padding: 12px 8px 0; color: var(--soft); font-size: 13px; }
.menu .footer .bar { height: 6px; border-radius: 4px; background: var(--raised); margin-top: 6px; overflow: hidden; }
.menu .footer .bar span { display: block; height: 100%; background: var(--accent-soft); }
.content { overflow: auto; padding: 22px 28px; min-width: 0; display: flex; flex-direction: column; }
.page-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.page-title h2 { font-size: 20px; }
.page-title .spacer { flex: 1; }

/* Status */
.st { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.st.connected { background: var(--good); }
.st.qr, .st.connecting, .st.reconnecting { background: var(--warn); }
.st.error { background: var(--bad); }
.badge { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 12px; padding: 2px 9px; font-size: 12px; background: var(--raised); color: var(--soft); white-space: nowrap; }
.pill.good { color: var(--good); background: rgba(61,214,140,.12); }
.pill.warn { color: var(--warn); background: rgba(245,165,36,.12); }
.pill.bad { color: var(--bad); background: rgba(240,75,90,.12); }
.pill.accent { color: var(--accent-soft); background: var(--accent-bg); }

/* Chat em 3 colunas */
.chat { flex: 1; min-height: 0; display: grid; grid-template-columns: 330px 1fr 330px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.col { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.col:last-child { border-right: 0; }
.col-head { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--line); position: relative; }
.col-head.accented { border-left: 4px solid var(--warn); }
.col-head .grow { flex: 1; min-width: 0; }
.col-head .phone { font-weight: 600; }
.list-tools { display: flex; gap: 8px; padding: 12px; }
.convs { list-style: none; margin: 0; padding: 0 6px 6px; overflow: auto; flex: 1; }
.convs li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--line); }
.convs li:hover { background: rgba(255,255,255,.03); }
.convs li.active { background: var(--raised); }
.convs .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convs .preview { color: var(--soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convs .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; color: var(--muted); }
.convs .side.unread { color: var(--accent-soft); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font-weight: 700; color: var(--soft); }
.avatar.small { width: 36px; height: 36px; font-size: 13px; }
.empty-state { flex: 1; display: grid; place-content: center; text-align: center; gap: 10px; padding: 30px; color: var(--soft); }
.empty-state h3 { color: #fff; font-size: 20px; }
.empty-state svg { width: 46px; height: 46px; margin: 0 auto; color: #fff; }
.messages { list-style: none; margin: 0; padding: 16px 20px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; background: #19191c; }
.messages li { max-width: 72%; padding: 8px 11px; border-radius: 10px; background: var(--in); white-space: pre-wrap; overflow-wrap: anywhere; }
.messages li.out { align-self: flex-end; background: var(--out); color: var(--out-text); }
.messages li.failed { outline: 1px solid var(--bad); }
.messages .meta { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; text-align: right; }
.messages li.out .meta { color: #55536a; }
.composer { display: flex; gap: 10px; padding: 12px 14px; background: var(--card); border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { resize: none; min-height: 42px; max-height: 140px; }
.thread-error { padding: 0 14px; margin: 4px 0; }
.suggestion { margin: 10px 14px 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-bg); border: 1px solid rgba(123,112,255,.4); }
.suggestion.empty { background: transparent; border-style: dashed; border-color: var(--line); padding: 8px 12px; }
.suggestion .head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--soft); margin-bottom: 6px; flex-wrap: wrap; }
.suggestion .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.suggestion .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.suggestion .action { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--warn); margin-top: 8px; }

/* Painel da direita */
.side-panel { overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.section { background: var(--card); border-radius: 10px; }
.section > summary { list-style: none; cursor: pointer; padding: 11px 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary::before { content: "›"; transform: rotate(90deg); display: inline-block; color: var(--soft); }
.section:not([open]) > summary::before { transform: none; }
.section .body { padding: 0 14px 14px; }
.info { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-left: 4px solid var(--accent-soft); background: var(--raised); border-radius: 8px; font-size: 13px; color: var(--soft); }
.kv { display: grid; gap: 6px; font-size: 13px; }
.kv div { display: flex; gap: 8px; color: var(--soft); overflow-wrap: anywhere; }
.kv svg { width: 16px; height: 16px; flex: none; color: var(--muted); margin-top: 2px; }
.purchases { display: grid; gap: 8px; }
.purchase { background: var(--raised); border-radius: 8px; padding: 10px 12px; display: grid; gap: 3px; font-size: 13px; }
.purchase.off { opacity: .7; }
.purchase .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.purchase .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.task-line { font-size: 13px; color: var(--warn); }

/* Tabelas */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search-box { flex: 1; min-width: 220px; position: relative; }
.toolbar .search-box input { padding-left: 34px; background: transparent; border-color: transparent; }
.toolbar .search-box input:focus { border-color: var(--line); }
.toolbar .search-box svg { position: absolute; left: 10px; top: 10px; width: 18px; height: 18px; color: var(--soft); }
.toolbar select { width: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid th { text-align: left; font-weight: 500; color: var(--soft); background: var(--card); padding: 12px; position: sticky; top: 0; }
table.grid th:first-child { border-radius: 8px 0 0 8px; }
table.grid th:last-child { border-radius: 0 8px 8px 0; }
table.grid td { padding: 13px 12px; border-bottom: 1px solid #242328; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: rgba(255,255,255,.03); }
.ev { display: inline-flex; align-items: center; gap: 6px; }
.ev i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.ev.good i { background: var(--good); } .ev.warn i { background: var(--warn); } .ev.bad i { background: var(--bad); }

/* Cartões */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-content: start; }
.card { background: var(--card); border-radius: 10px; padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 6px; }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: center; }
.stat b { display: block; font-size: 15px; margin-bottom: 8px; }
.stat span { color: var(--accent-soft); font-size: 26px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.qr { display: block; margin: 10px auto; background: #fff; border-radius: 8px; }
.stats { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.stats td, .stats th { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }

/* Menus suspensos, gaveta e aviso */
.pop { position: absolute; z-index: 30; background: var(--raised); border-radius: 10px; padding: 6px; min-width: 210px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.pop button { display: flex; width: 100%; gap: 10px; background: transparent; color: var(--text); font-weight: 500; text-align: left; padding: 9px 10px; border-radius: 6px; }
.pop button:hover { background: rgba(255,255,255,.06); }
.pop button.red { color: var(--bad); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--card); z-index: 40; box-shadow: -20px 0 40px rgba(0,0,0,.4); display: flex; flex-direction: column; }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.drawer header h2 { flex: 1; font-size: 20px; }
.drawer .tabs { display: flex; border-bottom: 1px solid var(--line); margin-top: 12px; }
.drawer .tabs button { flex: 1; background: transparent; color: var(--soft); border-radius: 0; font-weight: 500; border-bottom: 2px solid transparent; }
.drawer .tabs button.active { color: var(--accent-soft); border-bottom-color: var(--accent-soft); }
.drawer .body { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.timeline { display: grid; gap: 10px; font-size: 13px; }
.timeline div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--raised); padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 20px rgba(0,0,0,.4); }

@media (max-width: 1200px) { .chat { grid-template-columns: 300px 1fr; } .chat .col.right { display: none; } }
@media (max-width: 860px) { #shell { grid-template-columns: 56px 1fr; } .menu { display: none; } .chat { grid-template-columns: 1fr; } .chat .col.list-col.hide-mobile { display: none; } }
.menu svg, .tool svg { width: 18px; height: 18px; flex: none; }
button.ghost svg { width: 18px; height: 18px; display: block; }

/* Equipe, setores, respostas rápidas e saúde dos números */
.rail .me { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-soft); display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-bottom: 4px; cursor: default; }
.tag { margin-left: 6px; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px; vertical-align: middle; }
.tag.suporte { background: rgba(61,214,140,.12); color: var(--good); }
.tag.comercial { background: var(--accent-bg); color: var(--accent-soft); }
.composer { position: relative; }
.quick-box { position: absolute; left: 14px; right: 14px; bottom: calc(100% + 4px); background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; z-index: 5; box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
.quick-box button { background: transparent; color: var(--text); text-align: left; font-weight: 400; display: flex; gap: 10px; padding: 7px 8px; }
.quick-box button:hover { background: var(--menu); }
.quick-box b { color: var(--accent-soft); white-space: nowrap; }
.quick-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card .sub { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.warn-text { color: var(--warn); font-size: 12px; margin: 8px 0 0; }
.card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card.off { opacity: .55; }
.card.health { border-left: 3px solid var(--good); }
.card.health.amarelo { border-left-color: var(--warn); }
.card.health.vermelho { border-left-color: var(--bad); }
.meter { margin: 12px 0; }
.meter .bar { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; margin-bottom: 6px; }
.meter .bar span { display: block; height: 100%; background: var(--accent-soft); }
.health.amarelo .meter .bar span { background: var(--warn); }
.health.vermelho .meter .bar span { background: var(--bad); }
.mini-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; font-size: 11px; color: var(--muted); }
.mini-stats b { display: block; color: var(--text); font-size: 17px; }
.alerts { margin: 12px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; }
td.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.invite { margin-bottom: 14px; border: 1px solid var(--accent-soft); }
button.small svg, button.quiet svg { width: 15px; height: 15px; vertical-align: -3px; }
button.quiet.small { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tag { margin-left: 0; }
.cards { align-items: start; }

/* Anexos */
.composer .icon-btn { padding: 8px; align-self: center; }
.composer .icon-btn svg, .pending .icon-btn svg { width: 20px; height: 20px; }
#mic.recording { color: var(--bad); font-weight: 700; font-size: 12px; min-width: 64px; }
.pending { position: absolute; left: 14px; right: 14px; bottom: calc(100% + 4px); display: flex; align-items: center; gap: 12px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; z-index: 4; }
.pending img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; }
.pending audio { height: 36px; max-width: 260px; }
.pending .grow { min-width: 0; display: flex; flex-direction: column; }
.pending b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending small, .media-doc small { color: var(--muted); }
.pending-icon svg { width: 30px; height: 30px; color: var(--accent-soft); }
.messages li.has-media { display: flex; flex-direction: column; gap: 6px; }
.media-img { display: block; max-width: 280px; max-height: 320px; border-radius: 8px; cursor: zoom-in; }
.media-video { max-width: 300px; border-radius: 8px; }
.media-audio { width: 260px; height: 40px; }
.media-doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.18); color: inherit; text-decoration: none; min-width: 200px; }
.media-doc svg { width: 26px; height: 26px; flex: none; }
.media-doc span { display: flex; flex-direction: column; min-width: 0; }
.media-doc b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.media-error { font-size: 12px; color: var(--muted); font-style: italic; }

/* Dicas de ajuda (i) */
.tip { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font: italic 700 10px/1 Georgia, serif; cursor: help; vertical-align: 1px; flex: none; }
.tip:hover, .tip:focus { color: var(--accent-soft); border-color: var(--accent-soft); outline: none; }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; padding: 9px 11px; border-radius: 8px; background: #3a3941; color: #fff; font: 400 12px/1.45 Inter, system-ui, sans-serif; font-style: normal; text-align: left; white-space: normal; box-shadow: 0 8px 24px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 50; }
.tip:hover::after, .tip:focus::after { opacity: 1; }
.page-title .tip::after, .sub .tip::after { left: 0; transform: none; }
th .tip::after { bottom: auto; top: calc(100% + 8px); }

/* ---- etiquetas, CRM e funis ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.chips.small { gap: 4px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 18px;
  background: color-mix(in srgb, var(--c, #7b70ff) 18%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--c, #7b70ff) 45%, transparent); white-space: nowrap; }
.chips.small .chip { font-size: 11px; padding: 0 7px; line-height: 16px; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #7b70ff); flex: none; }
.chip-x { background: none; border: 0; color: var(--muted); padding: 0 0 0 2px; cursor: pointer; font-size: 14px; line-height: 1; min-height: 0; }
.chip.add { background: transparent; border: 1px dashed var(--line); color: var(--muted); cursor: pointer; }
.chip.var { background: var(--raised); border: 1px solid var(--line); cursor: pointer; font-family: ui-monospace, monospace; }
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.stage { flex: 0 0 270px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 10px; display: flex; flex-direction: column; max-height: 75vh; }
.stage.over { outline: 2px dashed var(--c); }
.stage-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.stage-head b { flex: 1; }
.stage-head .count { font-size: 12px; color: var(--muted); background: var(--bg); padding: 0 8px; border-radius: 999px; }
.stage-head .auto { cursor: help; }
.stage-cards { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.stage-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 6px; border: 1px dashed var(--line); border-radius: 8px; }
.card-crm { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: grab; }
.card-crm:hover { border-color: var(--c); }
.card-crm.dragging { opacity: .4; }
.card-crm .row-top { display: flex; align-items: center; gap: 6px; }
.card-crm .row-top strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiny { font-size: 11px; }
.bulk { display: flex; align-items: center; gap: 8px; }
.steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; }
input.num { width: 70px; }
.variants { display: flex; flex-direction: column; gap: 6px; }
.variant { display: flex; gap: 6px; align-items: flex-start; }
.variant textarea { flex: 1; }
.step-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
label.inline, div.inline { display: inline-flex; align-items: center; gap: 6px; flex-direction: row; }
label.inline input[type=checkbox] { width: auto; }
.days { display: inline-flex; gap: 6px; }
.day { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; flex-direction: row; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; gap: 8px; }
input.switch { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
input.switch:checked { background: #3dd68c; }
input.switch:checked::after { left: 18px; }
.danger { color: #f04b5a; }
input[type=checkbox], input[type=color] { width: auto; }
input[type=color] { padding: 2px; height: 36px; width: 48px; }
.toolbar form, form.toolbar { display: flex; gap: 8px; align-items: center; }
form.toolbar input:not([type=color]) { max-width: 320px; }
.step-head select, .step .row select, .step-opts input[type=time], .bulk select { width: auto; }
.step .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
label.inline { white-space: nowrap; }
.step-head .spacer { flex: 1; }
.list-tools { flex-wrap: wrap; }
.list-tools input[type=search] { flex: 1 1 100%; }
.list-tools select { flex: 1 1 0; width: auto !important; }
.convs .chips.small { flex-wrap: nowrap; overflow: hidden; }
table.grid td:last-child { white-space: normal; }
table.grid td:last-child button { margin: 2px 4px 2px 0; }
.list-tools { display: grid !important; grid-template-columns: 1fr 1fr; }
.list-tools input[type=search] { grid-column: 1 / -1; }
