/* ==========================================================
   VISUAL.CSS: fonte padrão (Inter) + tema claro no estilo ManyChat
   Carregar DEPOIS do style.css:
   <link rel="stylesheet" href="visual.css?v=1">
   Para desfazer tudo: tirar essa linha do index.html.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* ---------- 1. FONTE: tudo em Inter, menos os ícones ---------- */
body,
body *:not([class*="fa-"]):not(.fab):not(.fas):not(.far):not(.fa) {
    font-family: var(--font-ui) !important;
}

/* números alinhados nas colunas dos painéis */
.kpi-value, .ig-mini b, .ig-chip b, td, th {
    font-variant-numeric: tabular-nums;
}

/* ---------- 2. TEMA CLARO (body.theme-light) ---------- */
body.theme-light {
    --bg-dark: #e6eaf0;
    --bg-card: #ffffff;
    --primary: #006be3;
    --primary-glow: rgba(0, 107, 227, 0);
    --primary-dim: rgba(0, 107, 227, 0.08);
    --text-main: #1f1f1f;
    --text-dim: #6b6f76;
    --success: #0f8a5f;
    --danger: #d92d20;
    --warn: #b54708;
    --inset: #eef1f5;
    --surface: #f3f5f8;
    --line: #d3d9e2;
    --border: 1px solid #d3d9e2;
    -webkit-font-smoothing: antialiased;
}

body.theme-light .main-panel {
    background: #e6eaf0 !important;
}

/* Barra lateral */
body.theme-light .sidebar,
body.theme-light .chat-sidebar {
    background: #ffffff !important;
    border-color: #d3d9e2 !important;
    box-shadow: 1px 0 3px rgba(16, 24, 40, 0.05);
}

body.theme-light .logo-icon {
    filter: none;
}

body.theme-light .nav-btn {
    color: #5f6368;
    border-radius: 10px;
}

body.theme-light .nav-btn:hover {
    color: #1f1f1f;
    background: #f0f0f0;
    box-shadow: none;
}

body.theme-light .nav-btn.active {
    color: var(--primary);
    background: #e3edfb;
    box-shadow: none;
}

body.theme-light .nav-btn.active::after {
    display: none;
}

/* Cabeçalho da página */
body.theme-light .top-bar {
    border-bottom: 1px solid #cfd6df;
}

body.theme-light .page-title h1 {
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: -0.01em;
    color: #1f1f1f;
}

body.theme-light .page-title span {
    color: inherit;
    font-weight: 700;
}

body.theme-light .live-badge {
    color: #0f8a5f;
    background: #e8f6ef;
    border: 1px solid #cdeadb;
    border-radius: 999px;
    padding: 3px 10px;
    font-weight: 600;
}

body.theme-light .date-display {
    color: #6b6f76;
}

/* Cartões */
body.theme-light .kpi-card,
body.theme-light .tool-card,
body.theme-light .chart-container,
body.theme-light .stat-card,
body.theme-light .kanban-col,
body.theme-light .ad-card,
body.theme-light .config-grid > div,
body.theme-light #ig-profile-widget,
body.theme-light .lead-edit-card,
body.theme-light .ig-panel {
    background: #ffffff !important;
    border: 1px solid #d3d9e2 !important;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.06) !important;
}

/* Raio-X: caixas dentro do cartão branco ganham fundo cinza para aparecer */
body.theme-light #ig-profile-widget .stat-card,
body.theme-light #ig-profile-widget .ig-mini,
body.theme-light #ig-profile-widget .ig-panel,
body.theme-light #ig-profile-widget .chart-container {
    background: #eef1f6 !important;
    border: 1px solid #cbd3de !important;
    box-shadow: none !important;
}

body.theme-light #ig-profile-widget .ig-chip,
body.theme-light #ig-profile-widget .ig-tag {
    background: #ffffff;
    border: 1px solid #cbd3de;
}

body.theme-light #ig-profile-widget .ig-bar-track {
    background: #d3d9e2;
}

/* Dias da agenda: ficam direto sobre o fundo, então viram cartões brancos */
body.theme-light .cal-day-interactive {
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

body.theme-light .cal-day-interactive:hover {
    background: #f3f7fd !important;
}

body.theme-light .kpi-card::before {
    display: none;
}

body.theme-light .kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #6b6f76;
}

body.theme-light .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f1f1f;
}

body.theme-light .tool-header {
    color: #1f1f1f;
    font-weight: 600;
    border-bottom: 1px solid #ececec;
}

/* Botões: azul sólido, texto branco */
body.theme-light .action-btn,
body.theme-light .stark-btn,
body.theme-light .btn-salvar-lead {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #ffffff;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0;
    box-shadow: none;
}

body.theme-light .action-btn:hover,
body.theme-light .stark-btn:hover,
body.theme-light .btn-salvar-lead:hover {
    background: #005bc2;
    border-color: #005bc2;
    color: #ffffff;
    box-shadow: none;
}

/* Campos */
body.theme-light .stark-input,
body.theme-light select,
body.theme-light input[type="text"],
body.theme-light input[type="search"],
body.theme-light textarea {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    color: #1f1f1f;
}

body.theme-light .stark-input:focus,
body.theme-light select:focus,
body.theme-light textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 107, 227, 0.15);
}

body.theme-light .stark-input::placeholder {
    color: #8a8d93;
}

/* Triagem (kanban) */
body.theme-light .kanban-header {
    color: #1f1f1f;
    font-weight: 600;
}

body.theme-light .kanban-card {
    background: #ffffff;
    border: 1px solid #d3d9e2;
    border-radius: 8px;
    box-shadow: none;
}

body.theme-light .kanban-card:hover {
    border-color: #b9c7da;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Tabelas */
body.theme-light table th {
    color: #6b6f76;
    font-weight: 600;
    border-bottom: 1px solid #e3e3e3;
}

body.theme-light table td {
    border-bottom: 1px solid #f0f0f0;
}

/* Janelas (modais) */
body.theme-light .modal-content {
    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Chat flutuante */
body.theme-light .fab-chat {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 107, 227, 0.35);
}

body.theme-light .msg-ai {
    background: #f0f2f5;
    border: none;
    color: #1f1f1f;
    border-radius: 12px;
}

body.theme-light .msg-user {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
}

/* Barras de rolagem discretas */
body.theme-light ::-webkit-scrollbar { width: 8px; height: 8px; }
body.theme-light ::-webkit-scrollbar-thumb { background: #cfcfcf; border-radius: 4px; }
body.theme-light ::-webkit-scrollbar-track { background: transparent; }

/* Números e textos que o código escreve em branco (feitos para o fundo escuro):
   no tema claro viram o texto principal. Não mexe em nada que tenha fundo
   colorido (botões, selos), nos ícones nem na tela de login. */
body.theme-light [style*="color:white"]:not([style*="background"]):not(i):not([class*="fa-"]):not(#login-overlay *):not(.action-btn *):not(.stark-btn *),
body.theme-light [style*="color: white"]:not([style*="background"]):not(i):not([class*="fa-"]):not(#login-overlay *):not(.action-btn *):not(.stark-btn *),
body.theme-light [style*="color:#fff"]:not([style*="background"]):not(i):not([class*="fa-"]):not(#login-overlay *):not(.action-btn *):not(.stark-btn *),
body.theme-light [style*="color: #fff"]:not([style*="background"]):not(i):not([class*="fa-"]):not(#login-overlay *):not(.action-btn *):not(.stark-btn *) {
    color: var(--text-main) !important;
}

/* Texto dos botões branco, só nos que usam o azul padrão.
   Botões que já definem a própria cor no HTML (ex.: "CONFIGURAR GATILHO",
   "GATILHO ATIVO") mantêm o que foi definido lá. */
body.theme-light .action-btn:not([style*="color"]),
body.theme-light .action-btn:not([style*="color"]) *,
body.theme-light .stark-btn:not([style*="color"]),
body.theme-light .stark-btn:not([style*="color"]) * {
    color: #ffffff !important;
}

/* Borda dos posts sem automação (estava em cinza escuro) */
body.theme-light #grid-vitrine-ig > div[style*="#333"] {
    border-color: #e3e3e3 !important;
}

/* Cartões da tela de configurações sem espaçamento próprio */
body.theme-light #view-config .config-grid > div:not([style*="padding"]) {
    padding: 24px;
}