/* ==========================================================================
   CORE SCM - SUPPLY CHAIN MANAGEMENT ENGINE
   Design System Oficial | Desenvolvido por Mateus Lima
   InCor 2026 - Versão Premium Full (Login Institucional Compacto)
   ========================================================================== */

/* --- 1. IMPORTAÇÃO E VARIÁVEIS DE TEMA --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700;800;900&family=Space+Mono:wght@400;700&family=Orbitron:wght@400;700;900&display=swap');

:root {
    /* Paleta Core SCM */
    --primary: #0f172a; 
    --primary-light: #1e293b;
    --accent: #0284c7; 
    --accent-hover: #0369a1;
    --success: #16a34a;
    --warning: #eab308;
    --danger: #ef4444;

    /* Backgrounds e Superfícies */
    --bg-system: #f1f5f9; 
    --bg-login: #e8f4f8; /* Fundo claro para o portal de entrada */
    --card-bg: #ffffff; 
    --nav-bg: #ffffff;
    --text-main: #1e293b; 
    --text-muted: #64748b; 
    --border: #e2e8f0; 
    --input-bg: #f8fafc;

    /* Sombras e Transições */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.06);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Noturno Completo */
[data-theme="dark"] {
    --primary: #020617; 
    --primary-light: #0f172a;
    --accent: #38bdf8; 
    --bg-system: #0f172a; 
    --bg-login: #030712;
    --card-bg: #1e293b; 
    --nav-bg: #1e293b;
    --text-muted: #cbd5e1; /* Cor clara para os labels aparecerem no fundo escuro */
    --text-main: #f1f5f9; 
    --border: #334155; 
    --input-bg: rgba(0,0,0,0.2);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
    
}

label, .status-label {
    color: var(--text-muted) !important; /* !important garante que nenhuma outra regra sobrescreva */
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- 2. RESET E TIPOGRAFIA BASE --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-system);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Barra de rolagem estilizada */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- 3. TELA DE LOGIN (ESTILO INSTITUCIONAL COMPACTO - REF: UFVJM) --- */

/* ── LOGIN SUPERTECH ─────────────────────────────────────────── */

#loginScreen {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-login);
    position: fixed;
    top: 0; left: 0;
    z-index: 3000;
    overflow: hidden;
    transition: background 0.3s;
}

/* Grade animada de fundo */
#loginScreen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6,182,212,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6,182,212,0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridDrift 20s linear infinite;
}

[data-theme="light"] #loginScreen::before {
    background-image:
        linear-gradient(rgba(6,182,212,0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6,182,212,0.12) 1px, transparent 1px);
}

@keyframes gridDrift {
    0%   { transform: translateY(0); }
    100% { transform: translateY(40px); }
}

/* Vinheta radial para profundidade */
#loginScreen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 70% at 50% 50%,
        transparent 30%,
        rgba(3,7,18,0.85) 100%);
    pointer-events: none;
}

/* Glow central pulsante */
.login-glow {
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(6,182,212,0.12) 0%,
        rgba(99,102,241,0.08) 40%,
        transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50%       { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* Scanline */
.login-scanline {
    position: absolute;
    width: 100%; height: 2px;
    background: linear-gradient(90deg,
        transparent, rgba(6,182,212,0.4), transparent);
    top: -2px;
    animation: scanline 6s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanline {
    0%   { top: -2px; opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 0.6; }
    100% { top: 100vh; opacity: 0; }
}

/* Card de login */
.login-box {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 360px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: 16px;
    padding: 40px 36px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(6,182,212,0.1),
        0 0 60px rgba(6,182,212,0.08),
        0 32px 64px rgba(0,0,0,0.5);
    animation: cardReveal 0.6s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Login card — tema claro */
[data-theme="light"] .login-box {
    background: rgba(255,255,255,0.9);
    border-color: rgba(6,182,212,0.3);
    box-shadow: 0 0 0 1px rgba(6,182,212,0.15), 0 32px 64px rgba(0,0,0,0.12);
}

[data-theme="light"] .login-header h2 { color: #334155; }
[data-theme="light"] .login-inputs input { color: #1e293b; background: rgba(6,182,212,0.03); }
[data-theme="light"] .login-inputs input:focus { background: rgba(6,182,212,0.06); }
[data-theme="light"] .login-inputs input::placeholder { color: #94a3b8; }
.login-box::before, .login-box::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
}
.login-box::before {
    top: -1px; left: -1px;
    border-top: 2px solid #06b6d4;
    border-left: 2px solid #06b6d4;
    border-radius: 16px 0 0 0;
}
.login-box::after {
    bottom: -1px; right: -1px;
    border-bottom: 2px solid #06b6d4;
    border-right: 2px solid #06b6d4;
    border-radius: 0 0 16px 0;
}

.login-header {
    width: 100%;
    margin-bottom: 32px;
    text-align: center;
}

.login-logo {
    height: 64px;
    width: auto;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px rgba(6,182,212,0.5));
}

.login-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.6;
}

.login-inputs {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-inputs .field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.login-inputs label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-inputs input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 8px;
    background: rgba(6,182,212,0.04);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #e2e8f0;
    transition: all 0.2s;
    box-sizing: border-box;
}

.login-inputs input::placeholder { color: #334155; }

.login-inputs input:focus {
    border-color: rgba(6,182,212,0.6);
    background: rgba(6,182,212,0.08);
    outline: none;
    box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}

.login-erro {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #f87171;
    min-height: 18px;
    margin-top: 8px;
    text-align: center;
}

.btn-login-final {
    position: relative;
    width: 100%;
    padding: 13px 20px;
    border-radius: 8px;
    border: 1px solid rgba(6,182,212,0.5);
    background: linear-gradient(135deg,
        rgba(6,182,212,0.15) 0%,
        rgba(99,102,241,0.15) 100%);
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #06b6d4;
    cursor: pointer;
    margin-top: 24px;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-login-final::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(6,182,212,0.3), rgba(99,102,241,0.3));
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-login-final:hover {
    border-color: #06b6d4;
    box-shadow: 0 0 24px rgba(6,182,212,0.3), 0 0 48px rgba(6,182,212,0.1);
    color: #fff;
    transform: translateY(-1px);
}

.btn-login-final:hover::before { opacity: 1; }
.btn-login-final:active { transform: translateY(0); }

.btn-login-final span { position: relative; z-index: 1; }

.btn-esqueci-senha {
    background: transparent;
    border: none;
    color: #475569;
    font-size: 11px;
    font-family: 'Space Mono', monospace;
    cursor: pointer;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    transition: color 0.2s;
}

.btn-esqueci-senha:hover { color: #06b6d4; }

/* --- TELA DE PRIMEIRO ACESSO --- */
#primeiroAcessoScreen {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-login);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
}

.troca-senha-box {
    max-width: 360px;
}

.troca-subtitulo {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.6;
    text-align: center;
}

/* --- ERRO INLINE DE LOGIN --- */
.login-erro {
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid var(--danger);
    border-radius: 6px;
    display: none;
    margin-top: 12px;
    width: 100%;
}

/* --- 4. HEADER DO SISTEMA (ESTILO TRIPARTIDO) --- */

/* ── HEADER SUPERTECH ────────────────────────────────────────── */

header {
    background: rgba(3, 7, 18, 0.95);
    color: white;
    padding: 0 32px;
    height: 58px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(6,182,212,0.15);
    box-shadow: 0 1px 0 rgba(6,182,212,0.08), 0 4px 24px rgba(0,0,0,0.4);
    z-index: 1100;
    position: relative;
}

/* Linha decorativa cyan no topo */
header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(6,182,212,0.6) 30%,
        rgba(99,102,241,0.6) 70%,
        transparent 100%);
}

.header-left .logo-img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(6,182,212,0.4));
}

.header-center .brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-center h1 {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1;
    color: #f8fafc;
    text-shadow: 0 0 20px rgba(6,182,212,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-center h1 span {
    font-family: 'Space Mono', monospace;
    font-size: 7px;
    font-weight: 400;
    letter-spacing: 4px;
    color: #06b6d4;
    text-transform: uppercase;
    margin-top: 5px;
    opacity: 0.8;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid rgba(6,182,212,0.15);
}

#userNameHeader {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.refresh-btn, .theme-toggle, .logout-btn, .carrinho-btn {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.refresh-btn {
    background: rgba(6,182,212,0.08);
    border: 1px solid rgba(6,182,212,0.25);
    color: #06b6d4;
}
.refresh-btn:hover {
    background: rgba(6,182,212,0.18);
    box-shadow: 0 0 12px rgba(6,182,212,0.2);
}

.theme-toggle {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: #64748b;
}
.theme-toggle:hover { background: rgba(255,255,255,0.08); color: #94a3b8; }

.logout-btn {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
}
.logout-btn:hover {
    background: rgba(239,68,68,0.22);
    box-shadow: 0 0 12px rgba(239,68,68,0.2);
}

/* ── NAV SUPERTECH ────────────────────────────────────────────── */

nav {
    background: rgba(8, 14, 28, 0.98);
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(6,182,212,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    overflow: hidden;
}

/* Linha de scan que percorre o nav */
nav::after {
    content: '';
    position: absolute;
    left: -100%; top: 0; bottom: 0;
    width: 60%;
    background: linear-gradient(90deg, transparent, rgba(6,182,212,0.04), transparent);
    animation: navScan 8s linear infinite;
    pointer-events: none;
}
@keyframes navScan {
    0%   { left: -60%; }
    100% { left: 110%; }
}

/* Indicador deslizante */
.nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #06b6d4, #818cf8, transparent);
    box-shadow: 0 0 12px 2px rgba(6,182,212,0.6);
    transition: left 0.35s cubic-bezier(0.4,0,0.2,1),
                width 0.35s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    border-radius: 999px;
}

.nav-container {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-btn {
    position: relative;
    background: transparent;
    border: none;
    padding: 16px 18px;
    color: #3d5068;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

/* Flare sweep no hover */
.nav-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6,182,212,0.12), transparent);
    transition: none;
    pointer-events: none;
    transform: skewX(-15deg);
}

.nav-btn:hover::before {
    animation: btnFlare 0.5s ease-out forwards;
}

@keyframes btnFlare {
    0%   { left: -60%; opacity: 1; }
    100% { left: 130%; opacity: 0; }
}

.nav-btn:hover { color: #7dd3e8; }

.nav-btn.active {
    color: #06b6d4;
    text-shadow: 0 0 16px rgba(6,182,212,0.6);
    border-bottom-color: transparent;
}

/* Glow do texto ativo */
.nav-btn.active .nav-btn-text {
    animation: textGlow 3s ease-in-out infinite;
}
@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 8px rgba(6,182,212,0.4); }
    50%       { text-shadow: 0 0 18px rgba(6,182,212,0.8), 0 0 32px rgba(99,102,241,0.3); }
}

/* --- 6. CONTAINER DO SISTEMA (LOGADO) --- */

.container {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin: 40px auto;
    margin-bottom: 120px;
    width: 92%;
    max-width: 1280px; /* Largura apenas quando logado */
}

.view-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 30px;
}

/* --- 7. DASHBOARD DE PERFORMANCE --- */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.stat-card {
    background: var(--bg-system);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover { border-color: var(--accent); }

.stat-card i { font-size: 32px; color: var(--accent); margin-bottom: 10px; }

.stat-card h3 {
    font-size: 3.2rem;
    margin: 10px 0;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: -2px;
}

/* --- 8. FORMULÁRIOS E INPUTS --- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.fg-2 { grid-column: span 2; }

.field-group { display: flex; flex-direction: column; gap: 8px; }

label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-muted);
}

input, select {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 14px;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.08);
}

/* Card de Status Integrado */
.status-card {
    grid-column: 1 / -1;
    background: var(--bg-system);
    border-radius: 18px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border);
}

.status-row { display: flex; align-items: center; gap: 30px; }
.radio-group { display: flex; gap: 20px; }
.radio-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* --- 9. TABELAS DE ALTA DENSIDADE --- */

.table-container {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
    margin-top: 25px;
}

table { width: 100%; border-collapse: collapse; min-width: 900px; }

th {
    background: var(--bg-system);
    padding: 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}

tr:hover td { background: rgba(2, 132, 199, 0.02); }

/* Badges de Prazo */
.status-prazo {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 900;
}

.prazo-ok { background: #e8f5e9; color: #2e7d32; }
.prazo-urgente { background: #fff8e1; color: #f57f17; border: 1px solid #ffca28; }
.prazo-vencido {
    background: #ffebee; 
    color: #c62828; 
    animation: pulse 1.5s infinite;
}

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }

/* --- 10. BUSCA GLOBAL (CORRIGIDA E INTERATIVA) --- */

.search-section {
    margin-top: 40px;
    display: flex;        /* Ativa o flexbox */
    justify-content: center; /* Centraliza a barra de busca no meio da tela */
    width: 100%;
}

.search-box {
    display: flex;
    gap: 15px;
    background: var(--bg-system);
    padding: 10px 10px 10px 25px;
    border-radius: 20px;
    align-items: center;
    border: 1.5px solid var(--border);
    transition: var(--transition);
    width: 100%;
    max-width: 800px; /* Limita a largura para a barra não esticar demais */
}

.search-box:focus-within {
    border-color: var(--accent);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.search-box input {
    border: none;
    background: transparent;
    flex: 1;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
}

/* --- 10. BUSCA GLOBAL (CENTRALIZADA E INTERATIVA) --- */

.search-section {
    margin-top: 40px;
    width: 100%;
    display: flex;           /* Ativa o flexbox */
    justify-content: center;  /* Centraliza o conteúdo horizontalmente */
    padding: 0 20px;
}

.search-box {
    display: flex;
    gap: 15px;
    background: var(--bg-system);
    padding: 8px 8px 8px 25px;
    border-radius: 20px;
    align-items: center;
    border: 1.5px solid var(--border);
    width: 100%;
    max-width: 800px;        /* Define um tamanho limite para não esticar na tela toda */
    transition: var(--transition);
}

.search-box:focus-within {
    background: var(--card-bg);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.search-box input {
    border: none;
    background: transparent;
    flex: 1;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
}

/* BOTÃO COM ANIMAÇÃO DE HOVER E CLIQUE */
.btn-search-global {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transição suave */
}

.btn-search-global:hover {
    background: var(--accent-hover);
    transform: translateY(-2px); /* Eleva o botão no mouse */
    box-shadow: 0 8px 15px rgba(2, 132, 199, 0.3); /* Adiciona o brilho azul */
}

.btn-search-global:active {
    transform: scale(0.95); /* Efeito de "apertar" ao clicar */
}

/* --- AJUSTE DO MODAL (CENTRALIZADO E SCROLLÁVEL) --- */
.modal {
    display: none; /* Alterado para flex via JS quando aberto */
    position: fixed;
    z-index: 4000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    
    /* Centralização absoluta */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 24px;
    width: 90%;
    max-width: 1100px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    
    /* Scroll interno corrigido */
    max-height: 85vh; /* Não deixa o modal passar da altura da tela */
    overflow-y: auto; /* Cria a barra de rolagem se houver muitas notas */
}

/* --- ANIMAÇÃO DE CARREGAMENTO NO BOTÃO --- */
.rotating {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estilo do botão quando estiver "carregando" */
.btn-search-global.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- 12. BOTÕES DE AÇÃO --- */

.btn-add-lote {
    background: var(--accent);
    color: white;
    width: 100%;
    padding: 18px;
    border-radius: 15px;
    border: none;
    font-weight: 900;
    margin-top: 25px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

.actions-footer { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-top: 30px; }
.btn-sync { background: var(--success); color: white; border-radius: 12px; font-weight: 900; padding: 18px; border: none; cursor: pointer; }
.btn-copy { background: var(--text-muted); color: white; border-radius: 12px; font-weight: 800; border: none; cursor: pointer; }

/* --- 13. UTILS E ANIMAÇÕES --- */

.spinner { width: 45px; height: 45px; border: 4px solid rgba(2,132,199,0.1); border-left-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.rotating { animation: spin 1s linear infinite; }

.monitor-section { margin-top: 30px; }




/* --- 14. RODAPÉ --- */
.mainFooter {
    width: 100%;
    padding: 25px 0; /* Ajustei para ficar mais elegante */
    text-align: center;
    background: var(--primary); /* O azul escuro do InCor */
    color: rgba(255, 255, 255, 0.4); /* Texto sutil */
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: auto; /* Empurra o footer para o fim da página se houver pouco conteúdo */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- 15. RESPONSIVIDADE --- */

/* ==========================================================================
   RESPONSIVIDADE COMPLETA — MOBILE · TABLET · TV · TELÃO
   ========================================================================== */

/* ── TABLET (≤1024px) ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .main-wrapper { padding: 20px 16px; }
    .header-right .btn-header-action span { display: none; }
    .header-right .btn-header-action i   { margin: 0; }
    .nav-container { gap: 2px; padding: 0 12px; overflow-x: auto; flex-wrap: nowrap; }
    .nav-btn        { font-size: 10px; padding: 10px 10px; white-space: nowrap; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .fg-2      { grid-column: span 1; }
    .stat-card h3 { font-size: 28px; }
    .table-container { overflow-x: auto; }
    table { min-width: 600px; }
}

/* ══════════════════════════════════════════════════════════════
   HAMBURGER BUTTON
══════════════════════════════════════════════════════════════ */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #06b6d4;
    border-radius: 2px;
    transition: all .25s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════════════════════
   MOBILE NAV DRAWER
══════════════════════════════════════════════════════════════ */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.mobile-nav-overlay.open { display: block; }

.mobile-nav-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    background: rgba(8,14,28,0.98);
    border-right: 1px solid rgba(6,182,212,0.2);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(20px);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
}
.mobile-nav-drawer.open { transform: translateX(0); }

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(6,182,212,0.12);
}
.mobile-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.mobile-nav-links {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .15s, color .15s;
}
.mobile-nav-link i { font-size: 18px; flex-shrink: 0; }
.mobile-nav-link:hover  { background: rgba(6,182,212,0.08); color: #06b6d4; }
.mobile-nav-link.active { background: rgba(6,182,212,0.12); color: #06b6d4; }
.mobile-nav-link.admin  { color: #f59e0b; }
.mobile-nav-link.admin:hover  { background: rgba(245,158,11,0.08); }
.mobile-nav-link.admin.active { background: rgba(245,158,11,0.12); color: #f59e0b; }

.mobile-nav-footer {
    padding: 12px 8px 20px;
    border-top: 1px solid rgba(6,182,212,0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-nav-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .15s;
}
.mobile-nav-action-btn i { font-size: 16px; }
.mobile-nav-action-btn.refresh { color: #06b6d4; }
.mobile-nav-action-btn.refresh:hover { background: rgba(6,182,212,0.08); }
.mobile-nav-action-btn.theme   { color: #94a3b8; }
.mobile-nav-action-btn.theme:hover   { background: rgba(255,255,255,0.05); }
.mobile-nav-action-btn.logout  { color: #f87171; }
.mobile-nav-action-btn.logout:hover  { background: rgba(239,68,68,0.08); }

/* ══════════════════════════════════════════════════════════════
   MOBILE (≤768px)
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* ── Header ── */
    header {
        padding: 0 14px;
        height: 52px;
    }
    .header-left .logo-img { height: 28px; }
    .header-center h1 {
        font-size: 14px;
        letter-spacing: 2px;
    }
    .header-center h1 span { display: none; }

    /* Esconde todos os botões do header-right, exceto notif e hamburger */
    .user-info-header,
    .refresh-btn,
    .theme-toggle,
    .logout-btn,
    .carrinho-btn { display: none !important; }

    .notif-btn { display: flex; }
    .hamburger-btn { display: flex; }

    /* ── Float nav ── */
    .float-nav { display: none !important; }

    /* ── Container ── */
    .container {
        width: 100%;
        margin: 0;
        margin-bottom: 0;
        border-radius: 0;
        padding: 20px 16px 80px;
        box-shadow: none;
    }

    /* ── Header tab ── */
    .header-tab {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .header-tab h2 { font-size: 18px; }
    .header-tab > div:last-child {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        flex-wrap: nowrap !important;
    }

    /* ── Admin tabs ── */
    .btn-admin-tab { font-size: 9px; padding: 7px 10px; white-space: nowrap; }

    /* ── Forms ── */
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
    .fg-2      { grid-column: span 1; }
    .field-group input,
    .field-group select,
    .field-group textarea { font-size: 16px; /* evita zoom no iOS */ }

    /* ── Dashboard ── */
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
    .stat-card { padding: 20px 16px; }
    .stat-card h3 { font-size: 2rem; }
    .stat-card small { font-size: 9px; }

    /* ── Tables ── */
    .table-container { overflow-x: auto; border-radius: 10px; }
    table { min-width: 520px; font-size: 12px; }
    th, td { padding: 9px 10px; }

    /* ── Botões de ação admin ── */
    .admin-acoes { gap: 4px; }
    .btn-admin-acao { width: 28px; height: 28px; font-size: 13px; }

    /* ── Período search ── */
    .periodo-search-row { flex-wrap: wrap; gap: 8px; }
    .periodo-search-row input[type="date"] { min-width: 130px; flex: 1; }
    .periodo-search-row span { display: none; }

    /* ── Botões footer ── */
    .actions-footer { grid-template-columns: 1fr; gap: 8px; }

    /* ── Projeção ── */
    .filtros-projecao { flex-wrap: wrap; gap: 6px; }
    .filtro-btn { font-size: 9px; padding: 6px 10px; }
    .ponto-compra-wrap { padding: 12px; }
    .proj-pizza-grid { grid-template-columns: 1fr !important; }

    /* ── Modals ── */
    .modal-content,
    .usuario-modal-content,
    .saida-confirm-content {
        padding: 20px 16px;
        border-radius: 16px;
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    .saida-confirm-btns { flex-direction: column; }
    .saida-confirm-btns button { width: 100%; }

    /* ── Notif drawer ── */
    .notif-drawer { width: 100%; right: 0; border-radius: 20px 20px 0 0; top: auto; bottom: 0; height: 70vh; }

    /* ── Protocolo ── */
    .btn-prot-acao span { display: none; } /* só ícone no mobile */
    .btn-prot-acao { padding: 5px 8px; }

    /* ── Login ── */
    .login-box { padding: 28px 20px; border-radius: 20px; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE PEQUENO (≤480px)
══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .header-center h1 { font-size: 13px; letter-spacing: 1.5px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .alerta-adi-counters { flex-direction: column; }
    .stat-card h3 { font-size: 1.8rem; }
    .container { padding: 16px 12px 80px; }
    table { min-width: 460px; font-size: 11px; }
    th, td { padding: 8px 8px; }
    .modal-content,
    .usuario-modal-content { margin: 6px; max-width: calc(100vw - 12px); }
}

/* ── TV / TELÃO (≥1920px) ─────────────────────────────────────────────── */
@media (min-width: 1920px) {
    :root { --font-size-base: 15px; }
    .main-wrapper  { max-width: 1800px; padding: 40px 60px; }
    .app-header    { padding: 18px 60px; }
    .nav-container { padding: 0 60px; }
    .nav-btn       { font-size: 13px; padding: 16px 22px; }
    .stat-card h3  { font-size: 52px; }
    .stat-card small { font-size: 12px; }
    table          { font-size: 15px; }
    th, td         { padding: 16px 20px; }
    .card-box      { padding: 40px; border-radius: 24px; }
    .brand-title   { font-size: 28px !important; letter-spacing: 5px !important; }
    .btn-sync      { font-size: 16px; padding: 18px; }
}

/* ── TV 4K (≥2560px) ─────────────────────────────────────────────────── */
@media (min-width: 2560px) {
    .main-wrapper  { max-width: 2400px; padding: 60px 80px; }
    .app-header    { padding: 24px 80px; }
    .nav-container { padding: 0 80px; }
    .nav-btn       { font-size: 16px; padding: 20px 28px; }
    .stat-card h3  { font-size: 72px; }
    table          { font-size: 18px; }
    th, td         { padding: 20px 24px; }
    .brand-title   { font-size: 36px !important; letter-spacing: 7px !important; }
}

/* ── MODO TELA CHEIA (DASHBOARD) ──────────────────────────────────────── */
.dash-fullscreen-mode #mainHeader,
.dash-fullscreen-mode #mainNav,
.dash-fullscreen-mode .container > *:not(#view-dashboard) {
    display: none !important;
}

.dash-fullscreen-mode #view-dashboard {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--bg-main);
    padding: 12px 28px 20px;
    overflow-y: auto;
    display: block !important;
}

.dash-fullscreen-mode .dash-fullscreen-bar {
    display: flex !important;
    margin-bottom: 12px;
}

.dash-fullscreen-bar {
    display: none;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.dash-fullscreen-bar .clock-fs {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    letter-spacing: 3px;
}

/* Botão sair fixo no canto — só aparece em fullscreen */
.dash-exit-fixed {
    display: none;
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 9999;
    background: rgba(0,0,0,0.4);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}
.dash-exit-fixed:hover { color: var(--danger); border-color: var(--danger); }
body.dash-fullscreen-mode .dash-exit-fixed { display: flex; }

/* No fullscreen: mostra barra do relógio, esconde botão normal */
body.dash-fullscreen-mode .dash-fullscreen-bar { display: flex; }
body.dash-fullscreen-mode #dashFsButtonWrap   { display: none !important; }

/* Dashboard em fullscreen — layout compacto mas legível */
.dash-fullscreen-mode .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 0;
}
.dash-fullscreen-mode .stat-card {
    padding: 18px 20px;
}
.dash-fullscreen-mode .stat-card h3 { font-size: 44px; }
.dash-fullscreen-mode .stat-card small { font-size: 11px; }

/* Seção projeções mais compacta */
.dash-fullscreen-mode #dashProjCards { margin-top: 18px; }
.dash-fullscreen-mode #dashProjCards .section-subtitle { font-size: 13px; margin-bottom: 10px; }
.dash-fullscreen-mode #dashProjCards .proj-pizza-grid { gap: 14px; }
.dash-fullscreen-mode #dashProjCards .stat-card { padding: 16px 18px; }

/* Tabela produtividade mais compacta */
.dash-fullscreen-mode #dash-gestor { margin-top: 18px; }
.dash-fullscreen-mode .section-subtitle { font-size: 14px; }
.dash-fullscreen-mode table { font-size: 13px; }
.dash-fullscreen-mode th { padding: 10px 14px; }
.dash-fullscreen-mode td { padding: 8px 14px; }

/* ==========================================================================
   16. MODAL ALERTA DE ADIANTAMENTOS — POPUP DE LOGIN
   ========================================================================== */

/* Entrada suave do modal */
@keyframes alertaEntrada {
    from { opacity: 0; transform: scale(0.88) translateY(-20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);     }
}

/* Pulsar no ícone de aviso */
@keyframes pulsarAviso {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    50%       { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(239,68,68,0); }
}

.alerta-adi-content {
    max-width: 780px;
    border-top: 5px solid var(--danger);
    animation: alertaEntrada 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Cabeçalho do alerta --- */
.alerta-adi-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.alerta-adi-icon-wrap {
    width: 58px;
    height: 58px;
    min-width: 58px;
    background: rgba(239,68,68,0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulsarAviso 2s ease-in-out infinite;
}

.alerta-adi-icon {
    font-size: 30px;
    color: var(--danger);
}

.alerta-adi-titulo {
    font-size: 17px;
    font-weight: 900;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.alerta-adi-subtitulo {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Contadores rápidos --- */
.alerta-adi-counters {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.alerta-counter {
    flex: 1;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.alerta-counter.vencido  { background: rgba(239,68,68,0.10); border: 1.5px solid rgba(239,68,68,0.3); }
.alerta-counter.urgente  { background: rgba(234,179,8,0.10);  border: 1.5px solid rgba(234,179,8,0.35); }

.counter-num {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

.alerta-counter.vencido .counter-num  { color: var(--danger); }
.alerta-counter.urgente .counter-num  { color: var(--warning); }

.counter-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* --- Botão de fechar --- */
.btn-alerta-fechar {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-alerta-fechar:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239,68,68,0.35);
}

.btn-alerta-fechar i { font-size: 20px; }


/* ==========================================================================
   17. ABA PROJEÇÃO DE COMPRAS
   ========================================================================== */

.filtros-projecao {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-system);
    border-radius: 14px;
    border: 1px solid var(--border);
}

.filtro-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filtro-btn:hover {
    border-color: var(--accent);
    background: rgba(2, 132, 199, 0.05);
}

.filtro-btn.filtro-ativo {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.filtro-btn.perigo {
    border-color: var(--danger);
}

.filtro-btn.perigo:hover {
    background: rgba(239, 68, 68, 0.1);
}

.filtro-btn.perigo.filtro-ativo {
    background: var(--danger);
}

.badge-filtro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 11px;
    color: white;
}

.badge-filtro.rp {
    background: var(--success);
}

.badge-filtro.cd {
    background: var(--accent);
}

.badge-filtro.empenho {
    background: var(--warning);
}

.badge-filtro.zerado {
    background: var(--danger);
}

.proj-resumo {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding: 14px 20px;
    background: var(--bg-system);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

/* Badges de status na tabela */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-status.rp-sim {
    background: rgba(22, 163, 74, 0.15);
    color: var(--success);
}

.badge-status.cd-sim {
    background: rgba(2, 132, 199, 0.15);
    color: var(--accent);
}

.badge-status.empenho-sim {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.badge-status.zerado {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-status.comprar {
    background: rgba(234, 88, 12, 0.15);
    color: #ea580c;
}

/* ==========================================================================
   18. MODAL ALERTA DE PROJEÇÃO
   ========================================================================== */

.alerta-proj-content {
    max-width: 780px;
    border-top: 5px solid #f59e0b;
    animation: alertaEntrada 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.alerta-proj-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.alerta-proj-icon-wrap {
    width: 58px;
    height: 58px;
    min-width: 58px;
    background: rgba(245, 158, 11, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulsarAviso 2s ease-in-out infinite;
}

.alerta-proj-icon {
    font-size: 30px;
    color: #f59e0b;
}

.alerta-proj-titulo {
    font-size: 17px;
    font-weight: 900;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.alerta-proj-subtitulo {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.alerta-proj-counter {
    background: rgba(245, 158, 11, 0.10);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.alerta-proj-counter .counter-num {
    font-size: 36px;
    font-weight: 900;
    color: #f59e0b;
}


/* Estilo para cabeçalho clicável de ordenação */
table thead th[onclick] {
    transition: background-color 0.2s ease;
}

table thead th[onclick]:hover {
    background-color: rgba(2, 132, 199, 0.08);
}

/* ==========================================================================
   19. PAGINAÇÃO DA PROJEÇÃO
   ========================================================================== */

.proj-paginacao {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pag-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.pag-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(2, 132, 199, 0.06);
}

.pag-btn.pag-ativa {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.pag-btn.pag-disabled,
.pag-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pag-reticencias {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 38px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}


/* ==========================================================================
   20. CARRINHO DE COMPRAS
   ========================================================================== */

.carrinho-btn {
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--success);
    transition: 0.2s;
    background: rgba(22, 163, 74, 0.2);
    position: relative;
    color: white;
}
.carrinho-btn:hover { background: rgba(22, 163, 74, 0.45); }

.carrinho-contador {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

/* Overlay */
.carrinho-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 3500;
}

/* Drawer lateral */
.carrinho-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 460px;
    max-width: 95vw;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -8px 0 40px rgba(0,0,0,0.25);
    z-index: 3600;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    border-left: 1px solid var(--border);
}
.carrinho-drawer.aberto { right: 0; }

/* Header do drawer */
.carrinho-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-system);
    flex-shrink: 0;
}
.carrinho-header-title { display: flex; align-items: center; gap: 10px; }
.carrinho-header-title i { font-size: 22px; color: var(--success); }
.carrinho-header-title h3 { font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.carrinho-qtd-header {
    background: var(--success);
    color: white;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 800;
}
.carrinho-fechar-btn {
    background: var(--bg-system);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    transition: var(--transition);
}
.carrinho-fechar-btn:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* Estado vazio */
.carrinho-vazio {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    padding: 40px;
    text-align: center;
}
.carrinho-vazio i { font-size: 56px; opacity: 0.3; }
.carrinho-vazio p { font-size: 14px; font-weight: 700; }
.carrinho-vazio small { font-size: 12px; line-height: 1.6; }

/* Lista de itens */
.carrinho-lista { flex: 1; overflow-y: auto; padding: 12px 16px; }

.carrinho-table { width: 100%; border-collapse: collapse; min-width: unset; }
.carrinho-table th {
    background: var(--bg-system);
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: left;
}
.carrinho-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    vertical-align: middle;
}
.carrinho-table tr:hover td { background: rgba(2,132,199,0.03); }

.carrinho-qtd-input {
    width: 60px;
    padding: 6px 8px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
}
.carrinho-qtd-input:focus { border-color: var(--accent); outline: none; }

.carrinho-remover-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger);
    font-size: 18px;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
}
.carrinho-remover-btn:hover { background: rgba(239,68,68,0.1); }

/* Footer do drawer */
.carrinho-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-system);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.carrinho-obs-group { display: flex; flex-direction: column; gap: 6px; }
.carrinho-obs-group label { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.carrinho-obs-group textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}
.carrinho-obs-group textarea:focus { border-color: var(--accent); outline: none; }

.carrinho-enviar-btn {
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.carrinho-enviar-btn:hover { background: #15803d; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(22,163,74,0.3); }
.carrinho-enviar-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.carrinho-limpar-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}
.carrinho-limpar-btn:hover { color: var(--danger); border-color: var(--danger); }

/* Grid dos botões de ação do carrinho */
.carrinho-acoes-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 10px;
}

/* Botão de exportar CSV */
.carrinho-csv-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    width: 100%;
}

.carrinho-csv-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.3);
}

.carrinho-csv-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Botão carrinho em cada linha da tabela */
.btn-add-carrinho {
    background: rgba(22,163,74,0.12);
    border: 1.5px solid rgba(22,163,74,0.35);
    border-radius: 8px;
    color: var(--success);
    font-size: 18px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: var(--transition);
}
.btn-add-carrinho:hover { background: var(--success); color: white; transform: scale(1.12); }
.btn-add-carrinho.no-carrinho {
    background: rgba(2,132,199,0.12);
    border-color: rgba(2,132,199,0.4);
    color: var(--accent);
}

/* Barra busca da projeção — sem margin-top extra */
#view-projecao .search-section { margin-top: 0; }

/* ==========================================================================
   21. BOTÃO DE SAÍDA DE ADIANTAMENTO
   ========================================================================== */

.btn-saida-adi {
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: var(--transition);
}

.btn-saida-adi:hover {
    background: var(--danger);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   23. PAINEL DE ADMINISTRAÇÃO
   ========================================================================== */

.nav-btn-admin {
    color: #f59e0b !important;
}
.nav-btn-admin.active {
    color: #f59e0b !important;
    border-bottom-color: #f59e0b !important;
}

.btn-novo-usuario {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-novo-usuario:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(2,132,199,0.3);
}

/* Badges de cargo */
.badge-cargo {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-cargo.digitador     { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.badge-cargo.gestor        { background: rgba(2,132,199,0.15);   color: var(--accent); }
.badge-cargo.administrador { background: rgba(245,158,11,0.15);  color: #f59e0b; }

/* Badge comprador na tabela */
.badge-comprador {
    font-size: 11px;
    font-weight: 800;
    color: var(--success);
    background: rgba(22,163,74,0.12);
    padding: 4px 10px;
    border-radius: 8px;
}

/* Toggle switch de comprador no modal */
.toggle-comprador {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--bg-system);
    transition: var(--transition);
    user-select: none;
}
.toggle-comprador:hover { border-color: var(--success); }
.toggle-comprador input[type="checkbox"] { display: none; }

.toggle-track {
    width: 42px;
    height: 24px;
    min-width: 42px;
    background: var(--border);
    border-radius: 999px;
    position: relative;
    transition: background 0.25s;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-comprador input:checked ~ .toggle-track { background: var(--success); }
.toggle-comprador input:checked ~ .toggle-track::after { transform: translateX(18px); }

.toggle-label-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.toggle-label-text i { color: var(--success); font-size: 16px; }

/* Badges de status de acesso */
.badge-ativo {
    font-size: 11px;
    font-weight: 700;
    color: var(--success);
}
.badge-primeiro-acesso {
    font-size: 11px;
    font-weight: 700;
    color: var(--warning);
}

/* Botões de ação na tabela de usuários */
.admin-acoes {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}
.btn-admin-acao {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: var(--transition);
    color: var(--text-muted);
}
.btn-admin-acao.editar:hover  { border-color: var(--accent);   color: var(--accent);   background: rgba(2,132,199,0.08); }
.btn-admin-acao.resetar:hover { border-color: var(--warning);  color: var(--warning);  background: rgba(234,179,8,0.08); }
.btn-admin-acao.deletar:hover { border-color: var(--danger);   color: var(--danger);   background: rgba(239,68,68,0.08); }

/* Modal de usuário */
.usuario-modal-content {
    max-width: 540px;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

/* Botão salvar usuário */
.btn-salvar-usuario {
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-salvar-usuario:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2,132,199,0.3);
}
.btn-salvar-usuario:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

@keyframes pulsarSaida {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0   rgba(239,68,68,0.45); }
    50%       { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(239,68,68,0); }
}

.saida-confirm-content {
    max-width: 480px;
    border-top: 5px solid var(--danger);
    animation: alertaEntrada 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.saida-confirm-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 24px;
}

.saida-confirm-icon-wrap {
    width: 54px;
    height: 54px;
    min-width: 54px;
    background: rgba(239, 68, 68, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulsarSaida 2s ease-in-out infinite;
}

.saida-confirm-icon {
    font-size: 28px;
    color: var(--danger);
}

.saida-confirm-titulo {
    font-size: 15px;
    font-weight: 900;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.saida-confirm-subtitulo {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}

.saida-confirm-info {
    background: var(--bg-system);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.saida-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.saida-info-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.saida-info-label i { font-size: 14px; }

.saida-info-valor {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.saida-confirm-btns {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 12px;
}

.btn-saida-cancelar {
    padding: 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-saida-cancelar:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

.btn-saida-confirmar {
    padding: 14px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-saida-confirmar:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}
/* ==========================================================================
   24. SELETOR DIRETOR + GRID DE PERMISSÕES
   ========================================================================== */

/* Seletor de comprador para diretores na aba projeção */
.seletor-comprador {
    padding: 10px 16px;
    border: 1.5px solid #8b5cf6;
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    min-width: 240px;
    cursor: pointer;
    transition: var(--transition);
}
.seletor-comprador:focus { border-color: #8b5cf6; outline: none; box-shadow: 0 0 0 4px rgba(139,92,246,0.12); }

/* Grid de permissões no modal de usuário */
.permissoes-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perm-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 11px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--bg-system);
    transition: var(--transition);
    user-select: none;
}
.perm-toggle:hover { border-color: var(--accent); background: rgba(2,132,199,0.03); }
.perm-toggle input[type="checkbox"] { display: none; }
.perm-toggle input:checked ~ .toggle-track { background: var(--accent); }
.perm-toggle input:checked ~ .toggle-track::after { transform: translateX(18px); }

.perm-info { display: flex; flex-direction: column; gap: 2px; }
.perm-nome { font-size: 13px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 7px; }
.perm-nome i { font-size: 15px; color: var(--accent); }
.perm-desc { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* Abas de projeção para diretores */
.nav-btn-proj-dir {
    color: #8b5cf6 !important;
}
.nav-btn-proj-dir.active {
    color: #8b5cf6 !important;
    border-bottom-color: #8b5cf6 !important;
}

/* ==========================================================================
   25. FILTRO DE PREFIXOS DE CÓDIGO NA PROJEÇÃO
   ========================================================================== */

.prefixos-wrap {
    background: var(--bg-system);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.prefixos-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.prefixos-header i { font-size: 14px; }

.btn-prefixo-todos,
.btn-prefixo-nenhum {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    text-transform: uppercase;
}
.btn-prefixo-todos:hover  { border-color: var(--accent);  color: var(--accent); }
.btn-prefixo-nenhum:hover { border-color: var(--danger);  color: var(--danger); }

.prefixos-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-prefixo {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    font-family: monospace;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    transition: var(--transition);
    letter-spacing: 0.5px;
}
.chip-prefixo:hover { border-color: var(--accent); color: var(--accent); }
.chip-prefixo.ativo {
    background: rgba(2, 132, 199, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================================
   26. ADMIN SUB-ABAS + BLACKLIST
   ========================================================================== */

.btn-admin-tab {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-admin-tab:hover { border-color: var(--accent); color: var(--accent); }
.btn-admin-tab.ativo {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.blacklist-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.blacklist-add-multi {
    display: flex;
    gap: 10px;
}
.blacklist-add-multi input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 13px;
    font-family: monospace;
    transition: var(--transition);
}
.blacklist-add-multi input:focus { border-color: var(--danger); outline: none; }
.blacklist-add-multi button {
    padding: 12px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}
.blacklist-add-multi button:hover { background: #dc2626; transform: translateY(-1px); }

/* ==========================================================================
   27. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    min-width: 280px;
    max-width: 380px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: all;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    backdrop-filter: blur(8px);
}
.toast.visivel { opacity: 1; transform: translateY(0); }
.toast i { font-size: 18px; flex-shrink: 0; }
.toast-success { background: rgba(22,163,74,0.92); color: white; }
.toast-error   { background: rgba(220,38,38,0.92); color: white; }
.toast-warning { background: rgba(234,179,8,0.92);  color: #1a1a1a; }
.toast-info    { background: var(--card-bg); color: var(--text-main); border: 1.5px solid var(--border); }

/* ==========================================================================
   28. MODAL BOAS-VINDAS
   ========================================================================== */

.bv-modal-content {
    max-width: 520px;
    padding: 0;
    overflow: hidden;
}

.bv-header {
    background: linear-gradient(135deg, var(--accent) 0%, #0ea5e9 100%);
    padding: 28px 28px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
}

.bv-avatar {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.bv-saudacao {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.bv-nome {
    font-size: 24px;
    font-weight: 900;
    color: white;
    line-height: 1.1;
}

.bv-data {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    margin-top: 4px;
}

.bv-fechar {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 20px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: color 0.2s;
}
.bv-fechar:hover { color: white; }

.bv-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 28px 0;
}

.bv-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    transition: transform 0.2s;
}
.bv-card:hover { transform: translateX(4px); }

.bv-card-valor {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 2px;
}

.bv-card-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.bv-btn-entrar {
    margin: 24px 28px 28px;
    width: calc(100% - 56px);
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}
.bv-btn-entrar:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2,132,199,0.35);
}

/* ==========================================================================
   29. PESQUISA POR PERÍODO
   ========================================================================== */

.periodo-search-box {
    background: var(--bg-system);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 8px;
}

.periodo-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.periodo-search-row i {
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.periodo-search-row span {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.periodo-search-row input[type="date"] {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}
.periodo-search-row input[type="date"]:focus { border-color: var(--accent); outline: none; }

.btn-periodo-buscar {
    padding: 10px 18px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-periodo-buscar:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-periodo-buscar:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-periodo-limpar {
    padding: 10px 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-periodo-limpar:hover { border-color: var(--danger); color: var(--danger); }

/* ==========================================================================
   30. BOTÃO EXPORTAR CSV GENÉRICO + FULLSCREEN
   ========================================================================== */

.btn-export-csv {
    padding: 9px 16px;
    background: transparent;
    color: var(--success);
    border: 1.5px solid var(--success);
    border-radius: 10px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-export-csv:hover {
    background: var(--success);
    color: white;
    transform: translateY(-1px);
}

.btn-fullscreen {
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.btn-fullscreen:hover { border-color: var(--accent); color: var(--accent); }

/* Nav badge de urgentes */
.nav-badge {
    background: var(--danger);
    color: white;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* Fullscreen mode */
body.fullscreen-mode header,
body.fullscreen-mode nav {
    display: none !important;
}
body.fullscreen-mode .container {
    max-width: 100%;
    padding: 16px;
}
/* Dashboard em fullscreen-mode: ocupa tela toda */
body.dash-fullscreen-mode .container > *:not(#view-dashboard) {
    display: none !important;
}
body.dash-fullscreen-mode #view-dashboard {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--bg-main);
    padding: 24px 32px;
    overflow-y: auto;
    display: block !important;
}

/* actions-footer with CSV button */
.actions-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   31. BOTÃO DE TEMA NA TELA DE LOGIN
   ========================================================================== */

.btn-theme-login {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 100;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.btn-theme-login:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(20deg);
}

/* ==========================================================================
   32. ESQUECI MINHA SENHA
   ========================================================================== */

.btn-esqueci-senha {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    padding: 4px 0;
}
.btn-esqueci-senha:hover { color: var(--accent); }
/* ==========================================================================
   BOTÃO LIMPAR LOG
   ========================================================================== */

.btn-limpar-log {
    padding: 9px 16px;
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
    border-radius: 10px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-limpar-log:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-1px);
}
.btn-limpar-log:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   33. SLIDER PONTO DE COMPRA — PROJEÇÃO
   ========================================================================== */

.ponto-compra-wrap {
    background: var(--bg-system);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.ponto-compra-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    flex-wrap: wrap;
}

.ponto-compra-header i { font-size: 16px; color: var(--accent); }

.ponto-compra-header strong {
    color: var(--accent);
    font-size: 16px;
    font-weight: 900;
    min-width: 60px;
}

.ponto-compra-hint {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.ponto-compra-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ponto-compra-slider {
    flex: 1;
    accent-color: var(--accent);
    height: 6px;
    cursor: pointer;
    border-radius: 999px;
    border: none;
    background: transparent;
    padding: 0;
}

.ponto-compra-edge {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 36px;
    white-space: nowrap;
}

/* ==========================================================================
   34. SINO DE NOTIFICAÇÕES — HEADER
   ========================================================================== */

.notif-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.notif-btn:hover { background: rgba(255,255,255,0.08); color: #94a3b8; }

.notif-btn.tem-notif {
    border-color: rgba(6,182,212,0.4);
    color: #06b6d4;
    background: rgba(6,182,212,0.08);
    animation: sino-pulse 2s infinite;
}

@keyframes sino-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.3); }
    50%       { box-shadow: 0 0 0 4px rgba(6,182,212,0); }
}

.notif-contador {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    border-radius: 999px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ==========================================================================
   35. DRAWER DE NOTIFICAÇÕES
   ========================================================================== */

.notif-overlay {
    position: fixed;
    top: 105px; /* abaixo do header (58px) + nav (47px) */
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.notif-drawer {
    position: fixed;
    top: 105px; /* abaixo do header + nav */
    right: 0;
    width: min(400px, 95vw);
    height: calc(100vh - 105px);
    background: var(--bg-card);
    border-left: 1.5px solid var(--border);
    z-index: 1000;
    display: none;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.3);
    animation: drawerSlideIn 0.2s cubic-bezier(0.16,1,0.3,1);
}

@keyframes drawerSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.notif-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1.5px solid var(--border);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-fechar-notif {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-fechar-notif:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.notif-lista {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notif-vazia {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 200px;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-vazia i { font-size: 40px; opacity: 0.4; }

.notif-item {
    background: var(--bg-system);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s;
}

.notif-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-item-codigo {
    font-size: 11px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.notif-item-data {
    font-size: 10px;
    color: var(--text-muted);
}

.notif-item-msg {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.notif-item-acoes {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-notif-sim, .btn-notif-nao, .btn-notif-lida {
    flex: 1;
    padding: 7px 10px;
    border-radius: 8px;
    border: none;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: var(--transition);
}

.btn-notif-sim { background: rgba(16,185,129,0.15); color: #10b981; }
.btn-notif-sim:hover { background: #10b981; color: #fff; }

.btn-notif-nao { background: rgba(239,68,68,0.15); color: var(--danger); }
.btn-notif-nao:hover { background: var(--danger); color: #fff; }

.btn-notif-lida { background: var(--bg-card); color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-notif-lida:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ==========================================================================
   36. MINI MENU STATUS COMPRA
   ========================================================================== */

.status-compra-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1001;
}

.status-compra-menu {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    width: min(340px, 92vw);
    z-index: 1002;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    overflow: hidden;
}

.status-compra-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1.5px solid var(--border);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.status-compra-menu-header button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: var(--transition);
}
.status-compra-menu-header button:hover { background: var(--danger); color: #fff; }

.status-compra-opcoes {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-opcao {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg-system);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.status-opcao i { font-size: 15px; }

.status-opcao.fase-1:hover, .status-opcao.fase-1.ativo { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: #f59e0b; }
.status-opcao.fase-2:hover, .status-opcao.fase-2.ativo { background: rgba(59,130,246,0.15); color: #3b82f6; border-color: #3b82f6; }
.status-opcao.fase-3:hover, .status-opcao.fase-3.ativo { background: rgba(139,92,246,0.15); color: #8b5cf6; border-color: #8b5cf6; }
.status-opcao.fase-4:hover, .status-opcao.fase-4.ativo { background: rgba(16,185,129,0.15); color: #10b981; border-color: #10b981; }
.status-opcao.fase-entregue:hover { background: rgba(16,185,129,0.15); color: #10b981; border-color: #10b981; }
.status-opcao.fase-remover:hover { background: rgba(239,68,68,0.15); color: var(--danger); border-color: var(--danger); }

.status-compra-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ==========================================================================
   37. BOTÃO STATUS COMPRA NA LINHA DA TABELA
   ========================================================================== */

.btn-status-compra {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 5px 7px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 15px;
}

.btn-status-compra:hover { border-color: var(--accent); color: var(--accent); }
.btn-status-compra.ativo { background: rgba(0,0,0,0.05); }

/* ==========================================================================
   38. MODAL DE PERFIL
   ========================================================================== */

/* Modal de perfil — popover no canto superior direito */
#modalPerfil {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: transparent;
    display: none;
}

.perfil-modal {
    position: absolute;
    top: 58px;
    right: 12px;
    width: 300px;
    padding: 0;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(6,182,212,0.08);
    animation: popoverReveal 0.2s cubic-bezier(0.16,1,0.3,1) forwards;
    transform-origin: top right;
}

@keyframes popoverReveal {
    from { opacity: 0; transform: scale(0.92) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Setinha apontando pro header */
.perfil-modal::before {
    content: '';
    position: absolute;
    top: -6px; right: 32px;
    width: 12px; height: 12px;
    background: var(--bg-card);
    border-top: 1px solid rgba(6,182,212,0.2);
    border-left: 1px solid rgba(6,182,212,0.2);
    transform: rotate(45deg);
}

.perfil-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.perfil-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6,182,212,0.3), rgba(99,102,241,0.3));
    border: 1.5px solid rgba(6,182,212,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 900;
    color: #06b6d4;
    flex-shrink: 0;
}

.perfil-nome {
    font-weight: 900;
    font-size: 14px;
    color: var(--text-main);
    margin: 0;
}

.perfil-login {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.btn-fechar-perfil {
    position: absolute;
    top: 16px; right: 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}
.btn-fechar-perfil:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-perfil-opcao {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    color: var(--text-secondary);
}
.btn-perfil-opcao:hover { background: var(--bg-system); }
.btn-perfil-opcao > i:first-child { font-size: 20px; color: var(--accent); flex-shrink: 0; }
.btn-perfil-opcao > i:last-child { font-size: 14px; color: var(--text-muted); margin-left: auto; }
.btn-perfil-opcao span { display: block; font-size: 13px; font-weight: 700; }
.btn-perfil-opcao small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.btn-perfil-voltar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 14px 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.15s;
}
.btn-perfil-voltar:hover { color: var(--accent); }

.perfil-secao-titulo {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding: 14px 20px 0;
    margin: 0;
}

.perfil-cores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 20px;
}

.perfil-cor-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-system);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}
.perfil-cor-item label { font-size: 11px; font-weight: 800; color: var(--text-secondary); }
.perfil-cor-item small { font-size: 10px; color: var(--text-muted); line-height: 1.3; }
.perfil-cor-item input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: var(--bg-card);
    margin-top: 4px;
}

.btn-perfil-enviar {
    width: calc(100% - 40px);
    margin: 8px 20px 20px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(6,182,212,0.4);
    background: rgba(6,182,212,0.1);
    color: #06b6d4;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-perfil-enviar:hover { background: rgba(6,182,212,0.2); box-shadow: 0 0 16px rgba(6,182,212,0.2); }

/* Hover no nome do usuário no header */
.user-info-header:hover { opacity: 0.8; }

/* ==========================================================================
   39. TEMA VITÓRIA — Rosa e Branco
   ========================================================================== */

/* CLARO */
body[data-user="supvitoria"][data-theme="light"] {
    --primary:       #f472b6;
    --accent:        #ec4899;
    --bg-main:       #fff0f6;
    --bg-card:       #ffffff;
    --bg-system:     #fce7f3;
    --border:        rgba(236,72,153,0.2);
    --text-main:     #831843;
    --text-secondary:#9d174d;
    --text-muted:    #be185d;
    --nav-bg:        #ffffff;
    --bg-login:      #fdf2f8;
}

/* ESCURO */
body[data-user="supvitoria"][data-theme="dark"] {
    --primary:       #831843;
    --accent:        #f472b6;
    --bg-main:       #1a0a12;
    --bg-card:       #2d0f1e;
    --bg-system:     #3d1528;
    --border:        rgba(244,114,182,0.2);
    --text-main:     #fce7f3;
    --text-secondary:#fbcfe8;
    --text-muted:    #f9a8d4;
    --nav-bg:        #1a0a12;
}

/* Login screen cor pra Vitória */
body[data-user="supvitoria"] #loginScreen::before {
    background-image:
        linear-gradient(rgba(236,72,153,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(236,72,153,0.08) 1px, transparent 1px);
}
body[data-user="supvitoria"] .login-glow {
    background: radial-gradient(circle, rgba(236,72,153,0.15), rgba(244,114,182,0.08) 40%, transparent 70%);
}
body[data-user="supvitoria"] .login-box::before { border-color: #f472b6; }
body[data-user="supvitoria"] .login-box::after  { border-color: #f472b6; }
body[data-user="supvitoria"] .login-inputs label { color: #f472b6; }
body[data-user="supvitoria"] .login-inputs input:focus { border-color: rgba(244,114,182,0.6); box-shadow: 0 0 0 3px rgba(244,114,182,0.12); }
body[data-user="supvitoria"] .btn-login-final { border-color: rgba(244,114,182,0.5); color: #f472b6; }
body[data-user="supvitoria"] .btn-login-final:hover { box-shadow: 0 0 24px rgba(244,114,182,0.35); }
body[data-user="supvitoria"] .login-logo { filter: drop-shadow(0 0 12px rgba(244,114,182,0.5)); }

/* ==========================================================================
   40. BOTÃO "VER COMO" + BANNER DE PREVIEW
   ========================================================================== */

.btn-admin-acao.ver-como {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3);
    color: #818cf8;
}
.btn-admin-acao.ver-como:hover {
    background: rgba(99,102,241,0.25);
    border-color: #818cf8;
}

#verComoBanner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(99,102,241,0.5);
    border-radius: 999px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.2);
    animation: bannerSlide 0.3s cubic-bezier(0.16,1,0.3,1);
    white-space: nowrap;
}

@keyframes bannerSlide {
    from { opacity:0; transform: translateX(-50%) translateY(16px); }
    to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

#verComoBanner .banner-eye { font-size: 16px; color: #818cf8; }
#verComoBanner .banner-txt { font-family: 'Space Mono', monospace; font-size: 11px; color: #94a3b8; }
#verComoBanner .banner-txt strong { color: #e2e8f0; }

#verComoBanner .btn-sair-preview {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 999px;
    padding: 5px 14px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #f87171;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.btn-sair-preview:hover { background: rgba(239,68,68,0.3); }

/* ==========================================================================
   41. BOTÕES SELETOR TEMA NO PERFIL
   ========================================================================== */

.btn-tema-opcao {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-system);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-tema-opcao.ativo {
    background: rgba(6,182,212,0.12);
    border-color: rgba(6,182,212,0.4);
    color: #06b6d4;
}

body[data-user="supvitoria"] .btn-tema-opcao.ativo {
    background: rgba(244,114,182,0.12);
    border-color: rgba(244,114,182,0.4);
    color: #f472b6;
}

.btn-tema-opcao:hover:not(.ativo) {
    background: var(--bg-card);
    color: var(--text-secondary);
}

/* ==========================================================================
   42. FORMULÁRIO DE PROTOCOLO OPME
   ========================================================================== */

.prot-input {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-system);
    color: var(--text-main);
    font-size: 12px;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
    color-scheme: dark;
}

[data-theme="light"] .prot-input { color-scheme: light; }

.prot-input:focus {
    border-color: rgba(6,182,212,0.5);
    outline: none;
    background: var(--bg-card);
}

.prot-input option {
    background: var(--bg-card);
    color: var(--text-main);
}

/* ==========================================================================
   43. BOTÕES SELETOR DE INTERFACE NO LOGIN
   ========================================================================== */

.btn-interface-opcao {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(6,182,212,0.2);
    background: rgba(6,182,212,0.05);
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.btn-interface-opcao:hover {
    border-color: rgba(6,182,212,0.5);
    background: rgba(6,182,212,0.12);
    transform: translateX(3px);
}

.btn-interface-opcao i { color: #06b6d4; flex-shrink: 0; }

.btn-interface-opcao span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #e2e8f0;
}

.btn-interface-opcao small {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

[data-theme="light"] .btn-interface-opcao { color: #1e293b; }
[data-theme="light"] .btn-interface-opcao span { color: #1e293b; }
/* ==========================================================================
   44. FLOATING PILL NAV
   ========================================================================== */

.float-nav {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1050;
    display: none; /* shown via JS after login */
}

.float-nav-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(8, 14, 28, 0.92);
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 999px;
    padding: 10px 6px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(6,182,212,0.06),
        0 8px 32px rgba(0,0,0,0.5),
        0 0 40px rgba(6,182,212,0.05);
}

/* Glow edge */
.float-nav-pill::before {
    content: '';
    position: absolute;
    left: -1px; top: 10%; bottom: 10%;
    width: 1px;
    background: linear-gradient(180deg,
        transparent, rgba(6,182,212,0.6), rgba(99,102,241,0.4), transparent);
    border-radius: 999px;
}

.fn-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #3d5068;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.fn-btn.fn-hidden {
    display: none !important;
}

.fn-btn:hover {
    color: #06b6d4;
    background: rgba(6,182,212,0.12);
}

/* Tooltip */
.fn-btn::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(8,14,28,0.95);
    color: #e2e8f0;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(6,182,212,0.2);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
}

.fn-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Active state */
.fn-btn.active {
    color: #06b6d4;
    background: rgba(6,182,212,0.15);
    box-shadow: 0 0 12px rgba(6,182,212,0.25), inset 0 0 8px rgba(6,182,212,0.05);
}

.fn-btn.active::before {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px;
    background: #06b6d4;
    border-radius: 999px;
    box-shadow: 0 0 8px #06b6d4;
}

.fn-admin.active {
    color: #fbbf24;
    background: rgba(251,191,36,0.12);
    box-shadow: 0 0 12px rgba(251,191,36,0.2);
}
.fn-admin.active::before { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.fn-admin:hover { color: #fbbf24; background: rgba(251,191,36,0.1); }

.fn-divider {
    width: 20px;
    height: 1px;
    background: rgba(6,182,212,0.12);
    margin: 4px 0;
    border-radius: 999px;
}
.fn-divider.fn-hidden { display: none !important; }

.fn-badge {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 1px solid rgba(8,14,28,0.9);
}

/* =============================================================================
   PROJEÇÃO OPME — Estilos para modo escuro (body[data-theme=dark])
   ============================================================================= */
[data-theme="dark"] .opme-card           { background: #1e293b; }
[data-theme="dark"] .opme-card:hover     { background: #263548; }
[data-theme="dark"] .opme-tbl th         { background: #1e293b; }
[data-theme="dark"] .opme-tbl td         { border-bottom-color: #1e293b; }
[data-theme="dark"] .opme-tbl tr:hover td{ background: rgba(255,255,255,.03); }
[data-theme="dark"] .opme-tbl-wrap       { border-color: #1e293b; }
[data-theme="dark"] .opme-tabs-bar       { border-bottom-color: #1e293b; }
[data-theme="dark"] .opme-tab-btn:hover  { background: #1e293b; }
[data-theme="dark"] .opme-tab-btn.opme-tab-active{ background: #1e293b; }
[data-theme="dark"] .opme-hist-item      { background: #1e293b; border-color: #1e293b; }
[data-theme="dark"] .opme-hist-hdr:hover { background: #263548; }
[data-theme="dark"] .opme-hist-body      { border-top-color: #263548; }
[data-theme="dark"] .bd-rp   { background:rgba(2,132,199,.2);  border-color:rgba(2,132,199,.3);  }
[data-theme="dark"] .bd-norp { background:rgba(239,68,68,.15); border-color:rgba(239,68,68,.2);  }
[data-theme="dark"] .bd-emp  { background:rgba(22,163,74,.15); border-color:rgba(22,163,74,.2);  }
[data-theme="dark"] .bd-noemp{ background:rgba(245,158,11,.15);border-color:rgba(245,158,11,.2); }
[data-theme="dark"] #view-projecao-opme  { color: #e2e8f0; }
[data-theme="dark"] .opme-spin           { border-color:#1e293b; border-top-color:var(--accent); }
/* Card FORA COP */
.opme-card-bloq { border-color: #64748b; --opme-color:#64748b; }
.opme-card-bloq .opme-card-num { color:#64748b; }
.opme-card-bloq:hover { background:var(--card-bg); }
[data-theme="dark"] .opme-card-bloq { background:#1e293b; }
/* AUTOCOMPLETE FORNECEDOR */
.ac-dropdown { position:absolute; top:calc(100% + 4px); left:0; right:0; background:var(--card-bg); border:1.5px solid var(--accent); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.18); list-style:none; margin:0; padding:4px; z-index:999; max-height:260px; overflow-y:auto; }
.ac-dropdown li { padding:9px 14px; font-size:13px; color:var(--text-main); border-radius:7px; cursor:pointer; transition:background .12s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ac-dropdown li:hover, .ac-dropdown li.ac-active { background:rgba(2,132,199,.12); color:var(--accent); }
.ac-dropdown li strong { color:var(--accent); font-weight:900; }
.ac-dropdown::-webkit-scrollbar { width:4px; }
.ac-dropdown::-webkit-scrollbar-thumb { background:var(--border); border-radius:999px; }
[data-theme="dark"] .ac-dropdown { background:#1e293b; border-color:var(--accent); box-shadow:0 8px 24px rgba(0,0,0,.4); }
[data-theme="dark"] .ac-dropdown li:hover, [data-theme="dark"] .ac-dropdown li.ac-active { background:rgba(2,132,199,.18); }