/* Estilos específicos para o dashboard - Tema Vermelho e Cinza */

/* Cores principais do tema */
:root {
    --vermelho-principal: #c62828;     /* Vermelho forte */
    --vermelho-claro: #ef5350;         /* Vermelho claro */
    --vermelho-escuro: #b71c1c;        /* Vermelho escuro */
    --cinza-principal: #424242;        /* Cinza escuro */
    --cinza-claro: #616161;            /* Cinza médio */
    --cinza-clarissimo: #eeeeee;       /* Cinza claro */
    --cinza-bg: #f5f5f5;               /* Cinza de fundo */
    --branco: #ffffff;
    --preto: #212121;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.dashboard-card {
    background-color: var(--branco);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid var(--vermelho-principal);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-left-color: var(--vermelho-escuro);
}

.dashboard-card h3 {
    color: var(--vermelho-principal);
    margin-bottom: 15px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-card p {
    color: var(--cinza-claro);
    margin-bottom: 20px;
}

.card-icon {
    font-size: 1.8rem;
    color: var(--vermelho-claro);
}

/* Estatísticas */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--branco);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--cinza-clarissimo);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--vermelho-claro);
    box-shadow: 0 6px 12px rgba(198, 40, 40, 0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--vermelho-principal);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--cinza-principal);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Tabelas */
.table-container {
    background-color: var(--branco);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid var(--cinza-clarissimo);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: var(--vermelho-principal);
    color: var(--branco);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 3px solid var(--vermelho-escuro);
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--cinza-clarissimo);
    color: var(--cinza-principal);
}

.data-table tr:hover {
    background-color: rgba(239, 83, 80, 0.05);
}

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

/* Botões com tema vermelho */
.btn-primary {
    background-color: var(--vermelho-principal);
    color: var(--branco);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--vermelho-escuro);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(198, 40, 40, 0.2);
}

.btn-secondary {
    background-color: var(--cinza-principal);
    color: var(--branco);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--cinza-claro);
}

.btn-success {
    background-color: #2e7d32; /* Verde sucesso mantido */
    color: var(--branco);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background-color: #1b5e20;
}

.btn-danger {
    background-color: #d32f2f;
    color: var(--branco);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Formulários do dashboard */
.dashboard-form {
    background-color: var(--branco);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--cinza-clarissimo);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--vermelho-principal);
}

.form-header h2 {
    color: var(--vermelho-principal);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--cinza-clarissimo);
}

/* Cards de detalhes */
.detail-card {
    background-color: var(--branco);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--cinza-principal);
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--cinza-clarissimo);
}

.detail-label {
    font-weight: 600;
    min-width: 150px;
    color: var(--vermelho-principal);
}

.detail-value {
    color: var(--cinza-principal);
}

/* Status badges - Ajustados para tema vermelho/cinza */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.status-pendente {
    background-color: #ffebee;
    color: var(--vermelho-principal);
    border-color: var(--vermelho-claro);
}

.status-andamento {
    background-color: #fff8e1;
    color: #ff8f00;
    border-color: #ffd54f;
}

.status-concluido {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-color: #81c784;
}

.status-entregue {
    background-color: #e3f2fd;
    color: #1565c0;
    border-color: #64b5f6;
}

.status-pago {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-color: #81c784;
}

.status-aprovado {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-color: #81c784;
}

.status-recusado {
    background-color: #ffebee;
    color: var(--vermelho-principal);
    border-color: var(--vermelho-claro);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--branco);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    border: 3px solid var(--vermelho-principal);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease-out;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--cinza-clarissimo);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--cinza-principal);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.modal-close:hover {
    background-color: var(--vermelho-principal);
    color: var(--branco);
    transform: rotate(90deg);
}

.modal-title {
    color: var(--vermelho-principal);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cinza-clarissimo);
}

/* Dashboard sections */
.dashboard-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: var(--cinza-bg);
    border-radius: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--vermelho-principal);
}

.section-header h2 {
    color: var(--vermelho-principal);
}

/* Loader */
.loader {
    border: 4px solid var(--cinza-clarissimo);
    border-top: 4px solid var(--vermelho-principal);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-color: #81c784;
}

.alert-error {
    background-color: #ffebee;
    color: var(--vermelho-principal);
    border-color: var(--vermelho-claro);
}

.alert-warning {
    background-color: #fff8e1;
    color: #ff8f00;
    border-color: #ffd54f;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1565c0;
    border-color: #64b5f6;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--cinza-principal);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--cinza-claro);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: var(--branco);
    color: var(--cinza-principal);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--vermelho-principal);
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.1);
}

/* Ícones e elementos decorativos */
.icon-red {
    color: var(--vermelho-principal);
}

.icon-gray {
    color: var(--cinza-principal);
}

/* Badges e tags */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--cinza-clarissimo);
    color: var(--cinza-principal);
}

.badge-red {
    background-color: var(--vermelho-principal);
    color: var(--branco);
}

.badge-gray {
    background-color: var(--cinza-principal);
    color: var(--branco);
}

/* Separadores */
.hr-red {
    border: none;
    height: 2px;
    background-color: var(--vermelho-principal);
    margin: 20px 0;
}

.hr-gray {
    border: none;
    height: 1px;
    background-color: var(--cinza-clarissimo);
    margin: 20px 0;
}

/* Títulos e textos */
h1, h2, h3, h4, h5, h6 {
    color: var(--vermelho-principal);
}

.text-red {
    color: var(--vermelho-principal) !important;
}

.text-gray {
    color: var(--cinza-principal) !important;
}

.text-center {
    text-align: center;
}

/* Cards de resumo */
.summary-card {
    background: linear-gradient(135deg, var(--branco) 0%, var(--cinza-clarissimo) 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--cinza-clarissimo);
    transition: all 0.3s ease;
}

.summary-card:hover {
    border-color: var(--vermelho-claro);
    transform: translateY(-3px);
}

.summary-card .value {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--vermelho-principal);
    margin: 10px 0;
}

.summary-card .label {
    color: var(--cinza-claro);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animações para modais */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   REMOVER BOTÃO "CANCELAR" DOS FORM-ACTIONS
   ============================================ */

/* Esconder botões "Cancelar" e "Fechar" mas manter o "×" */
.form-actions .btn-secondary.modal-close,
.modal .btn-secondary:not(.modal-close) {
    display: none !important;
}

/* Ajustar form-actions para ter apenas um botão */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--cinza-clarissimo);
}

.form-actions .btn {
    min-width: 180px;
    padding: 14px 30px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ============================================
   CORREÇÕES ESPECÍFICAS PARA FINANCEIRO
   ============================================ */

/* Resumo financeiro - layout responsivo */
.resumo-financeiro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.resumo-card {
    background-color: var(--branco);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid var(--vermelho-principal);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.resumo-card.valor-total {
    border-left-color: var(--vermelho-principal);
    background: linear-gradient(135deg, #fef2f2 0%, var(--branco) 100%);
}

.resumo-card.recebido {
    border-left-color: #2e7d32;
    background: linear-gradient(135deg, #f0f9f0 0%, var(--branco) 100%);
}

.resumo-card.pendente {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, #fff8e1 0%, var(--branco) 100%);
}

.resumo-card.atrasado {
    border-left-color: #d32f2f;
    background: linear-gradient(135deg, #ffebee 0%, var(--branco) 100%);
}

.resumo-card .valor {
    font-size: 2.2rem;
    font-weight: bold;
    margin: 10px 0;
    color: var(--cinza-principal);
}

.resumo-card.valor-total .valor {
    color: var(--vermelho-principal);
}

.resumo-card.recebido .valor {
    color: #2e7d32;
}

.resumo-card.pendente .valor {
    color: #ff9800;
}

.resumo-card.atrasado .valor {
    color: #d32f2f;
}

.resumo-card .label {
    color: var(--cinza-claro);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Filtros do financeiro */
.filtros-financeiro {
    background-color: var(--branco);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--cinza-clarissimo);
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filtro-group {
    margin-bottom: 0;
}

.filtro-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--cinza-principal);
    font-weight: 600;
    font-size: 0.9rem;
}

.filtros-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Tabela de financeiro específica */
.financeiro-table-container {
    background-color: var(--branco);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    border: 1px solid var(--cinza-clarissimo);
}

.financeiro-table {
    width: 100%;
    border-collapse: collapse;
}

.financeiro-table th {
    background-color: var(--cinza-clarissimo);
    color: var(--cinza-principal);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--vermelho-principal);
}

.financeiro-table td {
    padding: 15px;
    border-bottom: 1px solid var(--cinza-clarissimo);
    color: var(--cinza-principal);
}

.financeiro-table tr:hover {
    background-color: rgba(239, 83, 80, 0.05);
}

/* Status de pagamento específicos */
.status-pagamento {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pago {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.status-pendente {
    background-color: #fff8e1;
    color: #ff9800;
}

.status-atrasado {
    background-color: #ffebee;
    color: #d32f2f;
}

.status-cancelado {
    background-color: #f5f5f5;
    color: var(--cinza-claro);
}

/* ============================================
   RESPONSIVIDADE GERAL
   ============================================ */

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
    
    .dashboard-card {
        padding: 20px;
        border-left: 3px solid var(--vermelho-principal);
    }
    
    .dashboard-card h3 {
        font-size: 1.2rem;
        gap: 8px;
    }
    
    .card-icon {
        font-size: 1.4rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Modal em mobile */
    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 60px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 100%;
        max-height: 85vh;
        padding: 20px;
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
        top: 10px;
        right: 10px;
        font-size: 1.8rem;
        background: var(--branco);
        border: 2px solid var(--cinza-clarissimo);
    }
    
    .modal-close:hover {
        transform: rotate(90deg) scale(1.1);
    }
    
    .modal-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    /* Tabelas responsivas */
    .table-container {
        overflow-x: auto;
        border-radius: 8px;
        margin-bottom: 20px;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .data-table .actions {
        flex-direction: column;
        gap: 5px;
    }
    
    /* Formulários */
    .dashboard-form {
        padding: 20px;
    }
    
    .form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }
    
    .form-actions .btn {
        width: 100%;
        min-width: auto;
        padding: 16px;
        font-size: 1.2rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 0.8rem;
        width: auto;
    }
    
    /* Cards de detalhes */
    .detail-card {
        padding: 20px;
    }
    
    .detail-row {
        flex-direction: column;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    .detail-label {
        min-width: auto;
        margin-bottom: 5px;
        width: 100%;
    }
    
    .detail-value {
        width: 100%;
    }
    
    /* Status badges */
    .status-badge {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    /* Cards de resumo */
    .summary-card {
        padding: 15px;
    }
    
    .summary-card .value {
        font-size: 1.8rem;
    }
    
    .summary-card .label {
        font-size: 0.8rem;
    }
    
    /* Alertas */
    .alert {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    /* Formulários */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    /* Dashboard sections */
    .dashboard-section {
        margin-bottom: 30px;
        padding: 15px;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    /* ============================================
       RESPONSIVIDADE ESPECÍFICA PARA FINANCEIRO
       ============================================ */
    
    .resumo-financeiro {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .resumo-card {
        padding: 15px;
    }
    
    .resumo-card .valor {
        font-size: 1.8rem;
    }
    
    .resumo-card .label {
        font-size: 0.8rem;
    }
    
    .filtros-financeiro {
        padding: 15px;
    }
    
    .filtros-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filtros-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .filtros-actions .btn {
        width: 100%;
    }
    
    /* Tabela de financeiro em mobile */
    .financeiro-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .financeiro-table {
        min-width: 700px;
    }
    
    /* Alternativa de cards para financeiro em mobile */
    .financeiro-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .financeiro-card {
        background-color: var(--branco);
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border-left: 4px solid var(--vermelho-principal);
    }
    
    .financeiro-card-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--cinza-clarissimo);
    }
    
    .financeiro-card-row:last-child {
        border-bottom: none;
    }
    
    .financeiro-card-label {
        font-weight: 600;
        color: var(--vermelho-principal);
        min-width: 120px;
    }
    
    .financeiro-card-value {
        text-align: right;
        color: var(--cinza-principal);
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .dashboard-card h3 {
        font-size: 1.1rem;
    }
    
    .dashboard-card p {
        font-size: 0.9rem;
    }
    
    /* Modal em celulares muito pequenos */
    .modal-content {
        padding: 15px;
        max-height: 90vh;
        width: 98%;
        border-radius: 12px;
    }
    
    .modal-close {
        width: 42px;
        height: 42px;
        top: 8px;
        right: 8px;
        font-size: 1.7rem;
    }
    
    /* Tabelas */
    .data-table {
        min-width: 500px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    /* Cards mais compactos */
    .dashboard-card {
        padding: 15px;
    }
    
    /* Header do formulário */
    .form-header h2 {
        font-size: 1.2rem;
    }
    
    /* Badges mais compactos */
    .badge {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    
    /* ============================================
       RESPONSIVIDADE ESPECÍFICA PARA FINANCEIRO 480px
       ============================================ */
    
    .resumo-financeiro {
        grid-template-columns: 1fr;
    }
    
    .resumo-card {
        padding: 20px;
    }
    
    .resumo-card .valor {
        font-size: 2rem;
    }
    
    .financeiro-card {
        padding: 12px;
    }
    
    .financeiro-card-actions {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .financeiro-card-actions .btn-sm {
        flex: 1;
        min-width: 70px;
        text-align: center;
    }
}

/* ============================================
   TÉCNICAS AVANÇADAS PARA TABELAS RESPONSIVAS
   ============================================ */

@media (max-width: 768px) {
    .table-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table-card {
        background-color: var(--branco);
        border-radius: 8px;
        padding: 15px;
        border-left: 3px solid var(--vermelho-principal);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .table-card-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--cinza-clarissimo);
    }
    
    .table-card-row:last-child {
        border-bottom: none;
    }
    
    .table-card-label {
        font-weight: 600;
        color: var(--vermelho-principal);
        min-width: 120px;
    }
    
    .table-card-value {
        text-align: right;
        color: var(--cinza-principal);
    }
    
    .table-scroll-indicator {
        display: block;
        text-align: center;
        padding: 10px;
        color: var(--cinza-claro);
        font-size: 0.9rem;
        background: var(--cinza-clarissimo);
        border-radius: 0 0 8px 8px;
    }
}

/* ============================================
   MELHORIAS DE USABILIDADE PARA TOUCH
   ============================================ */

@media (max-width: 768px) {
    .btn,
    .main-nav a,
    .modal-close {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .data-table .actions .btn-sm {
        min-height: 36px;
        padding: 10px 15px;
    }
    
    .form-group input,
    .form-group select {
        min-height: 44px;
    }
    
    /* Desativar hover effects em dispositivos touch */
    @media (hover: none) {
        .dashboard-card:hover,
        .stat-card:hover,
        .summary-card:hover {
            transform: none;
        }
        
        .btn:hover {
            transform: none;
        }
        
        .modal-close:hover {
            transform: none;
        }
    }
}

/* ============================================
   ORIENTAÇÃO PAISAGEM
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modal {
        padding-top: 10px;
        align-items: flex-start;
    }
    
    .modal-content {
        max-height: 85vh;
        max-width: 95vw;
    }
    
    .modal-close {
        top: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
    }
    
    /* Financeiro em paisagem */
    .resumo-financeiro {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

.modal-close:focus {
    outline: 3px solid var(--vermelho-principal);
    outline-offset: 2px;
    background: var(--vermelho-principal);
    color: var(--branco);
}

.btn:focus,
.main-nav a:focus,
.form-group input:focus {
    outline: 3px solid var(--vermelho-principal);
    outline-offset: 2px;
}

/* ============================================
   ANIMAÇÕES ESPECÍFICAS PARA MOBILE
   ============================================ */

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

@keyframes modalFadeInDesktop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .modal.active .modal-content {
        animation: modalSlideUpMobile 0.3s ease-out;
    }
}

@media (min-width: 769px) {
    .modal.active .modal-content {
        animation: modalFadeInDesktop 0.3s ease-out;
    }
}

/* ============================================
   UTILITÁRIOS RESPONSIVOS
   ============================================ */

.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-mt-20 {
        margin-top: 20px !important;
    }
    
    .mobile-mb-20 {
        margin-bottom: 20px !important;
    }
}

/* ============================================
   CORREÇÕES PARA IOS/SAFARI
   ============================================ */

@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .dashboard-grid {
            gap: 10px;
        }
        
        .modal {
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
        }
        
        .dashboard-card,
        .stat-card,
        .summary-card {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .modal-close {
            -webkit-tap-highlight-color: transparent;
        }
        
        /* Scroll suave para financeiro */
        .financeiro-table-container {
            -webkit-overflow-scrolling: touch;
        }
    }
}

/* ============================================
   ITENS DO ORÇAMENTO
   ============================================ */

.item-orcamento {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

/* ============================================
   ANIMAÇÕES DE CARREGAMENTO MOBILE
   ============================================ */

.mobile-loading {
    text-align: center;
    padding: 40px 20px;
}

.mobile-loading .loader {
    margin: 0 auto 20px;
    width: 30px;
    height: 30px;
    border-width: 3px;
}

.mobile-loading p {
    color: var(--cinza-claro);
    font-size: 0.9rem;
}

/* ============================================
   DESTAQUE PARA VALORES FINANCEIROS
   ============================================ */

.valor-destaque {
    font-size: 1.3rem;
    font-weight: bold;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.valor-positivo {
    color: #2e7d32;
    background-color: #e8f5e8;
    border-left: 4px solid #2e7d32;
}

.valor-negativo {
    color: #d32f2f;
    background-color: #ffebee;
    border-left: 4px solid #d32f2f;
}

.valor-pendente {
    color: #ff9800;
    background-color: #fff8e1;
    border-left: 4px solid #ff9800;
}

/* ============================================
   ANIMAÇÃO PARA ATUALIZAÇÃO DE VALORES
   ============================================ */

@keyframes pulseValor {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.valor-atualizado {
    animation: pulseValor 0.5s ease-in-out;
}


/* ============================================
   CORREÇÕES ESPECÍFICAS PARA FINANCEIRO NO MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* 1. CORRIGIR O HEADER DO FINANCEIRO */
    .main-content .dashboard-section {
        padding: 15px 10px !important;
        margin: 10px -10px !important;
        border-radius: 0 !important;
        background: var(--branco) !important;
    }

    .main-content .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 15px;
        padding: 15px 0 !important;
        border-bottom: 2px solid var(--vermelho-principal);
    }

    .main-content .section-header h2 {
        font-size: 1.4rem !important;
        margin: 0;
        color: var(--vermelho-principal);
    }

    .main-content .section-header > div {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .main-content .section-header .btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
        font-size: 0.9rem;
    }

    /* 2. CORRIGIR FILTRO POR MÊS */
    .filtro-container {
        padding: 15px !important;
        margin: 15px 0 !important;
        background: #f8f9fa;
        border-radius: 8px;
    }

    .filtro-container > div {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .filtro-container label {
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }

    .filtro-container select,
    .filtro-container .btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
        font-size: 0.9rem;
    }

    /* 3. CORRIGIR STATS CONTAINER */
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .stat-card {
        padding: 15px !important;
        text-align: center;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .stat-value {
        font-size: 1.8rem !important;
        margin-bottom: 5px !important;
        color: var(--vermelho-principal);
    }

    .stat-label {
        font-size: 0.75rem !important;
        color: var(--cinza-claro);
    }

    /* 4. CORRIGIR GRÁFICO */
    .main-content div[style*="height: 300px"] {
        height: 250px !important;
        padding: 10px !important;
        margin: 15px 0 !important;
        background: var(--branco);
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .main-content h3 {
        font-size: 1.2rem !important;
        margin: 0 0 10px 0 !important;
        padding: 0 !important;
        color: var(--vermelho-principal);
    }

    /* 5. CORRIGIR DASHBOARD-GRID (Receitas e Despesas lado a lado) */
    .dashboard-grid[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-top: 20px !important;
    }

    /* 6. CORRIGIR TABELAS DE RECEITAS E DESPESAS */
    .table-container {
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        margin-bottom: 15px;
    }

    .data-table {
        font-size: 0.8rem !important;
        min-width: 0 !important;
    }

    .data-table th {
        padding: 10px 8px !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }

    .data-table td {
        padding: 8px !important;
        font-size: 0.8rem !important;
    }

    /* 7. CORRIGIR RESUMO FINANCEIRO MENSAL */
    .main-content div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-top: 15px !important;
    }

    .main-content div[style*="text-align: center"] {
        padding: 12px !important;
        border-radius: 6px;
        background: var(--branco);
    }

    .main-content div[style*="font-size: 1.5rem"] {
        font-size: 1.2rem !important;
        font-weight: bold;
        margin: 5px 0 !important;
    }

    .main-content div[style*="color: #666"] {
        font-size: 0.75rem !important;
        color: var(--cinza-claro) !important;
    }

    /* 8. CORRIGIR BADGES E BOTÕES PEQUENOS */
    .badge {
        padding: 3px 8px !important;
        font-size: 0.7rem !important;
        border-radius: 10px;
    }

    .btn-sm {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
    }

    /* 9. CORRIGIR MENSAGENS DE CARREGAMENTO */
    small {
        font-size: 0.8rem !important;
    }

    div[style*="padding: 15px"] {
        padding: 10px !important;
    }

    /* 10. CORRIGIR MODAIS PARA MOBILE */
    .modal.active {
        padding: 10px !important;
        align-items: flex-start !important;
        padding-top: 40px !important;
    }

    .modal-content {
        width: 95% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        padding: 20px 15px !important;
        border-radius: 10px !important;
    }

    /* 11. CORRIGIR TABELAS DENTRO DE MODAIS */
    .modal-content .table-container {
        max-height: 300px;
        overflow-y: auto;
        margin: 15px 0;
    }

    /* 12. CORRIGIR FORMULÁRIOS EM MODAIS */
    .modal-content .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-top: 15px;
    }

    .modal-content .btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
    }

    /* 13. CORRIGIR FILTROS NO MODAL */
    .modal-content div[style*="display: flex; gap: 10px"] {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .modal-content select,
    .modal-content .btn {
        width: 100% !important;
        margin: 0 !important;
    }

    /* 14. MELHORIAS PARA TELAS MUITO PEQUENAS */
    @media (max-width: 480px) {
        .stats-container {
            grid-template-columns: 1fr !important;
        }

        .main-content div[style*="grid-template-columns: repeat(2, 1fr)"] {
            grid-template-columns: 1fr !important;
        }

        .data-table th,
        .data-table td {
            padding: 6px 4px !important;
            font-size: 0.75rem !important;
        }

        .main-content div[style*="font-size: 1.2rem"] {
            font-size: 1rem !important;
        }

        .modal-content {
            padding: 15px 10px !important;
        }
    }

    /* 15. CORRIGIR PROBLEMAS DE SCROLL EM TABELAS */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        width: 100%;
        min-width: 600px; /* Garante que as tabelas sejam roláveis */
    }

    /* 16. CORRIGIR ESPAÇAMENTO GLOBAL */
    .main-content {
        padding: 10px !important;
    }

    .dashboard-grid {
        gap: 15px !important;
        margin-top: 15px !important;
    }

    /* 17. CORRIGIR BOTÕES DE AÇÃO EM TABELAS */
    .data-table .btn-danger {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
        min-height: 30px !important;
    }

    /* 18. ADICIONAR INDICADOR DE SCROLL PARA TABELAS */
    .table-container::after {
        content: '↔ Arraste para ver mais';
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 0.75rem;
        color: var(--cinza-claro);
        background: var(--cinza-clarissimo);
        border-top: 1px solid var(--cinza-clarissimo);
    }

    /* 19. CORRIGIR LAYOUT DO FOOTER DO FINANCEIRO */
    .main-footer {
        padding: 15px !important;
        font-size: 0.8rem !important;
        text-align: center;
    }

    /* 20. CORRIGIR USER INFO NO HEADER */
    .user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-top: 10px;
    }

    .user-email {
        font-size: 0.8rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    #logout-btn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }
}

/* ============================================
   CORREÇÕES ESPECÍFICAS PARA IOS
   ============================================ */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .data-table th,
        .data-table td {
            padding: 12px 8px !important; /* Maior padding para iOS */
        }

        .btn,
        .modal-close {
            min-height: 44px !important; /* Tamanho mínimo para toque no iOS */
        }

        select,
        input[type="date"] {
            font-size: 16px !important; /* Evita zoom no iOS */
        }

        .table-container {
            -webkit-overflow-scrolling: touch !important;
        }
    }
}

/* ============================================
   MELHORIAS PARA ORIENTAÇÃO PAISAGEM NO CELULAR
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .stats-container {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .dashboard-grid[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }

    .modal-content {
        max-height: 75vh !important;
    }
}

/* ============================================
   UTILITÁRIOS PARA FINANCEIRO MOBILE
   ============================================ */
.mobile-financeiro-hide {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-financeiro-show {
        display: block !important;
    }

    .mobile-financeiro-text-center {
        text-align: center !important;
    }

    .mobile-financeiro-full-width {
        width: 100% !important;
    }

    .mobile-financeiro-mt-10 {
        margin-top: 10px !important;
    }

    .mobile-financeiro-mb-10 {
        margin-bottom: 10px !important;
    }
}

/* ============================================
   ESTILOS ESPECÍFICOS PARA LOADER DO FINANCEIRO
   ============================================ */
#financeiro-loader {
    border: 3px solid var(--cinza-clarissimo);
    border-top: 3px solid var(--vermelho-principal);
    width: 30px;
    height: 30px;
    margin: 20px auto;
}

/* ============================================
   CORREÇÃO DE Z-INDEX PARA MODAIS NO MOBILE
   ============================================ */
@media (max-width: 768px) {
    .modal {
        z-index: 9999 !important;
    }

    .modal-content {
        z-index: 10000 !important;
    }
}