/* Reset e base */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Evita scroll horizontal */
}

:root {
    --primary: #f8fafc;
    --secondary: #e2e8f0;
}

.dark:root {
    --primary: #0d1a26;
    --secondary: #2c5f6f;
}

/* Tema Light (padrão) */
.theme-content {
    background-color: #ffffff;
    color: #111827;
}

.theme-content .border-theme {
    border-color: #e5e7eb;
}

.theme-content .bg-theme-card {
    background-color: #f9fafb;
}

/* make native selects and options follow the card theme (improves dropdown contrast) */
.theme-content select,
.theme-content select option {
    background-color: #f9fafb;
    color: #6b7280;
    border-color: #e5e7eb;
}

.dark .theme-content select,
.dark .theme-content select option {
    background-color: rgba(255,255,255,0.02);
    color: #d1d5db;
}

.theme-content .text-theme-secondary {
    color: #6b7280;
} 

.theme-content .text-theme-muted {
    color: #9ca3af;
}

/* Tema Dark */
.dark .theme-content {
    background-color: #111827;
    color: #f9fafb;
}

.dark .theme-content .border-theme {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .theme-content .bg-theme-card {
    background-color: rgba(255, 255, 255, 0.02);
}

.dark .theme-content .text-theme-secondary {
    color: #d1d5db;
}

.dark .theme-content .text-theme-muted {
    color: #6b7280;
}

/* Botão do tema */
.theme-button {
    background-color: #111827;
    color: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark .theme-button {
    background-color: #ffffff;
    color: #111827;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.05);
}

.theme-button:hover {
    background-color: #111827;
    color: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: none;
}

.dark .theme-button:hover {
    background-color: #ffffff;
    color: #111827;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.05);
    transform: none;
}

/* Link do tema */
.theme-link {
    color: #111827;
}

.dark .theme-link {
    color: #ffffff;
}

/* Highlight do tema */
.theme-highlight {
    color: #111827;
}

.dark .theme-highlight {
    color: #ffffff;
}
:root {
    --header-bg: #ffffff;
    --header-border: #e5e7eb;
    --nav-text: #0d1a26;
    --nav-hover-bg: rgba(255, 107, 53, 0.1);
    --nav-hover-color: #ff6b35;
    --nav-active-bg: #ff6b35;
    --nav-active-color: white;
    --separator-bg: #ff6b35;
    --user-menu-bg: white;
    --user-menu-border: #e5e7eb;
    --user-menu-shadow: rgba(0, 0, 0, 0.1);
    --user-menu-item-color: #0d1a26;
    --user-menu-item-hover: #f9fafb;
    --user-menu-divider: #f3f4f6;
    --user-menu-logout: #dc2626;
    --user-menu-logout-hover: #fef2f2;
    --user-menu-secondary: #6b7280;
    /* Variáveis de tema para cards */
    --card-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --accent-shadow: rgba(255, 107, 53, 0.2);
}

.dark {
    --header-bg: #1f2937;
    --header-border: #374151;
    --nav-text: #f9fafb;
    --nav-hover-bg: rgba(255, 107, 53, 0.2);
    --nav-hover-color: #ff6b35;
    --nav-active-bg: #ff6b35;
    --nav-active-color: white;
    --separator-bg: #ff6b35;
    --user-menu-bg: #1f2937;
    --user-menu-border: #374151;
    --user-menu-shadow: rgba(0, 0, 0, 0.3);
    --user-menu-item-color: #f9fafb;
    --user-menu-item-hover: #374151;
    --user-menu-divider: #374151;
    --user-menu-logout: #f87171;
    --user-menu-logout-hover: #451a1a;
    --user-menu-secondary: #d1d5db;
    /* Variáveis de tema para cards no modo escuro */
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --accent-shadow: rgba(255, 107, 53, 0.3);
}

/* Header Desktop */
.desktop-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-container {
    max-width: 100%;
    height: 98px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo no header */
.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo img {
    display: block;
    width: 46px;
    height: 46px;
}

.header-logo img {
    transition: transform 0.3s ease;
}

.header-logo:hover img {
    transform: scale(1.05);
}

/* Navegação */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

/* Separador visual */
.header-separator {
    width: 1px;
    height: 30px;
    background: var(--separator-bg);
    margin: 0 0.5rem;
}

/* Itens do header (navegação e ações) */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    min-width: 70px;
}

.nav-item:hover {
    color: var(--nav-hover-color);
}

.nav-item.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-color);
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.125rem;
}


/* Saldo da carteira */
.wallet-balance {
    background: transparent;
    color: #ff6b35 !important;
    font-weight: 600;
    flex-direction: row;
    gap: 0.25rem;
}

.wallet-balance i {
    margin-bottom: 0;
}

.wallet-balance:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35 !important;
}

.balance-text {
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Garante que o texto do saldo sempre apareça, mesmo em telas menores */
@media (max-width: 1024px) {
    .wallet-balance .balance-text {
        display: inline !important;
    }
}

/* Avatar do usuário */

/* Avatar do usuário */
.user-avatar-item {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.user-avatar-item:hover {
    background: transparent;
}

.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-avatar-item:hover .user-avatar-img {
    border-color: rgba(255, 255, 255, 0.2);
    transform: none;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-avatar-item:hover .user-avatar-placeholder {
    border-color: rgba(255, 255, 255, 0.2);
    transform: none;
}

/* Menu dropdown do usuário */
.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: var(--user-menu-bg);
    border: 1px solid var(--user-menu-border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px var(--user-menu-shadow);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    padding: 1rem;
    border-bottom: 1px solid var(--user-menu-divider);
}

.user-menu-name {
    font-weight: 600;
    color: var(--user-menu-item-color);
    font-size: 0.875rem;
}

.user-menu-type {
    color: var(--user-menu-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.user-menu-divider {
    height: 1px;
    background: var(--user-menu-divider);
    margin: 0.5rem 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--user-menu-item-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.user-menu-item:hover {
    background: var(--user-menu-item-hover);
}

.user-menu-item.logout {
    color: var(--user-menu-logout);
}

.user-menu-item.logout:hover {
    background: var(--user-menu-logout-hover);
}

.user-menu-item i {
    width: 16px;
    text-align: center;
}

/* Subheader */
.subheader-nav {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 98px;
    z-index: 29;
}

.subheader-container {
    max-width: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.subheader-left,
.subheader-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subheader-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    min-width: 70px;
}

.subheader-item:hover {
    color: var(--nav-hover-color);
}

.subheader-item.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-color);
}

.subheader-item i {
    font-size: 1.25rem;
    margin-bottom: 0.125rem;
}

/* Conteúdo principal */
.desktop-content {
    flex: 1; /* Ocupa todo o espaço disponível */
    display: flex;
    flex-direction: column;
    width: 100%; /* Largura total */
    overflow-y: auto; /* Permite scroll se necessário */
    padding-top: 98px; /* Espaço para o header */
}

/* Responsividade */
@media (max-width: 1024px) {
    .header-container {
        padding: 0.75rem 1.5rem;
    }

    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .nav-item span {
        display: none;
    }

    .nav-item i {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .desktop-header {
        display: none;
    }

    .desktop-content {
        padding-top: 0;
    }
}

@media (max-width: 1024px) {
    .desktop-header {
        display: block;
    }

    .header-container {
        height: 70px;
        padding: 0 1rem;
    }

    .header-logo img {
        width: 36px;
        height: 36px;
    }

    .header-nav {
        gap: 0.125rem;
        overflow-x: auto;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .header-nav::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .nav-item {
        flex-direction: row;
        justify-content: center;
        padding: 0.375rem;
        min-width: 40px;
        height: 40px;
        font-size: 0;
    }

    .nav-item span {
        display: none;
    }

    .nav-item i {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .header-separator {
        height: 24px;
        margin: 0 0.25rem;
    }

    .subheader-nav {
        top: 70px;
    }

    .subheader-container {
        padding: 0 1rem;
    }

    .subheader-item {
        flex-direction: row;
        justify-content: center;
        padding: 0.375rem;
        min-width: 40px;
        height: 40px;
        font-size: 0;
    }

    .subheader-item span {
        display: none;
    }

    .subheader-item i {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .desktop-content {
        padding-top: 70px;
    }
}

@media (min-width: 1025px) {
    .subheader-item i {
        display: none;
    }

    .subheader-item span {
        display: block !important;
    }

    .subheader-item {
        padding: 0.75rem 1.5rem;
        min-width: 80px;
    }
}

/* Utility classes */
.hidden {
    display: none;
}

/* Error page background */
.error-bg {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.dark .error-bg {
    background: linear-gradient(135deg, #1f2937, #374151);
}