/* Reset e estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Container principal */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

/* Integrar anúncios com o header */
.app-header .adsense-top-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}

.app-header .adsense-ad {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    height: 80px;
    max-width: 250px;
}

.app-header .adsense-placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.app-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.app-header h1 i {
    margin-right: 0.5rem;
}

/* Navegação principal */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
}

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

.nav-btn.btn-primary {
    background: #28a745;
}

.nav-btn.btn-primary:hover {
    background: #218838;
}

.nav-btn.btn-secondary {
    background: #6c757d;
}

.nav-btn.btn-secondary:hover {
    background: #5a6268;
}

.nav-btn.btn-danger {
    background: #dc3545;
}

.nav-btn.btn-danger:hover {
    background: #c82333;
}

/* Conteúdo principal */
.main-content {
    display: flex;
    flex: 1;
    gap: 2rem;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Painéis */
.left-panel {
    flex: 0 0 45%;
    max-width: 600px;
}

.right-panel {
    flex: 0 0 55%;
    max-width: 800px;
}

.content-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.panel-header {
    background: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Abas do painel */
.panel-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    background: white;
    color: #6c757d;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tab-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* Botão de Importar Excel em vermelho */
.tab-btn[onclick*="showImportExcelForm"] {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.tab-btn[onclick*="showImportExcelForm"]:hover {
    background: #c82333;
    border-color: #c82333;
}

.tab-btn[onclick*="showImportExcelForm"].active {
    background: #c82333;
    border-color: #c82333;
}

/* Formulários */
.expense-form, .settings-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* Botões */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-primary:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Botões de ação minimalistas */
.btn-warning, .btn-danger {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 70px;
    justify-content: center;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn-warning:hover {
    background-color: #ffb300;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    min-width: 60px;
}

/* Seções de configurações */
.settings-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h4 {
    margin-bottom: 1rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Seções de lista */
.list-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.list-section:last-child {
    border-bottom: none;
}

.list-section h4 {
    margin-bottom: 1rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mensagem de lista vazia */
.empty-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

/* Lista de itens */
.items-list {
    margin-top: 1rem;
}

.category-item, .member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.category-info, .member-info {
    flex: 1;
}

.category-name, .member-name {
    font-weight: 600;
    color: #495057;
}

.category-actions, .member-actions {
    display: flex;
    gap: 0.5rem;
}

/* Filtros de período */
.period-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    height: 38px;
    box-sizing: border-box;
}

.filter-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Botão de aplicar filtro */
#applyPeriodFilter {
    padding: 8px 16px;
    font-size: 14px;
    height: 38px;
    align-self: flex-end;
    margin-bottom: 5px;
    min-width: 120px;
    white-space: nowrap;
}

/* Lista de despesas */
.expenses-list {
    padding: 1.5rem;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #667eea;
}

.expense-info {
    flex: 1;
}

.expense-date {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.expense-amount {
    font-weight: 600;
    color: #dc3545;
    font-size: 1.1rem;
}

.expense-description {
    color: #495057;
    margin-top: 0.25rem;
}

.expense-actions {
    display: flex;
    gap: 0.5rem;
}

/* Gráficos */
.charts-container {
    padding: 1.5rem;
}

.chart-card {
    margin-bottom: 2rem;
}

.chart-card h4 {
    margin-bottom: 1rem;
    color: #495057;
    text-align: center;
}

.chart-card canvas {
    max-height: 300px;
}

/* Importação Excel */
.import-content {
    padding: 1.5rem;
}

.excel-format, .import-prerequisites {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.excel-format h4, .import-prerequisites h4 {
    margin-bottom: 1rem;
    color: #495057;
}

.excel-format ul, .import-prerequisites ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.excel-format li, .import-prerequisites li {
    margin-bottom: 0.5rem;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.upload-content i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.upload-content h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.upload-content p {
    color: #6c757d;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* Responsividade */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
        padding: 1rem;
    }
    
    .left-panel, .right-panel {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .main-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .period-filters {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .expense-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .expense-actions {
        align-self: stretch;
        justify-content: center;
    }
}

/* Media Queries para Responsividade Mobile */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .content-panel {
        margin-bottom: 1rem;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 120px;
    }
    
    .main-nav {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .expense-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .period-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .charts-filters {
        padding: 15px;
    }
    
    .charts-filters .filter-group {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .charts-filters .filter-group select {
        width: 100%;
    }
    
    .chart-card {
        padding: 15px;
        margin: 0 10px;
    }
    
    .chart-card canvas {
        max-height: 250px;
    }
    
    .expense-item {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .expense-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .expense-actions {
        justify-content: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.5rem 1rem;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        min-width: 100px;
    }
    
    .content-panel {
        padding: 15px;
    }
    
    .panel-header h3 {
        font-size: 1.2rem;
    }
}

/* Estilos para autenticação */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 14px; /* Reduzido de 20px em 30% */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

/* Integrar anúncios com o container de autenticação */
.auth-container .adsense-top-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}

.auth-container .adsense-ad {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    height: 80px;
    max-width: 250px;
}

.auth-container .adsense-placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.auth-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 28px; /* Reduzido de 40px em 30% */
    width: 100%;
    max-width: 400px;
    position: relative;
    margin-top: -15vh; /* Adicionado para reduzir distância do topo */
}

.auth-form h2 {
    text-align: center;
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.auth-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1rem;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #6f42c1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: #5a32a3;
}

.auth-question {
    margin-top: 15px;
    text-align: center;
}

.auth-question a {
    color: #6f42c1;
    text-decoration: none;
    font-weight: 500;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    text-decoration: none;
    margin-top: 20px;
    padding: 10px 0;
    transition: color 0.3s;
}

.btn-back:hover {
    color: #495057;
}

/* Estilos para a página inicial */
.welcome-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin: 40px auto;
    max-width: 800px;
    text-align: center;
    position: relative;
}

/* Integrar anúncios com o container da página inicial */
.welcome-content .adsense-top-container {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}

.welcome-content .adsense-ad {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    height: 60px;
    max-width: 200px;
}

.welcome-content .adsense-placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.welcome-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.welcome-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.welcome-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.welcome-card i {
    font-size: 3rem;
    color: #6f42c1;
    margin-bottom: 20px;
}

.welcome-card h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.welcome-card p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

.welcome-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.welcome-actions .btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    min-width: 180px;
}

/* Centralizar o header também */
.app-header {
    text-align: center;
    padding: 30px 20px;
    position: relative;
}

.app-header h1 {
    margin-bottom: 10px;
}

.app-header p {
    margin: 0;
    font-size: 1.1rem;
}

/* Integrar anúncios com o header centralizado */
.app-header .adsense-top-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}

.app-header .adsense-ad {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    height: 80px;
    max-width: 250px;
}

.app-header .adsense-placeholder {
    color: rgba(255, 255, 255, 0.8);
}

/* Estatísticas rápidas */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #495057;
}

/* Estilos para AdSense */
.adsense-top-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 0;
    background: transparent;
    border: none;
}

.adsense-ad {
    flex: 1;
    max-width: 300px;
    height: 90px;
    margin: 0 10px;
    background: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ced4da;
}

.adsense-ad:first-child {
    margin-left: 0;
}

.adsense-ad:last-child {
    margin-right: 0;
}

.adsense-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6c757d;
    font-size: 14px;
}

.adsense-placeholder i {
    font-size: 24px;
    margin-bottom: 5px;
}

/* Barra flutuante inferior */
.adsense-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.adsense-bottom-bar .adsense-placeholder {
    color: #6c757d;
    font-size: 14px;
}

/* Barras flutuantes laterais */
.adsense-left-sidebar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    border-radius: 0 8px 8px 0;
}

.adsense-right-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    border-radius: 8px 0 0 8px;
}

.adsense-sidebar .adsense-placeholder {
    color: #6c757d;
    font-size: 12px;
    text-align: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.adsense-sidebar .adsense-placeholder i {
    font-size: 20px;
    margin-bottom: 10px;
    transform: rotate(90deg);
}

/* Ajustar margens laterais do conteúdo para as barras laterais */
.app-container {
    margin-bottom: 80px;
    margin-left: 180px;
    margin-right: 180px;
}

/* Ajustar margem inferior do conteúdo para a barra flutuante */

/* Responsividade para AdSense */
@media (max-width: 1200px) {
    .adsense-left-sidebar,
    .adsense-right-sidebar {
        display: none;
    }
    
    .app-container {
        margin-left: 20px;
        margin-right: 20px;
    }
}

@media (max-width: 768px) {
    .adsense-top-container {
        flex-direction: column;
        padding: 10px;
    }
    
    .adsense-ad {
        max-width: 100%;
        margin: 5px 0;
        height: 70px;
    }
    
    .adsense-bottom-bar {
        height: 50px;
    }
    
    .app-container {
        margin-bottom: 70px;
        margin-left: 10px;
        margin-right: 10px;
    }
    
    /* Ajustar anúncios integrados em mobile */
    .app-header .adsense-top-container,
    .auth-container .adsense-top-container,
    .welcome-content .adsense-top-container {
        position: relative;
        top: auto;
        height: auto;
        margin-bottom: 20px;
    }
    
    .app-header .adsense-ad,
    .auth-container .adsense-ad,
    .welcome-content .adsense-ad {
        background: #e9ecef;
        border: 2px dashed #ced4da;
        height: 60px;
    }
    
    .app-header .adsense-placeholder,
    .auth-container .adsense-placeholder,
    .welcome-content .adsense-placeholder {
        color: #6c757d;
    }
}

/* Estilos para Relatórios */
.report-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.report-section h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #6c5ce7;
    padding-bottom: 10px;
}

.report-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-width: 100%;
    position: relative;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    table-layout: auto;
}

.report-table th,
.report-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    white-space: nowrap;
    min-width: 80px;
}

.report-table th {
    background: #6c5ce7;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.report-table th:first-child,
.report-table td:first-child {
    text-align: left;
    font-weight: 600;
    min-width: 100px;
    width: auto;
}

.report-table th:nth-child(2),
.report-table td:nth-child(2) {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    min-width: 120px;
    width: auto;
}

/* Colunas das categorias/membros - largura dinâmica */
.report-table th:not(:first-child):not(:nth-child(2)),
.report-table td:not(:first-child):not(:nth-child(2)) {
    min-width: 100px;
    width: auto;
    max-width: 200px;
}

/* Melhorar distribuição das colunas */
.report-table {
    width: max-content;
    min-width: 100%;
    border-spacing: 0;
}

/* Ajustar largura das colunas baseado no conteúdo */
.report-table th,
.report-table td {
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Melhorar responsividade em telas pequenas */
@media (max-width: 768px) {
    .report-table-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .report-table th,
    .report-table td {
        min-width: 80px;
        padding: 8px 10px;
        font-size: 14px;
    }
}

.report-table tbody tr:hover {
    background: #f8f9fa;
}

.report-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

/* Filtros de Período para Relatórios */
.report-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.report-filters h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #6c5ce7;
    padding-bottom: 10px;
}

.report-filters .filter-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 15px;
}

.report-filters .filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.report-filters .filter-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

.report-filters .btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 14px;
}

/* Filtros de Período para Gráficos */
.charts-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.charts-filters h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.charts-filters .filter-group {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
}

.charts-filters .filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.charts-filters .filter-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

.charts-filters .btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 14px;
}

/* Container de Gráficos */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    align-items: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 600px;
}

.chart-card h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chart-card canvas {
    max-height: 300px;
    width: 100% !important;
}

/* Estilos para Tabela de Despesas (Layout Quadriculado) */
.expense-table-header {
    margin-bottom: 20px;
}

.expense-table-row {
    display: grid;
    grid-template-columns: 80px 120px 2fr 1fr 1fr 120px;
    gap: 0; /* Sem gap para criar aparência quadriculada */
    align-items: center;
    padding: 8px 0; /* Altura reduzida significativamente */
    margin-bottom: 0; /* Sem margem entre linhas */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-bottom: 1px solid #e9ecef;
    min-height: 40px; /* Altura mínima controlada */
}

.header-row {
    background: #e8e4f3;
    color: #000000;
    font-weight: 600;
    font-size: 13px; /* Fonte ligeiramente menor */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #d1c7e0; /* Borda mais grossa para cabeçalho */
}

.expense-cell {
    padding: 8px 12px;
    border-right: 1px solid #e9ecef; /* Borda direita para cada célula */
    font-size: 13px; /* Fonte ligeiramente menor */
    line-height: 1.2; /* Line-height bem reduzido */
    white-space: nowrap; /* Evita quebra de texto */
    overflow: hidden; /* Esconde conteúdo que exceda */
    text-overflow: ellipsis; /* Adiciona "..." se necessário */
    display: flex;
    align-items: center;
    justify-content: center;
}

.expense-cell:nth-child(3) { /* Descrição */
    justify-content: flex-start; /* Alinhamento à esquerda */
    text-align: left;
}

.expense-cell:nth-child(6) { /* Ações */
    border-right: none; /* Última célula sem borda direita */
}

.header-cell {
    text-align: center;
    font-weight: 600;
    border-right: 1px solid #d1c7e0; /* Borda mais escura para cabeçalho */
}

.expense-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e9ecef; /* Borda externa da tabela */
}

.expense-table .expense-table-row:not(.header-row) {
    background: white;
    transition: background-color 0.2s ease;
}

.expense-table .expense-table-row:not(.header-row):hover {
    background: #f8f9fa;
}

.expense-table .expense-table-row:not(.header-row):last-child {
    border-bottom: none;
}

/* Estilos específicos para cada coluna */
.expense-cell:nth-child(1) { /* Data */
    text-align: center;
    font-weight: 500;
    color: #000000;
    justify-content: center;
}

.expense-cell:nth-child(2) { /* Valor */
    text-align: center;
    font-weight: 600;
    color: #dc3545;
    font-size: 14px;
    justify-content: center;
}

.expense-cell:nth-child(3) { /* Descrição */
    text-align: left;
    color: #000000;
    font-weight: 500;
    justify-content: flex-start;
}

.expense-cell:nth-child(4) { /* Categoria */
    text-align: center;
    color: #000000;
    font-weight: 500;
    justify-content: center;
}

.expense-cell:nth-child(5) { /* Membro */
    text-align: center;
    color: #000000;
    font-weight: 500;
    justify-content: center;
}

.expense-cell:nth-child(6) { /* Ações */
    text-align: center;
    justify-content: center;
}



/* Responsividade para tabela */
@media (max-width: 768px) {
    .expense-table-row {
        grid-template-columns: 1fr;
        gap: 0;
        text-align: center;
        border-bottom: 1px solid #e9ecef;
        padding: 10px 0;
    }
    
    .expense-cell {
        padding: 8px 12px;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        white-space: normal; /* Permite quebra de linha em mobile */
        text-overflow: initial;
        overflow: visible;
        justify-content: center;
    }
    
    .expense-cell:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #000000;
        display: block;
        margin-bottom: 4px;
    }
    
    .expense-actions {
        justify-content: center;
        margin-top: 5px;
    }
    
    .expense-cell:nth-child(3) { /* Descrição */
        justify-content: center;
        text-align: center;
    }
}

/* Botões de ação com ícones */
.expense-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-edit {
    background: #ffc107;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-icon i {
    font-size: 12px;
}

/* Estilos para itens de categoria e membro */
.category-item, .member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.category-item:hover, .member-item:hover {
    background-color: #f8f9fa;
}

.item-name {
    font-weight: 500;
    color: #495057;
    flex: 1;
}

.item-actions {
    display: flex;
    gap: 8px;
}

/* Botões de ação com ícones para categorias e membros */
.item-actions .btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.item-actions .btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.item-actions .btn-edit {
    background: #ffc107;
}

.item-actions .btn-edit:hover {
    background: #e0a800;
}

.item-actions .btn-delete {
    background: #dc3545;
}

.item-actions .btn-delete:hover {
    background: #c82333;
}

.item-actions .btn-icon i {
    font-size: 10px;
}

/* Estilos para painel de configurações */
.settings-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.settings-section h4 {
    color: #495057;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h4 i {
    color: #6c757d;
    font-size: 14px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-form label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.settings-form input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.settings-form input[type="text"]:focus {
    outline: none;
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.settings-form .btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.settings-form .btn-success {
    background: #28a745;
    color: white;
}

.settings-form .btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* ===== ESTILOS PARA AVISO MÓVEL ===== */
.mobile-warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    animation: slideInDown 0.5s ease-out;
    display: none; /* Inicialmente oculto */
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .mobile-warning {
        margin: 10px;
        padding: 12px 15px;
    }
    
    .warning-content {
        gap: 10px;
    }
    
    .warning-text h4 {
        font-size: 14px;
    }
    
    .warning-text p {
        font-size: 12px;
    }
    
    .warning-content i {
        font-size: 20px;
    }
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.warning-content i {
    font-size: 24px;
    color: #fff;
}

.warning-text h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.warning-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.warning-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warning-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
