/* Custom CSS - Sistema Financeiro */

:root {
    /* Cores Principais */
    --primary-dark: #2C3E50;      /* Sidebar/Header - Azul petróleo escuro */
    --primary-blue: #4A90A4;      /* Botões azuis/Links */
    --primary-red: #E74C3C;       /* Botões primários/Ações/Totais */
    --success-green: #2ECC71;     /* Saldos positivos/Sucesso */
    --warning-orange: #F39C12;    /* Alertas/Atenção */
    
    /* Backgrounds */
    --bg-light: #F5F7F9;          /* Fundo principal */
    --bg-white: #FFFFFF;          /* Cards/Containers */
    --bg-sidebar: #2C3E50;        /* Navegação lateral */
    
    /* Textos */
    --text-dark: #34495E;         /* Títulos/Textos principais */
    --text-light: #ECF0F1;        /* Textos no sidebar */
    --text-muted: #7F8C8D;        /* Textos secundários */
    
    /* Bordas */
    --border-light: #BDC3C7;      /* Bordas sutis */
    --border-medium: #95A5A6;     /* Bordas mais visíveis */
    --border-color: #dee2e6;      /* Borda padrão do Bootstrap */
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #34495e 100%);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
    color: white;
    font-weight: 600;
}

.sidebar .nav-link {
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8) !important;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
    border-left-color: var(--primary-blue);
}

.sidebar .nav-link i {
    width: 18px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.main-header {
    height: var(--header-height);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-wrapper {
    min-height: calc(100vh - var(--header-height));
}

.main-area {
    background: white;
    min-height: calc(100vh - var(--header-height));
}

/* Right Sidebar (Dashboard) */
.right-sidebar {
    background-color: #f8f9fa;
    min-height: calc(100vh - var(--header-height));
    font-size: 0.85rem;
}

.month-selector {
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.financial-summary {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-item {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-item {
    font-size: 0.8rem;
    padding: 5px 0;
}

.category-item strong {
    font-weight: 600;
    color: #495057;
}

/* Transaction Table Styling */
.transaction-table {
    font-size: 0.9rem;
}

.transaction-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
}

.transaction-table th {
    font-weight: 600;
    color: #495057;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
}

.transaction-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.transaction-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Status Icons */
.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
}

.status-pending {
    background-color: #ffc107;
}

.status-confirmed {
    background-color: #28a745;
}

.status-cancelled {
    background-color: #dc3545;
}

/* Tabs Styling (similar to reference) */
.nav-tabs-custom {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.nav-tabs-custom .nav-link:hover {
    border-color: transparent;
    background-color: #f8f9fa;
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background-color: transparent;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:hover {
    background-color: #1a252f;
    border-color: #1a252f;
}

.btn-add-transaction {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    font-weight: 500;
    padding: 8px 16px;
}

.btn-add-transaction:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    color: white;
}

.btn-success {
    background-color: var(--success-green);
    border-color: var(--success-green);
}

.btn-warning {
    background-color: var(--warning-orange);
    border-color: var(--warning-orange);
}

/* Cards and Panels */
.card-custom {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-custom .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: #495057;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 164, 0.25);
}

.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 164, 0.25);
}

/* Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper .col-md-4 {
        order: -1;
    }
}

/* Utilities */
.text-income {
    color: #28a745 !important;
}

.text-expense {
    color: #dc3545 !important;
}

.bg-income {
    background-color: #d4edda !important;
}

.bg-expense {
    background-color: #f8d7da !important;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Import OFX Button */
#import-ofx-btn {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #5ba4b8 100%);
    border: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#import-ofx-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 164, 0.3);
}

/* Loading States */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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