/* AdScout Solution WB Web — Painel Admin. by Juan Guedes */
:root {
  --green: #00a884;
  --green-d: #008f72;
  --green-l: #16a34a;
  --accent: #14b8a6;
  --ink: #111b21;
  --muted: #667781;
  --line: #e9edef;
  --bg: #f0f2f5;
  --side-bg: #ffffff;
  --side-text: #3b4a54;
  --danger: #e74c3c;
  --radius: 12px;
  /* tokens de superfície (usados pelo modo escuro) */
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --surface-3: #eef1f3;
  --grad-brand: linear-gradient(135deg, var(--green-l), var(--green-d));
  --ring: 0 0 0 3px rgba(14,122,55,.18);
  --shadow-sm: 0 1px 2px rgba(17,27,33,.06);
  --shadow-md: 0 8px 24px rgba(17,27,33,.12);
}
/* ===== MODO ESCURO (paleta da logo: verde + azul-marinho) ===== */
html.dark {
  --bg: #0b1426;
  --ink: #e9eef7;
  --muted: #9fb0cf;
  --line: rgba(255,255,255,.10);
  --green: #18a94a;
  --green-d: #0e7a37;
  --green-l: #22c55e;
  --surface: #15223e;
  --surface-2: #1c2b4a;
  --surface-3: #233456;
  --side-bg: #0c1730;
  --side-text: #e7ecf7;
  --ring: 0 0 0 3px rgba(34,197,94,.28);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 10px 30px rgba(0,0,0,.5);
}
html.dark body { background: var(--bg); }
html.dark .card, html.dark .modal, html.dark .auth-card, html.dark .auth-foot, html.dark .kpi,
html.dark .kb-head, html.dark .kb-card, html.dark .tut-hero, html.dark .tut-card, html.dark .tour-card,
html.dark .qr-pop, html.dark .inbox, html.dark .inbox-scope, html.dark .inbox-search, html.dark .load-more,
html.dark .msg-menu, html.dark .cat-pop, html.dark .fup-pop, html.dark .aud-pop, html.dark .calc-widget,
html.dark .chat-head, html.dark .chat-compose, html.dark .bubble.them { background: var(--surface); color: var(--ink); }
html.dark input, html.dark textarea, html.dark select, html.dark .inbox-search select,
html.dark .inbox-scope button, html.dark .chat-act, html.dark .lm-btn, html.dark .calc-key,
html.dark .calc-disp, html.dark .chat-compose input[type=text], html.dark .media-attached,
html.dark .fin-summary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
html.dark .inbox-chat, html.dark .chat-msgs { background: var(--bg); }
html.dark .bubble.me { background: #1e4a37; color: #e7f7ee; }
html.dark .chat-item:hover, html.dark .chat-item.active, html.dark .calc-key:hover,
html.dark .inbox-scope button:hover, html.dark .perm:hover, html.dark .fup-item:hover { background: var(--surface-2); }
html.dark .ai-thumb, html.dark .svc-photos, html.dark .meth-bar, html.dark .funnel-bar,
html.dark .cat-noimg, html.dark .brand-logo-prev, html.dark .chat-head-tags { background: var(--surface-3); }
html.dark .muted-box, html.dark .auth-note, html.dark .audio-preview { background: #3a2f10; color: #ffe6a3; border-color: #5a4a1a; }
html.dark .inbox-scope button { color: var(--muted); }
html.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 6px; }
/* seletor segmentado (modo claro/escuro) */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn { border: none; background: none; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn.active { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-sm); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* ---------- Tela de login / bootstrap ---------- */
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0a1430; }
.auth-bg svg { width: 100%; height: 100%; display: block; }
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  background: #fff; width: 100%; max-width: 410px; border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45); overflow: hidden;
}
.auth-head { background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; padding: 26px 28px 20px; }
.auth-head h1 { font-size: 20px; display: flex; align-items: center; gap: 9px; }
.auth-head p { font-size: 12px; opacity: .9; margin-top: 4px; }
.auth-body { padding: 24px 28px 26px; }
.auth-foot { background: #f7f9fc; border-top: 1px solid var(--line); padding: 14px 24px 18px; text-align: center; }
.af-co { font-weight: 800; color: #0f1b2e; font-size: 13.5px; }
.af-info { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.af-sup { display: inline-block; margin-top: 10px; padding: 7px 12px; background: #e7f8f2; border-radius: 20px; color: #0b7a52; font-weight: 600; font-size: 12.5px; text-decoration: none; }
.af-sup:hover { background: #d3f1e7; }
.af-ver { margin-top: 9px; font-size: 10px; letter-spacing: .6px; color: var(--muted); opacity: .8; }
.auth-note { background: #fff8e1; border: 1px solid #ffe49b; color: #7a5b00; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; line-height: 1.45; }
.auth-body h2 { font-size: 16px; margin-bottom: 4px; }
.auth-body .sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.4; }

label { display: block; font-size: 12.5px; font-weight: 600; color: #54656f; margin: 12px 0 5px; }
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d9dde0; border-radius: 9px;
  font-size: 14px; outline: none; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 70px; }

.btn {
  background: var(--grad-brand); color: #fff; border: none; padding: 11px 16px;
  border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn:hover { filter: brightness(1.06); }
.btn.full { width: 100%; margin-top: 18px; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.secondary { background: #eceff1; color: #3b4a54; }
.btn.secondary:hover { background: #dfe4e7; }
.btn.danger { background: #fdecea; color: var(--danger); }
.btn.danger:hover { background: #fbd9d4; }
.btn.ghost { background: transparent; color: var(--green-d); }

.msg { font-size: 13px; padding: 10px 12px; border-radius: 9px; margin-top: 14px; display: none; }
.msg.show { display: block; }
.msg.error { background: #fdecea; color: #b3382c; }
.msg.success { background: #d9fdd3; color: #045b46; }

/* ---------- App / shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 240px; background: var(--side-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(128,128,128,.18); flex-shrink: 0; }
.brand .name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 7px; color: var(--side-text); }
.brand .by { font-size: 11px; color: var(--side-text); opacity: .6; margin-top: 2px; }
.nav { padding: 8px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.nav::-webkit-scrollbar { width: 7px; }
.nav::-webkit-scrollbar-thumb { background: rgba(128,128,128,.32); border-radius: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav { scrollbar-width: thin; scrollbar-color: rgba(128,128,128,.32) transparent; }
.nav button {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: var(--side-text);
  display: flex; align-items: center; gap: 9px; margin-bottom: 2px;
}
.nav-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; color: var(--side-text); opacity: .45; padding: 11px 12px 4px; }
.nav-sec:first-child { padding-top: 2px; }
.nav button:hover { background: rgba(128,128,128,.14); }
.nav button.active { background: var(--grad-brand); color: #fff; font-weight: 700; box-shadow: var(--shadow-sm); }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.chk-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; margin: 8px 0; cursor: pointer; line-height: 1.4; }
.chk-row input { margin-top: 2px; flex-shrink: 0; }

/* Formulários em grade */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid label { font-size: 12px; color: var(--muted); }

/* Agenda / lembretes */
.ag-sec { margin-bottom: 18px; }
.ag-sec h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
.ag-sec.late h4 { color: #c0392b; }
.ag-row { display: flex; align-items: center; gap: 10px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 7px; }
.ag-sec.late .ag-row { border-color: #f3c2bd; background: #fdf3f1; }
.ag-row.done { opacity: .6; }
.ag-row.done .ag-title { text-decoration: line-through; }
.ag-check { background: none; border: none; font-size: 19px; cursor: pointer; flex-shrink: 0; }
.ag-main { flex: 1; min-width: 0; }
.ag-title { font-weight: 600; font-size: 14px; }
.ag-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ag-acts { display: flex; gap: 2px; flex-shrink: 0; }

/* Orçamentos */
.q-items-head { display: grid; grid-template-columns: 1fr 70px 110px 36px; gap: 8px; font-size: 11px; color: var(--muted); margin: 6px 0 4px; padding: 0 2px; }
.q-item-row { display: grid; grid-template-columns: 1fr 70px 110px 36px; gap: 8px; margin-bottom: 6px; align-items: center; }
.q-item-row input { width: 100%; }
.q-total { font-size: 17px; font-weight: 800; color: var(--green-d); text-align: right; }

/* Relatórios */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi-card { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi-val { font-size: 24px; font-weight: 800; color: var(--green-d); }
.kpi-lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.rep-bars { display: flex; align-items: flex-end; gap: 6px; min-height: 110px; }
.rep-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; justify-content: flex-end; }
.rep-bar { width: 70%; max-width: 34px; background: linear-gradient(180deg, var(--green), var(--green-d)); border-radius: 5px 5px 0 0; min-height: 4px; }
.rep-bar-n { font-size: 11px; font-weight: 700; color: var(--ink); }
.rep-bar-col small { font-size: 10px; color: var(--muted); }
.rep-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.rep-line { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rep-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
@media (max-width: 700px) { .form-grid, .rep-cols { grid-template-columns: 1fr; } }

/* Anexos múltiplos (follow-up / respostas) */
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-list:empty { display: none; }
.att-adders { margin-top: 6px; }
.media-attached { display: flex; align-items: center; gap: 8px; background: #f0f2f5; border-radius: 8px; padding: 5px 8px; }
.media-attached .media-name { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Imagens IA */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ai-thumb { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #eef1f3; aspect-ratio: 1; }
.ai-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ai-thumb-acts { position: absolute; bottom: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.ai-thumb:hover .ai-thumb-acts { opacity: 1; }
.ai-thumb-acts .iconbtn { background: rgba(0,0,0,.65); color: #fff; border-radius: 8px; }
.ref-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 24px; }
.ref-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 16px; padding: 0; border: none; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 14px; cursor: pointer; }

/* Atividade */
.act-day { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--muted); margin: 14px 2px 6px; }
.act-item { display: flex; align-items: center; gap: 10px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; }
.act-ic { font-size: 18px; width: 30px; text-align: center; flex-shrink: 0; }
.act-body { flex: 1; min-width: 0; }
.act-main { font-size: 13.5px; }
.act-det { color: var(--green-d); font-weight: 600; }
.act-area { font-size: 11px; background: #eef3fb; color: #1f6feb; font-weight: 600; padding: 2px 9px; border-radius: 10px; flex-shrink: 0; }
.act-time { font-size: 12px; color: var(--muted); flex-shrink: 0; min-width: 42px; text-align: right; }

/* CRM lista */
.crm-name { display: flex; align-items: center; gap: 9px; }
.crm-table td { vertical-align: middle; }
.lead-row { cursor: pointer; }
.lead-row:hover { background: #f6fbf9; }

/* CRM Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kb-col { flex: 0 0 250px; background: var(--bg, #f0f2f5); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
/* Kanban em tela cheia: cabeçalho fixo, rolagem só no quadro */
.main.crm-kb .crm-top { padding: 18px 24px 8px; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.main.crm-kb .crm-top .page-head { margin-bottom: 10px; }
.main.crm-kb #crm-board { flex: 1; min-height: 0; padding: 14px 24px 14px; }
/* o quadro rola na horizontal (arrastar pro lado) e cada coluna na vertical */
.main.crm-kb #crm-board.kanban { height: 100%; padding-bottom: 14px; align-items: stretch; overflow-x: auto; overflow-y: hidden; }
.main.crm-kb .kb-col { max-height: 100%; }
.kb-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-weight: 700; font-size: 13px; border-radius: 12px 12px 0 0; background: #fff; }
.kb-count { background: var(--line); color: var(--muted); border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.kb-cards { padding: 8px; overflow-y: auto; flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.kb-cards.kb-over { background: rgba(0,168,132,.08); outline: 2px dashed var(--green); outline-offset: -4px; border-radius: 8px; }
.kb-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 14px 0; }
.kb-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.kb-card:hover { border-color: var(--green); }
.kb-card.dragging { opacity: .4; }
.kb-card-top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.kb-av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.kb-card-sub { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.kb-card .conv-tag { margin-right: 4px; }

/* Serviços */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.svc-card { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.svc-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; height: 120px; background: #eef1f3; }
.svc-photos img { width: 100%; height: 100%; object-fit: cover; }
.svc-photos img:only-child { grid-column: 1 / -1; }
.svc-noimg { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.svc-body { padding: 12px 14px; flex: 1; }
.svc-name { font-weight: 700; font-size: 15px; }
.svc-price { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.svc-acts { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.svc-acts .btn { flex: 1; }
.sv-comp-row { display: grid; grid-template-columns: 1fr 140px 32px; gap: 8px; margin-bottom: 6px; align-items: center; }
.sv-comp-row input, .sv-comp-row select { width: 100%; }
.svc-tbl-head { display: grid; grid-template-columns: 1fr 120px 32px; gap: 8px; font-size: 11px; color: var(--muted); margin: 4px 0 2px; }
.sv-tbl-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 8px; margin-bottom: 6px; align-items: center; }
.sv-tbl-row input { width: 100%; }
.svc-cat { margin-bottom: 22px; }
.svc-cat-h { font-size: 14px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--green); display: inline-block; }
.svc-sizes { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.svc-size { background: #eef3fb; color: #1f6feb; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.svc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.svc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.svc-thumb-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.side .me { padding: 14px 16px; border-top: 1px solid rgba(128,128,128,.18); font-size: 13px; flex-shrink: 0; }
.side .me .uname { font-weight: 700; color: var(--side-text); }
.side .me .urole { color: var(--side-text); opacity: .65; font-size: 12px; }

.main { flex: 1; padding: 28px 32px; max-width: 1000px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-head h2 { font-size: 21px; }
.page-head .desc { font-size: 13px; color: var(--muted); margin-top: 3px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; margin-bottom: 18px; }

/* tabela */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.pill.admin { background: #e7e0ff; color: #5b3bbd; }
.pill.supervisor { background: #d6ecff; color: #1f6fb0; }
.pill.atendente { background: #d9fdd3; color: #045b46; }
.pill.vendedor { background: #fde9d0; color: #b5651d; }
.pill.designer { background: #efe0ff; color: #7a3fd1; }
.pill.producao { background: #e1e7ec; color: #34495e; }
.pill.financeiro { background: #d8f5e8; color: #0e8a5f; }
.pill.posvenda { background: #dbeeff; color: #2272a8; }
.pill.off { background: #f0f0f0; color: #999; }
.row-actions { display: flex; gap: 6px; }
.iconbtn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 13px; }
.iconbtn:hover { background: #f3f5f6; }
.iconbtn.del:hover { background: #fdecea; border-color: #f5c6c0; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(17,27,33,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.x { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

/* permissões */
.perm-group { margin-top: 14px; }
.perm-group h4 { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; margin-bottom: 7px; }
.perm { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; cursor: pointer; font-size: 13.5px; }
.perm:hover { background: #f9fafb; }
.perm input { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }

/* respostas/etiquetas no admin */
.reply-row, .tag-row { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.reply-row .chip { background: #d9fdd3; color: #045b46; font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.tag-row input[type=color] { width: 42px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid #d9dde0; cursor: pointer; }
.muted-box { background: #fff8e1; color: #7a5c00; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45; }

/* Organizador de menu */
.menu-org-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; }
.menu-org-row.off { opacity: .55; background: #f6f7f8; }
.menu-org-row .mo-label { font-weight: 600; font-size: 13.5px; }
.menu-org-row .mo-actions { display: flex; gap: 5px; }
.menu-org-row .mo-tog { font-size: 12px; }

/* mídia anexada na resposta */
.media-zone { margin-top: 8px; }
.add-media { color: #008f72; border-color: #b6e6d7; }
.add-media:hover { background: #e7f8f2; }
.media-attached { display: flex; align-items: center; gap: 10px; background: #f6f8f9; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.media-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.media-doc { font-size: 30px; line-height: 1; }
.media-name { flex: 1; font-size: 12.5px; color: #3b4a54; word-break: break-all; }

/* CRM */
.lead-row { cursor: pointer; }
.lead-row:hover td { background: #f6fbf9; }
.lead-tag { display: inline-block; padding: 2px 9px; border-radius: 20px; color: #fff; font-size: 11px; font-weight: 600; margin: 1px 2px; }
.lead-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.lead-tag.toggle { cursor: pointer; user-select: none; transition: opacity .12s; }
.lead-tag.toggle:hover { filter: brightness(1.05); }

/* Financeiro */
.pos { color: #00a884 !important; }
.neg { color: #e74c3c !important; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi-val { font-size: 22px; font-weight: 800; }
.fin-h { font-size: 15px; margin: 20px 0 8px; }
.fin-block { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.fin-block h4 { font-size: 14px; margin-bottom: 6px; }
.fin-summary { background: #f6f8f9; border-radius: 9px; padding: 8px 12px; margin: 8px 0; }
.fin-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; }
.pay-list { margin-top: 6px; }
.pay { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.meth { margin-bottom: 10px; }
.meth-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.meth-bar { height: 8px; background: #eef1f3; border-radius: 6px; overflow: hidden; }
.meth-bar > div { height: 100%; background: var(--green); border-radius: 6px; }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* Visão geral (home) mais organizada */
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.kpi-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.kpi-ic { font-size: 17px; }
.kpi-label { margin-bottom: 0; }
.home-sec { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 20px 0 10px; }
.home-hero { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(120deg, #0e2c5a, #123e85); color: #eaf1ff; border-radius: 16px; padding: 18px 20px; }
.home-hero .hh-date { font-size: 13px; opacity: .85; margin-bottom: 6px; }
.home-hero .hh-wa { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.home-hero .hh-wa.wa-ok { color: #6ff0b6; } .home-hero .hh-wa.wa-warn { color: #ffd66b; } .home-hero .hh-wa.wa-bad { color: #ff9b9b; }
.home-hero .hh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.home-hero .hh-actions .btn.secondary { background: rgba(255,255,255,.16); color: #fff; border-color: transparent; }

/* Tutorial: página + guia */
.tut-hero { display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.tut-hero-robot { width: 96px; flex: 0 0 96px; }
.tut-hero-robot svg, .tour-robot svg { width: 100%; height: auto; display: block; }
.tut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.tut-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tut-card .tut-ic { font-size: 24px; flex: 0 0 auto; }
.tut-card .tut-name { font-weight: 700; font-size: 14px; }
.tut-card .tut-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tut-card .btn { margin-left: auto; flex: 0 0 auto; }

/* Tour guiado (overlay com mascote) */
.tour { position: fixed; inset: 0; z-index: 4000; }
.tour.tour-center { background: rgba(10,18,38,.66); }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 4px var(--green), 0 0 0 9999px rgba(10,18,38,.66); transition: all .25s ease; pointer-events: none; }
.tour-pop { position: fixed; display: flex; align-items: flex-end; gap: 4px; width: 360px; max-width: calc(100vw - 24px); }
.tour.tour-center .tour-pop { position: static; margin: 0 auto; top: auto; left: auto; transform: translateY(38vh); }
.tour-robot { width: 84px; flex: 0 0 84px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); margin-bottom: -6px; }
.tour-card { background: #fff; border-radius: 16px; padding: 16px 16px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.35); flex: 1; }
.tour-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tour-meta #tour-count { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tour-skip { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.tour-skip:hover { color: #e74c3c; }
.tour-card h3 { font-size: 17px; margin: 0 0 6px; color: #0f2747; }
.tour-card p { font-size: 13.5px; line-height: 1.5; color: #3b4a54; margin: 0 0 12px; }
.tour-dots { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: #d7dee6; }
.tour-dots span.on { background: var(--green); transform: scale(1.25); }
.tour-ctrls { display: flex; justify-content: space-between; gap: 8px; }
.tour-ctrls .btn { width: auto; }
@media (max-width: 600px) { .tour-pop { flex-direction: column; align-items: center; } .tour-robot { width: 64px; flex-basis: 64px; } }

/* Follow-up flutuante */
.fup-fab { position: fixed; bottom: 24px; left: 264px; width: 52px; height: 52px; border-radius: 50%; background: #e67e22; color: #fff; border: none; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 290; display: flex; align-items: center; justify-content: center; }
.fup-fab:hover { background: #d35400; transform: translateY(-2px); }
.fup-pop { position: fixed; bottom: 72px; right: 24px; left: auto; width: 320px; max-width: calc(100vw - 40px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.22); z-index: 291; overflow: hidden; max-height: 60vh; overflow-y: auto; }
.fup-head { background: #e67e22; color: #fff; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.fup-item { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fup-item:hover { background: #fff6ee; }
.fup-item b { display: block; font-size: 13px; }
.fup-item span { font-size: 12px; color: var(--muted); }
.fup-empty { padding: 16px; font-size: 13px; color: var(--muted); }
.fup-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fup-row .fup-label { flex: 1; }
.fup-row .fup-text { width: 100%; }
@media (max-width: 720px) { .fup-fab, .fup-pop { left: 16px; } }

/* Áudios personalizados */
.aud-pop { position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%); width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.22); z-index: 291; overflow: hidden; max-height: 60vh; overflow-y: auto; }
.aud-pop-head { background: var(--green-d); color: #fff; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.aud-pop-item { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.aud-pop-item:hover { background: #f6fbf9; }
.aud-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.aud-row .aud-label { flex: 1; min-width: 90px; }
.aud-row audio { height: 34px; max-width: 200px; }

/* Calculadora */
.calc-widget { position: fixed; bottom: 24px; right: 24px; width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.22); z-index: 300; overflow: hidden; outline: none; }
.calc-widget:focus, .calc-disp:focus { outline: none; }
.calc-head { background: var(--green-d); color: #fff; padding: 10px 14px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.calc-head .calc-x { background: rgba(255,255,255,.2); border: none; color: #fff; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 16px; }
.calc-disp { width: 100%; border: none; border-bottom: 1px solid var(--line); text-align: right; font-size: 26px; padding: 14px 16px; font-weight: 600; color: var(--ink); background: #f9fafb; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.calc-key { border: none; background: #fff; padding: 16px 0; font-size: 17px; cursor: pointer; color: var(--ink); }
.calc-key:hover { background: #f0f2f5; }
.calc-key.op { color: var(--green-d); font-weight: 700; }
.calc-key.clr { color: #e74c3c; }
.calc-key.eq { background: var(--green); color: #fff; font-weight: 700; }
.calc-key.eq:hover { background: var(--green-d); }

/* Visão Geral */
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13.5px; }
.funnel-lbl { width: 150px; flex-shrink: 0; color: #3b4a54; }
.funnel-bar { flex: 1; height: 14px; background: #eef1f3; border-radius: 7px; overflow: hidden; }
.funnel-bar > div { height: 100%; border-radius: 7px; min-width: 2px; transition: width .3s; }
.funnel-row b { width: 34px; text-align: right; }
.home-quick { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.home-quick .btn { width: auto; }

/* Inbox / Atendimento */
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-crm { background: #e7f8f2; color: var(--green-d); border: none; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chat-crm:hover { background: #d3f1e7; }
.chat-head-actions { display: flex; gap: 6px; align-items: center; }
.chat-act { background: #f0f2f5; color: #54656f; border: none; width: 34px; height: 32px; border-radius: 8px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chat-act.crm { width: auto; padding: 0 11px; background: #e7f8f2; color: var(--green-d); font-size: 12.5px; font-weight: 600; gap: 4px; }
.chat-act:hover { filter: brightness(.95); }
.chat-act.on { background: var(--green); color: #fff; }
.chat-act svg { vertical-align: middle; }
.qr-pop { position: relative; }
.qr-pop { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 0 12px; max-height: 200px; overflow-y: auto; box-shadow: 0 -4px 16px rgba(0,0,0,.08); flex-shrink: 0; }
.qr-item { padding: 9px 12px; border-bottom: 1px solid #f0f2f5; cursor: pointer; font-size: 13px; }
.qr-item:hover { background: #f6fbf9; }
.qr-item span { color: var(--muted); }
.inbox-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 22px; background: var(--side-bg); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.inbox-top h2 { font-size: 19px; }
.inbox { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 70vh; background: #fff; }
.inbox.inbox-full { flex: 1; min-height: 0; height: auto; border-radius: 0; border: none; }
.inbox-list { width: 320px; border-right: 1px solid var(--line); overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; }
.inbox-scope { display: flex; gap: 4px; padding: 8px 8px 0; flex-shrink: 0; background: #fff; }
.inbox-scope button { flex: 1; background: #f0f2f5; border: none; border-radius: 8px; padding: 7px 4px; font-size: 12.5px; font-weight: 600; color: #54656f; cursor: pointer; white-space: nowrap; }
.inbox-scope button.active { background: var(--green); color: #fff; }
.inbox-scope .sc-n { opacity: .8; font-size: 11px; }
.inbox-search { padding: 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; position: sticky; top: 0; background: #fff; z-index: 2; }
.inbox-search input { width: 100%; padding: 8px 12px; border-radius: 20px; border: 1px solid var(--line); font-size: 13px; }
#chat-list { flex: 1; overflow-y: auto; }
.chat-head-actions { display: flex; gap: 6px; align-items: center; }
.danger-btn { color: #c0392b !important; }
.danger-btn:hover { background: #fdecea !important; }
.load-more { text-align: center; padding: 6px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.lm-btn { background: #f0f2f5; border: none; color: #3b4a54; font-size: 12px; padding: 5px 14px; border-radius: 16px; cursor: pointer; }
.lm-btn:hover { background: #e4e7eb; }
.lm-btn:disabled { opacity: .6; cursor: default; }
.bubble { position: relative; }
.b-menu { position: absolute; top: 2px; right: 3px; background: none; border: none; color: #8696a0; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 4px; opacity: 0; }
.bubble:hover .b-menu { opacity: 1; }
.b-menu:hover { background: rgba(0,0,0,.08); }
.msg-menu { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); z-index: 500; overflow: hidden; min-width: 170px; }
.msg-menu button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 14px; font-size: 13px; cursor: pointer; }
.msg-menu button:hover { background: #f3f5f6; }
.cat-pop { position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%); width: 340px; max-height: 70vh; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); z-index: 291; display: flex; flex-direction: column; overflow: hidden; }
.cat-head { background: var(--green-d); color: #fff; padding: 11px 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.cat-head .cat-x { background: rgba(255,255,255,.2); border: none; color: #fff; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 16px; }
.cat-body { overflow-y: auto; }
.cat-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cat-item:hover { background: #f6fbf9; }
.cat-item img, .cat-noimg { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cat-noimg { background: #eef1f3; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.cat-info b { display: block; font-size: 13.5px; }
.cat-info span { font-size: 13px; color: var(--green-d); font-weight: 600; }
.inbox-chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f0f2f5; }
.inbox-empty { margin: auto; color: var(--muted); font-size: 15px; }

.chat-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #f0f2f5; cursor: pointer; position: relative; }
.chat-item:hover { background: #f6fbf9; }
.chat-item.active { background: #e7f8f2; }
.chat-av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; overflow: hidden; }
.av-pic { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.ct-name-cell { display: flex; align-items: center; gap: 9px; }
.ct-av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.chat-av.grp { background: #dfe7ea; color: #54656f; }
.chat-info { flex: 1; min-width: 0; }
.chat-top { display: flex; justify-content: space-between; gap: 6px; }
.chat-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.chat-last { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-badge { background: var(--green); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.inbox-search select { width: 100%; margin-top: 8px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 12.5px; background: #fff; color: #111b21; cursor: pointer; }
.chat-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.chat-menu-btn { background: none; border: none; color: #8696a0; font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; border-radius: 4px; opacity: 0; }
.chat-item:hover .chat-menu-btn { opacity: 1; }
.chat-menu-btn:hover { background: rgba(0,0,0,.08); }
.chat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); display: inline-block; }
.conv-tag { display: inline-block; color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
/* etiquetas do CRM na lista de conversa (linha própria, leve) */
.chat-tags { display: flex; gap: 3px; flex-wrap: wrap; margin: 2px 0 1px; max-height: 16px; overflow: hidden; }
.ci-tag { font-size: 9.5px; font-weight: 700; color: #fff; padding: 1px 6px; border-radius: 5px; line-height: 1.45; white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
/* trilho de etiquetas do CRM no topo da conversa */
.chat-head-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 14px; background: var(--surface-2, #f6f8f9); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.cht-lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.cht-none { font-size: 12px; color: var(--muted); font-style: italic; }
.chip-add { border: 1px dashed var(--green); background: none; color: var(--green); font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 20px; cursor: pointer; }
.chip-add:hover { background: rgba(14,122,55,.08); }
.tag-pop { padding-bottom: 8px; }
.tag-pop-list { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 12px; max-width: 280px; }
.msg-menu-sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 7px 14px 3px; border-top: 1px solid var(--line); margin-top: 2px; }
.cp-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.cp-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.cp-row:hover { background: #f6fbf9; }
.cp-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-fone { font-size: 12px; color: var(--muted); }

.chat-head { padding: 9px 14px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-head-name { display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 4px 8px 4px 4px; border-radius: 8px; text-align: left; min-width: 0; }
.chat-head-name.clickable { cursor: pointer; }
.chat-head-name.clickable:hover { background: #f3f5f6; }
.chh-av { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; overflow: hidden; }
.chh-av.grp { background: #dfe7ea; color: #54656f; }
.chh-txt { display: flex; flex-direction: column; min-width: 0; }
.chh-name { font-weight: 600; font-size: 14.5px; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chh-sub { font-size: 12px; color: var(--muted); }
/* Painel do contato */
.cc-av { width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; font-weight: 700; font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 4px auto 10px; overflow: hidden; }
.cc-name { font-size: 19px; font-weight: 700; }
.cc-phone { font-size: 15px; color: var(--green-d); font-weight: 600; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.cc-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.cc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.cc-actions .btn { width: 100%; }
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 72%; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word; }
.bubble.them { background: #fff; align-self: flex-start; border-top-left-radius: 3px; }
.bubble.me { background: #d9fdd3; align-self: flex-end; border-top-right-radius: 3px; }
.b-txt, .b-cap { white-space: pre-wrap; line-height: 1.35; }
.b-cap { margin-top: 4px; }
.b-img { max-width: 240px; max-height: 240px; border-radius: 8px; display: block; }
.b-sticker { width: 110px; height: 110px; object-fit: contain; }
.b-doc { display: inline-block; color: #1f6fb0; text-decoration: none; font-weight: 600; }
.b-time { font-size: 10px; color: #8696a0; text-align: right; margin-top: 2px; }
.b-author { font-size: 11px; font-weight: 700; color: #008f72; margin-bottom: 2px; }
.b-ad { font-size: 11px; font-weight: 700; color: #fff; background: #9b59b6; border-radius: 6px; padding: 3px 8px; margin-bottom: 4px; display: inline-block; }
.ad-box { background: #f3e8fb; color: #6c3483; border: 1px solid #e0c8f0; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-top: 10px; }
.ad-box a { color: #6c3483; font-weight: 600; }
.b-meta { font-size: 11px; color: #8696a0; }

.chat-compose { display: flex; align-items: center; gap: 5px; padding: 9px 12px; background: #fff; border-top: 1px solid var(--line); flex-shrink: 0; }
.chat-compose input[type=text] { flex: 1; border-radius: 20px; padding: 10px 15px; background: #f0f2f5; border: 1px solid transparent; }
.chat-compose input[type=text]:focus { background: #fff; border-color: var(--green); outline: none; }
.compose-btn { background: none; border: none; color: #54656f; cursor: pointer; width: 36px; height: 36px; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; transition: background .12s; }
.compose-btn:hover { background: #e7f8f2; color: var(--green-d); }
.compose-btn.rec { color: #e74c3c; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.compose-send { background: var(--green); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.compose-send:hover { background: var(--green-d); }
.compose-btn#c-pause { color: #e67e22; }

/* barra de gravação / prévia de áudio */
.audio-preview { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff8e1; border-top: 1px solid var(--line); font-size: 13px; color: #7a5c00; flex-shrink: 0; }
.audio-preview audio { height: 34px; max-width: 230px; }
.audio-preview .ap-hint { color: var(--muted); font-size: 12px; }
.audio-preview .ap-x { color: #e74c3c; margin-left: auto; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #e74c3c; display: inline-block; animation: pulse 1s infinite; }
.rec-dot.paused { background: #e67e22; animation: none; }

/* ícones em botões */
.btn svg, .chat-crm svg, .iconbtn svg { vertical-align: middle; margin-right: 4px; }
.btn svg:only-child, .compose-send svg { margin: 0; }
.chat-head-name { display: flex; align-items: center; gap: 6px; }
.chat-head-name svg { color: var(--green-d); }

/* bolhas de mídia */
.b-audio { display: flex; align-items: center; gap: 6px; }
.b-audio audio { max-width: 210px; height: 36px; }
.b-ph { font-size: 13px; color: #54656f; padding: 6px 2px; }
.b-ph span { color: #aab4ba; font-size: 11.5px; }
.b-img { cursor: pointer; }
.b-doc svg { vertical-align: middle; margin-right: 4px; }
.b-time svg { vertical-align: middle; color: #53bdeb; }
.b-actions { display: flex; gap: 10px; margin-top: 5px; }
.b-act { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: #1f6fb0; background: none; border: none; cursor: pointer; text-decoration: none; padding: 0; }
.b-act:hover { text-decoration: underline; }
.b-act svg { vertical-align: middle; }

/* Lightbox (popup de mídia) */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 30px; }
.lightbox img, .lightbox video { max-width: 92vw; max-height: 84vh; border-radius: 8px; box-shadow: 0 10px 50px rgba(0,0,0,.5); }
.lightbox .lb-x { position: absolute; top: 18px; right: 22px; background: rgba(255,255,255,.15); border: none; color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 26px; cursor: pointer; }
.lightbox .lb-x:hover { background: rgba(255,255,255,.3); }
.lightbox .lb-dl { position: absolute; bottom: 24px; background: rgba(255,255,255,.95); color: var(--ink); padding: 9px 18px; border-radius: 22px; font-weight: 600; font-size: 14px; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.lightbox .lb-dl:hover { background: #fff; }
@media (max-width: 720px) { .inbox-list { width: 130px; } .inbox { height: 76vh; } }

/* Personalização da marca */
.brand-logo-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.brand-logo-prev { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 28px; background: #f6f8f9; overflow: hidden; }
.brand-logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.color-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-top: 4px; }
.color-row input[type=color] { width: 56px; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; cursor: pointer; }
.theme-preview { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; align-items: center; justify-content: center; min-height: 56px; margin-top: 2px; }
.activity-item { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.activity-item .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  .nav { display: flex; overflow-x: auto; }
  .nav button { width: auto; }
  .main { padding: 18px; }
  .grid2 { grid-template-columns: 1fr; }
}
