/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #f9fafb;
    color: #374151;
}

a {
    text-decoration: none;
    color: #2563eb;
}

a:hover {
    text-decoration: underline;
}

/* Typography & Utilities */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.text-green { color: #16a34a; }
.text-red { color: #dc2626; }

/* Buttons */
.btn-primary {
    width: 100%;
    background-color: #2563eb;
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-primary:hover { background-color: #1d4ed8; }

.btn-add {
    background-color: #2563eb;
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-add:hover { background-color: #1d4ed8; }

.btn-secondary { background-color: white; color: #374151; border: 1px solid #d1d5db; padding: 0.75rem 1.5rem; border-radius: 0.375rem; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.btn-secondary:hover { background-color: #f9fafb; }

button:disabled, input:disabled { opacity: 0.5; cursor: not-allowed !important; pointer-events: none; }

.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    cursor: pointer;
}

/* Login Page */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; background-color: #1e3a8a; margin: 0; }
.login-card { background: white; padding: 2rem; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); width: 100%; max-width: 28rem; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.25rem; color: #2563eb; font-weight: bold; }
.login-header p { color: #6b7280; margin-top: 0.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; color: #374151; }
.form-group input, .form-group select { width: 100%; padding: 0.75rem 1rem; border: 1px solid #d1d5db; border-radius: 0.375rem; outline: none; transition: border-color 0.2s; background-color: #fff; }
.form-group input:focus, .form-group select:focus { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }

/* Dashboard Layout */
.app-container { height: 100vh; overflow-x: hidden; position: relative; }

.sidebar { 
    position: fixed;
    top: 0;
    left: -15rem;
    width: 14rem; 
    height: 100%;
    background: #2563eb; 
    box-shadow: 2px 0 5px rgba(0,0,0,0.05); 
    display: flex; 
    flex-direction: column; 
    z-index: 1100;
    transition: left 0.3s ease-in-out, width 0.3s ease-in-out;
}
.sidebar.show { left: 0; }

/* Estado Minimizado do Sidebar */
.sidebar.collapsed { width: 5rem; }
.sidebar.collapsed .text-hide { display: none !important; }
.sidebar.collapsed .sidebar-header h1 { justify-content: center; font-size: 0; }
.sidebar.collapsed .sidebar-header h1 i { font-size: 1.5rem; margin: 0; }
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .avatar { width: 2.5rem !important; height: 2.5rem !important; font-size: 1.25rem !important; }
.sidebar.collapsed .sidebar-nav a { justify-content: center; padding: 0.85rem 0; margin-bottom: 0.25rem; }
.sidebar.collapsed .sidebar-nav i { width: auto; font-size: 1.25rem; }
.desktop-toggle-btn { display: none; }

.sidebar-header { padding: 1.5rem; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.sidebar-header h1 { font-size: 0.95rem; color: white; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }

.sidebar-nav { flex: 1; padding: 1rem; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1rem; border-radius: 0.375rem; color: rgba(255, 255, 255, 0.8); text-decoration: none; margin-bottom: 0.5rem; transition: all 0.2s; font-size: 0.825rem; }
.sidebar-nav i { width: 1.25rem; text-align: center; font-size: 0.95rem; }
.sidebar-nav a.active { background-color: rgba(255, 255, 255, 0.2); color: white; font-weight: 500; }
.sidebar-nav a:hover:not(.active) { background-color: rgba(255, 255, 255, 0.1); color: white; }

.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.user-info { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background-color: white; color: #2563eb; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.user-details p { line-height: 1.2; }
.user-name { font-size: 0.875rem; font-weight: 500; color: white; }
.user-family { font-size: 0.75rem; color: rgba(255, 255, 255, 0.7); }

.btn-logout { display: block; width: 100%; text-align: center; border: 1px solid #93c5fd; color: #93c5fd; padding: 0.75rem; border-radius: 0.375rem; transition: all 0.2s; font-weight: 500; }
.btn-logout:hover { background-color: rgba(147, 197, 253, 0.1); color: white; border-color: white; text-decoration: none; }

/* Main Content */
.main-content { width: 100%; overflow-y: auto; padding: 1.5rem; }
.page-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; 
    background-color: #2563eb; 
    padding: 1.25rem 1.5rem; 
    border-radius: 0.75rem; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
}
.page-title { font-size: 1.25rem; font-weight: 600; color: white; }
.page-header .btn-add { background-color: white; color: #2563eb; }
.page-header .btn-add:hover { background-color: #f3f4f6; }

/* Summary Cards */
.summary-cards { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.card { background: white; padding: 1.5rem; border-radius: 0.75rem; border: 1px solid #f3f4f6; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: all 0.3s ease-in-out; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.card-title { color: #6b7280; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.card h3 i, .card .card-title i { display: inline-block; transition: transform 0.3s ease-in-out; }
.card:hover h3 i, .card:hover .card-title i { transform: scale(1.25) rotate(10deg); }
.card-value { font-size: 1.5rem; font-weight: bold; color: #1f2937; }

/* Forms inside Cards */
.form-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; border-top: 1px solid #f3f4f6; padding-top: 1.5rem; flex-wrap: wrap; }

/* Efeito Overlay para Menu Mobile */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1050; display: none; opacity: 0; transition: opacity 0.3s; }
.sidebar-overlay.show { display: block; opacity: 1; }

/* Ocultar Valores */
.blur-value { filter: blur(8px); user-select: none; transition: filter 0.3s ease; }
.btn-toggle-eye { background: none; border: none; color: rgba(255, 255, 255, 0.8); cursor: pointer; font-size: 1.1rem; transition: color 0.2s; }
.btn-toggle-eye:hover { color: white; }

/* Menu Toggle Mobile no Header */
.page-header .menu-toggle { color: white; }

/* Tables */
.table-container { background: transparent; border-radius: 0; border: none; box-shadow: none; overflow: visible; }
.table-header { padding: 1rem 1.5rem; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.table-header h3 { font-weight: 600; color: #1f2937; }
.table-responsive { overflow-x: visible; }
.transaction-table { width: 100%; text-align: left; border-collapse: collapse; }
.transaction-table thead { display: none; }
.transaction-table tbody tr { display: block; background: white; margin-bottom: 1rem; border-radius: 0.75rem; border: 1px solid #e5e7eb; padding: 0.5rem 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: all 0.3s ease-in-out; }
.transaction-table tbody tr:hover { transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.transaction-table td { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid #f3f4f6; color: #4b5563; font-size: 0.875rem; text-align: right; gap: 1rem; }
.transaction-table td:last-child { border-bottom: none; }
.transaction-table td::before { content: attr(data-label); font-weight: 600; color: #6b7280; font-size: 0.75rem; text-transform: uppercase; text-align: left; }
.transaction-table td[colspan] { justify-content: center; text-align: center; }
.transaction-table td[colspan]::before { display: none; }
.transaction-table .font-medium { font-weight: 500; color: #1f2937; }

/* Password Toggle e Icones */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}
.password-container input {
    padding-right: 2.5rem;
}
.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}
.password-toggle:hover {
    color: #374151;
}

/* Badges / Tags */
.badge { 
    padding: 0.25rem 0.5rem; 
    border-radius: 9999px; 
    font-size: 0.75rem; 
    font-weight: 500; 
}
.badge-orange { background-color: #ffedd5; color: #c2410c; }
.badge-green { background-color: #dcfce7; color: #15803d; }
.badge-purple { background-color: #f3e8ff; color: #7e22ce; }

/* Progress Bar */
.progress-bg {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    padding-top: 60px;
    animation: fadeInModal 0.3s ease-out;
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 0.5rem;
    position: relative;
    animation: slideDownModal 0.3s ease-out;
}

/* Animações do Modal */
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDownModal {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Classes para fechamento suave */
.modal.fade-out {
    animation: fadeOutModal 0.25s ease-in forwards;
}
.modal.fade-out .modal-content {
    animation: slideUpModal 0.25s ease-in forwards;
}
@keyframes fadeOutModal {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes slideUpModal {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-30px); opacity: 0; }
}
.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}
.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Top Navbar */
.top-navbar {
    background: white;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.topnav-header {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}
.topnav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}
.topnav-item {
    color: #4b5563;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.topnav-item:hover, .topnav-item.active { color: #2563eb; }
.dropdown { position: relative; display: inline-block; }
.dropbtn { background: none; border: none; cursor: pointer; }
.dropdown-content {
    display: none; position: absolute; right: 0; top: 100%;
    background-color: white; min-width: 200px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-radius: 0.5rem; z-index: 2000;
    border: 1px solid #f3f4f6; padding: 0.5rem 0;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a {
    color: #374151; padding: 0.65rem 1.25rem;
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.875rem; text-decoration: none; transition: background 0.3s ease;
}
.dropdown-content a:hover { background-color: #f9fafb; color: #2563eb; }

/* Botão Global Nova Transação (Navbar) */
.btn-global-add {
    background-color: #16a34a;
    color: white;
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}
.btn-global-add:hover {
    background-color: #15803d;
    color: white;
    text-decoration: none;
}

@media (max-width: 1199px) {
    .topnav-header { display: flex; }
    .topnav-links { 
        display: none; 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem; 
        margin-top: 1rem; 
        border-top: 1px solid #f3f4f6; 
        padding-top: 1rem; 
    }
    .topnav-links.show { display: flex; }
    .dropdown { margin-left: 0 !important; width: 100%; }
    .dropdown-content { 
        position: static; 
        box-shadow: none; 
        border: none; 
        padding-left: 1rem; 
        border-left: 2px solid #e5e7eb; 
        border-radius: 0; 
        margin-top: 0.5rem; 
        width: 100%;
    }
}

/* Layouts for specific pages */
.layout-split { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: flex-start; }
.filter-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: end; }

/* Dispositivos móveis (Celulares) - Ajustes de Modais e Formulários */
@media (max-width: 575px) {
    .modal-content {
        padding: 1.5rem 1.25rem;
        width: 95%;
        margin: 10% auto;
    }
    .modal-content h3 {
        padding-right: 1.5rem; /* Evita que o texto encoste no botão X (fechar) */
    }
    .close-button {
        top: 8px;
        right: 15px;
    }
    .form-actions {
        flex-direction: column-reverse; /* Coloca o Confirmar acima e o Cancelar abaixo */
        gap: 0.75rem;
    }
    .form-actions button {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* Small devices (sm) */
@media (min-width: 576px) {
    .form-row { grid-template-columns: 1fr 1fr; }
    .main-content { padding: 2rem; }
}

/* Medium devices (md) */
@media (min-width: 768px) {
    .login-header h1 { font-size: 1.5rem; }
    .page-title { font-size: 1.5rem; }
    .card-value { font-size: 1.875rem; }
    .doc-section h3 { font-size: 1.25rem; }
    .btn-primary { padding: 0.5rem 1rem; }
    .btn-add { padding: 0.5rem 1rem; }
    .btn-secondary { padding: 0.5rem 1.5rem; }
    .btn-logout { padding: 0.375rem; }
    .form-group input, .form-group select { padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .h-38px { height: 38px; }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .filter-layout { display: flex; flex-wrap: wrap; gap: 1rem; }
    .filter-layout > * { flex: 1 1 200px; }
    .filter-layout > *:last-child { flex: 0 0 auto; width: 100%; }
    .layout-split { grid-template-columns: 1fr 1fr; }

    /* Desktop Tables */
    .table-container { background: white; border-radius: 0.75rem; border: 1px solid #f3f4f6; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); overflow: hidden; }
    .table-responsive { overflow-x: auto; }
    .transaction-table { min-width: 600px; }
    .transaction-table thead { display: table-header-group; }
    .transaction-table tbody tr { display: table-row; background: transparent; margin-bottom: 0; border-radius: 0; border: none; padding: 0; box-shadow: none; transition: all 0.3s ease-in-out; }
    .transaction-table tr:hover { background-color: #f9fafb; transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
    .transaction-table th { padding: 0.75rem 1.5rem; background-color: #f9fafb; color: #6b7280; font-weight: 500; font-size: 0.875rem; border-bottom: 1px solid #e5e7eb; }
    .transaction-table td { display: table-cell; padding: 1rem 1.5rem; border-bottom: 1px solid #f3f4f6; text-align: left; gap: 0; }
    .transaction-table td::before { display: none; }
    .transaction-table .text-right { text-align: right; }
    .transaction-table .text-center { text-align: center; }
}

/* Large devices (lg) */
@media (min-width: 992px) {
    .summary-cards { grid-template-columns: repeat(3, 1fr); }
    .layout-split { grid-template-columns: 1fr 1.5fr; }
}

/* Extra large devices (xl) */
@media (min-width: 1200px) {
    .menu-toggle { display: none; }
    .app-container { display: flex; }
    .sidebar { position: static; left: 0; transition: width 0.3s ease-in-out; }
    .desktop-toggle-btn { display: flex; }
    .main-content { flex: 1; padding: 2.5rem 3rem; }
    .layout-split { grid-template-columns: 350px 1fr; gap: 2.5rem; }
    .summary-cards { gap: 2rem; }
    .filter-layout > *:last-child { width: auto; }
}

/* --- CLASSES UTILITÁRIAS E COMPONENTES EXTRAÍDOS DOS HTMLS --- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-600 { max-width: 600px; }
.max-w-800 { max-width: 800px; }
.h-38px { height: 44px; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-6 { margin-left: 1.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex-center-gap { display: flex; align-items: center; gap: 0.5rem; }
.flex-2 { flex: 2; }

.font-bold { font-weight: bold; }
.font-semibold { font-weight: 600; }
.text-sm-alt { font-size: 0.85rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-gray-800 { color: #1f2937; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-green-700 { color: #15803d; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #b45309; }
.no-underline { text-decoration: none; }

.btn-block { display: block; width: 100%; text-align: center; box-sizing: border-box; margin-bottom: 1rem; }
.btn-block-sec { display: block; width: 100%; text-align: center; text-decoration: none; box-sizing: border-box; }
.btn-red { background-color: #dc2626 !important; color: white; }
.btn-red:hover { background-color: #b91c1c !important; }
.page-header .btn-red { background-color: white !important; color: #dc2626 !important; }
.page-header .btn-red:hover { background-color: #fef2f2 !important; }

.alert-msg { padding: 10px; border-radius: 4px; margin-bottom: 15px; text-align: center; font-size: 14px; display: none; }
.alert-error { color: #d9534f; background-color: #f2dede; border: 1px solid #ebccd1; }
.alert-success { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; }
.alert-warning-card { background-color: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid #f59e0b; margin-bottom: 2rem; padding: 1.5rem; border-radius: 0.5rem; }
.alert-warning-title { color: #b45309; margin-bottom: 1rem; font-size: 1.1rem; font-weight: 600; }

/* Efeito de Pulsar para Ícones de Alerta */
@keyframes pulse-alert {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; color: #dc2626; }
    100% { transform: scale(1); opacity: 1; }
}
.icon-pulse { animation: pulse-alert 1.5s infinite ease-in-out; display: inline-block; }

.color-picker { height: 40px; padding: 2px; width: 100%; cursor: pointer; border: 1px solid #d1d5db; border-radius: 0.375rem; background: transparent; }

.action-link { font-size: 0.875rem; margin-right: 0.5rem; }
.action-link-red { font-size: 0.875rem; color: #dc2626; }

.chart-container { position: relative; height: 300px; width: 100%; }
.grid-auto-fit-200 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.grid-auto-fit-300 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-cols-1 { grid-template-columns: 1fr; }

@media (min-width: 1200px) { .grid-cols-4-desktop { grid-template-columns: repeat(4, 1fr); } }

.border-l-blue { border-left: 4px solid #3b82f6; }
.border-l-red { border-left: 4px solid #dc2626; }
.border-t { border-top: 1px solid #f3f4f6; }

.list-none { list-style: none; padding: 0; margin: 0; }
.w-90px { display: inline-block; width: 90px; }

/* Estilos de Impressão (Extrato Diário / Relatórios) */
@media print {
    .sidebar, .top-navbar, .page-header, .filter-layout, .btn-add, .btn-secondary, .btn-primary, .btn-toggle-visibility, #btn-voltar-topo, .form-actions { display: none !important; }
    .main-content { padding: 0 !important; margin: 0 !important; width: 100% !important; overflow: visible !important; }
    .card { box-shadow: none !important; border: 1px solid #e5e7eb !important; margin-bottom: 1.5rem !important; page-break-inside: avoid; }
    body { background-color: white !important; color: black !important; }
    .app-container { display: block !important; }
    .transaction-table th { background-color: #f9fafb !important; color: black !important; border-bottom: 2px solid #000 !important; }
    .transaction-table td { border-bottom: 1px solid #e5e7eb !important; }
    .sensitive-value { filter: none !important; }
}

/* Estilos Específicos para a Documentação */
.doc-section { margin-bottom: 2.5rem; }
.doc-section h3 { font-size: 1.125rem; font-weight: 600; color: #1f2937; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.doc-section p { margin-bottom: 0.75rem; line-height: 1.6; }
.doc-section code { background-color: #f3f4f6; color: #1f2937; padding: 0.15rem 0.4rem; border-radius: 0.25rem; font-family: 'Courier New', Courier, monospace; font-size: 0.9em; }
.doc-section pre { background-color: #f3f4f6; padding: 1rem; border-radius: 0.375rem; overflow-x: auto; font-size: 0.85rem; }
.color-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.color-swatch { text-align: center; }
.color-box { width: 100%; height: 60px; border-radius: 0.375rem; border: 1px solid #e5e7eb; margin-bottom: 0.5rem; }
.color-code { font-weight: 500; font-size: 0.875rem; }

/* Botão Voltar ao Topo */
#btn-voltar-topo {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    font-size: 1.2rem;
    border: none;
    outline: none;
    background-color: #2563eb;
    color: white;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
#btn-voltar-topo.show {
    opacity: 1;
    visibility: visible;
}
#btn-voltar-topo:hover {
    background-color: #1d4ed8;
    transform: translateY(-3px);
}

/* Tabs (Abas) */
.tabs-container { background: white; padding: 1.5rem; border-radius: 0.75rem; border: 1px solid #f3f4f6; box-shadow: 0 1px 2px rgba(0,0,0,0.05); margin-bottom: 2rem; }
.tab-buttons { display: flex; border-bottom: 1px solid #e5e7eb; margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; }
.tab-buttons::-webkit-scrollbar { display: none; }
.tab-btn { background: none; border: none; padding: 0.75rem 1.5rem; font-weight: 500; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; white-space: nowrap; font-size: 0.95rem; }
.tab-btn:hover { color: #2563eb; }
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- ESTILOS DO MENU DE PERFIL --- */
.dropdown-content a.logout-link { color: #dc2626; font-weight: 600; }
.dropdown-content a.logout-link:hover { background-color: #fef2f2; color: #dc2626; }

/* --- MODO ESCURO (DARK MODE) --- */
body.dark-mode { background-color: #111827; color: #f3f4f6; }
.dark-mode .card { background-color: #1f2937; border-color: #374151; }
.dark-mode .page-header { background-color: #1e3a8a; }
.dark-mode .text-gray-800 { color: #f9fafb; }
.dark-mode .text-gray-700 { color: #f3f4f6; }
.dark-mode .text-gray-600 { color: #d1d5db; }
.dark-mode .text-gray-500 { color: #9ca3af; }
.dark-mode .bg-gray-100 { background-color: #374151; }
.dark-mode .bg-gray-200 { background-color: #4b5563; }
.dark-mode .bg-gray-50 { background-color: #111827; }
.dark-mode .top-navbar { background-color: #1f2937; border-color: #374151; }
.dark-mode .dropdown-content { background-color: #1f2937; border-color: #374151; }
.dark-mode .dropdown-content a { color: #f3f4f6; }
.dark-mode .dropdown-content a:hover { background-color: #374151; }
.dark-mode .dropdown-content a.logout-link:hover { background-color: #7f1d1d; color: #fca5a5; }
.dark-mode .table-container { background-color: #1f2937; border-color: #374151; }
.dark-mode .transaction-table tbody tr { background-color: #1f2937; border-color: #374151; }
.dark-mode .transaction-table th { background-color: #111827; color: #d1d5db; border-bottom-color: #374151; }
.dark-mode .transaction-table td { border-bottom-color: #374151; }
.dark-mode .transaction-table tr:hover { background-color: #374151; }
.dark-mode input, .dark-mode select { background-color: #374151; border-color: #4b5563; color: #f9fafb; }
.dark-mode .modal-content { background-color: #1f2937; border-color: #374151; }
.dark-mode .tabs-container { background-color: #1f2937; border-color: #374151; }
.dark-mode .tab-buttons { border-bottom-color: #374151; }
.dark-mode .card-draggable { background-color: #374151 !important; border-color: #4b5563 !important; }
.dark-mode .border-t { border-top-color: #374151; }
.dark-mode .border-b { border-bottom-color: #374151; }
.dark-mode hr { border-color: #374151; }
.dark-mode .btn-secondary { background-color: #374151; color: #f9fafb; border-color: #4b5563; }
.dark-mode .btn-secondary:hover { background-color: #4b5563; }
.dark-mode .alert-warning-card { background-color: #422006; border-color: #78350f; }
.dark-mode .alert-warning-title { color: #f59e0b; }

/* Estilos de Destaque para Valores nas Transações */
.input-destaque {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    height: 3.5rem !important;
    border-width: 2px !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
}
.input-destaque-red {
    background-color: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #991b1b !important;
}
.input-destaque-red:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important; border-color: #ef4444 !important; }
.input-destaque-green {
    background-color: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}
.input-destaque-green:focus { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2) !important; border-color: #22c55e !important; }
.input-destaque-blue {
    background-color: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1e3a8a !important;
}
.input-destaque-blue:focus { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2) !important; border-color: #3b82f6 !important; }

.dark-mode .input-destaque-red { background-color: #450a0a !important; border-color: #991b1b !important; color: #fca5a5 !important; }
.dark-mode .input-destaque-green { background-color: #052e16 !important; border-color: #166534 !important; color: #86efac !important; }
.dark-mode .input-destaque-blue { background-color: #1e3a8a !important; border-color: #1e40af !important; color: #93c5fd !important; }

/* --- ESTILOS EXTRAÍDOS DAS PÁGINAS (REATORAÇÃO) --- */

/* Importação e Tabelas DRE */
.linha-duplicada { background-color: #f3f4f6; opacity: 0.7; }
.linha-nova { background-color: #f0fdf4; border-left: 4px solid #16a34a; }
.select-categoria-ofx { width: 100%; padding: 0.4rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 0.85rem; }
.select-categoria-ofx.sugerida { border-color: #3b82f6; background-color: #eff6ff; }
.status-badge-ofx { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.85rem; }
.status-badge-ofx.novo { background-color: #16a34a; color: white; }
.status-badge-ofx.duplicado { background-color: #9ca3af; color: white; }

.dre-table { width: 100%; border-collapse: collapse; min-width: 1200px; font-size: 0.85rem; }
.dre-table th, .dre-table td { padding: 0.75rem; border: 1px solid #e5e7eb; white-space: nowrap; }
.dre-table th { background-color: #f9fafb; font-weight: 600; color: #374151; position: sticky; top: 0; z-index: 10; }
.dre-table .th-first { left: 0; z-index: 20; background-color: #f9fafb; }
.dre-table td:first-child { position: sticky; left: 0; background-color: #fff; z-index: 5; font-weight: 500; color: #4b5563; }
.dre-table tbody tr:hover td { background-color: #f3f4f6; }
.dre-table tbody tr:hover td:first-child { background-color: #f3f4f6; }
.dre-header-row td { background-color: #e5e7eb !important; font-weight: bold; color: #1f2937 !important; text-transform: uppercase; font-size: 0.9rem; }
.dre-total-row td { background-color: #f9fafb !important; font-weight: bold; color: #1f2937 !important; border-top: 2px solid #d1d5db; }
.dre-net-row td { background-color: #1e293b !important; color: white !important; font-weight: bold; font-size: 0.95rem; border-top: 2px solid #000; }
.text-green-dre { color: #16a34a; }
.text-red-dre { color: #dc2626; }
@media (min-width: 1200px) { .main-content { max-width: calc(100vw - 14rem); } }

/* Tooltips, Drag & Drop e Hover Especiais */
.sortable-ghost { opacity: 0.2; background-color: #e5e7eb; border: 2px dashed #9ca3af !important; }
.sortable-fallback { transition: none !important; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25) !important; transform: scale(1.05) !important; opacity: 1 !important; z-index: 9999 !important; cursor: grabbing !important; }
.card-draggable { cursor: grab; }
.card-draggable:active { cursor: grabbing; }

.tooltip-container { position: relative; cursor: help; }
.tooltip-container:hover { z-index: 99999; }
.tooltip-box {
    visibility: hidden; width: 340px; background-color: #1f2937; color: #fff;
    text-align: left; border-radius: 8px; padding: 12px; position: absolute;
    z-index: 99999; top: 50%; left: 100%; transform: translateY(-50%) translateX(20px) scale(0.95); margin-left: 12px;
    opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); font-size: 0.85rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5), 0 10px 10px -5px rgba(0,0,0,0.3); max-height: 50vh; overflow-y: auto; cursor: default;
}
.tooltip-box::-webkit-scrollbar { width: 6px; }
.tooltip-box::-webkit-scrollbar-track { background: #374151; border-radius: 4px; }
.tooltip-box::-webkit-scrollbar-thumb { background: #6b7280; border-radius: 4px; }
.tooltip-box::after { content: ""; position: absolute; top: 50%; right: 100%; left: auto; margin-top: -6px; border-width: 6px; border-style: solid; border-color: transparent #1f2937 transparent transparent; }
.tooltip-container:hover .tooltip-box { visibility: visible; opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
.tooltip-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #374151; }
.tooltip-item:last-child { border-bottom: none; }

@media (max-width: 991px) {
    .tooltip-box { top: 100%; left: 50%; transform: translateY(10px) translateX(-50%) scale(0.95); margin-left: 0; width: 280px; }
    .tooltip-box::after { top: auto; bottom: 100%; left: 50%; right: auto; margin-top: 0; border-color: transparent transparent #1f2937 transparent; }
    .tooltip-container:hover .tooltip-box { transform: translateY(10px) translateX(-50%) scale(1); }
}

.transaction-table tbody tr:hover, .transaction-table tbody td:hover { position: relative; z-index: 999999; }

/* Ícones e Textareas Personalizados (Cadastros) */
.input-icon-wrapper { position: relative; width: 100%; }
.input-icon-wrapper textarea, .input-icon-wrapper input[type="text"] {
    padding-left: 2.5rem; width: 100%; box-sizing: border-box; border: 1px solid #d1d5db;
    border-radius: 0.375rem; padding-top: 0.75rem; padding-bottom: 0.75rem; transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical; font-family: inherit;
}
.input-icon-wrapper textarea:focus, .input-icon-wrapper input[type="text"]:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }
.input-icon-wrapper i { position: absolute; left: 14px; top: 14px; color: #9ca3af; transition: color 0.2s; pointer-events: none; }
.input-icon-wrapper textarea:focus + i, .input-icon-wrapper input[type="text"]:focus + i { color: #2563eb; }

.custom-tooltip { position: relative; display: inline-block; cursor: help; }
.custom-tooltip .tooltip-text {
    visibility: hidden; width: max-content; max-width: 250px; background-color: #1f2937; color: #fff;
    text-align: center; border-radius: 6px; padding: 8px 12px; position: absolute; z-index: 100;
    bottom: 125%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.85rem; box-shadow: 0 4px 6px rgba(0,0,0,0.1); white-space: pre-wrap; font-weight: normal; line-height: 1.4;
}
.custom-tooltip .tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: #1f2937 transparent transparent transparent; }
.custom-tooltip:hover .tooltip-text { visibility: visible; opacity: 1; }
.dark-mode .custom-tooltip .tooltip-text { background-color: #374151; color: #f9fafb; border: 1px solid #4b5563; }
.dark-mode .custom-tooltip .tooltip-text::after { border-color: #4b5563 transparent transparent transparent; }

.icon-grid-item {
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; width: 50px; height: 50px; border-radius: 8px;
    background: #fff; border: 1px solid #e5e7eb; color: #4b5563; cursor: pointer; transition: all 0.2s;
}
.icon-grid-item:hover { background: #eff6ff; border-color: #3b82f6; color: #2563eb; transform: scale(1.1); }
.dark-mode .icon-grid-item { background: #374151; border-color: #4b5563; color: #d1d5db; }
.dark-mode .icon-grid-item:hover { background: #1f2937; border-color: #3b82f6; color: #60a5fa; }

/* Tom Select (Transações) */
.ts-control { padding: 0.75rem 1rem; border-radius: 0.375rem; border: 1px solid #d1d5db; font-family: inherit; font-size: 1rem; box-shadow: none; min-height: 44px; display: flex; align-items: center; }
.ts-control.focus { box-shadow: 0 0 0 1px #3b82f6; border-color: #3b82f6; }
.dark-mode .ts-control { background-color: #374151; border-color: #4b5563; color: #f9fafb; }
.dark-mode .ts-dropdown { background-color: #374151; border-color: #4b5563; color: #f9fafb; }
.dark-mode .ts-dropdown .option { color: #f9fafb; }
.dark-mode .ts-dropdown .option:hover, .dark-mode .ts-dropdown .active { background-color: #4b5563; color: #f9fafb; }
.dark-mode .ts-control input { color: #f9fafb; }
details > summary::-webkit-details-marker { display: none; }

/* Páginas e Componentes Específicos */
.step-card { display: flex; align-items: flex-start; gap: 1.25rem; padding: 1.5rem; border-left: 4px solid #3b82f6; margin-bottom: 1rem; background: #fff; border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid #e5e7eb; border-left-width: 4px; }
.step-number { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #eff6ff; color: #3b82f6; border-radius: 50%; font-weight: bold; font-size: 1.2rem; flex-shrink: 0; }
.faq-item { margin-bottom: 1rem; border: 1px solid #e5e7eb; border-radius: 0.5rem; background: #fff; overflow: hidden; }
.faq-question { width: 100%; text-align: left; padding: 1rem 1.5rem; font-weight: bold; color: #1f2937; background: #f9fafb; border: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.faq-question:hover { background: #f3f4f6; }
.faq-answer { padding: 0 1.5rem; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out, padding 0.3s ease; color: #4b5563; line-height: 1.6; }
.faq-item.active .faq-answer { padding: 1rem 1.5rem; max-height: 1000px; }
.faq-item.active .faq-question i { transform: rotate(180deg); }
.faq-question i { transition: transform 0.3s ease; }

.hide-on-mobile { display: block; }
@media (max-width: 767px) { .hide-on-mobile { display: none !important; } }

/* Sidebar Widgets & Calc Helpers */
.sidebar-widgets {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar.collapsed .sidebar-widgets {
    display: none !important;
}
.mini-calc-btn {
    background: rgba(255,255,255,0.05);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 6px 0;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mini-calc-btn:hover {
    background: rgba(255,255,255,0.15) !important;
}
.mini-calc-btn:active {
    transform: scale(0.95);
}

/* Calc Helper Trigger */
.calc-trigger-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 10;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    outline: none;
}
.calc-trigger-btn:hover {
    color: #2563eb !important;
    transform: scale(1.15);
}
.dark-mode .calc-trigger-btn:hover {
    color: #60a5fa !important;
}

/* Modal Calc Keyboard Buttons */
.modal-calc-btn {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    outline: none;
}
.modal-calc-btn:active {
    transform: scale(0.95);
}
.modal-calc-btn:hover {
    opacity: 0.9;
}

/* Mini Calendar Text Colors */
#widget-calendar-container,
#widget-calendar-container * {
    color: #ffffff !important;
}

/* Card Optional Section */
.card-optional-section {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}
body.dark-mode .card-optional-section {
    background-color: #1f2937;
    border-color: #374151;
}