/* =====================================================================
   LSCRM - Estilos customizados (Bootstrap 5.3.3 + Bootstrap Icons + Inter)
   ===================================================================== */

:root {
    --color-primary:        #6366f1;
    --color-primary-hover:  #5350e0;
    --color-primary-soft:   #eef0ff;
    --color-primary-rgb:    99, 102, 241;
    --color-bg:             #f4f5fb;
    /* Gradiente de marca (design LsProjects): indigo -> violet -> fuchsia */
    --grad:                 linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --grad-soft:            linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --grad-shadow:          0 8px 18px -10px rgba(99,102,241,.8);
    --color-surface:        #ffffff;
    --color-border:         #e6e8ee;
    --color-border-strong:  #d4d8e2;
    --color-text:           #0f172a;
    --color-text-muted:     #4b5563;
    --color-success:        #16a34a;
    --color-warning:        #d97706;
    --color-danger:         #dc2626;
    --color-info:           #0ea5e9;
    --color-frio:           #38bdf8;
    --color-morno:          #f59e0b;
    --color-quente:         #ef4444;

    --sidebar-width:        252px;
    --sidebar-bg:           #0f1729;
    --sidebar-text:         #aeb9cc;
    --sidebar-text-active:  #ffffff;
    --topbar-height:        62px;

    --radius-sm: 9px;
    --radius:    14px;
    --radius-lg: 20px;
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.06);
    --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow:    0 4px 16px -2px rgba(15,23,42,0.10), 0 2px 6px -2px rgba(15,23,42,0.06);
    --shadow-lg: 0 12px 32px -8px rgba(15,23,42,0.18), 0 4px 12px -4px rgba(15,23,42,0.08);

    --font-base: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font-base);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02","cv03","cv04","cv11";
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.01em; }

a { color: var(--color-primary); text-decoration: none; transition: color .12s ease; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

::selection { background: rgba(var(--color-primary-rgb), 0.18); }

/* Scrollbars discretas */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
html[data-theme="dark"] * { scrollbar-color: #334155 transparent; }
html[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #334155; background-clip: content-box; }

/* =================== LAYOUT GERAL =================== */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar content";
    height: 100vh;            /* barra lateral + topo FIXOS: o shell ocupa a viewport */
}

.app-sidebar { grid-area: sidebar; background: var(--sidebar-bg); color: var(--sidebar-text); overflow-y: auto; }
.app-topbar  { grid-area: topbar;  background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.app-content { grid-area: content; padding: 24px 28px 60px; overflow: auto; }

@media (max-width: 992px) {
    .app-shell {
        /* minmax(0,1fr) evita o "grid blowout" (item de grid tem min-width:auto = min-content,
           o que expandia a coluna alem da viewport e gerava scroll horizontal em todas as telas) */
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "topbar"
            "content";
    }
    /* permite que os filhos encolham em vez de empurrar a largura */
    .app-content, .app-topbar { min-width: 0; }
    .app-content { overflow-x: hidden; }
    .topbar-inner { min-width: 0; }
    .topbar-inner > * { min-width: 0; }
    .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .app-sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-width);
        transform: translateX(-100%); transition: transform 0.2s ease; z-index: 1040;
    }
    .app-sidebar.open { transform: translateX(0); }
    /* Backdrop escuro atras da sidebar aberta no mobile (toque fora fecha o menu). */
    .sidebar-backdrop {
        position: fixed; inset: 0; z-index: 1035;
        background: rgba(8, 12, 24, 0.5);
        opacity: 0; transition: opacity 0.2s ease;
    }
    .sidebar-backdrop.show { opacity: 1; }
}
/* Fora do mobile o backdrop nunca aparece. */
@media (min-width: 992px) { .sidebar-backdrop { display: none !important; } }

@media (max-width: 768px) {
    .app-content { padding: 16px 14px 48px; }
    .topbar-inner { padding: 0 12px; }
    /* badge "MODO DEV (sem login)" ocupa muito espaco no mobile e nao e essencial ali */
    .app-topbar .badge-pill.badge-quente { display: none; }
}

/* =================== SIDEBAR =================== */
.app-sidebar {
    background: linear-gradient(180deg, #131c33 0%, var(--sidebar-bg) 55%, #0b1120 100%);
    border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 11px;
    height: var(--topbar-height);
    padding: 0 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.2px;
}
.sidebar-brand i {
    font-size: 1.15rem; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.45);
}
.sidebar-section {
    color: #64748b;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 15px 22px 6px;
}
.sidebar-nav {
    list-style: none;
    padding: 0 12px; margin: 0;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 7px 12px;
    margin: 1px 0;
    border-radius: 9px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
    transition: background-color .14s ease, color .14s ease, transform .14s ease;
}
.sidebar-nav a:hover {
    color: var(--sidebar-text-active);
    background: rgba(255,255,255,0.06);
    text-decoration: none;
    transform: translateX(2px);
}
.sidebar-nav a.active {
    color: var(--sidebar-text-active);
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb),0.28), rgba(var(--color-primary-rgb),0.12));
    box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb),0.25);
}
.sidebar-nav a.active::before {
    content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--color-primary);
}
.sidebar-nav i { width: 18px; text-align: center; font-size: 1.05rem; flex: 0 0 18px; }
/* divisoria fina entre blocos de itens (chunking sem reordenar) */
.sidebar-nav .nav-sep { height: 1px; margin: 7px 14px; background: rgba(255,255,255,0.07); list-style: none; padding: 0; }
html[data-theme="light"] .sidebar-nav .nav-sep { background: rgba(15,23,42,0.08); }
.app-shell.sidebar-mini .sidebar-nav .nav-sep { margin: 7px 18px; }
/* =================== SIDEBAR ACCORDION (grupos recolhiveis) =================== */
.sidebar-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: 0; cursor: pointer;
    text-align: left; font-family: inherit;
}
.sidebar-toggle:hover { color: #94a3b8; }
.sec-chevron { font-size: 0.8rem; opacity: .6; transition: transform .18s ease; }
.sidebar-group.collapsed .sec-chevron { transform: rotate(-90deg); }
.sidebar-group.collapsed .sidebar-nav { display: none; }
/* mini (recolhida): ignora o accordion, mostra todos os icones e esconde a seta */
.app-shell.sidebar-mini .sec-chevron { display: none; }
.app-shell.sidebar-mini .sidebar-group.collapsed .sidebar-nav { display: block; }

/* =================== SIDEBAR MINI (recolhida) =================== */
:root { --sidebar-width-mini: 72px; }
.app-shell.sidebar-mini { grid-template-columns: var(--sidebar-width-mini) 1fr; }
.app-shell.sidebar-mini .sidebar-section { height: 0; padding: 8px 0; font-size: 0; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 6px; overflow: hidden; }
.app-shell.sidebar-mini .sidebar-brand { justify-content: center; padding: 0; }
.app-shell.sidebar-mini .sidebar-brand span { display: none; }
.app-shell.sidebar-mini .sidebar-nav a { justify-content: center; padding: 12px 0; font-size: 0; gap: 0; }
.app-shell.sidebar-mini .sidebar-nav a i { font-size: 1.15rem; width: auto; }
.sidebar-toggle-btn { background: transparent; border: 0; color: #64748b; font-size: 1.15rem; line-height: 1; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.sidebar-toggle-btn:hover { background: rgba(15,23,42,0.06); color: #0f172a; }
@media (max-width: 992px) { .sidebar-toggle-btn { display: none; } }

/* =================== CHAT KOMMO (3 paineis) =================== */
/* pagina de chat ocupa exatamente a area de conteudo, sem rolar o body */
.app-content.wa-page { padding: 0; height: calc(100vh - var(--topbar-height)); overflow: hidden; }
.wa-kommo { display: grid; grid-template-columns: 340px 1fr 300px; height: 100%; border: 0; border-radius: 0; overflow: hidden; background: #fff; min-height: 0; }
/* Telas medias: contexto sai antes da lista — sem a lista nao ha o que atender,
   sem o contexto ainda da para responder. */
@media (max-width: 1200px) { .wa-kommo { grid-template-columns: 340px 1fr; } .wa-side-pane { display: none; } }
.wa-kommo > * { min-height: 0; }   /* permite que filhos flex/scroll encolham */
.wa-list-pane { border-right: 1px solid var(--color-border); display: flex; flex-direction: column; min-width: 0; background: #fff; }
.wa-list-head { padding: 12px; border-bottom: 1px solid var(--color-border); }
.wa-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.wa-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f1f3f5; }
.wa-list-item:hover { background: #f8fafc; }
.wa-list-item.active { background: #eaf2ff; }
.wa-list-item .nome { font-weight: 600; color: #111827; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-list-item .prev { color: #6b7280; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Acoes por conversa (arquivar/excluir) direto na lista: 30/07/2026.
   Escondidas ate o hover para nao poluir, mas sempre presentes no DOM (e
   visiveis no toque, onde nao existe hover). */
.wa-item-acoes { display: flex; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity .12s ease; }
.wa-list-item:hover .wa-item-acoes,
.wa-list-item.active .wa-item-acoes { opacity: 1; }
.wa-item-acoes .wa-ia-btn { background: transparent; border: 0; color: #6b7280; padding: 4px 6px; border-radius: 6px; line-height: 1; cursor: pointer; }
.wa-item-acoes .wa-ia-btn:hover { background: #e5e7eb; color: #111827; }
.wa-item-acoes .wa-ia-btn.text-danger:hover { background: #fee2e2; color: #b91c1c; }
@media (hover: none) { .wa-item-acoes { opacity: 1; } }
/* Coluna vazia do Kanban (30/07/2026): marca o alvo de drop e explica o vazio.
   Tracejado porque e uma AREA QUE RECEBE, nao um card. */
.kb-col-vazia { border: 2px dashed var(--color-border, #d1d5db); border-radius: 10px;
                padding: 22px 12px; margin: 8px 4px; text-align: center; color: #9ca3af; }
.kb-col-vazia i { font-size: 1.6rem; display: block; margin-bottom: 6px; opacity: .7; }
.kb-col-vazia .small { font-size: 11px; opacity: .85; }
[data-theme="dark"] .kb-col-vazia { border-color: #364556; color: #6b7280; }

/* ===== Lista de e-mails estilo webmail (30/07/2026, mockup do dono) =====
   Substitui a tabela: remetente, assunto, preview, tag e hora empilhados. */
.email-list { list-style: none; margin: 0; padding: 0; }
.email-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer;
              border-bottom: 1px solid var(--color-border, #e5e7eb); }
.email-item:hover { background: #f8fafc; }
.email-item.is-sel { background: #eef2ff; box-shadow: inset 3px 0 0 #6366f1; }
.email-item .email-ico { color: #9ca3af; font-size: 1.05rem; margin-top: 2px; flex: 0 0 auto; }
.email-item.is-novo .email-ico { color: #6366f1; }
.email-corpo { flex: 1; min-width: 0; }
.email-de { font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-assunto { font-size: 13px; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-prev { font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* nao lido: remetente e assunto em negrito, como em qualquer webmail */
.email-item.is-novo .email-de,
.email-item.is-novo .email-assunto { font-weight: 700; color: #0f172a; }
.email-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.email-tag { font-size: 11px; color: #6b7280; background: #f3f4f6; border-radius: 10px; padding: 1px 8px; }
.email-hora { font-size: 12px; color: #6b7280; white-space: nowrap; }
[data-theme="dark"] .email-item { border-bottom-color: #2b3648; }
[data-theme="dark"] .email-item:hover { background: #1f2836; }
[data-theme="dark"] .email-item.is-sel { background: #232f45; }
[data-theme="dark"] .email-de { color: #cbd5e1; }
[data-theme="dark"] .email-assunto { color: #e5e7eb; }
[data-theme="dark"] .email-item.is-novo .email-de,
[data-theme="dark"] .email-item.is-novo .email-assunto { color: #fff; }
[data-theme="dark"] .email-tag { background: #2b3648; color: #cbd5e1; }

/* Cronometro da gravacao de audio (30/07/2026) */
.wa-mic-tempo { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums;
                font-size: 13px; font-weight: 600; color: #b91c1c; padding: 0 8px; white-space: nowrap; }
.wa-mic-tempo::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #dc2626;
                        animation: waMicPulse 1s ease-in-out infinite; }
@keyframes waMicPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.wa-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #e8f0fe; color: #2563eb; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; overflow: hidden; }
.wa-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-thread { display: flex; flex-direction: column; min-width: 0; background: #efeae2; }
.wa-thread-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--color-border); }
.wa-thread-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; }
.wa-thread-input { padding: 12px 16px; background: #fff; border-top: 1px solid var(--color-border); }
.wa-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6b7280; gap: 8px; text-align: center; }
.wa-empty i { font-size: 3rem; opacity: .4; }
/* ---- painel de contexto do lead (3a coluna) ---- */
.wa-side-pane { border-left: 1px solid var(--color-border); background: #fff; overflow-y: auto; padding: 14px; }
.wa-side-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; gap: 8px; text-align: center; }
.wa-side-empty i { font-size: 2.2rem; opacity: .35; }
.wa-side-bloco { margin-bottom: 18px; }
.wa-side-bloco h6 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8;
    font-weight: 700; margin: 0 0 8px; }
.wa-side-nome { font-size: 15px; font-weight: 700; color: #111827; line-height: 1.2; }
.wa-side-sub { font-size: 12px; color: #6b7280; }
.wa-side-campo { display: flex; gap: 6px; font-size: 12px; padding: 3px 0; color: #374151; }
.wa-side-campo i { color: #94a3b8; width: 14px; flex: 0 0 auto; }
.wa-side-campo span { min-width: 0; overflow-wrap: anywhere; }
.wa-side-card { border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px;
    font-size: 12px; display: block; color: inherit; text-decoration: none; }
.wa-side-card:hover { background: #f8fafc; }
.wa-side-card .t { font-weight: 600; color: #111827; }
.wa-side-card .m { color: #6b7280; font-size: 11px; }
.wa-side-vazio { font-size: 12px; color: #9ca3af; font-style: italic; }
/* separador de dia na thread (Hoje / Ontem / data) - estilo WhatsApp */
.wa-day { text-align: center; margin: 10px 0; }
.wa-day span {
    display: inline-block; background: #e7f0e6; color: #4a5a52;
    font-size: 11.5px; font-weight: 600; padding: 4px 12px; border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0,0,0,.05); text-transform: capitalize;
}
html[data-theme="dark"] .wa-day span { background: #1f2937; color: #cbd5e1; }
/* linha de presenca (online / digitando / visto por ultimo) */
.wa-presence { line-height: 1.2; font-weight: 500; }
.wa-presence.text-success::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); margin-right: 5px; vertical-align: middle; }
/* mensagem apagada pelo contato */
.msg.apagada, .msg-apagada { font-style: italic; color: #8696a0; }
.msg.apagada i, .msg-apagada i { margin-right: 4px; }
/* divisor "mensagens nao lidas" */
.wa-unread-sep { text-align: center; margin: 10px 0; }
.wa-unread-sep span {
    display: inline-block; background: rgba(99,102,241,.12); color: var(--color-primary);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: 4px 14px; border-radius: 8px;
}
/* barra de busca dentro da conversa */
.wa-busca-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px;
    background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.wa-busca-bar i.bi-search { color: var(--color-text-muted); }
.wa-busca-bar input { flex: 1; border: 0; outline: none; background: transparent; font-size: 14px; color: var(--color-text); }
.msg-row.busca-hit .msg { box-shadow: 0 0 0 2px var(--color-primary); }
/* player de audio + botao de velocidade */
.msg-audio-wrap { display: flex; align-items: center; gap: 6px; }
.msg-audio-speed { border: 0; background: rgba(0,0,0,.06); color: #4b5563; font-size: 11px; font-weight: 700;
    border-radius: 999px; padding: 2px 8px; cursor: pointer; flex: 0 0 auto; }
.msg-audio-speed:hover { background: rgba(0,0,0,.12); }
html[data-theme="dark"] .msg-audio-speed { background: rgba(255,255,255,.12); color: #cbd5e1; }
.msg-audio-transcrever { border: 0; background: rgba(0,0,0,.06); color: #4b5563; font-size: 11px; font-weight: 700;
    border-radius: 999px; padding: 2px 8px; cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
.msg-audio-transcrever:hover { background: rgba(0,0,0,.12); }
.msg-audio-transcrever:disabled { opacity: .6; cursor: default; }
html[data-theme="dark"] .msg-audio-transcrever { background: rgba(255,255,255,.12); color: #cbd5e1; }
.msg-lightbox { cursor: zoom-in; }
/* lightbox de imagem / PDF sobre a conversa */
.lb-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(10,8,20,.82);
    display: flex; flex-direction: column; backdrop-filter: blur(2px); }
.lb-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; color: #fff; }
.lb-bar .lb-nome { flex: 1; font-size: .95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-act { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
    text-decoration: none; font-size: 1.05rem; transition: background-color .12s; }
.lb-act:hover { background: rgba(255,255,255,.28); color: #fff; }
.lb-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 1rem 1.2rem; min-height: 0; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-pdf { width: min(920px, 100%); height: 100%; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
@media (max-width: 640px) { .lb-pdf { width: 100%; } }
/* chips de fila de atendimento (Todas / Minhas / Nao atribuidas) */
.wa-fila-chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.wa-chip { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted);
    font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer; transition: background-color .12s, color .12s, border-color .12s; }
.wa-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.wa-chip.active { background: var(--grad-soft); color: #fff; border-color: transparent; }
/* mobile: lista e thread em coluna unica (alterna com botao voltar) */
@media (max-width: 768px) {
    .wa-kommo { grid-template-columns: 1fr; }
    .wa-kommo .wa-thread { display: none; }
    .wa-kommo.mostrar-thread .wa-list-pane { display: none; }
    .wa-kommo.mostrar-thread .wa-thread { display: flex; }
    .kb-col { flex: 0 0 82vw; width: 82vw; }
}
/* bolhas de mensagem (WhatsApp-like) */
.wa-thread-msgs .msg-row, .chat-msgs .msg-row { display: flex; margin-bottom: 6px; }
.wa-thread-msgs .msg-row.r, .chat-msgs .msg-row.r { justify-content: flex-start; }
.wa-thread-msgs .msg-row.e, .chat-msgs .msg-row.e { justify-content: flex-end; }
.wa-thread-msgs .msg, .chat-msgs .msg { max-width: 68%; padding: 7px 11px 5px; border-radius: 10px; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.06); font-size: 14px; line-height: 1.35; }
.wa-thread-msgs .msg.recebida, .chat-msgs .msg.recebida { background: #fff; border-top-left-radius: 2px; }
.wa-thread-msgs .msg.enviada, .chat-msgs .msg.enviada { background: #d9fdd3; border-top-right-radius: 2px; }
.wa-thread-msgs .msg .hora, .chat-msgs .msg .hora { font-size: 10px; color: #667781; margin-top: 2px; text-align: right; }
.msg .hora .ck { margin-left: 2px; }
.msg .hora .ck i { font-size: 12px; vertical-align: -1px; color: #8696a0; }
.msg .hora .ck-lida i { color: #34b7f1; }
.msg .hora .ck-erro i { color: #ef4444; }
/* midia nos baloes */
.msg-media-link { display: block; }
.msg-media { display: block; max-width: 260px; max-height: 320px; width: 100%; border-radius: 8px; cursor: pointer; object-fit: cover; }
video.msg-media { object-fit: contain; background: #000; }
.msg-audio { display: block; width: 240px; max-width: 100%; height: 40px; margin: 2px 0; }
.msg-cap { margin-top: 5px; font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.msg-doc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(0,0,0,0.05); color: inherit; text-decoration: none; font-size: 13px; max-width: 260px; }
.msg-doc:hover { background: rgba(0,0,0,0.09); text-decoration: none; color: inherit; }
.msg-doc i { font-size: 1.4rem; color: var(--color-primary); flex: 0 0 auto; }
.msg-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme="dark"] .msg-doc { background: rgba(255,255,255,0.08); }
html[data-theme="dark"] .msg-doc:hover { background: rgba(255,255,255,0.14); }
/* nota interna */
.msg-row.nota { justify-content: center; }
.msg-nota {
    background: #fff8e1; border: 1px solid #fde68a; color: #7c5e10;
    border-radius: 10px; padding: 7px 12px; font-size: 13px; max-width: 80%;
    box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
.msg-nota i { color: #d97706; margin-right: 4px; }
.msg-nota .hora { font-size: 10px; color: #b08900; margin-top: 2px; }
html[data-theme="dark"] .msg-nota { background: #2a2410; border-color: #4d4318; color: #e8d48a; }
html[data-theme="dark"] .msg-nota .hora { color: #b3942f; }
/* acoes na bolha (responder / reagir) - aparecem no hover */
.msg { position: relative; }
.msg-acts { position: absolute; top: -10px; right: 6px; display: none; gap: 2px; background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: 999px; padding: 1px 4px; box-shadow: var(--shadow-sm); }
.msg-row:hover .msg-acts { display: flex; }
.msg-act { border: 0; background: transparent; cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 50%; color: var(--color-text-muted); }
.msg-act:hover { background: var(--color-bg); color: var(--color-primary); }
/* barra "respondendo a..." acima do input */
.wa-reply-bar { align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 12px;
    background: var(--color-primary-soft); border-left: 3px solid var(--color-primary); border-radius: 6px; }
.wa-reply-bar .prev { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-muted); }
.wa-reply-bar i { color: var(--color-primary); }
/* indicador de conversa nao lida (pendencia) */
.wa-unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--color-success); margin-left: 4px; vertical-align: middle; }
.wa-list-item.nao-lido .nome { font-weight: 700; }
.wa-list-item.nao-lido .prev { color: var(--color-text); font-weight: 500; }
/* "aguardando ha X" nas conversas sem resposta. Tres faixas: ate 1h e normal,
   ate 1 dia incomoda, acima disso e falha de atendimento. */
.wa-espera { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px;
    font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; }
.wa-espera.ok      { background: #f1f5f9; color: #64748b; }
.wa-espera.alerta  { background: #fef3c7; color: #92400e; }
.wa-espera.critico { background: #fee2e2; color: #991b1b; }
/* toast interno (substitui alert do navegador) */
.wa-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1090;
    background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); max-width: 90vw; }
.wa-toast.erro { background: var(--color-danger); }
.wa-tpl-menu { position: absolute; bottom: 52px; left: 0; width: 320px; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--color-border); border-radius: 10px; box-shadow: var(--shadow); z-index: 20; }
.wa-tpl-item { padding: 8px 12px; border-bottom: 1px solid #f1f3f5; cursor: pointer; }
.wa-tpl-item:hover { background: #f8fafc; }
/* Selecao por teclado do atalho "/": marca propria, mais forte que o :hover —
   com o mouse parado sobre outro item, so o hover confundiria quem usa setas. */
.wa-tpl-item.sel { background: #eff6ff; box-shadow: inset 3px 0 0 var(--color-primary, #2563eb); }
.wa-tpl-item .t { font-weight: 600; font-size: 13px; color: #111827; }
.wa-tpl-item .c { font-size: 11px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Painel de scripts/objecoes no composer (C, 23/07/2026): acesso rapido, insere texto na mensagem. */
.wa-scripts-panel { position: absolute; bottom: 52px; left: 0; right: 0; max-height: 300px; overflow-y: auto;
    background: #fff; border: 1px solid var(--color-border); border-radius: 10px; box-shadow: var(--shadow); z-index: 20; padding: 6px; }
.wa-sp-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.wa-sp-tab { flex: 1; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: 8px;
    background: #fff; cursor: pointer; font-size: 12px; font-weight: 600; color: #374151; }
.wa-sp-tab.ativo { background: var(--color-primary-soft, #eff6ff); border-color: var(--color-primary, #2563eb); color: var(--color-primary, #2563eb); }
.wa-sp-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.wa-sp-item:hover { background: #f8fafc; border-color: var(--color-border); }
.wa-sp-tit { font-weight: 600; font-size: 13px; color: #111827; }
.wa-sp-cat { font-size: 11px; color: #6b7280; font-weight: 400; }
.wa-sp-prev { font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-sp-vazio { padding: 14px; text-align: center; color: #6b7280; font-size: 13px; }

/* Etiquetas (tags) por conversa (D/074): chips no cabecalho + seletor. */
.wa-tags-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.wa-tag-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; line-height: 1.5; }
.wa-tag-panel { position: absolute; top: 52px; right: 8px; width: 260px; max-height: 320px; overflow-y: auto;
    background: #fff; border: 1px solid var(--color-border); border-radius: 10px; box-shadow: var(--shadow); z-index: 30; padding: 10px; }
.wa-tag-titulo { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #111827; }
.wa-tag-vazio { font-size: 12px; color: #6b7280; padding: 6px 0; }
.wa-tag-lista { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.wa-tag-op { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; padding: 3px 4px; border-radius: 6px; }
.wa-tag-op:hover { background: #f8fafc; }
.wa-tag-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.wa-tag-nova { display: flex; gap: 4px; align-items: center; border-top: 1px solid #f1f3f5; padding-top: 8px; }
.wa-tag-nova input[type=text] { flex: 1; min-width: 0; border: 1px solid var(--color-border); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.wa-tag-nova input[type=color] { width: 30px; height: 30px; border: 1px solid var(--color-border); border-radius: 8px; padding: 2px; cursor: pointer; }

/* =================== TOPBAR =================== */
.app-topbar { box-shadow: 0 1px 0 var(--color-border), 0 2px 8px -4px rgba(15,23,42,0.06); position: sticky; top: 0; z-index: 30; }
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 24px;
}
.topbar-title { font-weight: 600; font-size: 15px; color: var(--color-text); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px; border-radius: 10px; cursor: pointer;
    transition: background-color .12s ease;
}
.topbar-user:hover { background: var(--color-bg); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #7c3aed); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
    box-shadow: 0 2px 6px rgba(var(--color-primary-rgb),0.35);
}

/* =================== CARDS =================== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: transparent; border-bottom: 1px solid var(--color-border);
    font-weight: 600; font-size: 14px; padding: 14px 18px;
}
.card-body { padding: 18px; }
.kpi-card {
    position: relative;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.kpi-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--color-primary); opacity: 0.85;
}
.kpi-card.kpi-success::before { background: var(--color-success); }
.kpi-card.kpi-danger::before  { background: var(--color-danger); }
.kpi-card.kpi-warning::before { background: var(--color-warning); }
.kpi-card.kpi-info::before    { background: var(--color-info); }
.kpi-card .label { color: var(--color-text-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; }
.kpi-card .value { font-size: 30px; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-card .footer { font-size: 12px; color: var(--color-text-muted); margin-top: 6px; }
.kpi-card.kpi-success .value { color: var(--color-success); }
.kpi-card.kpi-danger  .value { color: var(--color-danger);  }
.kpi-card.kpi-warning .value { color: var(--color-warning); }
.kpi-card.kpi-info    .value { color: var(--color-info); }

/* =================== TABELAS =================== */
.table-soft {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table-soft thead th {
    background: #fafbfc;
    color: var(--color-text-muted);
    font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.6px;
    padding: 12px 16px; border-bottom: 1px solid var(--color-border);
    text-align: left; white-space: nowrap;
}
.table-soft tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.table-soft tbody tr { transition: background-color .1s ease; }
.table-soft tbody tr:hover { background: var(--color-primary-soft); }
.table-soft tbody tr:last-child td { border-bottom: none; }

/* =================== BADGES E PILLS =================== */
.badge-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.2px;
    border: 1px solid transparent;
    line-height: 1.4;
}
.badge-pill::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.75; flex: 0 0 6px;
}
.badge-frio   { background: #e0f2fe; color: #0369a1; }
.badge-morno  { background: #fef3c7; color: #92400e; }
.badge-quente { background: #fee2e2; color: #b91c1c; }

.badge-ativo    { background: #dcfce7; color: #15803d; }
.badge-inativo  { background: #f1f5f9; color: #475569; }
.badge-status-aberta    { background: #e0e7ff; color: #4338ca; }
.badge-status-ganha     { background: #dcfce7; color: #15803d; }
.badge-status-perdida   { background: #fee2e2; color: #b91c1c; }
.badge-status-congelada { background: #e2e8f0; color: #475569; }
/* status agora usam icone proprio: some o ponto generico e dimensiona o icone */
.badge-status-aberta::before, .badge-status-ganha::before,
.badge-status-perdida::before, .badge-status-congelada::before { display: none; }
.badge-pill > i.bi { font-size: 12px; line-height: 1; }

/* =================== BOTOES =================== */
.btn {
    --btn-shadow: 0 1px 2px rgba(15,23,42,0.08);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 0.95rem;
    line-height: 1.35;
    letter-spacing: 0.1px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease,
                box-shadow .15s ease, transform .06s ease;
    box-shadow: var(--btn-shadow);
}
.btn:hover { box-shadow: 0 3px 8px rgba(15,23,42,0.12); }
.btn:active { transform: translateY(1px); box-shadow: var(--btn-shadow); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--color-primary-soft); }
.btn-sm { padding: 0.3rem 0.6rem; border-radius: 7px; font-size: 0.82rem; }
.btn-lg { padding: 0.65rem 1.3rem; border-radius: 10px; }

/* Botao so com icone (1 filho <i>) vira quadrado */
.btn:has(> i:only-child) { padding-left: 0.5rem; padding-right: 0.5rem; }
.btn-sm:has(> i:only-child) { padding-left: 0.38rem; padding-right: 0.38rem; }

/* Primario */
.btn-primary {
    background: var(--color-primary); border-color: var(--color-primary); color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.32);
}
.btn-primary:active { background: #1e40af; border-color: #1e40af; }

/* Soft (azul claro) */
.btn-soft {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border: 1px solid #dbeafe;
}
.btn-soft:hover { background: #dbeafe; color: var(--color-primary-hover); border-color: #bfdbfe; }
.btn-soft:active { background: #bfdbfe; }

/* Solidos coloridos: contraste + sombra coerente no hover */
.btn-success { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; box-shadow: 0 4px 12px rgba(22,163,74,0.30); }
.btn-danger  { background: var(--color-danger);  border-color: var(--color-danger);  color: #fff; }
.btn-danger:hover  { background: #b91c1c; border-color: #b91c1c; color: #fff; box-shadow: 0 4px 12px rgba(220,38,38,0.30); }
.btn-warning { background: var(--color-warning); border-color: var(--color-warning); color: #fff; }
.btn-warning:hover { background: #b45309; border-color: #b45309; color: #fff; }

/* Light / outline mais discretos */
.btn-light { background: #fff; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-light:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--color-text); }
.btn-outline-danger:hover { box-shadow: 0 4px 12px rgba(220,38,38,0.18); }
.btn-outline-secondary { border-color: var(--color-border); color: var(--color-text-muted); }
.btn-outline-secondary:hover { background: var(--color-bg); color: var(--color-text); }

/* Conteudo com icone alinhado */
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }
.btn i { line-height: 1; }

/* Estado de carregamento (app.js adiciona .is-loading no submit). Spinner
   indigo sobre anel cinza -> visivel em qualquer variante de botao e tema. */
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 1em; height: 1em; margin: -0.5em 0 0 -0.5em;
    border: 2px solid rgba(148,163,184,0.45); border-top-color: var(--color-primary);
    border-radius: 50%; animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* =================== FUNIL: controle de ordem da etapa (setas reordenar) =================== */
.ord-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.ord-num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 24px; padding: 0 7px;
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border: 1px solid var(--color-border); border-radius: 999px;
}
.ord-arrows {
    display: inline-flex; flex-direction: column;
    border: 1px solid var(--color-border); border-radius: 8px;
    overflow: hidden; box-shadow: var(--shadow-xs);
}
.ord-arrows form { margin: 0; line-height: 0; }
.ord-arrows form + form .ord-arrow { border-top: 1px solid var(--color-border); }
.ord-arrow {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 18px; padding: 0;
    border: 0; background: var(--color-surface);
    color: var(--color-text-muted); cursor: pointer;
    font-size: 12px; line-height: 1;
    transition: background .12s ease, color .12s ease;
}
.ord-arrow:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.ord-arrow:active { background: #dbeafe; }
.ord-arrow:focus-visible { outline: 2px solid var(--color-primary-soft); outline-offset: -2px; }

/* Grupo de acoes em tabela: alinhamento e espaco */
.table-soft td .btn-sm + .btn-sm { margin-left: 4px; }

/* Dark mode: variantes claras */
html[data-theme="dark"] .btn { box-shadow: 0 1px 2px rgba(0,0,0,0.35); }
html[data-theme="dark"] .btn-soft { background: #16233b; border-color: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .btn-soft:hover { background: #1c3050; border-color: #2563eb; color: #bfdbfe; }
html[data-theme="dark"] .btn-soft:active { background: #21395e; }
html[data-theme="dark"] .btn-outline-secondary { border-color: var(--color-border); color: var(--color-text-muted); }
html[data-theme="dark"] .btn-outline-secondary:hover { background: #1c2840; color: #fff; }

/* =================== LOGIN =================== */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}
@media (max-width: 992px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { display: none !important; }
}
.login-hero {
    color: #e2e8f0;
    padding: 60px;
    display: flex; flex-direction: column; justify-content: center;
}
.login-hero h1 { font-size: 36px; font-weight: 700; line-height: 1.15; margin-bottom: 16px; }
.login-hero p  { color: #94a3b8; font-size: 16px; max-width: 480px; }
.login-hero .brand-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 30px; color: #fff; font-weight: 600;
}
.login-hero .brand-row i { color: var(--color-primary); font-size: 1.4rem; }

.login-card-wrap {
    display: flex; align-items: center; justify-content: center;
    background: #ffffff; padding: 40px;
}
.login-card {
    width: 100%; max-width: 380px;
}
.login-card h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-card .sub { color: var(--color-text-muted); margin-bottom: 24px; font-size: 14px; }

/* =================== KANBAN KOMMO (.kb-*) =================== */
.app-content.kanban-page { padding: 0; height: calc(100vh - var(--topbar-height)); display: flex; flex-direction: column; overflow: hidden; }
/* Vista "todos os funis" (21/07/2026): os funis ficam empilhados, entao a pagina precisa rolar
   na vertical — a altura travada em 100vh esconderia tudo abaixo do primeiro funil. */
.app-content.kanban-page.kanban-empilhado { height: auto; min-height: calc(100vh - var(--topbar-height)); overflow: visible; }
.kanban-empilhado .kb-board { flex: none; }
.kanban-empilhado .kb-col { max-height: none; }
.kanban-empilhado .kb-col-body { overflow-y: visible; }
.kb-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.kb-topbar .left, .kb-topbar .right { display: flex; align-items: center; gap: 10px; }
.kb-total { font-weight: 700; color: var(--color-text); }
.kb-total small { color: var(--color-text-muted); font-weight: 500; }
.kb-stats { display: flex; gap: 28px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--color-border); overflow-x: auto; }
.kb-stats .stat { white-space: nowrap; font-size: 12px; color: var(--color-text-muted); }
.kb-stats .stat b { display: block; font-size: 19px; line-height: 1.1; color: var(--color-text); font-weight: 700; }
.kb-stats .stat b.warn { color: #f59e0b; } .kb-stats .stat b.bad { color: #ef4444; } .kb-stats .stat b.good { color: var(--color-success); }
.kb-board { flex: 1; display: flex; gap: 12px; padding: 14px 16px; overflow-x: auto; overflow-y: hidden; align-items: flex-start; background: #f1f5f9; }
.kb-col { flex: 0 0 300px; width: 300px; max-height: 100%; background: #f8fafc; border: 1px solid var(--color-border); border-radius: 10px; display: flex; flex-direction: column; }
.kb-col-head { padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.kb-col-head .nm { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: #334155; }
.kb-col-head .ct { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.kb-col-body { padding: 10px; overflow-y: auto; flex: 1; min-height: 80px; }
.kb-col-body.drag-over { background: #e0ecff; outline: 2px dashed var(--color-primary); outline-offset: -4px; border-radius: 8px; }
.kb-quickadd { padding: 8px 10px; border-bottom: 1px dashed var(--color-border); }
.kb-card { background: #fff; border: 1px solid var(--color-border); border-left: 3px solid #cbd5e1; border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow-sm); }
.kb-card:hover { border-color: var(--color-primary); }
.kb-card.dragging { opacity: .45; }
.kb-card.temp-QUENTE { border-left-color: #ef4444; }
.kb-card.temp-MORNO  { border-left-color: #f59e0b; }
.kb-card.temp-FRIO   { border-left-color: #3b82f6; }
.kb-card .tel { font-size: 12px; color: #64748b; display: flex; justify-content: space-between; gap: 8px; }
.kb-card .tel .t { color: #94a3b8; font-weight: 500; }
.kb-card .nome { font-weight: 600; color: #2563eb; font-size: 13px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card .msg { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card .msg i { color: #16a34a; }
.kb-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 6px; flex-wrap: wrap; }
.kb-card .val { font-weight: 700; color: var(--color-success); font-size: 12px; }
.kb-tag { font-size: 10px; background: #eef2f7; color: #475569; padding: 1px 6px; border-radius: 4px; }

/* =================== TIMELINE =================== */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px;
    width: 2px; background: var(--color-border);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
    content: ''; position: absolute; left: -19px; top: 4px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--color-primary); border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--color-primary-soft);
}
.timeline-item .hora { font-size: 11px; color: var(--color-text-muted); }
.timeline-item .titulo { font-weight: 600; font-size: 13px; }
.timeline-item .descricao { font-size: 13px; color: var(--color-text); }

/* =================== UTIL =================== */
.text-muted-2 { color: var(--color-text-muted); }
.lead-nome { font-weight: 600; color: inherit; text-decoration: none; }
.lead-nome:hover { color: var(--color-primary); text-decoration: none; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 18px; }
.section-title { font-size: 14px; font-weight: 600; color: var(--color-text-muted); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: 0.6px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--color-text-muted); }
.empty-state i { font-size: 40px; opacity: 0.45; display: block; margin-bottom: 12px; }
.empty-state .es-title { font-weight: 600; color: var(--color-text); font-size: 15px; margin-bottom: 4px; }
.empty-state .es-sub { font-size: 13px; margin-bottom: 16px; }

/* =================== ACESSIBILIDADE: FOCO VISIVEL =================== */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.sidebar-nav a:focus-visible { outline-offset: -2px; }
.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 2000;
    background: var(--color-primary); color: #fff; padding: 8px 16px;
    border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { left: 8px; color: #fff; text-decoration: none; }

/* =================== KPI CLICAVEL =================== */
a.kpi-card, .kpi-card.clickable { display: block; color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
a.kpi-card:hover, .kpi-card.clickable:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--color-primary); }
.kpi-card .trend { font-size: 11px; font-weight: 600; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; }
.kpi-card .trend.up { color: var(--color-success); }
.kpi-card .trend.down { color: var(--color-danger); }

/* =================== TABELA RESPONSIVA =================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
    .table-soft.table-stack thead { display: none; }
    .table-soft.table-stack tbody tr {
        display: block; margin-bottom: 12px; border: 1px solid var(--color-border);
        border-radius: var(--radius); background: var(--color-surface); padding: 6px 12px;
    }
    .table-soft.table-stack tbody td {
        display: flex; justify-content: space-between; align-items: center; gap: 12px;
        padding: 8px 0; border-bottom: 1px solid #f1f3f5; text-align: right;
    }
    .table-soft.table-stack tbody td::before {
        content: attr(data-label); font-weight: 600; font-size: 11px;
        text-transform: uppercase; letter-spacing: .4px; color: var(--color-text-muted);
        text-align: left;
    }
    .table-soft.table-stack tbody td:last-child { border-bottom: none; justify-content: flex-end; }
}

/* =================== SORT EM TABELA =================== */
.table-soft th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table-soft th.sortable::after { content: '\F282'; font-family: 'bootstrap-icons'; opacity: .25; margin-left: 4px; font-size: 11px; }
.table-soft th.sortable.asc::after { content: '\F235'; opacity: .9; }
.table-soft th.sortable.desc::after { content: '\F229'; opacity: .9; }

/* =================== SKELETON =================== */
.skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #f7fafc 37%, #eef2f7 63%);
    background-size: 400% 100%; border-radius: var(--radius-sm);
    animation: skeleton-shimmer 1.3s ease infinite; display: block;
}
.skeleton.line { height: 12px; margin: 6px 0; }
.skeleton.line.w60 { width: 60%; } .skeleton.line.w40 { width: 40%; } .skeleton.line.w80 { width: 80%; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* =================== BOTAO LOADING =================== */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 15px; height: 15px; margin: -8px 0 0 -8px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; color: #fff; animation: btn-spin .6s linear infinite;
}
.btn-soft.is-loading::after, .btn-light.is-loading::after, .btn-outline-secondary.is-loading::after { color: var(--color-primary); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* =================== DASHBOARD CHARTS =================== */
.chart-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.chart-card .chart-title { font-weight: 600; font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.chart-box { position: relative; height: 260px; }

/* =================== DARK MODE =================== */
html[data-theme="dark"] {
    --color-primary:       #6366f1;
    --color-primary-hover: #818cf8;
    --color-primary-rgb:   99, 102, 241;
    --color-bg:            #0b1220;
    --color-surface:       #121a2b;
    --color-border:        #243049;
    --color-border-strong: #334155;
    --color-text:          #e5e9f0;
    --color-text-muted:    #94a3b8;
    --color-primary-soft:  #1b2440;
    --sidebar-bg:          #0a0f1c;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.45);
    --shadow:    0 8px 24px -6px rgba(0,0,0,0.6);
    --shadow-lg: 0 16px 40px -10px rgba(0,0,0,0.7);
}
html[data-theme="dark"] .app-sidebar { background: linear-gradient(180deg, #111a30 0%, #0b1120 60%, #070b15 100%); }
html[data-theme="dark"] body { background: var(--color-bg); color: var(--color-text); }
html[data-theme="dark"] .app-topbar { background: var(--color-surface); }
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .table-soft thead th { background: #0f1827; color: var(--color-text-muted); }
html[data-theme="dark"] .table-soft tbody tr:hover { background: #16213a; }
html[data-theme="dark"] .table-soft thead th,
html[data-theme="dark"] .table-soft tbody td { border-color: var(--color-border); }
html[data-theme="dark"] .topbar-user:hover,
html[data-theme="dark"] .sidebar-toggle-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
html[data-theme="dark"] .kb-board,
html[data-theme="dark"] .kanban-col { background: #0d1525; }
html[data-theme="dark"] .kb-col { background: #0f1827; }
html[data-theme="dark"] .kb-card,
html[data-theme="dark"] .kb-topbar,
html[data-theme="dark"] .kb-stats { background: var(--color-surface); color: var(--color-text); }
html[data-theme="dark"] .kb-quickadd { border-color: var(--color-border); }
html[data-theme="dark"] .btn-light { background: #1c2840; border-color: var(--color-border); color: var(--color-text); }
html[data-theme="dark"] .btn-light:hover { background: #243049; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background: #0f1827; border-color: var(--color-border); color: var(--color-text);
}
html[data-theme="dark"] .form-control::placeholder { color: #5b6b86; }
html[data-theme="dark"] .dropdown-menu { background: var(--color-surface); border-color: var(--color-border); }
html[data-theme="dark"] .dropdown-item { color: var(--color-text); }
html[data-theme="dark"] .dropdown-item:hover { background: #1c2840; color: #fff; }
html[data-theme="dark"] .modal-content { background: var(--color-surface); color: var(--color-text); }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1a2336 25%, #243049 37%, #1a2336 63%); background-size: 400% 100%; }
html[data-theme="dark"] .wa-list-pane, html[data-theme="dark"] .wa-thread-head,
html[data-theme="dark"] .wa-thread-input { background: var(--color-surface); }
html[data-theme="dark"] .wa-thread { background: #0a0f1c; }
html[data-theme="dark"] .wa-list-item:hover { background: #16213a; }
html[data-theme="dark"] .wa-list-item.active { background: #1e293b; }
html[data-theme="dark"] .msg.recebida { background: #1c2840; color: var(--color-text); }
html[data-theme="dark"] .msg.enviada { background: #134d2e; color: #e5e9f0; }
html[data-theme="dark"] .page-link { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
html[data-theme="dark"] .page-link:hover { background: #1c2840; color: #fff; }
html[data-theme="dark"] .page-item.active .page-link { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
html[data-theme="dark"] .page-item.disabled .page-link { background: #0f1827; border-color: var(--color-border); color: #5b6b86; }
html[data-theme="dark"] .alert-info { background: #102234; border-color: #1c3a52; color: #cfe4f5; }

.theme-toggle { background: transparent; border: 0; color: var(--color-text-muted); font-size: 1.15rem; padding: 6px 9px; border-radius: 8px; cursor: pointer; line-height: 1; }
.theme-toggle:hover { background: var(--color-bg); color: var(--color-text); }

/* =================== TAGS =================== */
.tag-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid var(--color-border); background: var(--color-surface);
    font-size: 13px; font-weight: 500; user-select: none;
    transition: background-color .12s ease, border-color .12s ease;
}
.tag-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tag-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tag-cor, #6b7280); flex: 0 0 9px; }
.tag-chip:hover { border-color: var(--tag-cor, var(--color-primary)); }
.tag-chip:has(input:checked) {
    border-color: var(--tag-cor, var(--color-primary));
    background: color-mix(in srgb, var(--tag-cor, #6b7280) 14%, var(--color-surface));
}
.tag-chip:has(input:checked) .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-cor, #6b7280) 25%, transparent); }
.tag-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--tag-cor, #6b7280) 35%, transparent);
    color: var(--tag-cor, #475569);
    background: color-mix(in srgb, var(--tag-cor, #6b7280) 12%, var(--color-surface));
}
.tag-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tag-cor, #6b7280); }
.tags-cell { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* =================== FORMS / INPUTS =================== */
.form-label { font-weight: 500; font-size: 13px; color: var(--color-text); margin-bottom: 5px; }
.form-control, .form-select {
    border-radius: 9px;
    border: 1px solid var(--color-border-strong);
    padding: 0.5rem 0.8rem;
    font-size: 14px;
    background-color: var(--color-surface);
    color: var(--color-text);
    transition: border-color .14s ease, box-shadow .14s ease;
}
.form-control::placeholder { color: #9aa3b2; }
.form-control:hover, .form-select:hover { border-color: #b5bcca; }
.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
    outline: none;
}
.form-control-lg { padding: 0.65rem 1rem; font-size: 15px; border-radius: 10px; }
.input-group .form-control { box-shadow: none; }
textarea.form-control { line-height: 1.55; }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select { border-color: var(--color-border-strong); }
html[data-theme="dark"] .form-control:hover,
html[data-theme="dark"] .form-select:hover { border-color: #3d4a63; }

/* =================== CONTEUDO / DIVERSOS =================== */
.app-content { animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.alert { border-radius: var(--radius); border: 1px solid transparent; }
.alert-info    { background: var(--color-primary-soft); border-color: #dbe2ff; color: #3730a3; }
.alert-success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: #fde68a; color: #92400e; }

.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-size: 14px;
}
.dropdown-item { border-radius: 8px; padding: 8px 12px; }
.dropdown-item:active { background: var(--color-primary); }

.list-group-item { border-color: var(--color-border); }
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
hr { border-color: var(--color-border); opacity: 1; }

/* List-group hover (funis) */
.list-group-flush .list-group-item { transition: background-color .12s ease; }
.list-group-flush .list-group-item:hover { background: var(--color-primary-soft); }

/* =================== MOVIMENTO REDUZIDO =================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =====================================================================
   SKIN "LsProjects" — identidade visual: gradiente indigo->violet->fuchsia,
   sidebar clara (light), navbar glassmorphism, botoes/avatar com gradiente.
   Overrides no fim do arquivo p/ ter prioridade na cascata; dark mode preservado.
   ===================================================================== */

/* ----- Botao primario com gradiente ----- */
.btn-primary,
.btn-primary:disabled,
.btn-primary.disabled {
    background: var(--grad-soft); border: none; box-shadow: var(--grad-shadow);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--grad-soft); border: none;
    filter: brightness(1.07); transform: translateY(-1px);
    box-shadow: var(--grad-shadow);
}
.btn-primary:active { background: var(--grad-soft); border: none; filter: brightness(.95); transform: none; }
.nav-pills .nav-link.active { background: var(--grad-soft); }

/* ----- Avatar com gradiente de marca ----- */
.avatar { background: var(--grad-soft); box-shadow: 0 4px 10px -4px rgba(99,102,241,.6); }

/* ----- Navbar (topbar) glassmorphism ----- */
.app-topbar {
    background: rgba(255,255,255,.78);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(16,24,40,.07);
    box-shadow: none;
}
html[data-theme="dark"] .app-topbar {
    background: rgba(20,24,38,.7);
    border-bottom-color: rgba(255,255,255,.06);
}

/* ----- KPI cards: hover lift + circulo decorativo ----- */
.kpi-card { transition: transform .2s ease, box-shadow .2s ease; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-card::after {
    content: ''; position: absolute; right: -28px; bottom: -28px;
    width: 92px; height: 92px; border-radius: 50%;
    background: rgba(99,102,241,.06); pointer-events: none;
}

/* ----- SIDEBAR CLARA (somente tema claro; dark continua escura) ----- */
html[data-theme="light"] .app-sidebar {
    background: #fff;
    border-right: 1px solid rgba(16,24,40,.07);
}
html[data-theme="light"] .sidebar-brand {
    color: #1f2430;
    border-bottom: 1px solid rgba(16,24,40,.06);
}
html[data-theme="light"] .sidebar-brand span {
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-theme="light"] .sidebar-section { color: #9aa1b2; }
html[data-theme="light"] .sidebar-nav a { color: #6b7280; }
html[data-theme="light"] .sidebar-nav a:hover {
    background: rgba(99,102,241,.07); color: var(--color-primary);
}
html[data-theme="light"] .sidebar-nav a.active {
    background: rgba(99,102,241,.10); color: var(--color-primary);
    box-shadow: none; font-weight: 650;
}
html[data-theme="light"] .sidebar-nav a.active i { color: var(--color-primary); }
html[data-theme="light"] .sidebar-nav a.active::before { background: var(--grad-soft); }
html[data-theme="light"] .sidebar-toggle-btn { color: #9aa1b2; }
html[data-theme="light"] .sidebar-toggle-btn:hover { background: rgba(99,102,241,.08); color: var(--color-primary); }

/* =====================================================================
   AUTH / LOGIN — split-screen (lado navy->indigo->teal + form branco)
   Portado do design LsProjects, adaptado ao LSCRM.
   ===================================================================== */
.auth-wrap { display: flex; min-height: 100vh; min-height: 100dvh; }
.auth-side {
    flex: 1; position: relative; overflow: hidden;
    background:
        radial-gradient(900px 600px at 80% -10%, rgba(56,189,248,.22), transparent 60%),
        radial-gradient(700px 500px at -10% 110%, rgba(139,92,246,.20), transparent 55%),
        linear-gradient(160deg, #0f172a 0%, #1e293b 38%, #243b6b 70%, #0e7490 100%);
    color: #e8eefc;
    display: flex; flex-direction: column; justify-content: center;
    padding: 4rem;
}
.auth-side::before, .auth-side::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.05);
}
.auth-side::before { width: 380px; height: 380px; top: -120px; right: -120px; }
.auth-side::after { width: 260px; height: 260px; bottom: -100px; left: -60px; background: rgba(255,255,255,.04); }
.auth-side .content { position: relative; z-index: 2; max-width: 480px; }
.auth-side h1 { font-weight: 800; font-size: 2.5rem; letter-spacing: -.03em; line-height: 1.12; color: #fff; }
/* Features com ICONE EM CIRCULO (mockup 30/07/2026): antes era um icone solto,
   que sumia no fundo escuro. O circulo dá peso e alinha os três itens. */
.auth-side .feat { display: flex; gap: .9rem; align-items: center; margin-top: 1.1rem; }
.auth-side .feat i { font-size: 1.15rem; color: #fff; width: 44px; height: 44px; flex: 0 0 44px;
    display: flex; align-items: center; justify-content: center; border-radius: 14px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.auth-side .feat:nth-of-type(1) i { background: rgba(37,211,102,.16); border-color: rgba(37,211,102,.35); color: #25d366; }
.auth-side .feat:nth-of-type(2) i,
.auth-side .feat:nth-of-type(3) i { background: rgba(124,92,255,.18); border-color: rgba(124,92,255,.38); color: #a78bfa; }
.auth-side .feat strong { color: #fff; }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 1.5rem; }
.auth-brand i { font-size: 1.7rem; color: #a5b4fc; }
/* mini-ilustracao do funil (mockup kanban) */
.auth-illu { position: relative; z-index: 2; margin: 1.4rem 0 1.6rem; display: flex; gap: .7rem; }
.auth-illu .col { flex: 1; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10); border-radius: .8rem; padding: .55rem; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.auth-illu .col .ttl { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; margin-bottom: .45rem; display: flex; align-items: center; gap: .35rem; }
.auth-illu .col .ttl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.auth-illu .c1 .ttl::before { background: #94a3b8; }
.auth-illu .c2 .ttl::before { background: #38bdf8; }
.auth-illu .c3 .ttl::before { background: #34d399; }
/* Card do mini-funil (mockup 30/07/2026): avatar redondo + barra + tag colorida
   da coluna — lê como um card de CRM de verdade, não como duas listras. */
/* flex-direction:row EXPLICITO: .card do Bootstrap e column por padrao e empilhava
   avatar/barra/tag um sobre o outro. */
.auth-illu .card { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.08);
    border-radius: .55rem; padding: .5rem; margin-bottom: .4rem;
    display: flex; flex-direction: row; align-items: center; gap: .45rem; }
.auth-illu .card::before { content: ""; width: 16px; height: 16px; border-radius: 50%;
    background: rgba(255,255,255,.22); flex: 0 0 16px; }
.auth-illu .card .l1 { height: 6px; width: 100%; border-radius: 4px; background: rgba(255,255,255,.45); flex: 1; }
/* l2 vira a "tag" colorida à direita, na cor da coluna */
.auth-illu .card .l2 { height: 7px; width: 18px; border-radius: 3px; flex: 0 0 18px; background: rgba(255,255,255,.35); }
.auth-illu .c1 .card .l2 { background: #a78bfa; }
.auth-illu .c2 .card .l2 { background: #38bdf8; }
.auth-illu .c3 .card .l2 { background: #34d399; }
.auth-illu .card.sm .l1 { width: 70%; flex: 0 1 70%; }
.auth-form { width: 480px; max-width: 100%; display: flex; flex-direction: column; justify-content: center; padding: 3rem 3.5rem; background: #fff; }
/* Campo com icone dentro + olho da senha (mockup 30/07/2026) */
.auth-input { position: relative; }
.auth-input .form-control { padding-left: 42px; }
.auth-input .auth-input-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; font-size: 1rem; pointer-events: none; z-index: 2; }
.auth-input .auth-input-olho { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: #9ca3af; padding: 6px 10px; cursor: pointer; line-height: 1; z-index: 2; }
.auth-input .auth-input-olho:hover { color: #6b7280; }
.auth-input:has(.auth-input-olho) .form-control { padding-right: 44px; }
/* Botao Entrar com gradiente (mockup) */
.auth-form .btn-primary { background: linear-gradient(135deg, #6d28d9, #7c3aed 55%, #8b5cf6);
    border: 0; font-weight: 600; border-radius: .7rem; box-shadow: 0 8px 20px rgba(124,58,237,.30); }
.auth-form .btn-primary:hover { background: linear-gradient(135deg, #5b21b6, #6d28d9 55%, #7c3aed);
    box-shadow: 0 10px 24px rgba(124,58,237,.40); }
.auth-logo { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: .5rem; }
.auth-logo i, .auth-logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 991.98px) {
    .auth-side { display: none; }
    .auth-form { width: 100%; padding: 2.5rem 1.5rem; }
}
@media (max-width: 575.98px) {
    .auth-form { padding: 2rem 1.4rem calc(2rem + env(safe-area-inset-bottom)); justify-content: flex-start; padding-top: 12vh; }
    .auth-logo { font-size: 2rem; justify-content: center; }
    .auth-form .form-control { height: 52px; font-size: 1rem; border-radius: .9rem; }
    .auth-form .btn { min-height: 52px; font-size: 1.05rem; border-radius: .9rem; }
}

/* ===================================================================
   RESPONSIVO TOTAL + DARK MODE (2026-06-10)
   Telas dimensionaveis para qualquer tamanho + texto legivel no escuro
   =================================================================== */

/* ---- painel de ajuda fechado nao pode alargar a pagina (auditoria mobile 21/07/2026) ----
   O .ajuda-panel fica estacionado fora da tela (translateX(102%)). No celular isso empurrava a
   largura do documento para ~414px num viewport de 390 e o Chrome respondia dando zoom-out na
   pagina inteira (aquela faixa cinza na lateral). "clip" corta sem criar container de scroll,
   entao o position:sticky da topbar/sidebar continua funcionando (o que 'hidden' quebraria). */
body { overflow-x: clip; }

/* ---- larguras inline fixas viram fluidas no mobile ---- */
@media (max-width: 768px) {
    .app-content .form-select[style*="max-width"],
    .app-content .form-select[style*="min-width"],
    .app-content input.form-control[style*="max-width"],
    .app-content input.form-control[style*="width"],
    .app-content .input-group[style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .tab-content .card[style*="max-width"] { max-width: 100% !important; }
    .chart-box { height: 260px; }
    #calendario { min-height: auto; }
    .fc { font-size: 13px; }
}

/* ---- nav-tabs (Configuracoes tem 7 abas): scroll horizontal ---- */
@media (max-width: 768px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .nav-tabs .nav-link { white-space: nowrap; }
}

/* ---- kanban: colunas proporcionais a viewport ---- */
@media (max-width: 768px) {
    .kb-col { flex: 0 0 80vw; width: 80vw; }
    .kb-topbar { flex-wrap: wrap; }
    .kb-topbar .input-group { width: 100% !important; }
    .kb-topbar select { width: 100%; min-width: 0 !important; }
}

/* ---- kanban: a barra de filtros precisa QUEBRAR no celular (auditoria mobile 21/07/2026) ----
   Sem isto o form de filtros (funil + responsavel + 4 datas) nao quebra linha, forca uma
   largura minima de ~870px e ESTICA a pagina inteira: os selects colapsam para a largura da
   setinha e os campos de data saem da tela. Vale para as tres vistas (board/todos/lista). */
@media (max-width: 768px) {
    .kb-topbar { flex-direction: column; align-items: stretch; }
    .kb-topbar .left,
    .kb-topbar .right { flex-wrap: wrap; width: 100%; min-width: 0; }
    .kb-topbar form.d-flex { flex-wrap: wrap; width: 100%; gap: 8px !important; }
    /* selects (funil / responsavel) ocupam a linha inteira em vez de espremer */
    .kb-topbar form .form-select { flex: 1 1 100%; width: 100% !important; min-width: 0 !important; }
    /* cada par de datas ocupa uma linha; os dois campos dividem o espaco */
    .kb-topbar form > .d-flex.align-items-center { flex: 1 1 100%; flex-wrap: wrap; min-width: 0; }
    .kb-topbar form input[type="date"] { flex: 1 1 40%; width: auto !important; min-width: 0 !important; }
    .kb-topbar .right { justify-content: space-between; }
    .kb-total { font-size: 13px; }
    /* filtros avancados recolhidos: abertos ocupavam >50% da tela antes do primeiro card */
    .kb-filtros-av { display: none; }
    .kb-filtros-av.aberto { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .kb-filtros-av.aberto > .d-flex { flex: 1 1 100%; flex-wrap: wrap; }
}
/* No desktop o wrapper nao existe visualmente: os filhos seguem sendo itens do flex do form. */
@media (min-width: 769px) { .kb-filtros-av { display: contents; } }
@media (max-width: 576px) {
    .kb-col { flex: 0 0 calc(100vw - 40px); width: calc(100vw - 40px); }
}

/* ---- forms de toolbar/card empilham no celular (nao afeta forms inline de tabela) ---- */
@media (max-width: 576px) {
    .card-body > form.d-flex { flex-direction: column; align-items: stretch !important; }
    .card-body > form.d-flex > div { width: 100% !important; min-width: 0 !important; }
    .card-body > form.d-flex > .btn { width: 100%; }
    /* forms inline da tabela de etapas do funil: quebram linha em vez de estourar */
    .table-soft td form.d-flex { flex-wrap: wrap; }
    .table-soft td form.d-flex input[style*="flex:1"],
    .table-soft td form.d-flex input[style*="flex: 1"] { flex: 1 1 100% !important; }
}

/* ---- toolbar do topo das paginas (titulo + botoes) ---- */
@media (max-width: 576px) {
    .app-content > .d-flex.justify-content-between { flex-wrap: wrap; gap: 10px; }
}

/* ---- dropdown de notificacoes nao estoura o celular ---- */
@media (max-width: 576px) {
    .app-topbar .dropdown-menu {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
    }
}

/* ---- badges com nomes longos (etapa) quebram ENTRE palavras, nunca no meio ---- */
.badge-pill { white-space: normal; word-break: normal; overflow-wrap: break-word; }

/* ---- EXCECAO: o badge de empresa na topbar nao pode quebrar (auditoria mobile 21/07/2026).
   A topbar tem altura fixa; um nome como "PEDRO LUIS GUERRIERI-MATERIAIS ELETRICOS" virava
   4 linhas, vazava por cima da barra e esticava a pagina toda. Aqui trunca com reticencias. */
.app-topbar .badge-pill {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 260px; display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
}
@media (max-width: 992px) { .app-topbar .badge-pill { max-width: 150px; } }
/* Em tela estreita a topbar nao cabe (hamburguer + voltar + titulo + empresa + tema + sino +
   avatar somavam ~414px num viewport de 390, e o Chrome dava zoom-out na pagina inteira).
   O badge de empresa vira so o icone — continua clicavel para trocar de empresa. */
@media (max-width: 576px) {
    .app-topbar .badge-pill { max-width: none; font-size: 0; gap: 0; padding: 6px 8px; }
    .app-topbar .badge-pill > i { font-size: 14px; }
    .app-topbar .badge-pill > i.bi-chevron-down { display: none; }
    .topbar-inner { gap: 6px; }
    .app-topbar .topbar-user { padding: 5px 4px; gap: 4px; }
}
/* O min-width:0 precisa alcancar os NETOS do flex: sem isto o .topbar-title (que esta dentro de
   um .d-flex intermediario) nao encolhe e empurra a largura minima da barra. */
@media (max-width: 992px) {
    .topbar-inner .d-flex { min-width: 0; }
    .topbar-title { min-width: 0; flex: 0 1 auto; }
    /* Quem cede espaco e o lado ESQUERDO (titulo trunca). O lado direito (tema/sino/avatar) tem
       largura fixa: sem flex-shrink:0 ele era espremido e os botoes vazavam para fora da barra. */
    .topbar-inner > .d-flex:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; }
    .topbar-right { flex: 0 0 auto; }
}
/* ---- status/temperatura sao rotulos curtos: nunca quebram ("Ganha", "Perdida") ---- */
.badge-status-aberta, .badge-status-ganha, .badge-status-perdida, .badge-status-congelada,
.badge-frio, .badge-morno, .badge-quente, .badge-ativo { white-space: nowrap; word-break: normal; }

/* ---- alvo de toque confortavel no celular ---- */
@media (max-width: 576px) {
    .btn-sm { min-height: 36px; }
    .table-soft.table-stack tbody td .btn { min-height: 38px; }
}

/* =================== AUTOCOMPLETE (cliente no orcamento) =================== */
.orc-ac-lista {
    list-style: none; margin: 2px 0 0; padding: 4px;
    position: absolute; left: 0; right: 0; top: 100%; z-index: 1050;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 10px; box-shadow: var(--shadow-lg, 0 12px 32px -10px rgba(0,0,0,0.35));
    max-height: 280px; overflow-y: auto;
}
.orc-ac-item {
    padding: 8px 10px; border-radius: 7px; cursor: pointer;
    font-size: 14px; color: var(--color-text); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.orc-ac-item:hover, .orc-ac-item.ativo { background: var(--color-primary-soft, rgba(99,102,241,0.12)); }

/* =================== DARK MODE: texto sempre legivel =================== */
html[data-theme="dark"] .list-group-item {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
html[data-theme="dark"] .nav-tabs { border-color: var(--color-border); }
html[data-theme="dark"] .nav-tabs .nav-link { color: var(--color-text-muted); }
html[data-theme="dark"] .nav-tabs .nav-link:hover { color: var(--color-text); border-color: var(--color-border); }
html[data-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border) var(--color-border) var(--color-surface);
}
html[data-theme="dark"] .form-text { color: var(--color-text-muted); }
html[data-theme="dark"] .text-muted { color: var(--color-text-muted) !important; }
html[data-theme="dark"] .form-label { color: var(--color-text); }
html[data-theme="dark"] .form-check-label { color: var(--color-text); }
html[data-theme="dark"] .form-check-input { background-color: #0f1827; border-color: var(--color-border-strong); }
html[data-theme="dark"] .form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }
html[data-theme="dark"] .input-group-text { background: #0f1827; color: var(--color-text-muted); border-color: var(--color-border); }
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly] { background: #0d1525; color: var(--color-text-muted); }
html[data-theme="dark"] .table-soft tbody td { color: var(--color-text); }
html[data-theme="dark"] .table-soft tbody td .small,
html[data-theme="dark"] .table-soft tbody td .text-muted-2 { color: var(--color-text-muted); }
html[data-theme="dark"] dt, html[data-theme="dark"] dd { color: var(--color-text); }
html[data-theme="dark"] code { color: #f0abfc; background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 5px; }
html[data-theme="dark"] .wa-kommo { background: var(--color-surface); }
html[data-theme="dark"] .empty-state { color: var(--color-text-muted); }
html[data-theme="dark"] .modal-header, html[data-theme="dark"] .modal-footer { border-color: var(--color-border); }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .accordion-button { background: var(--color-surface); color: var(--color-text); }

/* ============================================================================
   REDESIGN 30/07/2026 — camada de refino visual (mockups do dono)
   ----------------------------------------------------------------------------
   Escrito no FIM do arquivo de proposito: sobrescreve por cascata, sem editar as
   regras originais. Se algo destoar, basta remover este bloco e a tela volta ao
   que era — reescrever as regras antigas nao teria essa saida.
   Aproxima TODAS as telas do desenho de uma vez: cards, KPIs, tabelas, badges,
   titulos, botoes e avatares sao o vocabulario repetido em todos os mockups.
   ========================================================================== */

/* ---- Superficies: raio maior e sombra mais suave/ampla ---- */
.card {
    border-radius: 14px;
    border-color: #eceef3;
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px -12px rgba(16,24,40,.10);
}
.card-header {
    padding: 16px 20px;
    font-size: 14.5px;
    letter-spacing: -.01em;
}
.card-body { padding: 20px; }

/* ---- Titulo da pagina: maior, com respiro (mockups) ---- */
.page-title { font-size: 26px; letter-spacing: -.025em; margin-bottom: 4px; }
.page-title + .text-muted-2,
.page-title + p { margin-bottom: 18px; }

/* ---- KPI: numero grande, rotulo caixa-alta discreto ----
   A barrinha lateral colorida saiu: nos mockups o destaque vem do NUMERO e da
   cor do proprio valor, nao de um adorno na borda. */
.kpi-card { border-radius: 14px; padding: 20px; border-color: #eceef3; }
.kpi-card::before { display: none; }
.kpi-card .label { font-size: 11px; letter-spacing: .8px; }
.kpi-card .value { font-size: 32px; }

/* Cartoes de numero feitos com .card + .h4/.h5 (Relatorios, Oportunidades,
   Contas a pagar): mesma pegada dos .kpi-card, sem precisar trocar o HTML. */
.card .text-uppercase.small { font-size: 11px; letter-spacing: .8px; font-weight: 600; }
.card .h4, .card .h5 { letter-spacing: -.02em; }

/* ---- Tabelas: cabecalho mais claro, linhas com mais ar ---- */
.table-soft { border-radius: 14px; border-color: #eceef3; }
.table-soft thead th {
    background: #f8f9fc;
    font-size: 10.5px;
    letter-spacing: .7px;
    padding: 13px 18px;
    border-bottom-color: #eceef3;
}
.table-soft tbody td { padding: 15px 18px; border-bottom-color: #f1f2f6; }
/* hover discreto: o roxo cheio competia com os badges coloridos da linha */
.table-soft tbody tr:hover { background: #f8f9fc; }

/* ---- Badges: pilulas com cor suave, como no desenho ---- */
.badge-pill { padding: 4px 11px; font-size: 11.5px; border-radius: 999px; }

/* ---- Botoes: raio maior; primario com o gradiente da marca ---- */
.btn { border-radius: 10px; }
.btn-sm { border-radius: 8px; }
.btn-primary {
    background: linear-gradient(135deg, #6d28d9, #7c3aed 60%, #8b5cf6);
    border: 0;
    box-shadow: 0 6px 16px -6px rgba(124,58,237,.55);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #5b21b6, #6d28d9 60%, #7c3aed);
    box-shadow: 0 8px 20px -6px rgba(124,58,237,.65);
}
.btn-soft { border-radius: 10px; }

/* ---- Campos ---- */
.form-control, .form-select { border-radius: 10px; border-color: #e3e6ee; }
.form-control:focus, .form-select:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}

/* ---- Avatar de pessoa (responsavel nas listas) ----
   Nos mockups o responsavel aparece como circulo com a inicial. Use
   <span class="av-ini">C</span> ou <span class="av-ini av-lilas">C</span>. */
.av-ini {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    font-size: 11px; font-weight: 700; color: #fff;
    background: #8b5cf6; flex: 0 0 26px; text-transform: uppercase;
}
.av-ini.av-azul  { background: #3b82f6; }
.av-ini.av-verde { background: #10b981; }
.av-ini.av-ambar { background: #f59e0b; }
.av-ini.av-rosa  { background: #ec4899; }
.av-ini.av-cinza { background: #94a3b8; }

/* ---- Tema escuro: acompanha os ajustes acima ---- */
html[data-theme="dark"] .card,
html[data-theme="dark"] .table-soft { border-color: #2b3648; box-shadow: none; }
html[data-theme="dark"] .table-soft thead th { background: #1c2532; border-bottom-color: #2b3648; }
html[data-theme="dark"] .table-soft tbody td { border-bottom-color: #232d3d; }
html[data-theme="dark"] .table-soft tbody tr:hover { background: #1f2836; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select { border-color: #334054; }

/* Cards de sugestao do Assistente interno (mockup 30/07/2026) */
.ia-card {
    display: flex; flex-direction: column; gap: 2px; text-align: left;
    background: var(--color-surface, #fff); border: 1px solid #eceef3;
    border-radius: 12px; padding: 14px; cursor: pointer; height: 100%;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.ia-card:hover { border-color: #c4b5fd; box-shadow: 0 8px 20px -10px rgba(124,58,237,.35); transform: translateY(-1px); }
.ia-card i { font-size: 1.3rem; margin-bottom: 6px; }
.ia-card strong { font-size: 13px; color: var(--color-text, #0f172a); line-height: 1.25; }
.ia-card em { font-size: 11.5px; color: var(--color-text-muted, #6b7280); font-style: normal; }
html[data-theme="dark"] .ia-card { border-color: #2b3648; }
html[data-theme="dark"] .ia-card:hover { border-color: #6d28d9; }

/* ---- Contas a pagar: KPI com icone, rosca e lista lateral (mockup 30/07/2026) ---- */
.cp-kpi { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cp-ico { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.cp-ico-azul     { background: #eff6ff; color: #3b82f6; }
.cp-ico-ambar    { background: #fffbeb; color: #d97706; }
.cp-ico-vermelho { background: #fef2f2; color: #dc2626; }
.cp-ico-verde    { background: #ecfdf5; color: #16a34a; }
/* rosca em CSS puro: evita carregar biblioteca de grafico por 4 fatias */
.cp-rosca { width: 150px; height: 150px; border-radius: 50%; position: relative; }
.cp-rosca::after { content: ""; position: absolute; inset: 26px; border-radius: 50%;
    background: var(--color-surface, #fff); }
.cp-leg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; }
.cp-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.cp-venc { padding: 8px 0; border-bottom: 1px solid #f1f2f6; }
.cp-venc:last-child { border-bottom: 0; }
html[data-theme="dark"] .cp-ico-azul     { background: #17233a; }
html[data-theme="dark"] .cp-ico-ambar    { background: #2a2110; }
html[data-theme="dark"] .cp-ico-vermelho { background: #2c1618; }
html[data-theme="dark"] .cp-ico-verde    { background: #12261d; }
html[data-theme="dark"] .cp-venc { border-bottom-color: #232d3d; }

/* Cabecalho de tabela ordenavel no servidor (30/07/2026) — usado em Oportunidades.
   A seta so aparece na coluna ativa; o link herda a cor do TH para nao virar
   "link azul" no meio do cabecalho. */
.th-ord { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.th-ord:hover { color: var(--color-primary, #7c3aed); }
.th-ord i { font-size: 10px; opacity: .85; }

/* ===== Tabela que cabe na tela (30/07/2026) =====
   Pedido do dono: "a tabela de leads corta, tem que aparecer completa
   horizontalmente em cada monitor". Em vez de a tabela crescer e o wrapper
   rolar, ela ocupa 100% e divide as colunas em % (colgroup na JSP). O que
   nao couber e cortado com reticencias na celula — nada de scroll lateral.
   So a partir de 992px: abaixo disso vale o .table-stack (vira cartoes). */
@media (min-width: 992px) {
    .tbl-fit { table-layout: fixed; width: 100%; }
    .tbl-fit th, .tbl-fit td { overflow: hidden; text-overflow: ellipsis; }
    /* uma linha so nas colunas curtas; o Nome pode quebrar em duas */
    .tbl-fit td > .text-muted-2.small,
    .tbl-fit td[data-label="Origem"],
    .tbl-fit td[data-label="Contato"] .text-muted-2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* botao de whatsapp com numero: nao pode empurrar a coluna */
    .tbl-fit td[data-label="Contato"] .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* nome do responsavel ao lado do avatar */
    .tbl-fit td[data-label="Responsável"] .d-inline-flex { max-width: 100%; }
    .tbl-fit td[data-label="Responsável"] .d-inline-flex > span:last-child {
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    /* acoes: icones sempre visiveis, sem quebrar linha */
    .tbl-fit td[data-label="Ações"] { white-space: nowrap; }
    .tbl-fit td[data-label="Ações"] .btn { padding-left: .45rem; padding-right: .45rem; }
}
/* telas apertadas (notebook 1366): aperta fonte e respiro antes de cortar texto */
@media (min-width: 992px) and (max-width: 1400px) {
    .tbl-fit { font-size: 13px; }
    .tbl-fit th, .tbl-fit td { padding-left: .5rem; padding-right: .5rem; }
}

/* ===== Kanban: colunas cabem na tela (30/07/2026) =====
   Antes cada coluna era fixa em 300px: com 6 etapas dava 1.8m px e o quadro
   aparecia cortado, exigindo rolagem lateral. Agora elas dividem a largura
   disponivel (flex: 1) e so voltam a rolar quando ha etapas demais para o
   minimo legivel de 210px — o mockup do dono mostra as 6 visiveis de uma vez. */
.kb-board { flex-wrap: nowrap; }
.kb-col { flex: 1 1 0; width: auto; min-width: 210px; }
/* com muitas etapas o scroll volta, mas so entao */
@media (max-width: 1200px) {
    .kb-col { min-width: 240px; flex: 0 0 240px; }
}

/* ===== Login conforme o mockup de 30/07/2026 =====
   Ajustes sobre o layout ja existente: palavras-chave destacadas no titulo,
   rotulos das colunas do funil em caixa normal (o mockup nao usa CAIXA ALTA)
   e o formulario como CARTAO flutuante sobre um fundo claro, em vez de coluna
   branca colada na borda. */
.auth-side h1 .hl { color: #a78bfa; }
.auth-illu .col .ttl { text-transform: none; font-size: .72rem; letter-spacing: 0; opacity: .95; }
.auth-illu .col .ttl::before { width: 8px; height: 8px; }
/* icone da feature redondo (mockup) */
.auth-side .feat i { border-radius: 50%; }

/* O cartao e um elemento REAL (.auth-card na login.jsp), nao um pseudo-elemento:
   com ::before a altura dependia do container e a "folha" descolava do conteudo. */
@media (min-width: 992px) {
    .auth-form {
        background: linear-gradient(160deg, #f7f7fb 0%, #eef0f8 100%);
        display: flex; align-items: center; justify-content: center; padding: 2.5rem;
    }
    .auth-card {
        width: 100%; max-width: 470px;
        background: #fff; border-radius: 24px; padding: 2.5rem 2.25rem;
        box-shadow: 0 24px 60px -24px rgba(15,23,42,.28), 0 2px 8px rgba(15,23,42,.06);
    }
}
html[data-theme="dark"] .auth-form { background: #0f1421; }
html[data-theme="dark"] .auth-card { background: #161d2e; box-shadow: 0 24px 60px -24px rgba(0,0,0,.6); }

/* Kanban: "Mais filtros" recolhido tambem no desktop (30/07/2026).
   Antes `display: contents` acima de 769px deixava os seis campos de data sempre
   na barra, que transbordava — o ultimo campo aparecia cortado. */
.kb-filtros-av { display: none; }
.kb-filtros-av.aberto { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
/* a 6a coluna encostava na borda: um pouco menos de minimo resolve */
.kb-col { min-width: 190px; }
/* respiro na direita: sem isso a ultima coluna encosta na borda da janela */
.kb-board::after { content: ""; flex: 0 0 4px; }

/* Coluna "Etapa" das Oportunidades (30/07/2026): os nomes da Santa Ines sao
   frases ("Manutenção/Melhoria em cotação"), nao rotulos curtos. A pilula
   quebra em ate 2 linhas e o resto vira reticencias — o nome inteiro fica no
   title. Sem isso o texto saia cortado no meio da palavra. */
.etapa-pill {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
    white-space: normal; line-height: 1.25; text-align: left;
    max-width: 100%; padding: 4px 10px;
}
/* o ponto colorido do badge nao cabe junto do texto multilinha */
.etapa-pill::before { display: none; }

/* ===== Quebras de linha nas mensagens (30/07/2026) =====
   O texto entra escapado na bolha; sem pre-wrap o navegador colapsa os \n e a
   mensagem padronizada (Endereço / Horário / Data / Contato / Instrutor) chegava
   como paragrafo unico. Vale para a conversa do WhatsApp e para o chat interno. */
.wa-thread-msgs .msg, .chat-msgs .msg, .msg-cap, .msg-nota { white-space: pre-wrap; }
/* dentro de midia/documento o pre-wrap nao deve valer (espacos do markup) */
.msg .msg-media, .msg .msg-doc, .msg .msg-audio-wrap, .msg .msg-baixar { white-space: normal; }

/* ações da caixa de e-mail (096, 04/08/2026): sinalizar, lido, arquivar, lixeira, mover */
.email-acoes { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 3px; }
.email-acao { color: #9aa1b0; text-decoration: none; line-height: 1; font-size: 13px; border: 0; background: none; }
.email-acao:hover { color: var(--color-primary); }
.email-item:hover .email-acoes { opacity: 1; }
.email-acoes { opacity: .55; transition: opacity .12s ease; }
html[data-theme="dark"] .email-acao { color: #94a3b8; }

/* link "salvar" da midia (04/08/2026) */
.msg-baixar { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 600;
    color: #4b5563; text-decoration: none; opacity: .75; }
.msg-baixar:hover { opacity: 1; text-decoration: underline; }
html[data-theme="dark"] .msg-baixar { color: #cbd5e1; }

/* composer multilinha: cresce com o texto, sem barra ate o limite */
.wa-composer { resize: none; overflow-y: auto; max-height: 140px; line-height: 1.35; }

/* ===== Conversa de GRUPO (30/07/2026) =====
   Antes o grupo era visualmente igual a uma conversa 1:1 e as mensagens nao
   diziam quem falou. Selo no cabecalho, icone na lista, autor colorido acima da
   bolha (como no WhatsApp) e painel de participantes. */
.wa-grupo-selo {
    font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
    background: #ede9fe; color: #6d28d9; border-radius: 999px; padding: 2px 8px;
    vertical-align: middle; white-space: nowrap;
}
.wa-ico-grupo { color: #7c3aed; font-size: 12px; }
.wa-grupo-membros {
    background: none; border: 0; padding: 0; color: var(--color-primary, #7c3aed);
    font-size: 12px; text-decoration: underline; cursor: pointer;
}
/* autor da mensagem dentro do grupo */
.msg-autor { font-size: 12px; font-weight: 700; margin-bottom: 2px; line-height: 1.2; }
.msg-autor.aut-lilas { color: #7c3aed; }
.msg-autor.aut-azul  { color: #2563eb; }
.msg-autor.aut-verde { color: #059669; }
.msg-autor.aut-ambar { color: #b45309; }
.msg-autor.aut-rosa  { color: #db2777; }
.msg-autor.aut-ciano { color: #0891b2; }
/* painel de participantes */
.wa-part-ov { display: flex; align-items: center; justify-content: center; }
.wa-part-box {
    background: #fff; border-radius: 14px; width: min(460px, 94vw); max-height: 80vh;
    display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.wa-part-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--color-border, #e5e7eb); }
.wa-part-head strong { flex: 1; font-size: 14px; }
.wa-part-body { overflow-y: auto; }
.wa-part-lista { list-style: none; margin: 0; padding: 6px 0; }
.wa-part-lista li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.wa-part-lista li + li { border-top: 1px solid #f1f5f9; }
html[data-theme="dark"] .wa-part-box { background: #161d2e; }
html[data-theme="dark"] .wa-part-lista li + li { border-top-color: #232d3d; }
html[data-theme="dark"] .wa-grupo-selo { background: #2b1f4a; color: #c4b5fd; }
