/* Variáveis de Cores - Paleta Clean e Moderna */
:root {
    /* Cores Base */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-elevated: #2d2d2d;
    --bg-hover: #353535;
    
    /* Cores de Texto */
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-tertiary: #b3b3b3;
    --text-muted: #808080;
    
    /* Cores de Acento */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-hover: #4f46e5;
    
    /* Cores de Borda */
    --border-primary: #2d2d2d;
    --border-secondary: #3a3a3a;
    --border-focus: rgba(99, 102, 241, 0.4);
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
}

/* Reset e Base */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar */
.sidebar {
    min-height: 100vh;
    background: var(--bg-secondary);
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    z-index: 1000;
    border-right: 1px solid var(--border-primary);
    overflow: hidden;
}

.sidebar-content {
    width: 100%;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
}

.project-switcher {
    width: 100%;
    display: flex;
    justify-content: center;
}

.project-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    transition: all var(--transition-base);
}

.project-full-btn {
    display: none;
}

.project-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link {
    color: var(--text-tertiary);
    padding: 12px;
    border-radius: 10px;
    margin: 4px 0;
    transition: all var(--transition-base);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sidebar .nav-link i {
    font-size: 18px;
}

.sidebar .nav-link .nav-text {
    display: none;
}

.sidebar .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.sidebar .nav-link.active {
    color: var(--text-primary);
    background: var(--accent-gradient);
    box-shadow: var(--shadow-sm);
}

/* Main Content */
.main-content {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    min-height: 100vh;
    margin-left: 80px;
    padding: 0;
    overflow-y: auto;
    height: 100vh;
    transition: margin-left var(--transition-base);
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-body {
    color: var(--text-secondary);
    padding: 1.5rem;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    max-height: calc(80vh - 200px);
    height: auto;
    overflow-y: auto;
    border: 1px solid var(--border-primary);
    margin-bottom: 20px;
}


.table {
    color: var(--text-secondary);
    background-color: var(--bg-elevated);
    margin-bottom: 0;
}

.table thead {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    background-color: var(--bg-elevated);
    border-color: var(--border-primary);
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table td, .table th {
    border-color: var(--border-primary);
    padding: 1rem;
    vertical-align: middle;
}

/* Forms */
.form-control, .form-select {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all var(--transition-base);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--border-focus);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Modals */
.modal-content {
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-primary);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-primary);
    padding: 1.5rem;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.close, .btn-close {
    filter: invert(1);
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.close:hover, .btn-close:hover {
    opacity: 1;
}

/* Alerts */
.alert {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

/* Badges */
.badge {
    border: 1px solid var(--border-primary);
    padding: 0.4em 0.8em;
    border-radius: 8px;
    font-weight: 500;
}

/* Dropdowns */
.dropdown-menu {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* List Groups */
.list-group-item {
    background-color: var(--bg-elevated);
    border-color: var(--border-primary);
    color: var(--text-secondary);
    padding: 1rem;
    transition: all var(--transition-fast);
}

.list-group-item:hover {
    background-color: var(--bg-hover);
}

/* Buttons */
.btn-primary {
    background: var(--accent-gradient);
    border: none;
    border-radius: 10px;
    padding: 0.625rem 1.5rem;
    font-weight: 500;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--accent-hover) 0%, #7c3aed 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Stats Cards */
.stats-card {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

/* Login */
.login-container {
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-gradient);
    opacity: 0.05;
    z-index: 0;
}

.login-card {
    background: var(--bg-elevated);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    position: relative;
    z-index: 1;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

/* Modal XL */
.modal-xl {
    max-width: 90%;
}

/* QR Code Container */
.qr-code-container {
    text-align: center;
    padding: 2rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

/* Status Badge */
.status-badge {
    font-size: 0.75rem;
    padding: 0.35em 0.75em;
    border-radius: 8px;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
}

/* Filter Section */
.filter-section {
    background: var(--bg-elevated);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-primary);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        border-right: none;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.show .sidebar-logo {
        width: 60px;
        height: 60px;
    }
    
    .sidebar.show .project-icon-btn {
        display: none;
    }
    
    .sidebar.show .project-full-btn {
        display: flex;
    }
    
    .sidebar.show .nav-link {
        justify-content: flex-start;
        padding: 12px 20px;
    }
    
    .sidebar.show .nav-link .nav-text {
        display: inline;
        margin-left: 12px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: var(--accent-gradient);
        color: var(--text-primary);
        border: none;
        padding: 12px;
        border-radius: 10px;
        cursor: pointer;
        box-shadow: var(--shadow-md);
        transition: all var(--transition-base);
    }
    
    .sidebar-toggle:hover {
        transform: scale(1.05);
        box-shadow: var(--shadow-lg);
    }
}

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }
}

/* Estilos para o Modal de Seleção de Projeto */
.project-selection-modal {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
}

.project-selection-header {
    background: var(--accent-gradient);
    border: none;
    padding: 2rem;
    color: var(--text-primary);
}

.project-selection-header .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

.project-selection-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-selection-body {
    padding: 2rem;
    background: var(--bg-elevated);
    max-height: 70vh;
    overflow-y: auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.project-card {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all var(--transition-base);
    overflow: hidden;
    border: 2px solid var(--border-primary);
    min-height: 150px;
}

.project-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.project-card-selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--border-focus);
    background: var(--bg-elevated);
}

.project-card-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0.9;
}

.project-card-content {
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.project-card-info {
    flex: 1;
}

.project-card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.project-card-description {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

.project-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-gradient);
    color: var(--text-primary);
    padding: 0.4rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card-badge i {
    font-size: 0.7rem;
}

.project-card-arrow {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    transition: all var(--transition-base);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.project-card:hover .project-card-arrow {
    background: rgba(99, 102, 241, 0.25);
    transform: translateX(4px);
    border-color: var(--accent-primary);
}

.project-empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--accent-primary);
    border: 2px solid rgba(99, 102, 241, 0.2);
}

.project-empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Scrollbar personalizada para o modal */
.project-selection-body::-webkit-scrollbar {
    width: 8px;
}

.project-selection-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.project-selection-body::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.project-selection-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Responsividade para o modal de projetos */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .project-selection-body {
        padding: 1.5rem;
    }
    
    .project-selection-header {
        padding: 1.5rem;
    }
    
    .project-card {
        min-height: 130px;
    }
    
    .project-card-content {
        padding: 1.25rem;
    }
}

/* Sistema de Modais Personalizados */
.custom-modal {
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.custom-modal .modal-header {
    background: var(--accent-gradient);
    color: var(--text-primary);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
}

.custom-modal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.custom-modal .modal-body {
    padding: 2rem;
    color: var(--text-secondary);
}

.custom-modal .modal-footer {
    border-top: 1px solid var(--border-primary);
    padding: 1.5rem;
}

/* Sistema de Notificações Discretas */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(400px);
    transition: all var(--transition-base);
    pointer-events: auto;
    overflow: hidden;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.notification-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Cores por tipo de notificação */
.notification-success {
    border-left: 4px solid #10b981;
}

.notification-success .notification-icon {
    color: #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-error .notification-icon {
    color: #ef4444;
}

.notification-warning {
    border-left: 4px solid #f59e0b;
}

.notification-warning .notification-icon {
    color: #f59e0b;
}

.notification-info {
    border-left: 4px solid var(--accent-primary);
}

.notification-info .notification-icon {
    color: var(--accent-primary);
}

/* Responsividade para notificações */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* Detalhamento do Cálculo de Lucros */
#profitCalculationDetails {
    font-family: 'Courier New', Consolas, monospace;
    line-height: 1.8;
}

#profitCalculationDetails .ps-3 {
    padding-left: 1.5rem !important;
}

#profitCalculationDetails small {
    font-size: 0.8rem;
}

/* Estilos para Abas de Despesas */
#expensesTabs .nav-link {
    color: var(--text-tertiary);
    background-color: transparent;
    border: 1px solid var(--border-primary);
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#expensesTabs .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
    border-color: var(--border-secondary);
}

#expensesTabs .nav-link.active {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
    border-color: var(--border-secondary);
    border-bottom-color: var(--bg-elevated);
    font-weight: 600;
}

#expensesTabs .nav-link .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

#expensesTabContent {
    padding-top: 1rem;
}

#expensesTabContent .tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

#expensesTabContent .tab-pane.active {
    display: block;
}

#expensesTabContent .tab-pane.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustes para as tabelas dentro das abas */
#expensesTabContent .table-responsive {
    background-color: transparent;
}

#expensesTabContent .table {
    margin-bottom: 0;
}

/* Estilos para Abas da Fila de Processamento */
#queueTabContent .tab-pane {
    display: none;
}

#queueTabContent .tab-pane.active {
    display: block;
}

#queueTabContent .tab-pane.show {
    display: block;
}

