/* ============================================================
   SISTEMA FINANCEIRO - ESTILO PRINCIPAL
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #2d3139;
    --sidebar-active: #0d6efd;
    --topbar-height: 56px;
    --body-bg: #f0f2f5;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header i {
    font-size: 1.6rem;
    color: var(--sidebar-active);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #a0a4ad;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(13,110,253,0.12);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-section-title {
    padding: 16px 20px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #5a5f6b;
    margin-top: 4px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e6ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.content-wrapper {
    padding: 24px;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s;
}

.card:hover {
    transform: translateY(-1px);
}

.stat-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 2.5rem;
    opacity: 0.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 4px;
}

.stat-card .stat-sub {
    font-size: 0.78rem;
    margin-top: 6px;
    opacity: 0.85;
}

.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, #f7971e 0%, #ffd200 100%); }
.bg-gradient-info    { background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%); }
.bg-gradient-dark    { background: linear-gradient(135deg, #434343 0%, #000000 100%); }

/* ============================================================
   TABLE
   ============================================================ */

.table-custom {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table-custom table {
    margin: 0;
}

.table-custom thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 700;
    padding: 12px 16px;
}

.table-custom tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.table-custom tbody tr:hover {
    background: #f8f9ff;
}

/* ============================================================
   FILTERS
   ============================================================ */

.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.12);
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 6px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-content {
    border: none;
    border-radius: 16px;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 12px 24px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

/* ============================================================
   TIPO BADGE
   ============================================================ */

.tipo-entrada {
    color: #0f5132;
    background-color: #d1e7dd;
}

.tipo-saida {
    color: #842029;
    background-color: #f8d7da;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

/* ============================================================
   COLOR SWATCH
   ============================================================ */

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .content-wrapper {
        padding: 16px;
    }
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
}

/* ============================================================
   SELECT2 OVERRIDE
   ============================================================ */

.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px !important;
    border: 1.5px solid #dee2e6 !important;
    min-height: 38px !important;
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    .sidebar, .topbar, .btn, .filter-bar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrapper { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
