/* YourBox Finance - Simple Version */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #f8f9fa;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: #2c3e50;
    color: #fff;
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Scroll vertical no sidebar */
}

.sidebar.collapsed {
    margin-left: -260px;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar-header i {
    color: #ffffff;
    margin-right: 8px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.sidebar .nav {
    padding: 20px 0;
    flex: 1;
}

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

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(52, 152, 219, 0.1);
    border-left-color: #3498db;
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(52, 152, 219, 0.2);
    border-left-color: #3498db;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

.sidebar .badge {
    float: right;
    margin-top: 2px;
    background-color: #dc3545 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    max-height: 100vh; /* Limitar altura */
    overflow-y: auto; /* Scroll vertical */
    transition: all 0.3s;
}

.main-content.expanded {
    margin-left: 0;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-header {
    background: #fff;
    border-bottom: 2px solid #f0f0f0;
    padding: 15px 20px;
    font-weight: 600;
}

.card-header.bg-primary {
    background: #3498db !important;
    color: #fff;
    border: none;
}

.card-header.bg-success {
    background: #27ae60 !important;
    color: #fff;
    border: none;
}

.card-header.bg-warning {
    background: #f39c12 !important;
    color: #fff;
    border: none;
}

.card-header.bg-danger {
    background: #e74c3c !important;
    color: #fff;
    border: none;
}

/* Stat Boxes */
.stat-box {
    padding: 20px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.stat-box h6 {
    font-size: 12px;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-box .value {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.stat-box .value.positive {
    color: #27ae60;
}

.stat-box .value.negative {
    color: #e74c3c;
}

.stat-box .change {
    font-size: 12px;
    margin-top: 5px;
}

/* Tables */
.table {
    font-size: 13px;
}

.table thead th {
    border-top: none;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    color: #6c757d;
}

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

/* Badges */
.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 5px 10px;
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed #dee2e6;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #3498db;
    background: #e3f2fd;
}

.upload-zone i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 20px;
}

.upload-zone.dragover i {
    color: #3498db;
}

.upload-zone h4 {
    margin-bottom: 10px;
}

.upload-zone p {
    color: #6c757d;
    margin-bottom: 0;
}

/* File List */
.file-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-item .file-icon {
    font-size: 24px;
    margin-right: 15px;
}

.file-item .file-info {
    flex: 1;
}

.file-item .file-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.file-item .file-meta {
    font-size: 12px;
    color: #6c757d;
}

.file-item .file-status {
    margin-left: 15px;
}

/* Alert Cards */
.alert-card {
    border-left: 4px solid;
}

.alert-card.alert-critical {
    border-left-color: #e74c3c;
}

.alert-card.alert-high {
    border-left-color: #f39c12;
}

.alert-card.alert-medium {
    border-left-color: #3498db;
}

.alert-card.alert-low {
    border-left-color: #95a5a6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #6c757d;
    margin-bottom: 10px;
}

.empty-state p {
    color: #adb5bd;
}

/* Action Buttons */
.btn-action {
    padding: 15px;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-action i {
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
}

/* Transaction Row Colors */
.transaction-income {
    border-left: 3px solid #27ae60;
}

.transaction-expense {
    border-left: 3px solid #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
    }
    
    .sidebar.show {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stat-box .value {
        font-size: 24px;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Loading Spinner */
.spinner-border-lg {
    width: 3rem;
    height: 3rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Utility Classes */
.text-positive {
    color: #27ae60 !important;
}

.text-negative {
    color: #e74c3c !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* EdiÃ§Ã£o de TransaÃ§Ãµes */
.clickable-row:hover {
    background-color: rgba(0, 123, 255, 0.05);
    cursor: pointer;
}

.checkbox-column {
    width: 40px;
    text-align: center;
}

.transaction-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Sticky header na tabela de batch */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

/* Alert de ediÃ§Ã£o */
.alert-warning {
    border-left: 4px solid #ffc107;
}

.alert-info {
    border-left: 4px solid #17a2b8;
}

/* Form labels mais destacados */
.form-label.fw-bold {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* Cards de ediÃ§Ã£o */
.card-header.bg-primary h4 {
    margin: 0;
}

/* BotÃµes de aÃ§Ã£o */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Tabela de batch */
.table-sm td {
    padding: 0.5rem;
    vertical-align: middle;
}

/* Ãcone de editado */
.fa-pencil-alt {
    font-size: 0.8rem;
}

/* ========== SCROLL E RESPONSIVIDADE ========== */

/* Wrapper com scroll horizontal para tabelas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll no iOS */
}

/* Scroll personalizado (Webkit browsers - Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Scroll para o sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Container de tabelas com altura máxima e scroll */
.table-container {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.table-container .table {
    margin-bottom: 0;
}

/* Fixar header das tabelas durante scroll */
.table-container thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* ========== MOBILE RESPONSIVENESS ========== */

@media (max-width: 768px) {
    /* Sidebar mobile - esconder por padrão */
    .sidebar {
        margin-left: -260px;
    }
    
    /* Sidebar aberto - overlay */
    .sidebar.show {
        margin-left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Main content ocupa tudo */
    .main-content {
        margin-left: 0;
    }
    
    /* Overlay escuro quando menu aberto */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Cards mais compactos */
    .stats-card {
        margin-bottom: 15px;
    }
    
    /* Tabelas scroll horizontal */
    .table {
        font-size: 12px;
    }
    
    /* Botões menores */
    .btn-sm {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Filtros em coluna */
    .filter-row {
        flex-direction: column;
    }
    
    .filter-row > div {
        width: 100% !important;
        margin-bottom: 10px;
    }
}


/* ========== LOADING OVERLAY ========== */

.app-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.app-loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.app-loading-content {
    text-align: center;
    color: white;
}

.app-loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.app-loading-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.app-loading-content p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 30px 0;
}

.app-loading-progress {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.app-loading-progress-bar {
    height: 100%;
    background: white;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.app-loading-tips {
    margin-top: 40px;
    font-size: 14px;
    opacity: 0.8;
    font-style: italic;
}

/* Animação de pulse para dicas */
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.app-loading-tips {
    animation: pulse 2s ease-in-out infinite;
}

/* Mobile */
@media (max-width: 768px) {
    .app-loading-content h2 {
        font-size: 24px;
    }
    
    .app-loading-progress {
        width: 80%;
    }
    
    .app-loading-spinner {
        width: 60px;
        height: 60px;
    }
}

/* Badges com texto branco */
.badge {
    color: #ffffff !important;
}