/* ==========================================
   FinanceFlow - SaaS de Conciliação Bancária
   Estilos Globais
   ========================================== */

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

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --gray-text: #666;
    --border-color: #dee2e6;
    --sidebar-width: 260px;
}

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

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.2);
    border-left-color: white;
    font-weight: 600;
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    display: inline-block;
}

/* ==========================================
   CONTEÚDO PRINCIPAL
   ========================================== */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--dark-text);
}

.page-header p {
    color: var(--gray-text);
    font-size: 16px;
}

/* ==========================================
   CARDS
   ========================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    font-size: 14px;
    color: var(--gray-text);
    text-transform: uppercase;
    font-weight: 600;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-body {
    margin-top: 15px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-text);
}

.card-trend {
    font-size: 14px;
    margin-top: 8px;
}

.card.positive .card-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.card.negative .card-icon {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.card.info .card-icon {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

/* ==========================================
   BOTÕES
   ========================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-outline {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ==========================================
   TABELAS
   ========================================== */

.table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-controls {
    padding: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--light-bg);
}

.valor-positivo {
    color: var(--success-color);
    font-weight: 600;
}

.valor-negativo {
    color: var(--danger-color);
    font-weight: 600;
}

/* ==========================================
   UPLOAD AREA
   ========================================== */

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: white;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.upload-area i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-area h3 {
    margin-bottom: 10px;
    color: var(--dark-text);
}

.upload-area p {
    color: var(--gray-text);
    font-size: 14px;
}

/* ==========================================
   FORMULÁRIOS
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

select.form-control {
    cursor: pointer;
}

/* ==========================================
   ALERTAS E NOTIFICAÇÕES
   ========================================== */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning-color);
    color: #856404;
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-left: 4px solid var(--info-color);
    color: var(--info-color);
}

/* ==========================================
   GRÁFICOS
   ========================================== */

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: var(--dark-text);
}

/* ==========================================
   BADGES
   ========================================== */

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: #856404;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
}

/* ==========================================
   UTILITÁRIOS
   ========================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
