    /* --- CSS BASE & PALETA --- */
        :root {
            --primary-blue: #044b81;
            --primary-red: #c63637;
            --sidebar-bg: #044b81;
            --light-bg: #f0f4f8;
            --text-dark: #333;
            --text-light: #fff;
            --text-muted: #777;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
        body { background-color: var(--light-bg); color: var(--text-dark); height: 100vh; overflow: hidden; display: flex; }

        /* --- TELA DE LOGIN --- */
        #loginScreen {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: linear-gradient(135deg, var(--primary-blue), #022a4d);
            z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column;
        }
        .login-box {
            background: white; padding: 40px; border-radius: 12px; width: 100%; max-width: 400px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.3); text-align: center;
        }
        .login-logo { max-width: 150px; margin-bottom: 20px; }
        .login-input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 6px; outline: none; }
        .login-input:focus { border-color: var(--primary-blue); }
        .btn-login { width: 100%; background: var(--primary-blue); color: white; padding: 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 16px; transition: 0.3s; }
        .btn-login:hover { background: #03365e; }
        .login-error { color: var(--primary-red); font-size: 13px; margin-top: 10px; display: none; }

        /* --- APLICAÇÃO (Escondida por padrão) --- */
        #appContainer { display: none; width: 100%; height: 100%; display: flex; }
        .hidden-app { display: none !important; }

        /* SIDEBAR */
aside {
    width: 260px; background-color: var(--sidebar-bg); color: white;
    display: flex; flex-direction: column; padding: 10px; 
    box-shadow: 4px 0 10px rgba(0,0,0,0.1); z-index: 10;
}
.brand { margin-bottom: 20px; text-align: center; padding: 10px 0; }
.brand img { width: 100%; max-width: 150px; height: auto; border-radius: 4px; display: block; margin: 0 auto; }
.menu-btn {
    background: transparent; border: none; color: rgba(255,255,255,0.8); padding: 15px; text-align: left;
    cursor: pointer; border-radius: 8px; font-size: 15px; margin-bottom: 5px; transition: 0.2s; display: flex; align-items: center; gap: 10px; width: 100%;
}
.menu-btn:hover, .menu-btn.active { background: var(--primary-red); color: white; box-shadow: 0 2px 5px rgba(0,0,0,0.2); font-weight: bold; }
/* Ajuste ícones sidebar */
.menu-btn i { width: 25px; text-align: center; }

.backup-section { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.btn-system { background: rgba(0,0,0,0.2); color: white; border: none; padding: 10px; width: 100%; border-radius: 6px; cursor: pointer; font-size: 12px; margin-bottom: 5px; text-align: center; }
.btn-system:hover { background: rgba(0,0,0,0.4); }

        /* MAIN */
        main { flex: 1; padding: 30px; overflow-y: auto; position: relative; background-color: #eef2f5; }
        h2 { margin-bottom: 20px; color: var(--primary-blue); border-bottom: 2px solid #ddd; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center;}

        /* KPI & UI */
        .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
        .kpi-card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border-top: 4px solid var(--primary-blue); }
        .kpi-title { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
        .kpi-value { font-size: 26px; font-weight: bold; color: var(--primary-blue); margin-top: 5px; }
        .content-card { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 20px; }
        .content-card h3 { color: var(--primary-blue); border-left: 4px solid var(--primary-red); padding-left: 10px; margin-bottom: 15px; }
        
        .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
        .form-group { margin-bottom: 15px; }
        .form-group label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; font-weight: 600; }
        input, select { width: 100%; padding: 12px; border: 1px solid #dde2e5; border-radius: 6px; outline: none; background: #fdfdfd; }
        input:focus, select:focus { border-color: var(--primary-blue); background: #fff; }
        
        .btn-primary { background: var(--primary-blue); color: white; padding: 12px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; }
        .btn-primary:hover { background: #03365e; } 
        .btn-danger { background: white; color: var(--primary-red); border: 1px solid var(--primary-red); padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; }
        .btn-danger:hover { background: var(--primary-red); color: white; }
        .btn-back { background: #ddd; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; margin-bottom: 15px; color: #555; font-weight: bold; }
        .btn-whatsapp { background: #25D366; color: white; border: none; padding: 12px; width: 100%; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; }
        
        .list-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee; transition: 0.2s; }
        .list-item:hover { background: #f1f8ff; border-left: 3px solid var(--primary-blue); }
        .list-header-label { font-size: 12px; font-weight: bold; color: white; background: var(--primary-blue); padding: 10px; margin-bottom: 10px; border-radius: 6px; text-align: center; letter-spacing: 0.5px; }

        table { width: 100%; border-collapse: collapse; font-size: 14px; }
        th, td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; }
        th { color: white; font-weight: 600; background: var(--primary-blue); }
        tr.clickable-row:hover { background-color: #f1f8ff; cursor: pointer; }
        .profit-positive { color: #28a745; font-weight: bold; }
        .profit-negative { color: var(--primary-red); font-weight: bold; }

        /* GRÁFICO */
        .chart-container { display: flex; align-items: center; justify-content: space-around; flex-wrap: wrap; gap: 20px; }
        .pie-chart { width: 160px; height: 160px; border-radius: 50%; background: #eee; position: relative; border: 5px solid #fff; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
        .pie-legend { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
        .legend-item { display: flex; align-items: center; gap: 8px; }
        .dot { width: 12px; height: 12px; border-radius: 2px; display: block; }

        /* STATUS & MODAL */
        .status-btn { border: 1px solid #ddd; padding: 5px 12px; border-radius: 20px; font-size: 11px; cursor: pointer; background: white; margin-left: 5px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 600; }
        .st-done { background: #d4edda; color: #155724; border-color: #c3e6cb; } 
        .st-pending { background: #fff3cd; color: #856404; border-color: #ffeeba; }
        .pay-paid { background: #cce5ff; color: #004085; border-color: #b8daff; }
        .pay-debt { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
        .badge { background: var(--primary-blue); color: white; padding: 3px 8px; border-radius: 10px; font-size: 11px; }
        .hidden { display: none !important; }
        .debt-summary { background-color: #ffebeb; color: var(--primary-red); padding: 15px; border-radius: 8px; font-weight: bold; text-align: right; margin-top: 10px; border: 1px solid var(--primary-red);}

        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); }
        .modal { background: white; padding: 25px; border-radius: 12px; width: 90%; max-width: 450px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); }
        .modal textarea { width: 100%; height: 150px; padding: 10px; border: 1px solid #ddd; border-radius: 6px; resize: none; font-family: monospace; font-size: 13px; margin-top: 10px;}

        .financial-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .col-income { border-top: 3px solid #28a745; background: white; padding: 10px; border-radius: 4px; }
        .col-expense { border-top: 3px solid var(--primary-red); background: white; padding: 10px; border-radius: 4px; }
        .col-income > div:first-child { background: #dce3ea; color: var(--primary-blue); }
        .col-expense > div:first-child { background: #fbe9eb; color: var(--primary-red); }
        @media (max-width: 700px) { .financial-cols { grid-template-columns: 1fr; } }

        .client-group { border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 20px; overflow: hidden; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
        .client-group-header { background: #f1f5f9; padding: 12px 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
        .client-link { color: var(--primary-blue); font-weight: bold; cursor: pointer; text-decoration: none; font-size: 15px; }
        .group-row { padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #eee; background: white; }


        /* --- ÍCONES (Ajuste fino) --- */
.menu-btn i, .btn-system i {
    width: 20px;
    text-align: center;
    margin-right: 5px;
}

/* ========================================= */
/* --- ANIMAÇÕES E EFEITOS VISUAIS --- */
/* ========================================= */

/* 1. Definição dos Keyframes (Movimentos) */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* 2. Animação de Entrada das Telas (Sections) */
/* Toda vez que você navega (remove a classe .hidden), a tela desliza suavemente */
section:not(.hidden) {
    animation: slideUp 0.4s ease-out forwards;
}

/* 3. Cards Interativos */
.kpi-card, .content-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.kpi-card:hover, .content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* 4. Listas com efeito "Tátil" */
/* Faz o item ir um pouco para a direita ao passar o mouse */
.list-item {
    transition: all 0.2s ease;
}
.list-item:hover {
    transform: translateX(4px);
    background-color: #f0f7ff; /* Azul bem clarinho */
}
/* Botão de lixeira aparece suavemente */
.list-item .btn-danger {
    transition: opacity 0.2s, transform 0.2s;
}
.list-item:hover .btn-danger {
    transform: scale(1.1);
}

/* 5. Botões com feedback de clique */
button {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
button:active {
    transform: scale(0.95); /* Encolhe levemente ao clicar */
}

/* 6. Modal com efeito "Pop" */
.modal-overlay:not(.hidden) {
    animation: fadeIn 0.3s ease;
}
.modal {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efeito elástico */
}

/* 7. Tela de Login */
.login-box {
    animation: slideUp 0.6s ease-out;
}

/* 8. Melhoria na Sidebar Mobile */
aside {
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================= */
/* --- MOBILE & RESPONSIVIDADE (NOVO) --- */
/* ========================================= */

#mobileMenuBtn { display: none; background: var(--primary-blue); color: white; border: none; padding: 10px 15px; border-radius: 6px; font-size: 20px; cursor: pointer; margin-bottom: 20px; }
#mobileOverlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; backdrop-filter: blur(2px); }

@media (max-width: 768px) {
    #mobileMenuBtn { display: inline-block; }
    aside { position: fixed; left: -280px; top: 0; height: 100%; transition: left 0.3s ease; z-index: 1000; width: 260px; }
    aside.active { left: 0; }
    aside.active ~ #mobileOverlay { display: block; }
    main { padding: 15px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    h2 { font-size: 1.2rem; }
    .content-card { padding: 15px; overflow-x: auto; }
}

input[type="date"] {
    font-family: 'Segoe UI', sans-serif;
    color: #333;
}