/* Tema escuro: ajustes finos sobre a folha gerada por modules/theme.js.
   Tudo aqui vale só com <html data-theme="dark">; o tema claro não muda. */
html[data-theme="dark"]{color-scheme:dark;background:#12161c}
:root[data-theme="dark"]{
 --bg:#12161c;--panel:#1b2028;--ink:#e4e8ee;--muted:#e4e8ee;--line:#2d3440;
 --brand-soft:color-mix(in srgb,var(--brand) 20%,var(--panel));
 --brand-border:color-mix(in srgb,var(--brand) 55%,var(--panel));
 --green:#4cc690;--red:#e0827d;--blue:#7fa4e6;
}
/* Conversas: mantém a identidade verde do WhatsApp, na versão escura dele. */
:root[data-theme="dark"] .inbox{
 --chat-surface-bg:#0b141a;--chat-message-incoming-bg:#202c33;--chat-message-outgoing-bg:#005c4b;
 --chat-message-shadow:0 1px .5px rgba(0,0,0,.4);--chat-message-text:#e9edef;--chat-message-meta:#a3b1ba;
 --chat-input-bg:#2a3942;--chat-system-event-bg:rgba(24,34,40,.94);
 --chat-list-selected:#2b2a22;--chat-list-divider:#262f36;
}
:root[data-theme="dark"] section[aria-labelledby="chat-queue-title"],
:root[data-theme="dark"] .followup-tracking{--chat-colhead-bg:#15302b;--chat-colhead-text:#bfe6dc}
:root[data-theme="dark"] .chat-workspace .chat-attach-button{background:#2a3942}
:root[data-theme="dark"] .chat-workspace .chat-workspace-header [data-action="chat-assume"]{background:#fff;border-color:#fff}
:root[data-theme="dark"] .chat-workspace .chat-workspace-header [data-action="chat-assume"]:hover{background:#d7efe9}
:root[data-theme="dark"] .chat-workspace .message.ai .message-author{color:#9cefdc}
:root[data-theme="dark"] .chat-workspace .message.ai small,:root[data-theme="dark"] .chat-workspace .message.human small,
:root[data-theme="dark"] .chat-workspace .message.ai .message-receiver,:root[data-theme="dark"] .chat-workspace .message.human .message-receiver,
:root[data-theme="dark"] .chat-workspace .message.human .message-author{color:#cfe3de}
/* O véu atrás dos modais precisa escurecer mais, porque a página já é escura. */
:root[data-theme="dark"] .overlay-backdrop{background:rgba(0,0,0,.58)}
/* Elementos cuja cor do texto vem do navegador (preto fixo), não do CSS do M1. */
:root[data-theme="dark"] mark{color:var(--ink)}
/* Controles nativos */
:root[data-theme="dark"] input,:root[data-theme="dark"] select,:root[data-theme="dark"] textarea{color:var(--ink)}
:root[data-theme="dark"] ::placeholder{color:#8a93a3}
/* Texto sobre o dourado da marca: escuro nos dois temas. */
:root[data-theme="dark"] .btn.primary,:root[data-theme="dark"] .btn.amber{color:#1d1708}
/* Avatares: a cor do usuário vem inline; no escuro o texto clareia e o fundo escurece. */
:root[data-theme="dark"] .avatar[style*="--avatar-color"]{color:color-mix(in srgb,var(--avatar-color) 45%,white)!important;background:color-mix(in srgb,var(--avatar-color) 32%,var(--panel))!important}
/* Botão de tema na barra superior */
.theme-toggle svg{width:18px;height:18px}
/* No celular a barra esconde os ícones; o de tema continua, ao lado das notificações. */
@media (max-width:520px){.top-actions > .theme-toggle{display:inline-flex;width:26px;margin-right:-4px}}

:root[data-theme="dark"] .pipeline-view {
  --funnel-canvas: #14171c;
  --funnel-column: #1b2027;
  --funnel-surface: #222832;
  --funnel-hover: #2b333e;
  --funnel-line: #39434f;
  --funnel-ink: #e8ecf1;
  --funnel-muted: #aab4c0;
  --funnel-gold: #c6a766;
  --funnel-warning: #f0a49d;
}
