/* ===== SISTEMA FINANCEIRO - DESIGN PADRONIZADO ===== */

/* Reset e Configurações Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Principais */
    --primary-500: #2563eb;
    --primary-600: #1d4ed8;
    --primary-700: #1e40af;
    
    --green-500: #10b981;
    --green-600: #059669;
    --green-700: #047857;
    
    --amber-600: #d97706;
    --amber-700: #b45309;
    --amber-800: #92400e;
    
    --red-500: #ef4444;
    --red-600: #dc2626;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Bordas */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--gray-900);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== HEADER PRINCIPAL ===== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.title-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-section h1 i {
    color: var(--primary-600);
    font-size: 1.75rem;
}

.title-section p {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

/* ===== NAVEGAÇÃO ===== */
.navigation {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(var(--gray-50), 0.5);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
    border: 1px solid var(--gray-200);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-link.active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.nav-link i {
    font-size: 1rem;
}

/* Cores específicas dos botões */
.nav-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
}

.nav-green {
    background: linear-gradient(135deg, var(--green-600), var(--green-700));
}

.nav-amber {
    background: linear-gradient(135deg, var(--amber-700), var(--amber-800));
}

.nav-push-right {
    margin-left: auto;
}

/* ===== CARDS DE RESUMO ===== */
.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.summary-box {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.summary-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--green-500), var(--amber-600));
}

.summary-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.summary-box h3 {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.summary-box h3 i {
    font-size: 1rem;
}

.summary-box p {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
}

.receita {
    color: var(--green-600);
}

.despesa {
    color: var(--red-600);
}

.saldo {
    color: var(--primary-600);
}

/* ===== FORMULÁRIOS ===== */
.form-container,
.filter-container {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.form-container h2,
.filter-container h2 {
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
}

.form-container h2 i,
.filter-container h2 i {
    color: var(--primary-600);
    font-size: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== BOTÕES ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: 0;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary i {
    font-size: 0.875rem;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    margin: 0.125rem;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-danger {
    background: linear-gradient(135deg, var(--red-500), var(--red-600));
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--amber-600), var(--amber-700));
    color: white;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== TABELAS ===== */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-700));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

th i {
    margin-right: 0.5rem;
    color: var(--gray-300);
}

td.valor {
    font-weight: 700;
    text-align: right;
    font-family: 'Monaco', 'Menlo', monospace;
}

tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

/* ===== ALERTAS ===== */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 1px solid;
}

.alert i {
    font-size: 1.125rem;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #fde68a;
}

/* ===== LINKS DE COMPROVANTE ===== */
.comprovante-link {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.comprovante-link:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.comprovante-link i {
    font-size: 0.875rem;
}

/* ===== MODAIS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.modal h3 {
    color: var(--red-600);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
}

.modal h3 i {
    font-size: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-buttons button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== GRÁFICOS E CHARTS ===== */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.875rem;
    margin: 1.875rem 0;
}

.chart-box {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    padding: 1.5625rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.chart-box h3 {
    margin: 0 0 1.25rem;
    text-align: center;
    color: var(--gray-800);
    font-weight: 600;
}

/* ===== BOTÕES ESPECÍFICOS PARA RELATÓRIOS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    color: white;
}

.btn-amber {
    background: linear-gradient(135deg, var(--amber-700), var(--amber-800));
    box-shadow: 0 4px 16px rgba(180, 83, 9, 0.3);
}

.btn-amber:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(180, 83, 9, 0.45);
}

.btn-green {
    background: linear-gradient(135deg, var(--green-600), var(--green-700));
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.btn-green:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(5, 150, 105, 0.45);
}

/* ===== CLASSES DE CORES PARA ÍCONES ===== */
.text-success {
    color: var(--green-600) !important;
}

.text-danger {
    color: var(--red-600) !important;
}

.text-primary {
    color: var(--primary-600) !important;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .navigation {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-push-right {
        margin-left: 0;
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .summary {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .title-section h1 {
        font-size: 1.5rem;
    }
    
    .summary-box {
        padding: 1.5rem;
    }
    
    .summary-box p {
        font-size: 1.875rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th,
    td {
        padding: 0.75rem 0.5rem;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .form-container,
    .filter-container {
        padding: 1.5rem;
    }
    
    .summary-box {
        padding: 1rem;
    }
    
    .summary-box p {
        font-size: 1.5rem;
    }
    
    th,
    td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
}

/* ===== ANIMAÇÕES E EFEITOS ===== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.3s ease;
}

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

/* ===== UTILITÁRIOS ===== */
.text-center {
    text-align: center;
}

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

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.p-4 {
    padding: 1rem;
}

.rounded {
    border-radius: var(--radius-md);
}

.shadow {
    box-shadow: var(--shadow-md);
}

.border {
    border: 1px solid var(--gray-200);
}

/* ===== LOADING E ESTADOS ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ===== MELHORIAS DE ACESSIBILIDADE ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus\:ring:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== IMPRESSÃO ===== */
@media print {
    .navigation,
    .btn-primary,
    .btn-small,
    .modal {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        background: white;
    }
    
    .summary-box {
        break-inside: avoid;
    }
    
    table {
        break-inside: auto;
    }
    
    tr {
        break-inside: avoid;
        break-after: auto;
    }
}