/* ==========================================================================
   VARIÃVEIS GLOBAIS E RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --yellow: #FBBF24; --yellow-dark: #D97706; --yellow-light: #FEF3C7;
    --black: #0A0A0A; --gray-900: #111827; --gray-800: #1F2937; --gray-700: #374151;
    --gray-600: #4B5563; --gray-500: #6B7280; --gray-400: #9CA3AF; --gray-300: #D1D5DB;
    --gray-200: #E5E7EB; --gray-100: #F3F4F6; --white: #FFFFFF;
    --green: #10B981; --red: #EF4444; --blue: #3B82F6; --orange: #F59E0B; --purple: #8B5CF6;
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--gray-100); color: var(--gray-900); min-height: 100vh; display: flex; flex-direction: column; }

/* ==========================================================================
   NAVBAR (com Glassmorphism)
   ========================================================================== */
header { 
    background: rgba(10, 10, 10, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1000; 
    box-shadow: 0 2px 20px rgba(0,0,0,0.4); 
    transition: background 0.3s ease;
}
nav { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 72px; }
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo-icon { width: 44px; height: 44px; background: var(--yellow); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.nav-logo-text .brand { font-size: 20px; font-weight: 800; color: var(--white); letter-spacing: -0.5px; }
.nav-logo-text .brand span { color: var(--yellow); }
.nav-logo-text .tagline { font-size: 11px; color: var(--gray-400); letter-spacing: 0.5px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { 
    display: flex; align-items: center; gap: 8px; padding: 10px 18px; 
    border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 500; 
    color: var(--gray-400); transition: all 0.2s ease; border: 1px solid transparent; 
}
.nav-link:hover:not(:disabled) { color: var(--white); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); }
.nav-link.active { color: var(--black); background: var(--yellow); border-color: var(--yellow); }
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer { background: var(--black); padding: 32px 24px; text-align: center; margin-top: auto; width: 100%; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-logo { font-size: 18px; font-weight: 900; color: var(--white); margin-bottom: 8px; }
.footer-logo span { color: var(--yellow); }
footer p { font-size: 12px; color: var(--gray-600); }
footer a { color: var(--yellow); text-decoration: none; }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--white); border-radius: 20px; padding: 40px 36px 36px; width: 100%; max-width: 460px; box-shadow: 0 24px 80px rgba(0,0,0,0.35); position: relative; transform: translateY(20px) scale(0.97); transition: transform 0.25s ease; font-family: 'Inter', sans-serif; }
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-close-btn { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--gray-100); color: var(--gray-500); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.modal-close-btn:hover { background: var(--gray-200); color: var(--gray-900); }
.modal-icon { width: 56px; height: 56px; background: var(--yellow-light); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.modal-icon svg { width: 28px; height: 28px; color: var(--yellow-dark); }
.modal-box h2 { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; letter-spacing: -0.5px; }
.modal-box p, .modal-box p.modal-desc { font-size: 14px; color: var(--gray-500); line-height: 1.6; margin-bottom: 28px; }
.modal-field, .modal-field-rs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.modal-field label, .modal-field-rs label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.modal-field input, .modal-field select, .modal-field-rs input, .modal-field-rs select { padding: 11px 14px; border: 1.5px solid var(--gray-200); border-radius: 10px; font-size: 14px; font-family: 'Inter', sans-serif; color: var(--gray-900); background: var(--gray-100); transition: all 0.2s ease; outline: none; width: 100%; }
.modal-field input:focus, .modal-field select:focus, .modal-field-rs input:focus, .modal-field-rs select:focus { border-color: var(--yellow); background: var(--white); box-shadow: 0 0 0 3px rgba(251,191,36,0.15); }
.modal-actions { display: flex; gap: 12px; margin-top: 28px; }
.modal-btn-cancel { flex: 1; padding: 12px; border-radius: 10px; border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-600); font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s; }
.modal-btn-cancel:hover { background: var(--gray-100); border-color: var(--gray-300); }
.modal-btn-submit { flex: 2; padding: 12px; border-radius: 10px; border: none; background: var(--yellow); color: var(--black); font-size: 14px; font-weight: 700; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s; box-shadow: 0 4px 14px rgba(251,191,36,0.35); display: flex; align-items: center; justify-content: center; gap: 8px; }
.modal-btn-submit:hover:not(:disabled) { background: var(--yellow-dark); transform: translateY(-1px); }
.modal-btn-submit:disabled { background: var(--gray-300); color: var(--gray-500); cursor: not-allowed; box-shadow: none; transform: none; }
.modal-feedback { border-radius: 10px; padding: 12px 16px; font-size: 14px; font-weight: 500; margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.modal-feedback.success { background: #D1FAE5; border: 1px solid #6EE7B7; color: #065F46; }
.modal-feedback.error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.modal-feedback svg { width: 18px; height: 18px; flex-shrink: 0; }
.modal-spinner { width: 18px; height: 18px; border: 2.5px solid rgba(0,0,0,0.15); border-top-color: var(--black); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   LOGIN & FILTERS
   ========================================================================== */
.login-container { display: flex; align-items: center; justify-content: center; flex: 1; padding: 24px; }
.login-box { background: var(--white); border-radius: 16px; padding: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid var(--gray-200); width: 100%; max-width: 420px; }
.login-box h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; color: var(--gray-900); }
.login-box p { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.filter-field input, .filter-field select { padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: 10px; font-size: 14px; font-family: 'Inter', sans-serif; color: var(--gray-900); background: var(--gray-100); transition: all 0.2s ease; outline: none; width: 100%; }
.filter-field input:focus, .filter-field select:focus { border-color: var(--yellow); background: var(--white); box-shadow: 0 0 0 3px rgba(251,191,36,0.15); }
.msg-box { border-radius: 10px; padding: 14px 20px; font-size: 14px; font-weight: 500; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.msg-box.error { background: #FEF2F2; border: 1px solid #FECACA; color: var(--red); }
.msg-box.loading { background: #EFF6FF; border: 1px solid #BFDBFE; color: var(--blue); }
.msg-box.empty { background: #F9FAFB; border: 1px solid var(--gray-200); color: var(--gray-500); }
.msg-box svg { width: 18px; height: 18px; flex-shrink: 0; }
.hidden { display: none !important; }

/* ==========================================================================
   MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    nav { padding: 0 16px; height: 60px; }
    .nav-logo-text .tagline { display: none; }
    .nav-link span { display: none; }
}

/* ==========================================================================
   INDEX (HERO, CARDS, FEATURES)
   ========================================================================== */
.hero { background: linear-gradient(135deg, var(--black) 0%, var(--gray-800) 100%); padding: 80px 24px 100px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -100px; right: -100px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(251,191,36,0.15) 0%, transparent 70%); pointer-events: none; }
.hero::after { content: ''; position: absolute; bottom: -50px; left: -50px; width: 300px; height: 300px; background: radial-gradient(circle, rgba(251,191,36,0.08) 0%, transparent 70%); pointer-events: none; }
.hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.3); border-radius: 50px; padding: 6px 16px; font-size: 12px; font-weight: 600; color: var(--yellow); letter-spacing: 0.5px; margin-bottom: 24px; }
.hero-badge-dot { width: 6px; height: 6px; background: var(--yellow); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.hero h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 900; color: var(--white); line-height: 1.05; letter-spacing: -2px; margin-bottom: 20px; }
.hero h1 span { color: var(--yellow); }
.hero p { font-size: 18px; color: var(--gray-400); max-width: 560px; line-height: 1.7; margin-bottom: 40px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; }
.btn-primary { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; background: var(--yellow); color: var(--black); font-size: 15px; font-weight: 700; border-radius: 10px; text-decoration: none; transition: all 0.2s ease; box-shadow: 0 4px 20px rgba(251,191,36,0.3); }
.btn-primary:hover { background: var(--yellow-dark); transform: translateY(-2px); box-shadow: 0 6px 28px rgba(251,191,36,0.4); }
.btn-secondary { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; background: transparent; color: var(--white); font-size: 15px; font-weight: 600; border-radius: 10px; text-decoration: none; border: 1.5px solid rgba(255,255,255,0.2); transition: all 0.2s ease; }
.btn-secondary:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); transform: translateY(-2px); }
.btn-primary svg, .btn-secondary svg { width: 18px; height: 18px; }
.stats-bar { background: var(--yellow); padding: 24px; }
.stats-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: center; gap: 60px; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-item .number { font-size: 28px; font-weight: 900; color: var(--black); letter-spacing: -1px; }
.stat-item .label { font-size: 13px; font-weight: 600; color: rgba(0,0,0,0.6); margin-top: 2px; }
.cards-section { max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: 32px; font-weight: 800; color: var(--gray-900); letter-spacing: -1px; margin-bottom: 12px; }
.section-title p { font-size: 16px; color: var(--gray-500); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.card { background: var(--white); border-radius: 16px; padding: 36px; box-shadow: 0 1px 3px rgba(0,0,0,0.12); border: 1px solid var(--gray-200); transition: all 0.3s ease; position: relative; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--yellow); transform: scaleX(0); transition: transform 0.3s ease; }
.card:hover { box-shadow: 0 10px 40px rgba(0,0,0,0.2); transform: translateY(-6px); border-color: transparent; }
.card:hover::before { transform: scaleX(1); }
.card-icon { width: 60px; height: 60px; background: var(--yellow-light); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; transition: all 0.3s ease; }
.card:hover .card-icon { background: var(--yellow); }
.card-icon svg { width: 28px; height: 28px; color: var(--yellow-dark); transition: color 0.3s ease; }
.card:hover .card-icon svg { color: var(--black); }
.card h3 { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-bottom: 12px; letter-spacing: -0.5px; }
.card p { font-size: 15px; color: var(--gray-500); line-height: 1.7; flex-grow: 1; }
.card-footer { margin-top: 28px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--yellow-dark); }
.card-footer svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.card:hover .card-footer svg { transform: translateX(4px); }
.features-section { background: var(--gray-900); padding: 80px 24px; }
.features-inner { max-width: 1200px; margin: 0 auto; }
.features-header { text-align: center; margin-bottom: 56px; }
.features-header h2 { font-size: 32px; font-weight: 800; color: var(--white); letter-spacing: -1px; margin-bottom: 12px; }
.features-header p { font-size: 16px; color: var(--gray-500); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.feature-item { text-align: center; }
.feature-icon { width: 56px; height: 56px; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.feature-icon svg { width: 24px; height: 24px; color: var(--yellow); }
.feature-item h4 { font-size: 16px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.feature-item p { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

/* ==========================================================================
   PAGES (CORRIDAS, PENDENTES, USUARIOS)
   ========================================================================== */
.page-header { background: linear-gradient(135deg, var(--black) 0%, var(--gray-800) 100%); padding: 48px 24px; position: relative; overflow: hidden; }
.page-header::before { content: ''; position: absolute; top: -80px; right: -80px; width: 350px; height: 350px; background: radial-gradient(circle, rgba(251,191,36,0.12) 0%, transparent 70%); pointer-events: none; }
.page-header-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.page-header h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; color: var(--white); letter-spacing: -1.5px; margin-bottom: 8px; }
.page-header h1 span { color: var(--yellow); }
.page-header p { font-size: 15px; color: var(--gray-400); }

.main { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: 32px 24px 48px; }

.filter-card { background: var(--white); border-radius: 16px; padding: 28px 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--gray-200); margin-bottom: 28px; }
.filter-card-title { font-size: 14px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.filter-card-title svg { width: 16px; height: 16px; }
.filter-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

.btn-buscar { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 24px; background: var(--yellow); color: var(--black); font-size: 14px; font-weight: 700; border-radius: 10px; border: none; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 4px 12px rgba(251,191,36,0.3); white-space: nowrap; }
.btn-buscar:hover { background: var(--yellow-dark); transform: translateY(-1px); }
.btn-buscar:disabled { background: var(--gray-300); color: var(--gray-500); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-buscar svg { width: 16px; height: 16px; }

.results-card { background: var(--white); border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--gray-200); overflow: hidden; }
.results-header { padding: 20px 28px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.results-title { font-size: 16px; font-weight: 800; color: var(--gray-700); }
.results-count { font-size: 13px; color: var(--gray-500); }
.table-wrapper { padding: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); text-align: left; font-size: 14px; }
th { background: transparent; font-weight: 700; color: var(--gray-600); }
.td-voucher a { color: var(--yellow); text-decoration: none; font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.badge-pendente { background: #FEF3C7; color: #92400E; }
.badge-recebido { background: #D1FAE5; color: #065F46; }
.badge-cancelado { background: #FEE2E2; color: #991B1B; }
.badge-nfse { background: #EDE9FE; color: #5B21B6; }
.badge-fatura-aprov { background: #FEF3C7; color: #92400E; }
.badge-fatura-env { background: #DBEAFE; color: #1E40AF; }

.pagination { padding: 20px 28px; border-top: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pag-info { font-size: 13px; color: var(--gray-500); }
.pag-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pag-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-700); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.pag-btn:hover:not(:disabled) { border-color: var(--yellow); background: var(--yellow-light); color: var(--gray-900); }
.pag-btn.active { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pag-btn-nav { width: auto; padding: 0 14px; gap: 6px; }
.pag-btn-nav svg { width: 14px; height: 14px; }

@media (max-width: 768px) {
    .hero { padding: 60px 16px 80px; }
    .stats-inner { gap: 32px; }
    .cards-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   GRAFICOS / DASHBOARD
   ========================================================================== */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-bottom: 24px; }
.chart-card { background: var(--white); border-radius: 16px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--gray-200); }
.chart-title { font-size: 16px; font-weight: 700; color: var(--gray-800); margin-bottom: 16px; text-align: center; }
.chart-container { position: relative; height: 300px; width: 100%; }
.error-msg { background: #FEF2F2; border: 1px solid #FECACA; color: var(--red); padding: 16px; border-radius: 10px; font-weight: 500; text-align: center; margin-bottom: 24px; }

app-header { display: block; width: 100%; z-index: 1000; }
app-footer { display: block; width: 100%; margin-top: auto; }


/* ==========================================================================
   DROPDOWN MENUS (MODERN SUBMENUS)
   ========================================================================== */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 1001;
    padding: 8px 0;
    margin-top: 10px;
}
.nav-dropdown:hover > .nav-dropdown-content {
    display: block;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--black);
}
.dropdown-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--gray-500);
    transition: color 0.2s;
}
.dropdown-item:hover svg {
    color: var(--yellow-dark);
}
.dropdown-arrow {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
}
.nav-submenu {
    position: relative;
}
.nav-submenu-content {
    display: none;
    position: absolute;
    top: 0;
    right: 100%;
    left: auto;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 1002;
    padding: 8px 0;
    margin-right: 5px;
}
.nav-submenu:hover > .nav-submenu-content {
    display: block;
    animation: slideLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideLeft {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}
/* Fix de área de hover para não perder o foco ao passar o mouse */
.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}
.nav-submenu-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: -15px;
    left: auto;
    width: 15px;
    height: 100%;
}

