/* =================================================================== */
/* ===== 1. VARIÁVEIS E ESTILOS GLOBAIS ===== */
/* =================================================================== */
:root {
    /* Tema Claro (Paleta Suavizada) */
    --fundo: #F0F2F5;       /* Um cinza muito claro e neutro para o fundo geral */
    --superficie: #fdfdfd; /* Mantém os cards brancos, mas vamos ajustar o texto */
    --borda: #e9ecef;
    --texto-principal: #123458; /* <-- Um cinza-escuro em vez de preto puro */
    --texto-secundario: #2c2e30;
    --azul: #123458;
    --branco: #fdfdfd;       /* Cor para textos sobre fundos escuros */
    --sucesso: #28a745;
    --erro: #e74c3c;
    --sombra: rgba(0,0,0,0.075); /* Sombra um pouco mais suave */
    
    /* Variáveis que já tínhamos */
    --ativa-menu: var(--azul);
    --popup-usuario: #0d2a4c;
}

html.dark-mode {
    /* Tema Escuro (Sobrescreve as variáveis para um visual mais suave) */
    --fundo: #1E202A;         /* Fundo principal mais escuro, mas não preto */
    --superficie: #2C2F3B;    /* Cor dos cards, modais, sidebar, um pouco mais clara que o fundo */
    --borda: #404454;         /* Bordas suaves */
    --texto-principal: #E0E2E7; /* Texto principal claro, mas não branco puro */
    --texto-secundario: #A0A3AE; /* Texto secundário (cinza) com bom contraste */
    --sombra: rgba(0, 0, 0, 0.3); /* Sombras mais escuras no modo escuro */
    
    /* Adicionando cores para hover/ativos, se necessário */
    --hover-menu: rgba(255, 255, 255, 0.08); /* Efeito de hover mais suave */
    --ativa-menu: rgba(255, 255, 255, 0.15); /* Item de menu ativo */
    --popup-usuario: #161b22;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--fundo);
    color: var(--texto-principal);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* (O restante do seu CSS continua aqui, mas usando as novas variáveis) */
/* ... (substitua todo o resto do seu CSS pelo código completo das próximas partes) ... */

/* =================================================================== */
/* ===== 2. COMPONENTES GERAIS (Botões, Formulários, Modais, etc) ===== */
/* =================================================================== */

/* --- Botões --- */
.btn-primary, .btn-danger, .btn-secondary, .btn-cta, .btn-danger-outline {
    padding: 0.8rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

/* Garante que o botão de salvar em qualquer modal tenha o estilo correto */
.modal-content .btn-submit {
    background-color: var(--sucesso);
    color: var(--branco) !important; /* Garante que o texto seja sempre branco */
    border: none;
    padding: 0.9rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.modal-content .btn-submit:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.btn-primary:hover, .btn-submit:hover, .btn-danger:hover, .btn-secondary:hover, .btn-cta:hover, .btn-danger-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary { background-color: var(--azul); color: var(--branco); }
.btn-primary:hover { background-color: #1a457a; color: var(--branco); }

.btn-secondary { background-color: var(--cinza-claro); color: var(--cinza-medio); border-color: var(--cinza-claro); }
.btn-secondary:hover { background-color: #d8dde1; border-color: var(--cinza-medio); color: var(--preto); }

.btn-submit { background-color: var(--sucesso); color: white; }
.btn-submit:hover { background-color: #218838; }

.btn-danger { background-color: var(--erro); color: white; }
.btn-danger:hover { background-color: #c0392b; }

.btn-danger-outline { background-color: transparent; color: var(--erro); border-color: var(--erro); }
.btn-danger-outline:hover { background-color: var(--erro); color: white; }

.btn-action {
    background: none; border: none; color: var(--cinza-medio); cursor: pointer;
    margin-left: 0.5rem; font-size: 1rem; transition: color 0.2s ease, transform 0.2s ease;
}
.btn-action:hover { color: var(--azul); transform: scale(1.1); }

/* --- Formulários --- */
.input-group { margin-bottom: 1.2rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.input-group input, .input-group select, .input-group textarea {
    width: 100%; padding: 0.8rem; border: 1px solid var(--borda);
    border-radius: 5px; font-size: 1rem; background-color: var(--branco);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none; border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(18, 52, 88, 0.1);
}
.input-row { display: flex; gap: 1.5rem; }
.input-row .input-group { flex: 1; }

/* --- Modais --- */
.modal {
    display: none; /* Alterado dinamicamente por JS para 'flex' */
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;

    /* PROPRIEDADES ADICIONADAS PARA CENTRALIZAÇÃO */
    align-items: center;     /* Alinha verticalmente no centro */
    justify-content: center; /* Alinha horizontalmente no centro */
}
@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

.modal-content {
    background-color: #fefefe; margin: 10% auto; padding: 2.5rem;
    width: 90%; max-width: 500px; border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    position: relative; animation: slideIn 0.4s;
}
.modal-content.large { max-width: 700px; }
.modal-content.small-modal { max-width: 400px; }
@keyframes slideIn { from {transform: translateY(-50px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

.close-btn {
    color: #aaa; position: absolute; top: 1rem; right: 1.5rem;
    font-size: 28px; font-weight: bold; cursor: pointer; transition: color 0.2s ease;
}
.close-btn:hover { color: var(--preto); }

/* --- Cards --- */
.cards-container {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem; margin-bottom: 2rem;
}
.data-card {
        background-color: var(--superficie); /* Todos devem usar a cor da superfície */
        padding: 1.5rem; border-radius: 8px;
        border: 1px solid var(--borda); transition: all 0.2s ease-in-out;
        box-shadow: 0 4px 8px var(--sombra);
}
.data-card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.07); }
.data-card h4 { margin: 0 0 0.5rem 0; color: var(--cinza-medio); font-size: 0.9rem; text-transform: uppercase; }
.data-card p { margin: 0; font-size: 1.8rem; font-weight: 600; }
.data-card.verde p { color: var(--sucesso); }
.data-card.vermelho p { color: var(--erro); }
.data-card.azul p { color: var(--azul); }
.data-card.superavit p { color: var(--erro); }
.data-card.deficit p { color: var(--sucesso); }

/* --- Alertas e Placeholders --- */
.alert {
    padding: 1rem; margin: 0 0 1.5rem 0; border: 1px solid transparent;
    border-radius: 5px; text-align: center;
}
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; }
.placeholder-text {
    color: var(--cinza-medio); padding: 2rem; text-align: center;
    border: 2px dashed var(--cinza-claro); border-radius: 8px;
    background-color: #fafafa;
}

/* =================================================================== */
/* ===== 3. LAYOUTS DE PÁGINA (Landing, Login, Dashboard) ===== */
/* =================================================================== */

/* --- Landing Page --- */
.landing-body { background-color: var(--branco); line-height: 1.7; }
.landing-body .container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.hero-section {
    background-color: var(--azul); color: var(--branco); text-align: center;
    padding: 6rem 1.5rem 8rem 1.5rem; clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}
.landing-logo { width: 100px; height: 100px; margin-bottom: 1.5rem; border-radius: 20px; }
.hero-title { font-size: 3.2rem; font-weight: 700; max-width: 700px; margin: 0 auto 1rem auto; line-height: 1.2; }
.hero-subtitle { font-size: 1.2rem; max-width: 600px; margin: 0 auto 2.5rem auto; opacity: 0.9; }
.btn-cta { background-color: var(--branco); color: var(--azul); padding: 14px 32px; border-radius: 50px; font-size: 1.1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.btn-cta:hover { background-color: var(--cinza-fundo); color: var(--preto); transform: translateY(-4px) scale(1.05); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.features-section { padding: 6rem 1.5rem; }
.section-title { text-align: center; font-size: 2.5rem; color: var(--azul); margin-bottom: 3.5rem; max-width: 650px; margin-left: auto; margin-right: auto; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2.5rem; }
.feature-card { background: #fff; padding: 2.5rem; border: 1px solid var(--cinza-claro); border-radius: 10px; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(18, 52, 88, 0.1); }
.feature-icon { font-size: 3rem; color: var(--azul); margin-bottom: 1.5rem; }
.feature-card h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.final-cta-section { background-color: var(--cinza-fundo); padding: 6rem 1.5rem; text-align: center; }
.final-cta-section p { max-width: 500px; margin: 0 auto 2rem auto; font-size: 1.1rem; }
.landing-footer { background-color: var(--dark-grey); color: var(--cinza-claro); text-align: center; padding: 2.5rem 1.5rem; }

/* --- Login/Cadastro --- */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: var(--cinza-fundo); padding: 1rem; }
.form-container { background-color: var(--superficie); padding: 2.5rem; border-radius: 10px; box-shadow: 0 4px 8px var(--sombra); width: 100%; max-width: 420px; border: 1px solid var(--borda); }
.login-logo-wrapper { text-align: center; margin-bottom: 2rem; }
.login-logo-wrapper img { width: 90px; height: 90px; }
.login-logo-wrapper h3 { margin-top: 0.75rem; font-size: 1.8rem; color: var(--azul); }
.form-switch-link { text-align: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--cinza-claro); font-size: 0.9rem; }
.form-switch-link a { color: var(--azul); font-weight: 600; text-decoration: none; }
.form-switch-link a:hover { text-decoration: underline; }
.form-container.wide-form {
    max-width: 700px;
}

.profile-card { /* E o card de perfil se ele existir */
    background-color: var(--superficie); /* Todos devem usar a cor da superfície */
    border: 1px solid var(--borda); /* Bordas consistentes */
    box-shadow: 0 4px 8px var(--sombra); /* Sombra mais suave */
    /* ... outras propriedades ... */
}

.form-container a {
    color: var(--azul);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.form-container a:hover {
    text-decoration: underline;
    color: #1a457a; /* Tom mais escuro do azul no hover */
}

.form-container > form > .input-group > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem; /* Adiciona um pequeno espaço abaixo da linha do link */
}

.form-container > form > .input-group > div > label {
    flex-grow: 1; /* Garante que a label ocupe o espaço necessário */
}

.form-container > form > .input-group > div > a {
    margin-left: 1rem; /* Adiciona um espaço entre a label e o link */
}

/* --- Dashboard --- */
.dashboard-container { display: flex; }
.main-content { flex-grow: 1; padding: 2rem;
background-color: var(--cor-fundo);
    
}
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
    background-color: var(--superficie); padding: 1.5rem;
    border-radius: 8px; border: 1px solid var(--cinza-claro);
}
.page-header h1 { margin: 0; color: var(--text-color); font-size: 1.8rem; flex-grow: 1; }

/* =================================================================== */
/* ===== 4. SIDEBAR E ESTADOS ===== */
/* =================================================================== */

.sidebar {
    background-color: var(--ativa-menu);
    border-right: 1px solid var(--borda)
    color: var(--branco);
    display: flex;
    flex-direction: column;
    width: 260px;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar a:hover,
.sidebar a.active {
    background-color: var(--hover-menu); /* Usar cor de hover/ativo */
    color: var(--branco);
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 70px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}
.logo-img { height: 40px; width: 40px; flex-shrink: 0; }
.logo-text { font-size: 1.3rem; font-weight: 600; white-space: nowrap; color: var(--branco) }

.toggle-btn {
    background-color: var(--branco);
    color: var(--azul);
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: absolute;
    top: 20px; right: -15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    z-index: 10;
    transition: transform 0.3s ease;
}
.toggle-btn i { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 15px; padding: 12px;
    margin-bottom: 8px; border-radius: 8px; color: var(--branco);
    text-decoration: none; font-size: 1rem;
    transition: background-color 0.2s ease;
}

.sidebar-nav span{
    color: var(--branco);
}

.sidebar-nav a:hover { background-color: #1a426d; color: var(--branco);}
.sidebar-nav a.active {
    background-color: rgba(255, 255, 255, 0.1) ; /* Usa a variável correta */
    font-weight: 600;
    color: var(--branco);
}

/* Força o ÍCONE dentro do link ativo a ser branco */
.sidebar-nav a.active .nav-icon {
    color: var(--branco);
}

/* Força o TEXTO dentro do link ativo a ser branco */
.sidebar-nav a.active .nav-text {
    color: var(--branco);
}

.nav-icon { font-size: 1.2rem; width: 24px; text-align: center; flex-shrink: 0; }
.nav-text { white-space: nowrap; opacity: 1; transition: opacity 0.2s 0.1s ease; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}
.user-menu {
    display: flex; align-items: center; gap: 12px;
    padding: 8px; border-radius: 8px; cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--branco);
}

.user-menu:hover { background-color: rgba(255, 255, 255, 0.1); color: var(--branco); }
.user-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-name {
    font-weight: 600; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; opacity: 1; transition: opacity 0.2s ease;
    color: var(--branco);
}
.user-popup {
    color: var(--branco);
    position: absolute; bottom: calc(100% + 5px); left: 1rem; right: 1rem;
    background-color: var(--popup-usuario); border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 20; overflow: hidden; display: none;
}
.user-popup.show { display: block; }
.user-popup a { display: block; padding: 12px 15px; color: #fdfdfd ; text-decoration: none; transition: background-color 0.2s ease; }
.user-popup a:hover { background-color: rgba(255, 255, 255, 0.1); #fdfdfd }

/* --- Estado da Sidebar Fechada --- */
.sidebar-collapsed .sidebar { width: 80px; }
.sidebar-collapsed .logo-text, .sidebar-collapsed .nav-text, .sidebar-collapsed .user-name { opacity: 0; visibility: hidden; width: 0; }
.sidebar-collapsed .toggle-btn i { transform: rotate(180deg); }
.sidebar-collapsed .sidebar-header { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .logo-wrapper { gap: 0; }
.sidebar-collapsed .sidebar-nav a { justify-content: center; }
.sidebar-collapsed .sidebar-nav .nav-icon { margin-right: 0; }
.sidebar-collapsed .user-menu { justify-content: center; }

/* =================================================================== */
/* ===== 5. MÓDULOS ESPECÍFICOS ===== */
/* =================================================================== */

/* --- Agenda --- */
.agenda-container { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; height: calc(100vh - 4rem); }
.agenda-sidebar { background: var(--superficie); padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); display: flex; flex-direction: column; border: 1px solid var(--cinza-claro); }
.agenda-filter { display: flex; align-items: center; gap: 15px; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--preto); font-weight: 500; margin-bottom: 5px; transition: background-color 0.2s ease, color 0.2s ease; }
.agenda-filter:hover { background-color: var(--cinza-fundo); }
.agenda-filter.active {
    background-color: var(--ativa-menu); /* Usa a variável correta */
    color: var(--branco);
}

.agenda-filter.active span {
    color: var(--branco);
}

.agenda-filter.active .nav-icon { color: var(--branco); }
.agenda-filter .nav-icon { color: var(--cinza-medio); transition: color 0.2s ease; }
.projects-section { margin-top: 2rem; border-top: 1px solid var(--cinza-claro); padding-top: 1rem; }
.projects-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; padding: 0 10px; }
.projects-header h3 { margin: 0; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: var(--texto-secundario); }
#btn-novo-projeto { background: none; border: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--cinza-medio); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
#btn-novo-projeto:hover { background-color: var(--cinza-fundo); color: var(--azul); }
.projects-list { list-style: none; padding: 0; margin: 0; }
.project-item { position: relative; display: flex; }
.project-item .agenda-filter { width: 100%; }
.btn-delete-project { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--cinza-medio); cursor: pointer; padding: 8px; border-radius: 6px; font-size: 0.9rem; opacity: 0; visibility: hidden; transition: all 0.2s ease; }
.project-item:hover .btn-delete-project { opacity: 1; visibility: visible; }
.btn-delete-project:hover { background-color: var(--cinza-fundo); color: var(--erro); }
.agenda-main { background: var(--superficie); padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid var(--cinza-claro); overflow-y: auto; }
.task-category-group { margin-bottom: 2rem; }
.category-title { font-size: 1.3rem; color: var(--texto-primario); padding-bottom: 0.5rem; border-bottom: 2px solid var(--cinza-fundo); margin-bottom: 1rem; }
.tarefa-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--cinza-claro); transition: background-color 0.2s ease; }
.tarefa-item:hover { background-color: var(--cinza-fundo); }
.tarefa-item.concluida { opacity: 0.6; }
.tarefa-item.concluida .tarefa-info h3 { text-decoration: line-through; }
.tarefa-info h3 { margin: 0 0 0.25rem 0; font-size: 1.1rem; }
.tarefa-info p { margin: 0; font-size: 0.9rem; color: var(--cinza-medio); }
.tarefa-tags { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.75rem; }
.tag-data, .tag-projeto, .tag-valor, .tag-hora { padding: 3px 10px; border-radius: 12px; background-color: var(--cinza-fundo); }
.tag-valor { background-color: #eaf6f0; color: var(--sucesso); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.finance-integration-box { background-color: var(--cinza-fundo); border: 1px solid var(--cinza-claro); padding: 1.5rem; border-radius: 8px; margin-top: 1rem; }
.checkbox-group { margin-top: 1rem; }
.checkbox-group label { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; font-weight: normal; color: var(--text-color); line-height: 1.4; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 4px; }
.confirmation-modal { text-align: center; padding-top: 2rem; }
.modal-header-icon { font-size: 3rem; color: var(--erro); margin-bottom: 1rem; }
.confirmation-modal h2 { border: none; padding-bottom: 0; margin-bottom: 0.5rem; }
.modal-text { color: var(--cinza-medio); font-size: 1.1rem; line-height: 1.6; }
.modal-text strong { color: var(--preto); font-weight: 600; }
.modal-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--cinza-claro); }
.modal-actions .btn-secondary, .modal-actions .btn-danger { width: auto; min-width: 120px; }

/* --- Financeiro --- */
.month-filter, .date-filter { display: flex; align-items: center; gap: 0.5rem; }
.month-filter label, .date-filter label { font-weight: 500; }
#month-selector, #date-selector { padding: 0.5rem; border: 1px solid var(--cinza-claro); border-radius: 5px; background-color: #fff; }
.chart-container { background-color: var(--superficie); padding: 2rem; border-radius: 8px; border: 1px solid var(--borda); margin-bottom: 2rem; box-shadow: 0 4px 8px var(--sombra);}
.chart { display: flex; justify-content: space-around; align-items: flex-end; height: 250px; border-left: 1px solid var(--cinza-claro); border-bottom: 1px solid var(--cinza-claro); padding-top: 1rem; gap: 1.5rem; }
.bar-wrapper { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; text-align: center; flex-grow: 1; }
.bar { width: 60%; max-width: 40px; background: linear-gradient(to top, var(--azul), #4a77a9); border-radius: 5px 5px 0 0; transition: height 0.5s ease-out; position: relative; }
.bar:hover::after { content: attr(data-label); position: absolute; top: -25px; left: 50%; transform: translateX(-50%); background: var(--preto); color: var(--branco); padding: 3px 8px; border-radius: 3px; font-size: 0.8rem; white-space: nowrap; }
.bar-wrapper span { margin-top: 0.5rem; font-size: 0.8rem; color: var(--cinza-medio); }
.transaction-list-container { margin-top: 2rem; background-color: var(--superficie); padding: 2rem; border-radius: 8px; border: 1px solid var(--borda); box-shadow: 0 4px 8px var(--sombra); }
.transaction-group h3 { font-size: 1.2rem; color: var(--texto-secundario); border-bottom: 1px solid var(--cinza-claro); padding-bottom: 0.5rem; margin: 1.5rem 0 1rem 0; }
.transaction-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid var(--cinza-fundo); }
.transaction-item:last-child { border-bottom: none; }
.transaction-details .description { font-weight: 500;display: flex; flex-direction: row; gap: 10px; }
.transaction-details .date { font-size: 0.85rem; color: var(--cinza-medio); }
.transaction-item .value { font-weight: 600; font-size: 1.1rem; }
.transaction-item .value.receita { color: var(--sucesso); }
.transaction-item .value.despesa { color: var(--erro); }

/* --- Saúde --- */
.health-cards.cards-container { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.saude-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.action-box { background: var(--superficie); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--cinza-claro); }
.action-box h3 { margin-top: 0; color: var(--azul); }
#add-food-confirm-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--cinza-claro); }
#add-food-confirm-box .input-row { display: flex; align-items: flex-end; gap: 1rem; }
.meal-card { background-color: #fff; border: 1px solid var(--cinza-claro); border-radius: 8px; padding: 1rem 1.5rem; margin-bottom: 1rem; }
.meal-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.5rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--superficie); }
.meal-header h3 { margin: 0; color: var(--azul); }
.meal-card ul { list-style: none; padding: 0; margin: 0; }
.meal-card li { display: flex; justify-content: space-between; padding: 0.25rem 0; }
.meal-card li span { color: var(--cinza-medio); }
#form-dados-saude {
    margin-top: 1.5rem;
}

/* =================================================================== */
/* ===== ESTILOS PARA O POPUP DE ADICIONAR REFEIÇÃO ===== */
/* =================================================================== */

.modal {
display: none; /* Hidden by default /
position: fixed; / Stay in place /
z-index: 1; / Sit on top /
left: 0;
top: 0;
width: 100%; / Full width /
height: 100%; / Full height /
overflow: auto; / Enable scroll if needed /
background-color: rgba(0,0,0,0.4); / Black w/ opacity */
}

.modal-content {
background-color: var(--superficie);
border: 1px solid var(--borda); /* Bordas consistentes */
box-shadow: 0 4px 8px var(--sombra);
margin: 8% auto; /* 15% from the top and centered /
padding: 20px;
border: 1px solid #888;
width: 80%; / Could be more or less, depending on screen size */
max-width: 600px;
border-radius: 8px;
position: relative;
}

.modal-content h2 {
color: var(--azul-escuro);
margin-top: 0;
margin-bottom: 15px;
}

.modal-content label {
display: block;
margin-bottom: 5px;
color: var(--texto-primario);
font-weight: bold;
}

.modal-content input#nome-refeicao {
width: calc(100% - 22px);
padding: 10px;
margin-bottom: 15px;
border: 1px solid var(--cinza-claro);
border-radius: 4px;
box-sizing: border-box;
font-size: 16px;
}

.modal-content h3 {
color: var(--azul-medio);
margin-top: 20px;
margin-bottom: 10px;
font-size: 1.2em;
}

.modal-content #busca-alimento {
width: calc(100% - 22px);
padding: 10px;
margin-bottom: 10px;
border: 1px solid var(--cinza-claro);
border-radius: 4px;
box-sizing: border-box;
font-size: 16px;
}

.modal-content #resultados-busca {
border: 1px solid var(--cinza-medio);
border-top: none;
border-radius: 0 0 4px 4px;
margin-top: -5px;
max-height: 150px;
overflow-y: auto;
display: none;
background-color: white;
z-index: 2;
position: relative;
}

.modal-content #resultados-busca .resultado-item {
padding: 8px 10px;
cursor: pointer;
font-size: 16px;
color: var(--texto-secundario);
}

.modal-content #resultados-busca .resultado-item:hover {
background-color: var(--azul-claro);
color: white;
}

.modal-content #lista-itens-refeicao {
margin-top: 15px;
margin-bottom: 20px;
padding-left: 20px;
color: var(--texto-primario);
}

.modal-content #lista-itens-refeicao li {
margin-bottom: 8px;
list-style-type: disc;
}

.modal-content .btn-salvar-refeicao {
background-color: var(--verde);
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
display: block;
width: 100%;
box-sizing: border-box;
}

.modal-content .btn-salvar-refeicao:hover {
background-color: var(--verde-escuro);
}

.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}

.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

/* Estilo adicional para o título "Adicionar Alimento à Refeição" */
.modal-content h3:first-of-type {
margin-top: 25px;
}

.modal-content > * {
margin-bottom: 15px; 
}

.modal-content > :last-child {
margin-bottom: 0; 
}

/* Estilos para os botões de ação no card de refeição */
.meal-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.meal-header strong {
    font-size: 1.1rem;
    flex-grow: 1; /* Empurra os botões para a direita */
    text-align: right;
}

/* =================================================================== */
/* ===== ESTILOS PARA OS RESULTADOS DA BUSCA DE ALIMENTOS ===== */
/* =================================================================== */

/* Garante que o container da busca possa posicionar a lista de resultados */
.search-wrapper {
    position: relative;
}

/* A caixa flutuante com a lista de resultados */
#resultados-busca-alimento {
    position: absolute;
    width: 100%;
    top: 100%; /* Posiciona logo abaixo do input de busca */
    left: 0;
    background-color: var(--branco);
    border: 1px solid var(--cinza-claro);
    border-top: none; /* Remove a borda de cima para se "conectar" ao input */
    border-radius: 0 0 8px 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1002; /* Garante que fique acima de outros elementos do modal */
    max-height: 210px; /* Define uma altura máxima para a lista */
    overflow-y: auto; /* Adiciona uma barra de rolagem se a lista for muito grande */
    display: none; /* O JavaScript controla a visibilidade */
}

/* Cada item individual na lista de resultados */
.resultado-item {
    padding: 0.9rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--preto);
    border-bottom: 1px solid var(--cinza-claro);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Remove a borda do último item da lista */
.resultado-item:last-child {
    border-bottom: none;
}

/* Efeito visual ao passar o mouse sobre um item */
.resultado-item:hover {
    background-color: var(--cinza-fundo);
    color: var(--preto);
}

/* =================================================================== */
/* ===== ESTILOS PARA A LISTA DE ITENS DA REFEIÇÃO (MODAL) ===== */
/* =================================================================== */

/* A caixa que contém a lista de itens */
.meal-staging-area {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: var(--cinza-fundo);
    border: 1px solid var(--cinza-claro);
}

.meal-staging-area h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--azul);
    font-size: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* A lista em si */
.meal-staging-area ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 180px; /* Altura máxima antes de mostrar a barra de rolagem */
    overflow-y: auto;
}

/* Cada item da lista */
#lista-alimentos-refeicao li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid var(--cinza-claro);
}

/* Remove a borda do último item */
#lista-alimentos-refeicao li:last-child {
    border-bottom: none;
}

/* Estilo para o texto do placeholder "Nenhum alimento..." */
#lista-alimentos-refeicao li.placeholder-item {
    color: var(--cinza-medio);
    justify-content: center;
    font-style: italic;
    border-bottom: none;
}

/* Estilo para o botão de remover item (X) */
.btn-remove-item {
    background: none;
    border: none;
    color: var(--cinza-medio);
    cursor: pointer;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-remove-item:hover {
    background-color: #f8d7da; /* Fundo vermelho claro */
    color: var(--erro);
}

/* --- Configurações --- */
.settings-container { max-width: 700px; margin: 0 auto; }
.settings-card {
    background-color: var(--superficie);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    width: 100%; /* Garante que o card ocupe toda a largura disponível */
    box-sizing: border-box; /* Garante que o padding não adicione largura extra */
}.settings-card h2 { color: var(--texto-primario); border-bottom: 1px solid var(--cinza-claro); padding-bottom: 1rem; margin-bottom: 1.5rem; }
#profile-pic-preview { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--cinza-fundo); margin: 0 auto 1rem auto; display: block; }
.photo-buttons { display: flex; gap: 10px; align-items: center; justify-content: center; }
.danger-zone { border-color: #ffd2d2; background-color: #fff5f5; }
.danger-zone h2 { color: var(--erro); border-bottom-color: #ffb8b8; }
.requirements-box { padding: 1rem; background-color: var(--cinza-fundo); border: 1px solid var(--cinza-claro); border-radius: 5px; margin-top: -0.5rem; margin-bottom: 1.5rem; display: none; }
.requirements-box p { margin-top: 0; font-weight: bold; }
.requirements-box ul { list-style: none; padding: 0; margin-left: 0.5rem; }
.requirements-box li { padding: 2px 0; font-size: 0.9rem; position: relative; padding-left: 20px; }
.requirements-box li::before { position: absolute; left: 0; top: 5px; font-family: "Font Awesome 6 Free"; font-weight: 900; content: "\f00d"; color: var(--erro); }
.requirements-box li.valid { color: var(--sucesso); }
.requirements-box li.valid::before { content: "\f00c"; color: var(--sucesso); }

/* =================================================================== */
/* ===== 6. ESTILOS RESPONSIVOS ===== */
/* =================================================================== */
@media (max-width: 992px) {
    .agenda-container { 
        grid-template-columns: 1fr; 
        height: auto;
    }
    .agenda-main { 
        overflow-y: visible; 
    }
}

@media (max-width: 768px) {
    .dashboard-container { 
        display: block; 
    }
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: static; 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        padding: 0.5rem 1rem; 
    }
    .sidebar-nav, .sidebar-footer, .toggle-btn { 
        display: none; /* Em uma versão futura, isso seria um menu "hambúrguer" */
    }
    .sidebar.collapsed { 
        width: 100%; 
    }
    .main-content { 
        padding: 1rem;
        background-color: var(--cor-fundo);
    }
    .page-header { 
        flex-direction: column; 
        align-items: flex-start; 
    }
    .hero-title { 
        font-size: 2.2rem; 
    }
    .saude-actions { 
        grid-template-columns: 1fr; 
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .cards-container { 
        grid-template-columns: 1fr; 
    }
    .input-row { 
        flex-direction: column; 
        gap: 0; 
    }
    .input-row .input-group {
        margin-bottom: 1.2rem;
    }
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    .modal-actions .btn-secondary, .modal-actions .btn-danger {
        width: 100%;
    }
}

/* =================================================================== */
/* ===== ESTILOS PARA O BOTÃO DE MOSTRAR/ESCONDER SENHA ===== */
/* =================================================================== */

/* Cria um container para posicionar o ícone dentro do input */
.password-wrapper {
    position: relative;
    width: 100%;
}

/* Posiciona o ícone no canto direito do input */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--cinza-medio);
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--azul);
}

/* =================================================================== */
/* ===== ESTILOS PARA AS NOTIFICAÇÕES (TOASTS) ===== */
/* =================================================================== */

/* Container que segura as notificações no canto da tela */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000; /* Garante que fique acima de tudo */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

/* Estilo da notificação individual */
.toast {
    background-color: var(--dark-grey);
    color: var(--branco);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-weight: 500;
    
    /* Animação de entrada e saída */
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.215, 0.610, 0.355, 1);
}

/* Classe 'show' que o JavaScript adiciona para a animação de entrada */
.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Estilos para diferentes tipos de toast */
.toast.success {
    background-color: var(--sucesso);
}

.toast.error {
    background-color: var(--erro);
}

/* =================================================================== */
/* ===== ESTILOS DA PÁGINA DE METAS ===== */
/* =================================================================== */
#metas-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.meta-card {
    background-color: var(--superficie);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.meta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.meta-header h3 {
    margin: 0;
    font-size: 1.2rem;
}
.meta-status {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}
.meta-status.ativa { background-color: #cfe2ff; color: #084298; }
.meta-status.concluida { background-color: #d1e7dd; color: #0f5132; }

.meta-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.meta-progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--cinza-fundo);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.meta-progress {
    height: 100%;
    background-color: var(--sucesso);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.meta-details, .meta-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--cinza-medio);
    margin-bottom: 0.5rem;
}
.meta-values {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--preto);
}

/* Estilo para o texto de ajuda/informação nos formulários */
.form-text-info {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--cinza-medio);
}

.settings-card .checkbox-group span {
    font-weight: normal;
    color: var(--text-color);
}

/* =================================================================== */
/* ===== ESTILOS DO SISTEMA DE NOTIFICAÇÕES (VERSÃO PROFISSIONAL) ===== */
/* =================================================================== */

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 1rem; /* Adicionado padding para alinhar com o conteúdo */
}

#titulo-view-principal {
    margin: 0;
    color: var(--texto-principal);
    font-size: 1.8rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-wrapper {
    position: relative;
}

#notification-bell {
    font-size: 1.6rem;
    color: var(--cinza-medio);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 5px;
}
#notification-bell:hover {
    color: var(--azul);
}

.badge {
    position: absolute;
    top: -2px;
    right: -5px;
    background-color: var(--erro);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid var(--branco);
}

.notification-panel {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 380px;
    background-color: var(--superficie);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease-out;
}

.notification-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--cor-borda);
}
.panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
#btn-marcar-todas-lidas {
    background: none;
    border: none;
    color: var(--azul);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 5px;
}
#btn-marcar-todas-lidas:hover {
    text-decoration: underline;
}

#notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--preto);
    transition: background-color 0.2s ease;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item:hover {
    background-color: var(--cinza-fundo);
}
.notification-item.empty {
    text-align: center;
    color: var(--cinza-medio);
    padding: 2.5rem;
    font-style: italic;
}

.notification-icon {
    font-size: 1.2rem;
    color: var(--azul);
    flex-shrink: 0;
    padding-top: 2px;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}
.notification-content strong {
    font-size: 1rem;
    font-weight: 600;
}
.notification-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--cinza-medio);
    line-height: 1.4;
}
.notification-content small {
    font-size: 0.8rem;
    color: var(--cinza-medio);
    opacity: 0.8;
}

/* Estilo para o ícone de notificação de tarefa vencida */
.notification-icon.overdue {
    color: var(--erro);
}

/* =================================================================== */
/* ===== ESTILOS PARA EXCLUSÃO DE NOTIFICAÇÃO ===== */
/* =================================================================== */

.notification-item-wrapper {
    position: relative; /* Necessário para posicionar o botão de excluir */
    border-bottom: 1px solid var(--border-color);
}

.notification-item-wrapper:last-child {
    border-bottom: none;
}

.notification-item {
    border-bottom: none; /* Remove a borda do item individual */
}

/* Botão de excluir notificação */
.btn-delete-notification {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--cinza-medio);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    
    /* Começa invisível */
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

/* Mostra o botão quando o mouse passa sobre a notificação */
.notification-item-wrapper:hover .btn-delete-notification {
    opacity: 1;
    visibility: visible;
}

.btn-delete-notification:hover {
    background-color: var(--cinza-fundo);
    color: var(--erro);
}

.checkbox-group.master-switch label span {
    font-weight: bold;
    font-size: 1.1rem;
}

/* =================================================================== */
/* ===== ESTILOS PARA O DRAG-AND-DROP DA AGENDA ===== */
/* =================================================================== */

/* Adiciona o cursor de "agarrar" às tarefas arrastáveis */
.tarefa-item[draggable="true"] {
    cursor: grab;
}
.tarefa-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Estilo para a tarefa enquanto ela está sendo arrastada */
.tarefa-item.dragging {
    opacity: 0.5;
    background: var(--cinza-claro);
}

/* =================================================================== */
/* ===== ESTILOS PARA O CHECKBOX CUSTOMIZADO (SWITCH) - CORRIGIDO ===== */
/* =================================================================== */

.settings-card .checkbox-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

/* Esconde o checkbox padrão do navegador de forma acessível */
.checkbox-group input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* A label agora é a área clicável principal */
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    cursor: pointer;
    width: 100%;
}

/* Cria a base do "switch" (a "pista" cinza) */
.checkbox-group label::after {
    content: '';
    order: 1; /* Coloca o switch no final da linha */
    margin-left: auto; /* Empurra o switch para a direita */
    width: 52px;  /* Largura da base */
    height: 30px; /* Altura da base */
    background-color: var(--cinza-claro);
    border-radius: 15px; /* Metade da altura para ser arredondado */
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

/* Cria o círculo do "switch" (o botão que desliza) */
.checkbox-group label::before {
    content: '';
    position: absolute;
    right: 24px; /* Posição inicial (desligado) */
    top: 50%;
    transform: translateY(-50%); /* Centraliza verticalmente */
    width: 24px;  /* Largura do círculo */
    height: 24px; /* Altura do círculo */
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
    transition: right 0.3s ease; /* Anima a propriedade 'right' */
}

/* --- ESTADOS DO SWITCH (A LÓGICA CORRIGIDA) --- */

/* Quando o checkbox (invisível) está MARCADO, muda a cor da pista */
.checkbox-group input[type="checkbox"]:checked + label::after {
    background-color: var(--sucesso);
}

/* Quando o checkbox (invisível) está MARCADO, move o círculo */
.checkbox-group input[type="checkbox"]:checked + label::before {
    right: 3px; /* Posição final (ligado) */
}

/* Estilos para quando as sub-opções estão desabilitadas */
#fieldset-notificacoes-tipos:disabled .checkbox-group {
    opacity: 0.6;
    pointer-events: none;
}

/* Estilos para os botões de ação na lista de transações */
.transaction-value-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.transaction-actions {
    display: flex;
    opacity: 0; /* Começa invisível */
    visibility: hidden;
    transition: all 0.2s ease;
}

.transaction-item:hover .transaction-actions {
    opacity: 1; /* Aparece no hover */
    visibility: visible;
}

/* =================================================================== */
/* ===== ESTILOS APRIMORADOS PARA A ZONA DE PERIGO ===== */
/* =================================================================== */

/* Melhora o design do card de perigo */
.danger-zone {
    border-color: #ffd2d2;
    background-color: #fff5f5;
    padding: 2rem;
}

.danger-zone h2 {
    color: var(--erro);
    border-bottom-color: #ffb8b8;
    font-size: 1.4rem;
}

.danger-zone p {
    color: #58151c;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Estilo para o botão de apagar conta */
.btn-danger {
    background-color: var(--erro);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* Deixa o botão de confirmação desabilitado com aparência clara */
.btn-danger:disabled {
    background-color: #f5c6cb;
    cursor: not-allowed;
}

/* =================================================================== */
/* ===== ESTILOS PARA O INDICADOR DE CARREGAMENTO (SPINNER) ===== */
/* =================================================================== */

.loading-spinner-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--cinza-medio);
    text-align: center;
}

.loading-spinner {
    font-size: 2.5rem;
    color: var(--azul);
    animation: spin 1.5s linear infinite; /* Animação de rotação */
}

.loading-spinner-container p {
    margin-top: 1rem;
    font-weight: 500;
}

/* Animação que faz o ícone girar */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* =================================================================== */
/* ===== ESTILOS PARA OS "ESTADOS VAZIOS" AMIGÁVEIS ===== */
/* =================================================================== */

.empty-state-container {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--cinza-fundo);
    border: 2px dashed var(--cinza-claro);
    border-radius: 8px;
    margin-top: 1rem;
    opacity: 0.7;
}

.empty-state-icon {
    font-size: 3.5rem;
    color: var(--azul);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--preto);
    margin: 0;
}

.empty-state-text {
    margin-top: 0.5rem;
    color: var(--cinza-medio);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =================================================================== */
/* ===== ESTILOS PARA OS ÍCONES DA LISTA FINANCEIRA (SEM FUNDO) ===== */
/* =================================================================== */

/* Ajusta o item da transação para alinhar o novo ícone */
.transaction-item {
    display: flex;
    align-items: center; /* Alinha verticalmente os itens */
    gap: 1rem; /* Espaço entre o ícone e os detalhes */
}

/* O contêiner do ícone (agora sem tamanho fixo) */
.transaction-icon {
    font-size: 1.5rem; /* Aumenta um pouco o tamanho do ícone */
    flex-shrink: 0; /* Impede que o ícone seja espremido */
}

/* Colore o ícone de receita (seta para cima) */
.transaction-item .fa-arrow-up {
    color: var(--sucesso);
}

/* Colore o ícone de despesa (seta para baixo) */
.transaction-item .fa-arrow-down {
    color: var(--erro);
}

/* Ajusta os outros elementos para funcionarem bem com o flexbox */
.transaction-details {
    flex-grow: 1; /* Faz os detalhes ocuparem o espaço disponível */
}

.transaction-value-actions {
    margin-left: auto; /* Empurra o valor e as ações para a direita */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--texto-secundario);
}

p, span, label {
    color: var(--texto-secundario); /* Para textos menores e rótulos */
}

/* =================================================================== */
/* ===== ESTILOS DO MODO ESCURO (DARK MODE) ===== */
/* =================================================================== */

.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none; /* Esconde o checkbox padrão */
}

/* A base do interruptor */
.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

/* O círculo que desliza */
.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
}

/* Estilo para o estado "ligado" (modo escuro) */
input:checked + .slider {
    background-color: var(--cor-azul);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Deixa os cantos arredondados */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ÍCONES DE SOL E LUA */
.sun-icon, .moon-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    transition: opacity 0.4s ease;
}

.sun-icon {
    left: 8px;
    color: #f39c12;
    opacity: 1; /* Visível por padrão */
}

.moon-icon {
    right: 8px;
    color: #f1c40f;
    opacity: 0; /* Invisível por padrão */
}

/* Lógica de visibilidade dos ícones */
input:checked ~ .slider .sun-icon {
    opacity: 0; /* Esconde o sol no modo escuro */
}

input:checked ~ .slider .moon-icon {
    opacity: 1; /* Mostra a lua no modo escuro */
}

/* =================================================================== */
/* ===== CORREÇÃO DE COR DE TEXTO PARA O TEMA CLARO ===== */
/* =================================================================== */

/* Garante que o texto dentro dos cards de resumo seja escuro no tema claro */
.data-card h4,
.data-card p {
    color: var(--cor-texto-secundario);
}

.data-card p {
    color: var(--cor-texto-principal);
    font-weight: 600;
}

/* Garante que os rótulos de formulário sejam escuros no tema claro */
.input-group label,
.month-filter label,
.date-filter label {
    color: var(--cor-texto-principal);
}

/* Garante que o texto dos itens da lista de transações seja escuro */
.transaction-details .description {
    color: var(--cor-texto-principal);
}

.transaction-details .date {
    color: var(--cor-texto-secundario);
}