:root {
            /* Paleta EvaCloudd profissional*/
            --primary-blue: #1565C0; /* Azul principal EvaCloudd */
            --secondary-blue: #42A5F5; /* Azul claro */
            --accent-blue: #2196F3; /* Azul accent */
            --accent-green: #4CAF50; /* Verde sucesso */
            --accent-red: #F44336; /* Vermelho despesa */
            --bg-light: #F5F7FA;
            --bg-white: #FFFFFF;
            --text-dark: #263238;
            --text-medium: #546E7A;
            --text-light: #90A4AE;
            --text-white: #FFFFFF;
            --gray-border: #E0E7ED;
            --shadow-sm: 0 2px 8px rgba(21, 101, 192, 0.08);
            --shadow-md: 0 4px 16px rgba(21, 101, 192, 0.12);
            --shadow-lg: 0 8px 32px rgba(21, 101, 192, 0.16);
            --gradient-primary: linear-gradient(135deg, #1565C0 0%, #1976D2 100%);
            --gradient-secondary: linear-gradient(135deg, #42A5F5 0%, #64B5F6 100%);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', sans-serif;
        }

        body {
            background: linear-gradient(135deg, #F5F7FA 0%, #E8ECF1 100%);
            background-attachment: fixed;
            color: var(--text-dark);
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }

        /* Ondas azuis no fundo (Estilo EvaCloudd) */
        body::before, body::after {
            content: '';
            position: fixed;
            border-radius: 50%;
            z-index: -1;
            animation: float 20s ease-in-out infinite;
        }

        /* Onda Esquerda */
        body::before {
            width: 700px;
            height: 700px;
            background: linear-gradient(135deg, rgba(66, 165, 245, 0.25) 0%, rgba(144, 202, 249, 0.15) 100%);
            top: -150px;
            left: -250px;
            animation-delay: 0s;
        }

        /* Onda Direita */
        body::after {
            width: 900px;
            height: 900px;
            background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(100, 181, 246, 0.12) 100%);
            bottom: -250px;
            right: -350px;
            animation-delay: -10s;
        }

        @keyframes float {
            0%, 100% {
                transform: translate(0, 0) scale(1);
            }
            50% {
                transform: translate(30px, -30px) scale(1.05);
            }
        }

        /* Header */
        header {
            background: var(--gradient-primary);
            color: white;
            padding: 2rem 5%;
            border-bottom-left-radius: 40px;
            border-bottom-right-radius: 40px;
            box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px 30px;
            position: relative;
            overflow: hidden;
        }

.header-bg-image {
    position: absolute;
    inset: 0;
    background: url("https://i.pinimg.com/736x/10/43/3c/10433c98906331e048c4a9d7cff10e3a.jpg") center/cover no-repeat;
    opacity: 0.22;
    filter: saturate(1.05) brightness(0.9);
    pointer-events: none;
    z-index: 0;
}

        .header-left {
            display: flex;
    flex-direction: column;
    gap: 15px;
            flex: 1;
        }

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 160px;
}

.brand-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
    min-width: 180px;
}

.header-illustration {
    display: flex;
    justify-content: center;
    width: 600px;
    min-height: 160px;
}

.header-illustration .brand-logo {
    display: none;
}

        .month-nav {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-end;
        }

        header::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            border-radius: 50%;
        }

        .header-title h1 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            letter-spacing: -0.5px;
            position: relative;
            z-index: 1;
        }
        
        .header-title p {
            font-size: 0.95rem;
            opacity: 0.95;
            font-weight: 400;
            position: relative;
            z-index: 1;
        }

        .stats-card {
            display: flex;
            flex-direction: row;
            gap: 10px;
            position: relative;
            z-index: 1;
            align-items: center;
            flex-wrap: wrap;
        }

        .stat-item {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            padding: 8px 14px;
            min-width: 100px;
            text-align: center;
            transition: all 0.3s ease;
            flex: 0 1 auto;
        }

        .stat-item:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .stat-item .stat-label {
            display: block;
            font-size: 0.65rem;
            opacity: 0.9;
            margin-bottom: 4px;
            font-weight: 500;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .stat-item .stat-value {
            font-size: 1.1rem;
            font-weight: 700;
            margin: 0;
            text-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .stat-item.receita .stat-value {
            color: #C8E6C9;
        }

        .stat-item.despesa .stat-value {
            color: #FFCDD2;
        }

        .stat-item.saldo .stat-value {
            color: #FFFFFF;
        }

        /* Container Principal */
        .container {
            max-width: 1200px;
    margin: 40px auto; /* Centralizado sem deslocar as seções */
            padding: 0 20px;
            display: grid;
            grid-template-columns: 1fr 1.5fr;
            gap: 25px;
        }

        /* Cards Gerais */
        .card {
            background: var(--bg-white);
            border-radius: 24px;
            padding: 32px;
            box-shadow: var(--shadow-md);
            border: 1px solid var(--gray-border);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: visible;
            box-sizing: border-box;
            min-width: 0;
        }

        .card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: var(--gradient-primary);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.3s ease;
        }

        .card:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }

        .card:hover::before {
            transform: scaleX(1);
        }

        /* Formulário */
        .form-group {
            margin-bottom: 15px;
        }

        .row {
            display: flex;
            gap: 10px;
        }

        .row .form-group {
            flex: 1;
        }

        input, select, textarea {
            width: 100%;
            padding: 14px 18px;
            border: 2px solid var(--gray-border);
            border-radius: 12px;
            font-size: 0.95rem;
            outline: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: var(--bg-white);
            color: var(--text-dark);
            font-weight: 400;
        }

        input:focus, select:focus, textarea:focus {
            border-color: var(--accent-blue);
            background: var(--bg-white);
            box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
            transform: translateY(-1px);
        }

        input::placeholder, textarea::placeholder {
            color: var(--text-light);
            font-weight: 400;
        }

        /* Botões */
        .btn-group {
            display: flex;
            gap: 10px;
            margin-top: 10px;
            flex-wrap: wrap;
        }

        button {
            padding: 14px 24px;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.95rem;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            flex: 1;
            position: relative;
            overflow: hidden;
            letter-spacing: 0.3px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        button::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        button:hover::before {
            width: 300px;
            height: 300px;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(0,0,0,0.2);
        }

        button:active {
            transform: scale(0.97) translateY(0);
            box-shadow: 0 1px 4px rgba(0,0,0,0.15);
        }

        .btn-add {
            background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
            color: white;
            flex: 2;
            box-shadow: 0 4px 16px rgba(76, 175, 80, 0.35);
            font-weight: 700;
            letter-spacing: 0.5px;
        }

        .btn-add:hover {
            box-shadow: 0 8px 24px rgba(76, 175, 80, 0.45);
            transform: translateY(-3px);
            background: linear-gradient(135deg, #45A049 0%, #5CB85C 100%);
        }
        
        .btn-clear {
            background-color: var(--bg-white);
            color: var(--text-medium);
            border: 2px solid var(--gray-border);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

        .btn-clear:hover {
            background-color: #F5F7FA;
            border-color: var(--text-medium);
            color: var(--text-dark);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        }

        .btn-export {
            background: linear-gradient(135deg, #FFFFFF 0%, #F5F7FA 100%);
            color: var(--primary-blue);
            border: 2px solid var(--primary-blue);
            box-shadow: 0 2px 8px rgba(21, 101, 192, 0.15);
        }

        .btn-export:hover {
            background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
            color: white;
            border-color: var(--primary-blue);
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(21, 101, 192, 0.35);
        }

        .btn-pdf {
            background: var(--gradient-primary);
            color: white;
            box-shadow: 0 4px 16px rgba(21, 101, 192, 0.35);
            font-weight: 600;
        }

        .btn-pdf:hover {
            box-shadow: 0 8px 24px rgba(21, 101, 192, 0.45);
            transform: translateY(-3px);
            background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%);
        }

        .relatorios-container button {
            flex: 0 1 auto;
            min-width: auto;
            font-size: 0.8rem;
            background: rgba(255,255,255,0.2);
            backdrop-filter: blur(15px);
            border: 2px solid rgba(255,255,255,0.3);
            color: white;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            padding: 6px 12px;
        }

        .relatorios-container button:hover {
            background: rgba(255,255,255,0.3);
            border-color: rgba(255,255,255,0.5);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        }

        .relatorios-container .btn-pdf {
            background: linear-gradient(135deg, rgba(21, 101, 192, 0.9) 0%, rgba(33, 150, 243, 0.9) 100%);
            backdrop-filter: blur(15px);
            color: white;
            font-size: 0.85rem;
            padding: 10px 16px;
            border: 2px solid rgba(255,255,255,0.3);
            box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
        }

        .relatorios-container .btn-pdf:hover {
            background: linear-gradient(135deg, rgba(21, 101, 192, 1) 0%, rgba(33, 150, 243, 1) 100%);
            box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
            transform: translateY(-3px);
        }

        #mesReferencia {
            color: white;
            font-weight: 600;
            text-shadow: 0 2px 4px rgba(0,0,0,0.2);
            letter-spacing: 0.5px;
            background: rgba(255,255,255,0.15) !important;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.2);
            transition: all 0.3s ease;
            font-size: 0.85rem;
        }

        #mesReferencia:hover {
            background: rgba(255,255,255,0.25) !important;
            transform: scale(1.02);
        }

        /* Lista de Transações Recentes (Mini Dashboard na esquerda) */
        .transaction-list {
            margin-top: 20px;
            max-height: 400px;
            overflow-y: auto;
            padding-right: 8px;
        }

        .transaction-list::-webkit-scrollbar {
            width: 6px;
        }

        .transaction-list::-webkit-scrollbar-track {
            background: var(--bg-light);
            border-radius: 10px;
        }

        .transaction-list::-webkit-scrollbar-thumb {
            background: var(--text-light);
            border-radius: 10px;
        }

        .transaction-list::-webkit-scrollbar-thumb:hover {
            background: var(--text-medium);
        }

        .transaction-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px;
            border-bottom: 1px solid var(--gray-border);
            animation: fadeIn 0.5s;
            transition: all 0.3s ease;
            border-radius: 12px;
            margin-bottom: 8px;
            background: var(--bg-white);
        }

        .transaction-item:hover {
            background: var(--bg-light);
            transform: translateX(4px);
            box-shadow: var(--shadow-sm);
        }

        .t-info h4 { 
            font-size: 1rem; 
            color: var(--text-dark);
            font-weight: 600;
            margin-bottom: 4px;
        }
        
        .t-info span { 
            font-size: 0.85rem; 
            color: var(--text-medium);
            font-weight: 400;
        }
        
        .t-value { 
            font-weight: 700;
            font-size: 1.05rem;
        }
        
        .income { 
            color: var(--accent-green);
        }
        
        .expense { 
            color: var(--accent-red);
        }

        .actions i {
            margin-left: 10px;
            cursor: pointer;
            color: var(--text-light);
            transition: all 0.3s ease;
            padding: 8px;
            border-radius: 8px;
        }
        
        .actions i:hover { 
            color: var(--accent-red);
            background: rgba(244, 67, 54, 0.1);
            transform: scale(1.1);
        }

        /* Área dos Gráficos (Direita) */
        .charts-area {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .chart-container {
            position: relative;
            height: 280px;
            width: 100%;
            background: var(--bg-white);
            border-radius: 16px;
            padding: 16px;
            box-shadow: var(--shadow-sm);
            overflow: visible;
            box-sizing: border-box;
        }

        .chart-container canvas {
            max-width: 100%;
            height: auto !important;
        }

        .chart-box h4 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--primary-blue);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chart-box h4::before {
            content: '';
            width: 4px;
            height: 20px;
            background: var(--gradient-primary);
            border-radius: 2px;
        }

        /* Tabela Resumo */
        .summary-table-container {
            margin-top: 32px;
            overflow-x: auto;
            border-radius: 16px;
            background: var(--bg-white);
            padding: 8px;
            box-shadow: var(--shadow-sm);
        }

        .summary-table-container h4 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--primary-blue);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 8px;
        }

        .summary-table-container h4::before {
            content: '';
            width: 4px;
            height: 20px;
            background: var(--gradient-primary);
            border-radius: 2px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            text-align: left;
            padding: 16px;
            color: var(--text-medium);
            font-size: 0.875rem;
            font-weight: 600;
            border-bottom: 2px solid var(--gray-border);
            background: var(--bg-light);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        td {
            padding: 16px;
            border-bottom: 1px solid var(--gray-border);
            font-size: 0.9rem;
            color: var(--text-dark);
        }

        tbody tr {
            transition: all 0.2s ease;
        }

        tbody tr:hover {
            background: var(--bg-light);
        }

        /* =============================== */
        /* RESPONSIVIDADE PARA TODAS AS TELAS */
        /* =============================== */

        /* Desktop Grande (acima de 1440px) */
        @media (min-width: 1441px) {
            .container {
                max-width: 1400px;
            }

            header {
                padding: 2.5rem 8%;
            }

            .card {
                padding: 40px;
            }

            .chart-container {
                height: 320px;
            }
        }

        /* Desktop Médio (1201px - 1440px) */
        @media (min-width: 1201px) and (max-width: 1440px) {
            .container {
                max-width: 1200px;
            }

            header {
                padding: 2rem 5%;
            }
        }

        /* Desktop Pequeno / Laptop (1025px - 1200px) */
        @media (min-width: 1025px) and (max-width: 1200px) {
            .container {
                max-width: 1100px;
                grid-template-columns: 1fr 1.4fr;
                gap: 20px;
            }

            .card {
                padding: 28px;
            }

            .chart-container {
                height: 260px;
            }

            #faturasTable {
                font-size: 0.85rem;
            }
            
            #faturasTable th,
            #faturasTable td {
                padding: 10px 8px;
            }
        }

        /* Tablet Grande (901px - 1024px) */
        @media (min-width: 901px) and (max-width: 1024px) {
            .container {
                grid-template-columns: 1fr 1.3fr;
                gap: 20px;
                padding: 0 20px;
            }

            header {
                padding: 1.8rem 4%;
                grid-template-columns: 1fr auto 1fr;
            }

            .card {
                padding: 24px;
            }

            .chart-container {
                height: 250px;
            }

            .charts-area {
                gap: 15px;
            }

            .stat-item {
                min-width: 130px;
                padding: 10px 12px;
            }

            .stat-item .stat-value {
                font-size: 1rem;
            }
        }

        /* Tablet / Desktop Pequeno (769px - 900px) */
        @media (min-width: 769px) and (max-width: 900px) {
            .container {
                grid-template-columns: 1fr;
                margin-top: 20px;
                gap: 20px;
            }

            .charts-area {
                grid-template-columns: 1fr 1fr;
                gap: 20px;
            }

            header {
                padding: 1.5rem 4%;
                grid-template-columns: 1fr auto 1fr;
            }

            .header-center {
                min-height: 140px;
            }

            .header-illustration {
                width: 400px;
            }

            .card {
                padding: 22px;
            }

            .chart-container {
                height: 240px;
            }

            body::before, body::after {
                opacity: 0.5;
            }
        }

        @keyframes fadeIn {
            from { 
                opacity: 0; 
                transform: translateY(10px); 
            }
            to { 
                opacity: 1; 
                transform: translateY(0); 
            }
        }

        footer {
            background: var(--bg-white);
            border-top: 1px solid var(--gray-border);
            margin-top: 60px;
            padding: 30px 20px;
        }

        footer p {
            color: var(--text-medium);
            font-size: 0.875rem;
            margin: 0;
        }

        /* Estilos para Faturas Parceladas */
        .full-col {
            width: 100%;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-dark);
            font-weight: 500;
            font-size: 0.9rem;
        }

        #faturasTable {
            width: 100%;
            border-collapse: collapse;
        }

        #faturasTable th {
            background: var(--bg-light);
            color: var(--text-medium);
            font-weight: 600;
            text-align: left;
            padding: 14px;
            font-size: 0.875rem;
            border-bottom: 2px solid var(--gray-border);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        #faturasTable td {
            padding: 14px;
            border-bottom: 1px solid var(--gray-border);
            font-size: 0.9rem;
        }

        #faturasTable tbody tr:hover {
            background: var(--bg-light);
        }

        /* Tablet e Mobile (até 768px) - Breakpoint principal mobile */

        /* =============================== */
        /* RESPONSIVIDADE MOBILE COMPLETA */
        /* =============================== */

        /* Tablet Pequeno (641px - 768px) */
        @media (min-width: 641px) and (max-width: 768px) {
            header {
                grid-template-columns: 1fr;
                padding: 1.5rem 4%;
            }

            .header-center {
                display: none;
            }

            .header-right {
                align-items: center;
            }

            .container {
                grid-template-columns: 1fr;
                padding: 0 20px;
            }

            .charts-area {
                grid-template-columns: 1fr;
            }

            .card {
                padding: 22px;
            }

            .stat-item {
                min-width: 140px;
            }

            .chart-container {
                height: 260px;
            }
        }

        /* Mobile Grande (481px - 640px) */
        @media (min-width: 481px) and (max-width: 640px) {
            header {
                grid-template-columns: 1fr;
                padding: 1.4rem 3%;
            }

            .header-center {
                display: none;
            }

            .stats-card {
                justify-content: center !important;
            }

            .stat-item {
                min-width: 130px !important;
                padding: 9px 14px !important;
            }

            .container {
                padding: 0 15px;
            }

            .card {
                padding: 20px;
            }

            .chart-container {
                height: 250px;
            }

            table {
                min-width: 650px;
            }
        }

        /* Tablet e Mobile (até 768px) */
        @media (max-width: 768px) {
            /* Header - Layout em coluna */
            header {
                grid-template-columns: 1fr;
                padding: 1.5rem 4%;
                gap: 20px;
            }

            .header-left {
                text-align: center;
                align-items: center;
                position: relative;
            }

            .dark-mode-toggle {
                position: absolute;
                top: 0;
                right: 0;
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }

            .header-center {
                display: none; /* Oculta ilustração no mobile */
            }

            .header-right {
                align-items: center;
                width: 100%;
            }

            .header-title h1 {
                font-size: 1.5rem;
            }

            .header-title p {
                font-size: 0.85rem;
            }

            /* Cards de Estatísticas */
            .stats-card {
                width: 100%;
                justify-content: center !important;
            }

            .stat-item {
                min-width: 120px !important;
                padding: 8px 12px !important;
            }

            .stat-item .stat-label {
                font-size: 0.6rem;
            }

            .stat-item .stat-value {
                font-size: 0.95rem;
            }

            /* Navegação de Mês */
            .relatorios-container.month-nav {
                width: 100%;
            }

            .relatorios-container.month-nav > div {
                width: 100%;
            }

            .relatorios-container.month-nav button {
                font-size: 0.75rem !important;
                padding: 6px 10px !important;
                flex: 1;
                min-width: 0;
            }

            #mesReferencia {
                min-width: 120px !important;
                font-size: 0.8rem !important;
                padding: 6px 10px !important;
            }

            /* Container Principal */
            .container {
                grid-template-columns: 1fr;
                padding: 0 15px;
                margin: 20px auto;
                gap: 20px;
                max-width: 100%;
                overflow-x: hidden;
            }

            /* Garantir que seções não cortem conteúdo */
            section {
                overflow: visible;
                min-width: 0;
            }

            .left-col, .right-col {
                overflow: visible;
                min-width: 0;
            }

            /* Cards */
            .card {
                padding: 20px;
                border-radius: 16px;
                overflow: visible;
                min-width: 0;
            }

            .right-col .card {
                overflow: visible;
            }

            /* Formulários */
            .row {
                flex-direction: column;
            }

            input, select, textarea {
                padding: 12px 15px;
                font-size: 0.9rem;
            }

            /* Botões */
            button {
                padding: 12px 18px;
                font-size: 0.85rem;
                white-space: nowrap;
                overflow: visible;
            }

            .btn-group {
                flex-direction: column;
                width: 100%;
                gap: 10px;
            }

            .btn-group button {
                width: 100%;
                min-width: 0;
            }

            .btn-add, .btn-clear, .btn-export, .btn-pdf {
                flex: 1;
                width: 100%;
            }

            /* Botões PDF na área de gráficos */
            .right-col .card > div:first-child {
                display: flex;
                flex-direction: column;
                gap: 8px;
                width: 100%;
                margin-bottom: 20px;
            }

            .right-col .card > div:first-child button {
                width: 100%;
                padding: 10px 15px;
            }

            /* Tabelas - Scroll Horizontal */
            .summary-table-container {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                margin-left: -20px;
                margin-right: -20px;
                padding-left: 20px;
                padding-right: 20px;
                width: calc(100% + 40px);
            }

            table {
                min-width: 600px;
                font-size: 0.8rem;
            }

            table th,
            table td {
                padding: 8px 6px;
                white-space: nowrap;
            }

            #faturasTable,
            #despesasRecorrentesTable {
                font-size: 0.75rem;
            }

            #faturasTable th,
            #faturasTable td,
            #despesasRecorrentesTable th,
            #despesasRecorrentesTable td {
                padding: 8px 4px;
            }

            /* Gráficos */
            .charts-area {
                grid-template-columns: 1fr;
                gap: 20px;
                width: 100%;
                overflow: visible;
            }

            .chart-box {
                padding: 15px;
                width: 100%;
                overflow: visible;
                min-width: 0;
            }

            .chart-container {
                height: 280px;
                width: 100%;
                min-height: 250px;
                overflow: visible;
                padding: 10px;
                box-sizing: border-box;
            }

            .chart-container canvas {
                max-width: 100% !important;
                height: auto !important;
            }

            /* Lista de Transações */
            .transaction-list {
                max-height: 300px;
            }

            .transaction-item {
                padding: 12px;
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }

            .transaction-item .t-info {
                width: 100%;
            }

            /* Seções Full Width */
            .full-col {
                margin-top: 20px;
            }

            /* Footer */
            footer {
                padding: 20px 15px;
                margin-top: 40px;
            }

            footer p {
                font-size: 0.8rem;
            }
        }

        /* Mobile Pequeno (361px - 480px) */
        @media (min-width: 361px) and (max-width: 480px) {
            header {
                padding: 1.2rem 3%;
            }

            .header-title h1 {
                font-size: 1.25rem;
            }

            .stat-item {
                min-width: 110px !important;
            }

            .container {
                padding: 0 12px;
            }

            .card {
                padding: 18px;
            }

            table {
                min-width: 700px;
                font-size: 0.75rem;
            }

            .chart-container {
                height: 240px;
                padding: 8px;
            }
        }

        /* Mobile Pequeno (até 480px) */
        @media (max-width: 480px) {
            /* Header */
            header {
                padding: 1.2rem 3%;
                border-bottom-left-radius: 24px;
                border-bottom-right-radius: 24px;
            }

            .header-title h1 {
                font-size: 1.3rem;
            }

            .header-title p {
                font-size: 0.8rem;
            }

            /* Cards de Estatísticas - Uma coluna */
            .stats-card {
                flex-direction: column !important;
            }

            .stat-item {
                width: 100% !important;
                min-width: 100% !important;
            }

            /* Botões de Navegação */
            .relatorios-container.month-nav > div:first-child {
                flex-direction: column;
                gap: 8px;
            }

            .relatorios-container.month-nav button {
                width: 100%;
            }

            #mesReferencia {
                width: 100%;
                min-width: 100% !important;
            }

            /* Container */
            .container {
                padding: 0 10px;
                margin: 15px auto;
            }

            /* Cards */
            .card {
                padding: 15px;
                border-radius: 12px;
            }

            /* Inputs */
            input, select, textarea {
                padding: 10px 12px;
                font-size: 0.85rem;
            }

            /* Botões */
            button {
                padding: 10px 15px;
                font-size: 0.8rem;
            }

            /* Tabelas */
            table {
                min-width: 700px;
                font-size: 0.75rem;
            }

            table th {
                font-size: 0.7rem;
                padding: 6px 4px;
            }

            table td {
                padding: 6px 4px;
                font-size: 0.7rem;
            }

            /* Gráficos */
            .charts-area {
                width: 100%;
                overflow: visible;
            }

            .chart-box {
                width: 100%;
                overflow: visible;
                padding: 10px;
            }

            .chart-container {
                height: 260px;
                min-height: 260px;
                padding: 12px;
                width: 100%;
                overflow: visible;
                box-sizing: border-box;
            }

            .chart-container canvas {
                max-width: 100% !important;
                height: auto !important;
            }

            /* Títulos de Seção */
            h3 {
                font-size: 1.1rem;
            }

            h4 {
                font-size: 0.95rem;
            }

            /* Labels de Formulário */
            .form-group label {
                font-size: 0.85rem;
            }

            /* Modais e Containers de Formulário */
            #faturaFormContainer,
            #despesaRecorrenteFormContainer {
                padding: 15px !important;
            }

            /* Botões de Ação nas Tabelas */
            table td button {
                padding: 4px 8px !important;
                font-size: 0.7rem !important;
                margin: 2px !important;
                display: inline-block;
            }

            table td {
                position: relative;
            }

            /* Títulos de Seções com Botões */
            .full-col .card > div:first-child {
                flex-direction: column;
                align-items: flex-start !important;
            }

            .full-col .card > div:first-child button {
                width: 100%;
                margin-top: 10px;
            }
        }

        /* Mobile Extra Pequeno (até 360px) */
        @media (max-width: 360px) {
            header {
                padding: 1rem 2%;
            }

            .header-title h1 {
                font-size: 1.1rem;
            }

            .header-title p {
                font-size: 0.75rem;
            }

            .stat-item {
                min-width: 100% !important;
                padding: 8px 10px !important;
            }

            .stat-item .stat-label {
                font-size: 0.55rem;
            }

            .stat-item .stat-value {
                font-size: 0.85rem;
            }

            .container {
                padding: 0 10px;
            }

            .card {
                padding: 15px;
            }

            button {
                padding: 10px 12px;
                font-size: 0.75rem;
            }

            input, select, textarea {
                padding: 10px 12px;
                font-size: 0.8rem;
            }

            .chart-container {
                height: 220px;
                padding: 8px;
            }

            table {
                min-width: 800px;
                font-size: 0.7rem;
            }

            table th, table td {
                padding: 6px 3px;
                font-size: 0.7rem;
            }

            h3 {
                font-size: 1rem;
            }

            h4 {
                font-size: 0.9rem;
            }

            footer {
                padding: 15px 10px;
            }

            footer p {
                font-size: 0.75rem;
            }
        }

        /* Landscape Mobile (480px - 768px em landscape) */
        @media (max-width: 768px) and (orientation: landscape) {
            .header-center {
                display: none;
            }

            .stats-card {
                flex-direction: row !important;
            }

            .stat-item {
                min-width: 100px !important;
            }
        }

        /* Ajustes Adicionais para Tabelas em Mobile */
        @media (max-width: 768px) {
            /* Container de Scroll para Tabelas */
            .summary-table-container {
                position: relative;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .summary-table-container::after {
                content: '← Arraste para ver mais →';
                display: block;
                text-align: center;
                padding: 8px;
                font-size: 0.75rem;
                color: var(--text-medium);
                background: var(--bg-light);
                border-radius: 8px;
                margin-top: 10px;
            }

            /* Botões de PDF no mobile */
            .right-col .card {
                overflow: visible;
                padding: 20px 15px;
            }

            .right-col .card > div:first-child {
                flex-direction: column;
                gap: 10px;
                width: 100%;
                margin-bottom: 20px;
            }

            .right-col .card > div:first-child button {
                width: 100%;
                font-size: 0.85rem !important;
                padding: 12px 15px !important;
                white-space: normal;
            }

            /* Garantir que gráficos não sejam cortados */
            .charts-area {
                width: 100%;
                overflow: visible;
                margin: 0;
                padding: 0;
            }

            .chart-box {
                width: 100%;
                overflow: visible;
                padding: 10px 0;
                margin: 0;
            }

            .chart-container {
                width: 100%;
                overflow: visible;
                padding: 10px;
            }

            /* Ajustar tamanho dos ícones */
            button i {
                font-size: 0.85em;
            }

            /* Melhorar espaçamento entre seções */
            section.full-col {
                margin-top: 20px;
                overflow: visible;
            }

            section.full-col .card {
                margin-bottom: 20px;
                overflow: visible;
            }

            /* Garantir que cards não cortem conteúdo */
            .card {
                overflow: visible !important;
            }
        }

        /* Mobile Extra Pequeno (até 360px) */
        @media (max-width: 360px) {
            header {
                padding: 1rem 2%;
            }

            .header-title h1 {
                font-size: 1.1rem;
            }

            .header-title p {
                font-size: 0.75rem;
            }

            .stat-item {
                min-width: 100% !important;
                padding: 8px 10px !important;
            }

            .stat-item .stat-label {
                font-size: 0.55rem;
            }

            .stat-item .stat-value {
                font-size: 0.85rem;
            }

            .container {
                padding: 0 10px;
            }

            .card {
                padding: 15px;
            }

            button {
                padding: 10px 12px;
                font-size: 0.75rem;
            }

            input, select, textarea {
                padding: 10px 12px;
                font-size: 0.8rem;
            }

            .chart-container {
                height: 220px;
                padding: 8px;
            }

            table {
                min-width: 800px;
                font-size: 0.7rem;
            }

            table th, table td {
                padding: 6px 3px;
                font-size: 0.7rem;
            }

            h3 {
                font-size: 1rem;
            }

            h4 {
                font-size: 0.9rem;
            }

            footer {
                padding: 15px 10px;
            }

            footer p {
                font-size: 0.75rem;
            }
        }

        /* Impressão */
        @media print {
            body::before,
            body::after {
                display: none;
            }

            header {
                background: white;
                color: black;
                box-shadow: none;
            }

            .card {
                box-shadow: none;
                border: 1px solid #ddd;
                page-break-inside: avoid;
            }

            button {
                display: none;
            }

            .btn-group {
                display: none;
            }

            .summary-table-container {
                overflow: visible;
            }

            table {
                min-width: auto;
            }
        }

        /* Alto Contraste (Acessibilidade) */
        @media (prefers-contrast: high) {
            .card {
                border: 2px solid var(--text-dark);
            }

            button {
                border: 2px solid currentColor;
            }

            .stat-item {
                border: 2px solid rgba(255, 255, 255, 0.3);
            }
        }

        /* Botão de Modo Escuro */
        .header-left {
            position: relative;
        }

        .dark-mode-toggle {
            position: absolute;
            top: 0;
            right: 0;
            background: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            width: 45px;
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            color: white;
            font-size: 1.2rem;
            z-index: 10;
            flex-shrink: 0;
        }

        .dark-mode-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .dark-mode-toggle:active {
            transform: scale(0.95);
        }

        /* Modo Escuro Ativado */
        body.dark-mode {
            --bg-white: #1e1e1e;
            --bg-light: #2d2d2d;
            --text-dark: #e0e0e0;
            --text-medium: #b0b0b0;
            --text-light: #808080;
            --gray-border: #404040;
        }

        body.dark-mode {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        }

        body.dark-mode header {
            background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        }

        body.dark-mode .card {
            background: var(--bg-white);
            border-color: var(--gray-border);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        }

        body.dark-mode .card:hover {
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        }

        body.dark-mode input,
        body.dark-mode select,
        body.dark-mode textarea {
            background: var(--bg-light);
            border-color: var(--gray-border);
            color: var(--text-dark);
        }

        body.dark-mode input:focus,
        body.dark-mode select:focus,
        body.dark-mode textarea:focus {
            border-color: var(--primary-blue);
            background: var(--bg-white);
        }

        body.dark-mode table th {
            background: #2d2d2d;
            color: var(--text-dark);
            border-bottom-color: var(--gray-border);
        }

        body.dark-mode table td {
            border-bottom-color: var(--gray-border);
            color: var(--text-dark);
        }

        body.dark-mode tbody tr:hover {
            background: var(--bg-light);
        }

        body.dark-mode .summary-table-container {
            background: var(--bg-white);
        }

        body.dark-mode .chart-container {
            background: var(--bg-white);
        }

        body.dark-mode .transaction-item {
            background: var(--bg-light);
            border-color: var(--gray-border);
        }

        body.dark-mode footer {
            background: var(--bg-white);
            border-top-color: var(--gray-border);
        }

        body.dark-mode footer p {
            color: var(--text-medium);
        }

        body.dark-mode .dark-mode-toggle {
            background: rgba(255, 255, 255, 0.15);
        }

        body.dark-mode .dark-mode-toggle:hover {
            background: rgba(255, 255, 255, 0.25);
        }

        /* Modo Escuro (Preferência do Sistema - apenas se não houver preferência manual) */
        @media (prefers-color-scheme: dark) {
            body:not(.light-mode):not(.dark-mode) {
                --bg-white: #1e1e1e;
                --bg-light: #2d2d2d;
                --text-dark: #e0e0e0;
                --text-medium: #b0b0b0;
                --gray-border: #404040;
            }

            body:not(.light-mode):not(.dark-mode) {
                background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            }

            body:not(.light-mode):not(.dark-mode) .card {
                background: var(--bg-white);
                border-color: var(--gray-border);
            }
        }
