/*
 * Flux Help Desk — tema visual (dez/2026).
 *
 * Carregado em todas as páginas internas, junto com includes/sidebar.php.
 * As páginas continuam a usar as classes do Tailwind; aqui elas ganham o
 * visual novo (fonte, cores, cartões, campos, tabelas). Os seletores
 * começam por "html body" para vencer o Tailwind CDN, que injeta o seu
 * CSS depois desta folha.
 */

:root {
    --flux-bg: #F4F6F9;
    --flux-surface: #FFFFFF;
    --flux-border: #E5E7EB;
    --flux-border-campo: #D9DEE5;
    --flux-texto: #111827;
    --flux-texto-2: #4B5563;
    --flux-texto-3: #6B7280;
    --flux-azul: #185FA5;
    --flux-azul-escuro: #0C447C;
    --flux-azul-claro: #E6F1FB;
    --flux-sidebar: 248px;
    --flux-surface-2: #F8FAFC;   /* cabeçalho de tabela, hover de linha */
    --flux-linha: #F1F3F5;       /* divisória entre linhas */
    --flux-trilho: #EEF2F7;      /* fundo de barras, hover do menu */
    --flux-segmento: #E9EDF2;    /* fundo dos botões de período/abas */
    --flux-texto-4: #9CA3AF;     /* datas, ids */
    --flux-ok-fundo: #F4FAEE;    /* linha marcada como lida */
    --flux-alerta: #A32D2D;
    --flux-sucesso: #3B6D11;
}

/* ---------- base ---------- */
html body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
    background: var(--flux-bg) !important;
    color: var(--flux-texto);
    -webkit-font-smoothing: antialiased;
}
html body.bg-gray-100, html body .bg-gray-100 { background-color: var(--flux-bg) !important; }
html body h1, html body h2, html body h3 { color: var(--flux-texto); letter-spacing: -0.01em; }
html body .text-gray-800, html body .text-gray-900 { color: var(--flux-texto) !important; }
html body .text-gray-600, html body .text-gray-700 { color: var(--flux-texto-2) !important; }
html body .text-gray-500 { color: var(--flux-texto-3) !important; }

/* Menu antigo de cada página: substituído pelo menu lateral. */
html body > nav.sticky.top-0 { display: none !important; }

/* ---------- layout com menu lateral ---------- */
@media (min-width: 1024px) {
    html body.flux-app { padding-left: var(--flux-sidebar) !important; }
}

/* ---------- cartões ---------- */
html body .bg-white.shadow,
html body .bg-white.shadow-md,
html body .bg-white.shadow-lg,
html body .bg-white.rounded-lg.shadow {
    box-shadow: none !important;
    border: 1px solid var(--flux-border);
    border-radius: 14px !important;
}
html body .hover\:shadow-xl:hover, html body .hover\:shadow-md:hover { box-shadow: 0 4px 14px rgba(17, 24, 39, .06) !important; }
html body .rounded-lg { border-radius: 10px; }
html body .shadow-xl, html body .shadow-2xl { box-shadow: 0 20px 50px rgba(17, 24, 39, .18) !important; }

/* ---------- cores principais ---------- */
html body .bg-blue-600, html body .bg-indigo-600 { background-color: var(--flux-azul) !important; }
html body .hover\:bg-blue-700:hover, html body .hover\:bg-indigo-700:hover, html body .bg-blue-700 { background-color: var(--flux-azul-escuro) !important; }
html body .text-blue-600, html body .text-indigo-600 { color: var(--flux-azul) !important; }
html body .hover\:text-blue-800:hover, html body .hover\:text-blue-600:hover { color: var(--flux-azul-escuro) !important; }
html body .border-blue-500, html body .border-blue-600, html body .border-indigo-500 { border-color: var(--flux-azul) !important; }
html body .bg-blue-100 { background-color: var(--flux-azul-claro) !important; }

/* ---------- botões ---------- */
html body button.bg-blue-600, html body a.bg-blue-600,
html body button.bg-indigo-600, html body a.bg-indigo-600,
html body button.bg-green-600, html body button.bg-red-600 {
    border-radius: 10px !important;
    font-weight: 600;
    transition: background-color .15s, transform .05s;
}
html body button:active { transform: translateY(1px); }

/* ---------- campos ---------- */
html body input[type="text"], html body input[type="email"], html body input[type="password"],
html body input[type="number"], html body input[type="date"], html body input[type="datetime-local"],
html body input[type="search"], html body input[type="tel"], html body input:not([type]),
html body select, html body textarea {
    border: 1px solid var(--flux-border-campo) !important;
    border-radius: 8px !important;
    background-color: var(--flux-surface);
    color: var(--flux-texto);
    font-family: inherit;
}
html body input[type="text"], html body input[type="email"], html body input[type="password"],
html body input[type="number"], html body input[type="date"], html body input[type="search"],
html body input[type="tel"], html body input:not([type]), html body select {
    min-height: 40px;
}
html body input:focus, html body select:focus, html body textarea:focus {
    outline: none !important;
    border-color: var(--flux-azul) !important;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .15) !important;
}
html body input[type="checkbox"] { accent-color: var(--flux-azul); }

/* ---------- tabelas ---------- */
html body table thead.bg-gray-50, html body table thead tr { background: var(--flux-surface-2) !important; }
html body table thead th {
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: .03em;
    color: var(--flux-texto-3) !important;
    text-transform: uppercase;
}
html body table tbody tr { transition: background-color .1s; }
html body .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--flux-linha) !important; }

/* ---------- abas (border-b-2) ---------- */
html body .border-b-2.border-blue-500, html body .border-b-2.border-indigo-500 { color: var(--flux-azul) !important; }

/* ---------- janelas (modais) ---------- */
html body .fixed.inset-0.bg-gray-900.bg-opacity-50,
html body .fixed.inset-0.bg-black.bg-opacity-50 { background-color: rgba(17, 24, 39, .45) !important; }

/* ---------- etiquetas de nível ---------- */
.flux-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.flux-pill.leve { background: #E6F1FB; color: #0C447C; }
.flux-pill.medio { background: #EAF3DE; color: #27500A; }
.flux-pill.alto { background: #FAEEDA; color: #633806; }
.flux-pill.critico { background: #FCEBEB; color: #791F1F; }
.flux-pill.cinza { background: #F1F3F5; color: #374151; }
.flux-pill.verde { background: #EAF3DE; color: #27500A; }
.flux-pill.amarelo { background: #FAEEDA; color: #633806; }

/* ---------- componentes novos (dashboard, métricas, filtros) ---------- */
.flux-card { background: var(--flux-surface); border: 1px solid var(--flux-border); border-radius: 14px; }
.flux-kpi { background: var(--flux-surface); border: 1px solid var(--flux-border); border-radius: 14px; padding: 16px; min-width: 0; }
.flux-kpi .kl { font-size: 12px; color: var(--flux-texto-3); }
.flux-kpi .kv { font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1.1; }
.flux-kpi .ks { font-size: 12px; color: var(--flux-texto-3); margin-top: 4px; }
.flux-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.flux-segmento { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--flux-segmento); border-radius: 10px; }
.flux-segmento button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--flux-texto-3); font-size: 13px; font-weight: 500; cursor: pointer; }
.flux-segmento button.ativo { background: var(--flux-surface); color: var(--flux-texto); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.flux-filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.flux-filtros label { display: block; font-size: 12px; font-weight: 500; color: var(--flux-texto-2); }
.flux-filtros label > input, .flux-filtros label > select { width: 100%; margin-top: 5px; padding: 0 10px; font-size: 14px; box-sizing: border-box; }
.flux-btn { height: 42px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--flux-azul); color: #FFFFFF; font-size: 14px; font-weight: 600; cursor: pointer; }
.flux-btn:hover { background: var(--flux-azul-escuro); }
.flux-btn2 { height: 40px; padding: 0 16px; border: 1px solid var(--flux-border-campo); border-radius: 10px; background: var(--flux-surface); color: var(--flux-texto-2); font-size: 14px; cursor: pointer; }
.flux-btn2:hover { background: var(--flux-surface-2); }

/* Linha de resumo compacta (acima das listas) */
.flux-resumo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 2px; font-size: 13px; color: var(--flux-texto-3); }
.flux-resumo:empty { display: none; }
.flux-resumo span { white-space: nowrap; }
.flux-resumo b { color: var(--flux-texto); font-weight: 600; }
.flux-resumo .r-alerta b { color: #A32D2D; }
.flux-resumo .r-ok b { color: #3B6D11; }

@media (max-width: 640px) {
    html body input, html body select, html body textarea { font-size: 16px !important; }
}


/* =====================================================================
 * TEMA ESCURO
 * Ativo com a classe "flux-escuro" no <html> (posta pelo grupos.js /
 * includes/sidebar.php conforme a escolha do usuário: claro, escuro ou
 * automático, que segue o sistema).
 * ===================================================================== */
html.flux-escuro {
    color-scheme: dark;
    --flux-bg: #0F1115;
    --flux-surface: #171A21;
    --flux-surface-2: #1D212A;
    --flux-border: #2A2F3A;
    --flux-border-campo: #363C48;
    --flux-linha: #22262F;
    --flux-trilho: #252A34;
    --flux-segmento: #22262F;
    --flux-texto: #E6E8EC;
    --flux-texto-2: #B8BEC9;
    --flux-texto-3: #8E96A3;
    --flux-texto-4: #6E7684;
    --flux-azul: #3D86D6;
    --flux-azul-escuro: #5A9BE0;
    --flux-azul-claro: #1A2B41;
    --flux-ok-fundo: #18241A;
    --flux-alerta: #F09595;
    --flux-sucesso: #9FCF6B;
}
html.flux-escuro body { background: var(--flux-bg) !important; color: var(--flux-texto); }

/* superfícies do Tailwind */
html.flux-escuro body .bg-white { background-color: var(--flux-surface) !important; }
html.flux-escuro body .bg-gray-50, html.flux-escuro body .hover\:bg-gray-50:hover { background-color: var(--flux-surface-2) !important; }
html.flux-escuro body .bg-gray-100, html.flux-escuro body .hover\:bg-gray-100:hover { background-color: var(--flux-trilho) !important; }
html.flux-escuro body .bg-gray-200, html.flux-escuro body .hover\:bg-gray-200:hover { background-color: #2A2F3A !important; }
html.flux-escuro body .bg-gray-300 { background-color: #343A46 !important; }
html.flux-escuro body .text-gray-400, html.flux-escuro body .text-gray-300 { color: var(--flux-texto-4) !important; }
html.flux-escuro body .text-black { color: var(--flux-texto) !important; }
html.flux-escuro body .border, html.flux-escuro body .border-gray-100, html.flux-escuro body .border-gray-200,
html.flux-escuro body .border-gray-300, html.flux-escuro body .border-t, html.flux-escuro body .border-b { border-color: var(--flux-border) !important; }
html.flux-escuro body .divide-y > :not([hidden]) ~ :not([hidden]) { border-color: var(--flux-linha) !important; }
html.flux-escuro body .shadow-xl, html.flux-escuro body .shadow-2xl { box-shadow: 0 20px 50px rgba(0, 0, 0, .55) !important; }
html.flux-escuro body .bg-blue-600, html.flux-escuro body .bg-indigo-600 { background-color: #2B6CB0 !important; }
html.flux-escuro body .hover\:bg-blue-700:hover, html.flux-escuro body .bg-blue-700 { background-color: #3D86D6 !important; }

/* faixas coloridas (linhas por nível, avisos) e etiquetas */
html.flux-escuro body .bg-blue-50 { background-color: rgba(55, 138, 221, .10) !important; }
html.flux-escuro body .bg-green-50 { background-color: rgba(99, 153, 34, .12) !important; }
html.flux-escuro body .bg-yellow-50 { background-color: rgba(239, 159, 39, .12) !important; }
html.flux-escuro body .bg-red-50 { background-color: rgba(226, 75, 74, .12) !important; }
html.flux-escuro body .hover\:bg-blue-100:hover, html.flux-escuro body .bg-blue-100 { background-color: rgba(55, 138, 221, .20) !important; }
html.flux-escuro body .hover\:bg-green-100:hover, html.flux-escuro body .bg-green-100 { background-color: rgba(99, 153, 34, .22) !important; }
html.flux-escuro body .hover\:bg-yellow-100:hover, html.flux-escuro body .bg-yellow-100 { background-color: rgba(239, 159, 39, .22) !important; }
html.flux-escuro body .hover\:bg-red-100:hover, html.flux-escuro body .bg-red-100 { background-color: rgba(226, 75, 74, .22) !important; }
html.flux-escuro body .text-blue-800, html.flux-escuro body .text-blue-900, html.flux-escuro body .text-blue-700 { color: #8DBDF0 !important; }
html.flux-escuro body .text-green-800, html.flux-escuro body .text-green-900, html.flux-escuro body .text-green-700, html.flux-escuro body .text-green-600 { color: #9FCF6B !important; }
html.flux-escuro body .text-yellow-800, html.flux-escuro body .text-yellow-700, html.flux-escuro body .text-yellow-600,
html.flux-escuro body .text-amber-800, html.flux-escuro body .text-amber-700 { color: #F2C06E !important; }
html.flux-escuro body .text-red-800, html.flux-escuro body .text-red-900, html.flux-escuro body .text-red-700,
html.flux-escuro body .text-red-600, html.flux-escuro body .text-red-500 { color: #F09595 !important; }
html.flux-escuro body .text-purple-800 { color: #B9B3F2 !important; }
html.flux-escuro body .border-yellow-300, html.flux-escuro body .border-yellow-400 { border-color: rgba(239, 159, 39, .45) !important; }
html.flux-escuro body .border-red-400, html.flux-escuro body .border-red-100 { border-color: rgba(226, 75, 74, .45) !important; }
html.flux-escuro body .border-green-400 { border-color: rgba(99, 153, 34, .5) !important; }

/* campos */
html.flux-escuro body input, html.flux-escuro body select, html.flux-escuro body textarea { background-color: var(--flux-surface-2) !important; color: var(--flux-texto) !important; }
html.flux-escuro body input::placeholder, html.flux-escuro body textarea::placeholder { color: var(--flux-texto-4); }
html.flux-escuro body option, html.flux-escuro body optgroup { background-color: var(--flux-surface); color: var(--flux-texto); }

/* etiquetas próprias do Flux */
html.flux-escuro .flux-pill.leve { background: rgba(55, 138, 221, .20); color: #8DBDF0; }
html.flux-escuro .flux-pill.medio, html.flux-escuro .flux-pill.verde { background: rgba(99, 153, 34, .22); color: #9FCF6B; }
html.flux-escuro .flux-pill.alto, html.flux-escuro .flux-pill.amarelo { background: rgba(239, 159, 39, .22); color: #F2C06E; }
html.flux-escuro .flux-pill.critico { background: rgba(226, 75, 74, .22); color: #F09595; }
html.flux-escuro .flux-pill.cinza { background: var(--flux-trilho); color: var(--flux-texto-2); }
html.flux-escuro .flux-resumo .r-alerta b { color: #F09595; }
html.flux-escuro .flux-resumo .r-ok b { color: #9FCF6B; }

/* imagens de logo claras sobre fundo escuro continuam legíveis */
html.flux-escuro img[src*="flux-logo.svg"] { filter: brightness(1.15); }

/* seletor de tema (menu lateral) */
.flux-tema { display: flex; gap: 4px; padding: 4px; margin: 10px 4px 0; background: var(--flux-segmento); border-radius: 10px; }
.flux-tema button { flex: 1; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--flux-texto-3); font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-family: inherit; }
.flux-tema button.ativo { background: var(--flux-surface); color: var(--flux-texto); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }


/* ---------- telas de entrada (login, cadastro, senha) ---------- */
html body.bg-gradient-to-br { background: linear-gradient(135deg, #2F80D1 0%, #185FA5 55%, #0C447C 100%) !important; }
html.flux-escuro body.bg-gradient-to-br { background: radial-gradient(circle at 20% 10%, #1A2B41 0%, #0F1115 60%) !important; }
html body.bg-gradient-to-br > .bg-white { border-radius: 18px !important; }
html.flux-escuro body.bg-gradient-to-br > .bg-white { border: 1px solid var(--flux-border); }
.flux-tema-flutuante { position: fixed; top: 14px; right: 14px; width: 230px; margin: 0; z-index: 60; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); }
html body.bg-gradient-to-br .flux-tema-flutuante { background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); }
html body.bg-gradient-to-br .flux-tema-flutuante button { color: rgba(255, 255, 255, .85); }
html body.bg-gradient-to-br .flux-tema-flutuante button.ativo { background: #FFFFFF; color: #111827; }
html.flux-escuro body.bg-gradient-to-br .flux-tema-flutuante { background: var(--flux-segmento); }
html.flux-escuro body.bg-gradient-to-br .flux-tema-flutuante button { color: var(--flux-texto-3); }
html.flux-escuro body.bg-gradient-to-br .flux-tema-flutuante button.ativo { background: var(--flux-surface); color: var(--flux-texto); }
@media (max-width: 480px) { .flux-tema-flutuante { top: auto; right: auto; bottom: 12px; left: 50%; transform: translateX(-50%); } }


/* ---------- páginas de suporte e informações ---------- */
body:not(.bg-gradient-to-br) .flux-tema-flutuante { top: auto; bottom: 14px; }
.flux-info-topo { position: sticky; top: 0; z-index: 30; background: var(--flux-surface); border-bottom: 1px solid var(--flux-border); }
.flux-info-barra { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.flux-info-marca { display: inline-flex; align-items: center; gap: 10px; color: var(--flux-texto); text-decoration: none; }
.flux-info-marca img { border-radius: 8px; }
.flux-info-links { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.flux-info-links a { padding: 7px 12px; border-radius: 8px; color: var(--flux-texto-2); font-size: 14px; text-decoration: none; }
.flux-info-links a:hover { background: var(--flux-trilho); color: var(--flux-texto); }
.flux-info-links a.ativo { background: var(--flux-azul-claro); color: var(--flux-azul-escuro); font-weight: 600; }
.flux-info-conteudo { max-width: 1100px; margin: 0 auto; padding: 32px 16px 56px; box-sizing: border-box; width: 100%; }
.flux-info-sub { margin: 6px 0 28px; color: var(--flux-texto-3); font-size: 15px; max-width: 760px; }
.flux-doc { color: var(--flux-texto-2); font-size: 15px; line-height: 1.7; }
.flux-doc h2 { font-size: 21px; font-weight: 700; color: var(--flux-texto); margin: 34px 0 10px; scroll-margin-top: 80px; }
.flux-doc h3 { font-size: 16px; font-weight: 600; color: var(--flux-texto); margin: 20px 0 6px; }
.flux-doc p { margin: 0 0 12px; }
.flux-doc ul, .flux-doc ol { margin: 0 0 14px 22px; }
.flux-doc ul { list-style: disc; } .flux-doc ol { list-style: decimal; }
.flux-doc li { margin: 4px 0; }
.flux-doc b, .flux-doc strong { color: var(--flux-texto); }
.flux-doc a { color: var(--flux-azul-escuro); }
.flux-doc .nota { padding: 12px 16px; border-radius: 12px; background: var(--flux-azul-claro); color: var(--flux-texto); margin: 14px 0; }
.flux-indice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.flux-indice a { display: block; padding: 12px 14px; border: 1px solid var(--flux-border); border-radius: 12px; background: var(--flux-surface); color: var(--flux-texto); text-decoration: none; font-weight: 500; font-size: 14px; }
.flux-indice a:hover { border-color: var(--flux-azul); }
.flux-indice a small { display: block; color: var(--flux-texto-3); font-weight: 400; margin-top: 2px; }
.flux-faq details { border: 1px solid var(--flux-border); border-radius: 12px; background: var(--flux-surface); margin-bottom: 10px; }
.flux-faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--flux-texto); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.flux-faq summary::-webkit-details-marker { display: none; }
.flux-faq summary::after { content: '+'; color: var(--flux-texto-3); font-size: 20px; line-height: 1; }
.flux-faq details[open] summary::after { content: '−'; }
.flux-faq details > div { padding: 0 18px 16px; color: var(--flux-texto-2); line-height: 1.7; font-size: 15px; }
.flux-faq h2 { font-size: 18px; font-weight: 700; color: var(--flux-texto); margin: 28px 0 12px; }

/* ---------- rodapé ---------- */
.flux-rodape { margin-top: 40px; background: var(--flux-surface); border-top: 1px solid var(--flux-border); color: var(--flux-texto-3); font-size: 14px; }
.flux-rodape-grade { max-width: 1100px; margin: 0 auto; padding: 32px 16px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 26px; }
.flux-rodape h3, .flux-rodape h4 { color: var(--flux-texto); font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.flux-rodape ul { list-style: none; margin: 0; padding: 0; }
.flux-rodape li { margin: 6px 0; }
.flux-rodape a { color: var(--flux-texto-3); text-decoration: none; }
.flux-rodape a:hover { color: var(--flux-azul-escuro); }
.flux-rodape-base { max-width: 1100px; margin: 0 auto; padding: 14px 16px 22px; border-top: 1px solid var(--flux-border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; }
