:root {
    /* Paleta base (Dark Mode) */
    --bg-fundo: #0f172a;
    --cor-texto: #e2e8f0;
    --cor-primaria: #38bdf8;
    --cor-primaria-hover: #0ea5e9;
    --bg-escuro: #090d16;
    --bg-sidebar: #1e293b;
    --branco: #ffffff;

    /* Variáveis semânticas (superfícies, bordas, textos) */
    --superficie: #1e293b;          /* cards, modais, painéis */
    --superficie-2: #0f172a;        /* inputs, fundos internos */
    --superficie-3: #334155;        /* hover, elementos elevados */
    --borda: #334155;               /* bordas padrão */
    --borda-suave: rgba(51, 65, 85, 0.5);
    --texto-secundario: #94a3b8;    /* textos de apoio */
    --texto-terciario: #64748b;     /* textos discretos */
    --texto-suave: #cbd5e1;         /* textos médios */
    --sombra-card: 0 20px 50px rgba(0, 0, 0, 0.45);
    --sombra-suave: 0 8px 20px rgba(0, 0, 0, 0.25);
    --sombra-hover: 0 16px 40px rgba(0, 0, 0, 0.35);
    --overlay: rgba(9, 13, 22, 0.8);
    --glass: rgba(30, 41, 59, 0.7);
    --glass-borda: rgba(51, 65, 85, 0.7);
    --hover-fundo: rgba(255, 255, 255, 0.05);
    --perigo: #ef4444;
    --perigo-suave: rgba(239, 68, 68, 0.12);
    --sucesso: #10b981;
    --aviso: #f59e0b;
}

body.light-mode {
    /* Paleta base (Light Mode) */
    --bg-fundo: #eef2f7;
    --cor-texto: #1e293b;
    --cor-primaria: #0284c7;
    --cor-primaria-hover: #0369a1;
    --bg-escuro: #dbe3ee;
    --bg-sidebar: #ffffff;
    --branco: #0f172a;

    /* Variáveis semânticas (Light Mode) */
    --superficie: #ffffff;
    --superficie-2: #f8fafc;
    --superficie-3: #e2e8f0;
    --borda: #cbd5e1;
    --borda-suave: rgba(203, 213, 225, 0.7);
    --texto-secundario: #475569;
    --texto-terciario: #64748b;
    --texto-suave: #334155;
    --sombra-card: 0 20px 50px rgba(15, 23, 42, 0.12);
    --sombra-suave: 0 8px 20px rgba(15, 23, 42, 0.08);
    --sombra-hover: 0 16px 40px rgba(15, 23, 42, 0.14);
    --overlay: rgba(15, 23, 42, 0.45);
    --glass: rgba(255, 255, 255, 0.75);
    --glass-borda: rgba(203, 213, 225, 0.8);
    --hover-fundo: rgba(15, 23, 42, 0.05);
    --perigo: #dc2626;
    --perigo-suave: rgba(220, 38, 38, 0.08);
    --sucesso: #059669;
    --aviso: #d97706;
}

body.light-mode .btn-primario { color: #ffffff !important; }
body.light-mode .btn-secundario:hover { color: #ffffff !important; }
body.light-mode .nav-btn.ativo { color: #ffffff !important; }
body.light-mode .fab-suporte { color: #ffffff !important; }
body.light-mode .chat-suporte-input button { color: #ffffff !important; }
body.light-mode .modal-box,
body.light-mode .manager-painel,
body.light-mode .tabela-container { background-color: var(--superficie); border-color: var(--borda); }
body.light-mode .tabela-produtos th { background-color: var(--superficie-2); border-bottom-color: var(--borda); color: var(--texto-secundario); }
body.light-mode .tabela-produtos td { border-bottom-color: var(--borda); }
body.light-mode input,
body.light-mode select { background-color: var(--superficie-2); color: var(--cor-texto); border-color: var(--borda); }
body.light-mode select,
body.light-mode input[type="text"],
body.light-mode input[type="number"],
body.light-mode input[type="email"],
body.light-mode input[type="password"] {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: var(--borda) !important;
}
body.light-mode .tabela-produtos tr:hover td { background-color: var(--hover-fundo); }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body { background-color: var(--bg-fundo); color: var(--cor-texto); min-height: 100vh; display: flex; flex-direction: column; }

.hidden { display: none !important; }

body, .sidebar, .top-bar, .manager-painel, .tabela-container, .modal-box,
.tabela-produtos th, .tabela-produtos td, button, input, select, .theme-switch,
.switch-handle {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, width 0.3s ease, padding 0.3s ease, flex-basis 0.3s ease !important;
}

button { border: none; cursor: pointer; border-radius: 8px; font-weight: 600; }
.btn-primario { background-color: var(--cor-primaria); color: var(--bg-escuro); padding: 12px 20px; width: 100%; font-size: 1rem; box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2); }
.btn-primario:hover { background-color: var(--cor-primaria-hover); }
.btn-primario.esta-carregando { opacity: 0.8; cursor: wait; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.spinner-loading { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar-spinner 0.7s linear infinite; }
@keyframes girar-spinner { to { transform: rotate(360deg); } }
.btn-secundario { background-color: transparent; border: 2px solid var(--cor-primaria); color: var(--cor-primaria); padding: 10px 20px; font-size: 1rem; }
.btn-secundario:hover { background-color: var(--cor-primaria); color: var(--bg-escuro); }
.btn-novo { width: auto; padding: 10px 20px; font-size: 0.95rem; }

/* ============ UTILITÁRIOS SEMÂNTICOS (Design System interno) ============ */
/* Cores de texto que respondem ao tema claro/escuro */
.texto-secundario { color: var(--texto-secundario); }
.texto-terciario { color: var(--texto-terciario); }
.texto-suave { color: var(--texto-suave); }
.texto-perigo { color: var(--perigo); }
.texto-sucesso { color: var(--sucesso); }
.texto-aviso { color: var(--aviso); }
.texto-primaria { color: var(--cor-primaria); }
.texto-branco { color: var(--branco); }

/* Badges de status (pill) */
.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.badge-perigo { color: var(--perigo); background: var(--perigo-suave); }
.badge-sucesso { color: var(--sucesso); background: rgba(16, 185, 129, 0.12); }
.badge-aviso { color: var(--aviso); background: rgba(245, 158, 11, 0.12); }
.badge-primaria { color: var(--cor-primaria); background: rgba(56, 189, 248, 0.12); }
.badge-neutro { color: var(--texto-secundario); background: var(--hover-fundo); }
body.light-mode .badge-sucesso { background: rgba(5, 150, 105, 0.1); }
body.light-mode .badge-aviso { background: rgba(217, 119, 6, 0.1); }
body.light-mode .badge-primaria { background: rgba(2, 132, 199, 0.1); }

/* Botões de ação compactos (tabelas e listas) */
.btn-acao { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: none; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: filter 0.2s ease, transform 0.15s ease, background-color 0.2s ease; }
.btn-acao:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-acao-sucesso { background: var(--sucesso); color: #ffffff; }
.btn-acao-perigo { background: var(--perigo); color: #ffffff; }
.btn-acao-neutro { background: var(--superficie-3); color: var(--cor-texto); }
.btn-acao-primaria { background: var(--cor-primaria); color: #ffffff; }

/* Inputs e selects padronizados (substituem estilos inline) */
.input-padrao { padding: 14px; border: 1px solid var(--borda); border-radius: 8px; outline: none; font-size: 1rem; width: 100%; background: var(--superficie-2); color: var(--cor-texto); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input-padrao:focus { border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }

/* Links de ação em tabelas */
.btn-editar, .link-editar, .link-excluir { display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; min-height: 32px; border-radius: 6px; font-size: 13px; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn-editar, .link-editar { border: 1px solid rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.14); color: var(--cor-primaria); transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease; }
.btn-editar:hover, .link-editar:hover { background: rgba(56, 189, 248, 0.28); border-color: var(--cor-primaria); transform: translateY(-1px); }
.link-excluir { border: 1px solid rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.14); color: var(--perigo); }
.link-excluir:hover { background: rgba(248, 113, 113, 0.25); border-color: var(--perigo); }

/* Linhas clicáveis de tabela */
.linha-clicavel { cursor: pointer; transition: background-color 0.2s ease; }
.linha-clicavel:hover td { background-color: var(--hover-fundo); }

/* Divisores e bordas suaves */
.borda-suave { border-color: var(--borda); }
.divisor-suave { border-top: 1px solid var(--borda); }

/* ============ SUPER LANDING PAGE ============ */
.landing-page { min-height: 100vh; background: linear-gradient(160deg, var(--bg-escuro) 0%, var(--bg-fundo) 45%, var(--bg-sidebar) 100%); color: var(--branco); overflow-x: hidden; }

.landing-nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 18px 40px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--borda-suave); }
.landing-logo, .landing-footer-logo { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.landing-logo i, .landing-footer-logo i { color: var(--cor-primaria); font-size: 1.6rem; }
.landing-logo span, .landing-footer-logo span { color: var(--cor-primaria); }
.landing-theme-toggle { display: flex; align-items: center; gap: 12px; color: var(--branco); cursor: pointer; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.landing-theme-toggle:hover { background-color: var(--hover-fundo); }
.landing-theme-toggle > span { display: flex; align-items: center; gap: 8px; }

/* HERO */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 80px 40px; }
.hero-texto { animation: fadeInUp 0.7s ease-out both; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: rgba(56, 189, 248, 0.12); color: var(--cor-primaria); font-size: 0.85rem; font-weight: 600; margin-bottom: 24px; border: 1px solid rgba(56, 189, 248, 0.25); }
.hero-texto h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 20px; }
.hero-texto h1 span { color: var(--cor-primaria); }
.hero-subtitulo { font-size: 1.15rem; line-height: 1.7; color: var(--texto-secundario); max-width: 560px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.btn-cta { width: auto; padding: 15px 28px; font-size: 1rem; display: inline-flex; align-items: center; gap: 10px; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; gap: 4px; }
.hero-stat strong { font-size: 1.6rem; color: var(--branco); font-weight: 800; }
.hero-stat span { font-size: 0.85rem; color: var(--texto-secundario); }

/* CARD DE LOGIN (GLASSMORPHISM) */
.hero-card { position: relative; animation: fadeInUp 0.7s ease-out 0.15s both; }
.hero-card-glow { position: absolute; inset: -2px; border-radius: 20px; background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(245, 158, 11, 0.2)); filter: blur(24px); opacity: 0.5; z-index: 0; }
.hero-card-conteudo { position: relative; z-index: 1; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-borda); border-radius: 20px; padding: 40px 36px; box-shadow: var(--sombra-card); }
.hero-card-topo { display: flex; align-items: center; gap: 10px; color: var(--cor-primaria); font-weight: 700; font-size: 0.9rem; margin-bottom: 20px; }
.hero-card-topo i { font-size: 1.5rem; }
.hero-card-conteudo h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.hero-card-conteudo > p { color: var(--texto-secundario); font-size: 0.95rem; margin-bottom: 24px; }
.hero-card-conteudo form { display: flex; flex-direction: column; gap: 8px; }
.campo-label { font-size: 0.8rem; font-weight: 600; color: var(--texto-secundario); margin-top: 8px; }
.hero-card-conteudo input { padding: 14px; border: 1px solid var(--borda); border-radius: 10px; outline: none; font-size: 1rem; width: 100%; background: var(--superficie-2); color: var(--cor-texto); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.hero-card-conteudo input:focus { border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
.hero-card-conteudo .btn-primario { margin-top: 16px; }
.hero-card-conteudo .link-texto { text-align: center; margin-top: 16px; }

/* SEÇÕES */
.landing-secao { max-width: 1200px; margin: 0 auto; padding: 80px 40px; }
.secao-titulo { text-align: center; margin-bottom: 50px; }
.secao-kicker { display: inline-block; color: var(--cor-primaria); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.secao-titulo h2 { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; }

.sobre-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sobre-card, .stack-card, .feature-card { background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px; padding: 30px; box-shadow: var(--sombra-suave); transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.sobre-card i, .stack-card i, .feature-card i { font-size: 2rem; color: var(--cor-primaria); margin-bottom: 16px; display: block; }
.sobre-card h3, .stack-card h3, .feature-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.sobre-card p, .stack-card p, .feature-card p { color: var(--texto-secundario); line-height: 1.6; font-size: 0.95rem; }
.sobre-card strong, .stack-card strong { color: var(--branco); }

.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.sobre-card:hover, .stack-card:hover, .feature-card:hover { transform: translateY(-6px); border-color: var(--cor-primaria); box-shadow: var(--sombra-hover); }

/* FOOTER ACADÊMICO */
.landing-footer { border-top: 1px solid var(--borda); background: var(--glass); padding: 50px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.landing-footer-logo { margin-bottom: 8px; }
.landing-footer-creditos, .landing-footer-orientador { color: var(--texto-suave); font-size: 0.95rem; }
.landing-footer-creditos strong, .landing-footer-orientador strong { color: var(--branco); }
.landing-footer-instituicao { color: var(--texto-terciario); font-size: 0.85rem; }

/* ANIMAÇÕES DE ENTRADA */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.landing-secao { animation: fadeInUp 0.7s ease-out both; }
.landing-footer { animation: fadeIn 0.7s ease-out both; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: center; z-index: 999; }
.modal-box { background: var(--superficie); color: var(--cor-texto); padding: 35px; border-radius: 16px; width: 400px; display: flex; flex-direction: column; gap: 18px; text-align: center; box-shadow: var(--sombra-card); border: 1px solid var(--borda); }
.modal-box h2 { color: var(--branco); font-size: 1.5rem; }
.modal-box input { padding: 14px; border: 1px solid var(--borda); border-radius: 8px; outline: none; font-size: 1rem; width: 100%; background: var(--superficie-2); color: var(--cor-texto); }
.modal-box input:focus { border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
.form-produto { display: flex; flex-direction: column; gap: 15px; }
.select-com-seta { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 42px !important; cursor: pointer; transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, transform 0.15s ease; }
.select-com-seta:hover { border-color: #38bdf8; }
.select-com-seta:focus { border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18); }
.select-com-seta option { background-color: var(--superficie-2); color: var(--cor-texto); padding: 10px; }
body.light-mode .select-com-seta option { background-color: #ffffff; color: #1e293b; }
.link-texto { color: var(--cor-primaria); cursor: pointer; font-size: 0.95rem; font-weight: 500; margin-top: 5px; }
.link-texto:hover { text-decoration: underline; }
.btn-fechar-modal { background: none; color: #f87171; font-size: 0.9rem; margin-top: 5px; font-weight: 600; }

/* ÁREA DO SISTEMA */
#app-area { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.top-bar { background-color: var(--bg-sidebar); height: 75px; display: flex; justify-content: space-between; align-items: center; padding: 0 30px; border-bottom: 1px solid var(--borda); }
.menu-esquerdo { display: flex; align-items: center; gap: 18px; }
.menu-esquerdo h2 { color: var(--branco); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.5px; }
#btn-menu { background: none; font-size: 1.6rem; color: var(--branco); cursor: pointer; padding: 6px; border-radius: 6px; }
#btn-menu:hover { background: var(--hover-fundo); }

.perfil-usuario { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--branco); }
.foto-perfil { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--cor-primaria); object-fit: cover; }
.foto-perfil.foto-perfil-admin { border: 2px solid #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }
.btn-config-perfil { background: transparent; color: var(--texto-secundario); padding: 6px; font-size: 1.2rem; }
.btn-config-perfil:hover { color: var(--cor-primaria); background: var(--hover-fundo); }

.main-container { display: flex; flex: 1; overflow: hidden; }

/* SIDEBAR */
.sidebar { background-color: var(--bg-sidebar); width: 250px; flex: 0 0 250px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 25px 15px; border-right: 1px solid var(--borda); overflow: hidden; white-space: nowrap; }
.sidebar.fechada { width: 0; flex-basis: 0; padding: 0; overflow: hidden; white-space: nowrap; }
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }

.theme-switch { width: 48px; height: 24px; background-color: #334155; border-radius: 12px; position: relative; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.switch-handle { width: 18px; height: 18px; background-color: #ffffff; border-radius: 50%; position: absolute; top: 3px; left: 3px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
body.light-mode .switch-handle { transform: translateX(24px); }
body.light-mode .theme-switch { background-color: #cbd5e1; }
#btn-tema { flex-shrink: 0; min-width: 220px; }
#btn-tema > span, #theme-switch { flex-shrink: 0; }

.nav-btn, .btn-deslogar { background: transparent; color: var(--texto-secundario); padding: 12px 15px; text-align: left; font-size: 0.95rem; border-radius: 8px; display: flex; align-items: center; gap: 12px; width: 100%; font-weight: 500; }
#btn-chamados { justify-content: space-between; padding-right: 15px; }
.nav-item-label { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-btn i, .btn-deslogar i { font-size: 1.2rem; }
.nav-btn:hover { background-color: var(--hover-fundo); color: var(--branco); }
.nav-btn.ativo { background-color: var(--cor-primaria); color: var(--bg-escuro); font-weight: 700; }
.btn-deslogar { color: #f87171; margin-top: auto; }
.btn-deslogar:hover { background-color: var(--perigo-suave); color: var(--perigo); }

.content { flex: 1; min-height: 0; min-width: 0; padding: 35px; overflow-y: auto; overflow-x: hidden; background-color: var(--bg-fundo); scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.35) transparent; }
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 3px; }
.app-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 30px; background-color: var(--bg-sidebar); border-top: 1px solid var(--borda); color: var(--texto-secundario); font-size: 0.78rem; }
.faq-lista { display: flex; flex-direction: column; gap: 12px; }
.faq-lista details { border: 1px solid var(--borda); border-radius: 12px; padding: 18px 20px; background: var(--superficie-2); transition: border-color 0.2s ease, background-color 0.2s ease; }
.faq-lista details:hover { border-color: var(--superficie-3); }
.faq-lista details[open] { border-color: var(--cor-primaria); }
.faq-lista summary { cursor: pointer; color: var(--branco); font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq-lista summary::-webkit-details-marker { display: none; }
.faq-lista summary::after { content: '+'; color: var(--cor-primaria); font-size: 1.3rem; font-weight: 700; transition: transform 0.2s ease; }
.faq-lista details[open] summary::after { transform: rotate(45deg); }
.faq-lista details p { color: var(--texto-secundario); line-height: 1.6; margin: 14px 0 0; }
.suporte-form input, .suporte-form textarea { width: 100%; padding: 14px; border: 1px solid var(--borda); border-radius: 8px; outline: none; font: inherit; background: var(--superficie-2); color: var(--cor-texto); }
.suporte-form textarea { resize: vertical; }
.suporte-form input:focus, .suporte-form textarea:focus { border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
body.light-mode .faq-lista details { background: var(--superficie-2); border-color: var(--borda); }
body.light-mode .faq-lista details[open] { border-color: var(--cor-primaria); }
body.light-mode .suporte-form input, body.light-mode .suporte-form textarea { background: var(--superficie); color: var(--cor-texto); border-color: var(--borda); }

@media (max-width: 600px) {
    .app-footer { padding: 10px 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* FAB E CHAT FLUTUANTE DE SUPORTE */
.fab-suporte { position: fixed; right: 24px; bottom: 64px; width: 58px; height: 58px; border-radius: 50%; background: var(--cor-primaria); color: var(--bg-escuro); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: var(--sombra-suave); z-index: 9999; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.fab-suporte:hover { transform: translateY(-3px); box-shadow: var(--sombra-hover); }

.chat-suporte { position: fixed; right: 24px; bottom: 92px; width: 340px; max-width: calc(100vw - 32px); height: 460px; max-height: calc(100vh - 120px); background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px; box-shadow: var(--sombra-card); display: flex; flex-direction: column; overflow: hidden; z-index: 9999; }
.chat-suporte-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--bg-sidebar); border-bottom: 1px solid var(--borda); color: var(--branco); font-weight: 600; }
.chat-suporte-header button { background: none; border: none; color: var(--texto-secundario); cursor: pointer; font-size: 1.2rem; }
.chat-suporte-header button:hover { color: var(--branco); }
.chat-suporte-mensagens { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--superficie-2); }
.chat-suporte-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--borda); background: var(--bg-sidebar); }
.chat-suporte-input input, .chat-suporte-input textarea { flex: 1; height: 48px; min-height: 48px; padding: 12px 15px; border: 1px solid var(--borda); border-radius: 8px; outline: none; background: var(--superficie-2); color: var(--cor-texto); font: inherit; line-height: 1.4; resize: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.chat-suporte-input input:focus { border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
/* Oculta a barra de rolagem do campo de mensagem do chat flutuante (mantém o scroll nativo) */
.chat-suporte-input textarea { scrollbar-width: none; -ms-overflow-style: none; }
.chat-suporte-input textarea::-webkit-scrollbar { display: none; }
.chat-suporte-input button { background: var(--cor-primaria); color: var(--bg-escuro); border: none; border-radius: 8px; padding: 0 16px; cursor: pointer; font-size: 1.2rem; }
.chat-encerrado-aviso { margin: 0 12px 12px; padding: 10px 15px; border: 1px solid rgba(239, 68, 68, 0.45); border-radius: 8px; background: var(--perigo-suave); color: var(--perigo); text-align: center; font-weight: 700; }
.btn-encerrar-chamado { display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; vertical-align: middle !important; width: calc(100% - 24px); margin: 0 12px 12px; padding: 10px; background: var(--perigo-suave); color: var(--perigo); border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 8px; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1; transition: background 0.2s ease, color 0.2s ease; }
.btn-encerrar-chamado i { display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1 !important; margin: 0 !important; }
.btn-encerrar-chamado:hover { background: #ef4444; color: #fff; }

/* INPUT DE RESPOSTA DO ADMIN (CENTRAL DE CHAMADOS) */
#resposta-admin-texto { flex: 1; padding: 15px; border: 1px solid var(--borda); border-radius: 8px; outline: none; background: var(--superficie-2); color: var(--cor-texto); font: inherit; transition: border-color 0.2s ease, box-shadow 0.2s ease; height: 60px; min-height: 60px; max-height: 60px; resize: none; overflow-y: auto; line-height: 1.4; }
#resposta-admin-texto:focus { border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
body.light-mode #resposta-admin-texto, body.light-mode .chat-suporte-input textarea { background: var(--superficie-2); color: var(--cor-texto); border-color: var(--borda); }

.chat-bolha { max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; }
.chat-bolha:not(.chat-digitando):not(.sem-animacao) { animation: entradaMensagem 0.28s ease-out both; }
@keyframes entradaMensagem { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-bolha-nome { font-size: 0.75rem; font-weight: 700; margin-bottom: 4px; opacity: 0.7; }
.chat-bolha-texto { word-wrap: break-word; }
.chat-usuario { align-self: flex-end; background: var(--cor-primaria); color: var(--bg-escuro); border-bottom-right-radius: 4px; }
.chat-admin { align-self: flex-start; background: var(--superficie-3); color: var(--cor-texto); border-bottom-left-radius: 4px; }
.chat-vazio { text-align: center; color: var(--texto-secundario); padding: 20px; font-size: 0.9rem; }

/* INDICADOR "DIGITANDO..." COM BOLINHAS ANIMADAS */
.chat-digitando { display: flex; flex-direction: column; gap: 4px; }
.chat-digitando-bolinhas { display: flex; align-items: center; gap: 5px; padding: 4px 0; }
.chat-digitando-bolinhas span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: bolinha-pulsar 1.2s infinite ease-in-out;
}
.chat-digitando-bolinhas span:nth-child(1) { animation-delay: 0s; }
.chat-digitando-bolinhas span:nth-child(2) { animation-delay: 0.2s; }
.chat-digitando-bolinhas span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bolinha-pulsar {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* BADGE DE MENSAGENS NÃO LIDAS NO FAB */
.fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    border: 2px solid var(--bg-escuro);
    z-index: 1001;
}

/* BADGE DE NOTIFICAÇÕES NO MENU LATERAL */
.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    flex-shrink: 0;
}

body.light-mode .chat-suporte { background: var(--superficie); border-color: var(--borda); }
body.light-mode .chat-suporte-header { background: var(--bg-sidebar); border-color: var(--borda); color: var(--branco); }
body.light-mode .chat-suporte-mensagens { background: var(--superficie-2); }
body.light-mode .chat-suporte-input { background: var(--bg-sidebar); border-color: var(--borda); }
body.light-mode .chat-suporte-input input { background: var(--superficie-2); color: var(--cor-texto); border-color: var(--borda); }
body.light-mode .chat-admin { background: var(--superficie-3); color: var(--cor-texto); }
body.light-mode .chat-usuario { background: var(--cor-primaria); color: #ffffff; }
body.light-mode .chat-vazio { color: var(--texto-terciario); }
body.light-mode .chat-bolha-nome { opacity: 0.6; }

/* FUNDO DO CHAT DO ADMIN (CENTRAL DE CHAMADOS) */
.chat-admin-mensagens { background: var(--superficie-2); border: 1px solid var(--borda); }
body.light-mode .chat-admin-mensagens { background: var(--superficie-2); border-color: var(--borda); }

/* MODAL DE SUSPENSÃO (bloqueio do chat) */
.modal-suspensao { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 20px; }
.modal-suspensao-box { background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px; padding: 35px 30px; max-width: 420px; width: 100%; text-align: center; box-shadow: var(--sombra-card); }
.modal-suspensao-icone { font-size: 3rem; color: var(--perigo); margin-bottom: 15px; }
.modal-suspensao-box h3 { color: var(--branco); font-size: 1.3rem; font-weight: 800; margin-bottom: 12px; }
.modal-suspensao-box p { color: var(--texto-suave); font-size: 0.95rem; line-height: 1.5; margin-bottom: 10px; }
.modal-suspensao-timer { color: var(--aviso); font-weight: 700; }
.modal-suspensao-timer strong { font-size: 1.4rem; color: var(--aviso); }
body.light-mode .modal-suspensao-box { background: var(--superficie); border-color: var(--borda); }
body.light-mode .modal-suspensao-box h3 { color: var(--branco); }
body.light-mode .modal-suspensao-box p { color: var(--texto-secundario); }

/* PAINEL ORÇAMENTO (ESTILO MANAGER) */
.manager-painel { background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px; padding: 30px; box-shadow: var(--sombra-suave); }
.manager-titulo { font-size: 1.4rem; font-weight: 800; color: var(--branco); margin-bottom: 25px; text-transform: uppercase; letter-spacing: 1px; border-left: 4px solid var(--cor-primaria); padding-left: 12px; }

.manager-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: center; gap: 30px; }
.manager-bloco { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.manager-bloco h4 { color: var(--texto-secundario); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.manager-bloco .valor-destaque { font-size: 1.8rem; font-weight: 800; }
.valor-vermelho { color: var(--perigo); }
.valor-verde { color: var(--sucesso); }
.valor-azul { color: var(--cor-primaria); }

/* CONTAINER DO GRÁFICO DE ROSCA */
.grafico-rosca-box { position: relative; height: 260px; width: 100%; display: flex; justify-content: center; align-items: center; }

/* CABEÇALHO DE CONTEÚDO E TABELA */
.header-conteudo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.header-conteudo h3 { font-size: 1.5rem; color: var(--branco); font-weight: 700; }

.tabela-container { background-color: var(--superficie); border-radius: 14px; padding: 10px; border: 1px solid var(--borda); overflow-x: auto; }
.tabela-produtos { width: 100%; border-collapse: collapse; text-align: left; }
.tabela-produtos th { background-color: var(--superficie-2); padding: 16px 20px; color: var(--texto-secundario); font-weight: 600; border-bottom: 1px solid var(--borda); font-size: 0.85rem; text-transform: uppercase; }
.tabela-produtos td { padding: 16px 20px; border-bottom: 1px solid var(--borda); color: var(--cor-texto); vertical-align: middle; font-size: 0.95rem; }
.tabela-produtos tr:hover td { background-color: var(--hover-fundo); }
.tabela-produtos tr:last-child td { border-bottom: none; }
.tabela-produtos-acoes td:last-child { display: flex; gap: 8px; align-items: center; align-content: center; flex-wrap: wrap; }
.tabela-extrato { table-layout: fixed; }
.tabela-extrato th, .tabela-extrato td { display: table-cell; text-align: left; }
.tabela-extrato th:nth-child(1), .tabela-extrato td:nth-child(1) { width: 16%; }
.tabela-extrato th:nth-child(2), .tabela-extrato td:nth-child(2) { width: 38%; }
.tabela-extrato th:nth-child(3), .tabela-extrato td:nth-child(3) { width: 14%; text-align: center; }
.tabela-extrato th:nth-child(4), .tabela-extrato td:nth-child(4) { width: 16%; text-align: right; }
.tabela-extrato th:nth-child(5), .tabela-extrato td:nth-child(5) { width: 16%; white-space: nowrap; }

/* LOGS GERAIS (AUDITORIA POR USUÁRIO) */
.auditoria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.auditoria-card { display: flex; align-items: center; gap: 14px; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 12px; padding: 16px; cursor: pointer; text-align: left; transition: border-color 0.2s, transform 0.2s; color: var(--cor-texto); }
.auditoria-card:hover { border-color: var(--cor-primaria); transform: translateY(-2px); }
.auditoria-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--cor-primaria); color: #090d16; font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auditoria-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.auditoria-info strong { color: var(--branco); font-size: 0.95rem; }
.auditoria-info span { color: var(--texto-secundario); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auditoria-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.75rem; color: var(--texto-secundario); }
.badge-admin { color: var(--cor-primaria); font-weight: bold; background: rgba(56, 189, 248, 0.12); padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; }
.badge-usuario { color: var(--texto-secundario); font-weight: bold; background: var(--hover-fundo); padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; }
body.light-mode .badge-admin { background: rgba(2, 132, 199, 0.1); }
.auditoria-seta { color: var(--texto-terciario); font-size: 1.2rem; flex-shrink: 0; }
.auditoria-card:hover .auditoria-seta { color: var(--cor-primaria); }

.auditoria-item { background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 10px; padding: 12px 14px; }
.auditoria-item-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.auditoria-item-topo strong { color: var(--cor-primaria); font-size: 0.9rem; }
.auditoria-item-topo span { color: var(--texto-terciario); font-size: 0.75rem; white-space: nowrap; }
.auditoria-item p { color: var(--cor-texto); font-size: 0.85rem; margin: 0; }

body.light-mode .auditoria-card,
body.light-mode .auditoria-item { background: var(--superficie); border-color: var(--borda); }
body.light-mode .auditoria-info strong { color: var(--branco); }
body.light-mode .auditoria-item p { color: var(--cor-texto); }

/* ============ RESPONSIVIDADE UNIVERSAL (MOBILE-FIRST / MULTI-DEVICE) ============ */

/* Wrappers de tabelas com rolagem horizontal fluida */
.tabela-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Touch targets confortáveis e prevenção de zoom automático em inputs */
@media (max-width: 768px) {
    input, select, textarea { font-size: 16px !important; }
    button, .nav-btn, .btn-deslogar, .link-texto { min-height: 44px; }
    .btn-primario, .btn-secundario { min-height: 48px; }
}

/* ===== TABLETS E SMARTPHONES (<= 768px) ===== */
@media (max-width: 768px) {
    /* Landing page */
    .landing-nav { padding: 14px 20px; }
    .hero { grid-template-columns: 1fr; gap: 40px; padding: 50px 20px; }
    .hero-texto h1 { font-size: 2.2rem; }
    .hero-subtitulo { font-size: 1rem; }
    .hero-stats { gap: 24px; }
    .hero-card-conteudo { padding: 30px 24px; }
    .landing-secao { padding: 50px 20px; }
    .secao-titulo h2 { font-size: 1.7rem; }
    .sobre-grid { grid-template-columns: 1fr; }
    .stack-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: 1fr; }
    .landing-footer { padding: 40px 20px; }

    /* Top bar */
    .top-bar { height: 64px; padding: 0 16px; }
    .menu-esquerdo h2 { font-size: 1.1rem; }
    .perfil-usuario > span { display: none; }

    /* Sidebar vira menu retrátil (overlay) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    }
    .sidebar.aberta { transform: translateX(0); }
    .sidebar.fechada { width: 280px; max-width: 85vw; flex-basis: auto; padding: 25px 15px; }

    /* Overlay escuro atrás da sidebar */
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 999; }

    .content { padding: 20px 16px; }

    /* Modais ocupam largura segura */
    .modal-box { width: calc(100vw - 30px); max-width: 420px; padding: 28px 22px; }
    .modal-box[style*="width"] { width: calc(100vw - 30px) !important; }

    /* Chat flutuante ocupa largura segura */
    .chat-suporte { right: 10px; bottom: 80px; width: calc(100vw - 20px); max-width: 400px; }
    .fab-suporte { right: 16px; bottom: 20px; }

    /* Tabelas em cards verticais */
    .tabela-container { border-radius: 12px; }
    .tabela-produtos { min-width: 600px; }

    .app-footer { padding: 10px 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ===== SMARTPHONES PEQUENOS (<= 480px) ===== */
@media (max-width: 480px) {
    .hero-texto h1 { font-size: 1.8rem; }
    .hero-cta { flex-direction: column; }
    .btn-cta { width: 100%; justify-content: center; }
    .hero-stats { gap: 16px; }
    .hero-stat strong { font-size: 1.3rem; }
    .stack-grid { grid-template-columns: 1fr; }
    .secao-titulo h2 { font-size: 1.5rem; }
    .landing-logo, .landing-footer-logo { font-size: 1.2rem; }
    .landing-theme-toggle > span { display: none; }
    .content { padding: 16px 12px; }
    .modal-box { padding: 24px 18px; }
    .chat-suporte { height: calc(100vh - 100px); max-height: none; }
}

/* ============ ESTÉTICA "LANDING PAGE" APLICADA AO PAINEL INTERNO ============ */
/* Replica o visual chique/profissional da tela inicial (gradiente + glassmorphism
   + glow + hover elevado + animações de entrada) em todas as abas do sistema. */

/* 1) Fundo com gradiente (igual à landing page) */
#app-area {
    background: linear-gradient(160deg, var(--bg-escuro) 0%, var(--bg-fundo) 45%, var(--bg-sidebar) 100%);
}
.content {
    background: linear-gradient(160deg, var(--bg-escuro) 0%, var(--bg-fundo) 45%, var(--bg-sidebar) 100%);
}

/* 2) Glassmorphism na top-bar, sidebar e footer */
.top-bar, .sidebar, .app-footer {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: var(--glass-borda);
}

/* 3) Painéis com glow suave + borda translúcida + hover elevado */
.manager-painel, .tabela-container, .modal-box, .modal-suspensao-box,
.faq-lista details, .auditoria-card, .auditoria-item {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-borda);
    box-shadow: var(--sombra-card);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.manager-painel:hover, .auditoria-card:hover {
    transform: translateY(-4px);
    border-color: var(--cor-primaria);
    box-shadow: var(--sombra-hover);
}

/* 4) Glow decorativo atrás dos painéis principais (como o hero-card-glow) */
.manager-painel { position: relative; }
.manager-painel::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(245, 158, 11, 0.08));
    filter: blur(18px);
    opacity: 0.35;
    z-index: -1;
    pointer-events: none;
}

/* 5) Tabelas: cabeçalho translúcido e linhas com hover suave */
.tabela-produtos th {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 6) Animações de entrada nas views (como a landing page) */
.view-section:not(.hidden) {
    animation: fadeInUp 0.5s ease-out both;
}

/* 7) Botões de navegação com transição mais rica */
.nav-btn, .btn-deslogar {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.nav-btn:hover { transform: translateX(3px); }

/* 8) Chat flutuante e FAB com glassmorphism */
.chat-suporte {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-borda);
}
.chat-suporte-header, .chat-suporte-input {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.fab-suporte {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15), var(--sombra-hover);
}

/* 9) Ajuste fino no light mode para manter o contraste do glassmorphism */
body.light-mode .manager-painel,
body.light-mode .tabela-container,
body.light-mode .modal-box,
body.light-mode .modal-suspensao-box {
    background: var(--glass);
    border-color: var(--glass-borda);
}

/* ============ REFINAMENTO UI/UX ============ */

/* 10) Scrollbars customizadas: finas, modernas e sutis (tema dark/light) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--borda) transparent;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--borda);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--texto-terciario);
    background-clip: padding-box;
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* 11) Logo compacta: reduz o espaçamento entre "Estoque" e "Flex" */
.landing-logo, .landing-footer-logo {
    gap: 8px;
    letter-spacing: -1px;
}
.landing-logo span, .landing-footer-logo span {
    margin-left: -2px;
}
/* Logo na navbar do painel interno (mesma identidade da landing) */
.logo-app {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--branco);
    cursor: pointer;
}
.logo-app i {
    color: var(--cor-primaria);
    font-size: 1.5rem;
}
.logo-app span {
    color: var(--cor-primaria);
    margin-left: -2px;
}

/* 12) Destaque de estoque zerado (linha/quantidade em vermelho) */
.estoque-zerado {
    color: var(--perigo) !important;
    font-weight: 800 !important;
}
tr.linha-esgotada td {
    background: var(--perigo-suave) !important;
}
tr.linha-esgotada td.estoque-zerado {
    color: var(--perigo) !important;
}

/* 13) Padronização de modais: overlay translúcido + glassmorphism em todos */
.modal-overlay {
    background: var(--overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-box {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-borda);
    box-shadow: var(--sombra-card);
}

/* 14) Campos de formulário alinhados (Editar Perfil e demais modais) */
.campo-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.campo-form label {
    margin-bottom: 2px;
}
.campo-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--borda);
    background: var(--superficie-2);
    color: var(--cor-texto);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.campo-form input:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* 15) Modal de Editar Perfil: altura limitada com rolagem interna */
#modal-perfil .modal-box {
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
}
#modal-perfil .modal-cabecalho {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-bottom: 12px;
}

/* 16) Estoque crítico (acima de 0, mas <= estoque mínimo): destaque AMARELO */
.estoque-critico {
    color: #f59e0b !important;
    font-weight: 800 !important;
}
tr.linha-critica td {
    background: rgba(245, 158, 11, 0.12) !important;
}
tr.linha-critica td.estoque-critico {
    color: #f59e0b !important;
}

/* ============ POLIMENTO FINAL: AUDITORIA / UI-UX ============ */

/* 17) Modal "Editar Produto" (página standalone): glassmorphism idêntico ao "Novo Produto" */
body .modal-overlay .modal-box {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-borda);
    box-shadow: var(--sombra-card);
}
body.light-mode .modal-overlay .modal-box {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--glass-borda);
    color: var(--cor-texto);
}
body.light-mode .modal-overlay .modal-box h2 {
    color: var(--cor-texto);
}
body.light-mode .modal-overlay .modal-box input {
    background: #ffffff;
    color: #1e293b;
    border-color: var(--borda);
}

#modal-usuario {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
#modal-usuario .modal-box {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    margin: auto;
    overflow-y: auto;
    box-sizing: border-box;
}

/* 18) Modal "Gerenciar Usuários": centralização perfeita + fundo limpo (sem blur pesado) */
#modal-usuario.modal-suspensao {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
#modal-usuario .modal-suspensao-box {
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: 16px;
    box-shadow: var(--sombra-card);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
    margin: auto;
}
body.light-mode #modal-usuario .modal-suspensao-box {
    background: #ffffff;
    border-color: var(--borda);
}

/* 19) Histórico de Atividades: Timeline vertical moderna */
#auditoria-lista {
    overflow-x: hidden;
}
.auditoria-timeline {
    position: relative;
    padding: 0 0 2px 24px;
}
.auditoria-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--cor-primaria);
    border-radius: 2px;
}
.auditoria-item {
    position: relative;
    z-index: 1;
    background: var(--superficie-2);
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 12px 14px 12px 16px;
    margin-bottom: 10px;
}
.auditoria-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cor-primaria);
    border: 2px solid var(--superficie);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}
.auditoria-item-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.auditoria-item-topo strong {
    color: var(--cor-primaria);
    font-size: 0.9rem;
}
.auditoria-item-topo span {
    color: var(--texto-terciario);
    font-size: 0.75rem;
    white-space: nowrap;
}
.auditoria-item p {
    color: var(--cor-texto);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}
body.light-mode .auditoria-item {
    background: #ffffff;
    border-color: var(--borda);
}
body.light-mode .auditoria-item::before {
    border-color: #ffffff;
}
body.light-mode .auditoria-item p {
    color: var(--cor-texto);
}

/* 20) Extrato: padronização da cor do "Valor Total" (mesma cor de texto padrão) */
.extrato-valor {
    color: var(--cor-texto);
    font-weight: 600;
}
body.light-mode .extrato-valor {
    color: #1e293b;
}