/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0b0e17;
    color: #e2e8f0;
    line-height: 1.5;
    font-size: 14px;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* COMMON UTILITIES */
.text-right { text-align: right; }
.text-green { color: #10b981 !important; }
.text-red { color: #ef4444 !important; }
.text-muted { color: #64748b; }

/* BTNS */
button {
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
    padding: 10px 18px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    padding: 8px 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-secondary:hover {
    background-color: #334155;
    color: #ffffff;
}

.btn-primary-small {
    background-color: #2563eb;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
}
.btn-primary-small:hover {
    background-color: #1d4ed8;
}

.btn-text {
    background: transparent;
    color: #38bdf8;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-text:hover {
    color: #0ea5e9;
    text-decoration: underline;
}

/* LOGIN SCREEN */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1e1b4b 0%, #090514 100%);
    padding: 20px;
}

.login-card {
    background: rgba(254, 254, 254, 0.03);
    border: 1px solid rgba(254, 254, 254, 0.08);
    backdrop-filter: blur(16px);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.accent-icon {
    font-size: 40px;
    color: #2563eb;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.5));
}

.logo h2 {
    font-weight: 600;
    font-size: 24px;
    letter-spacing: 1px;
}

.logo p {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 12px;
    color: #64748b;
}

.input-wrapper input {
    width: 100%;
    background-color: #11131c;
    border: 1px solid #1e293b;
    color: #ffffff;
    padding: 12px 12px 12px 38px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.error-msg {
    color: #ef4444;
    font-size: 12px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.login-card button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

/* MAIN DASHBOARD CONTAINER */
.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 0 40px 0;
}

/* NAVBAR */
.navbar {
    background-color: #0c101c !important;
    border-bottom: 1px solid #1e293b;
    height: 46px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 999999 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.nav-left-section {
    display: flex;
    align-items: center;
    gap: 36px; /* Afastamento maior entre logo e filtros conforme solicitado */
    flex-wrap: nowrap;
    flex: 1;
    justify-content: flex-start;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 26px; /* Altura uniforme para alinhamento simétrico em cima e embaixo */
    flex-shrink: 0;
}

.brand-logo {
    height: 24px;
    max-height: 24px;
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    height: 24px; /* Casando perfeitamente com a altura da logo */
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.brand-title .brand-cash {
    color: #ef4444;
    font-weight: 700;
}

.brand-underline {
    height: 2px;
    background-color: #ef4444;
    width: 100%;
    border-radius: 2px;
    margin-top: 2px;
}

.nav-date-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.75);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #233148;
    height: 28px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    margin: 0 auto; /* Perfeitamente centralizado no cabeçalho */
    flex: 0 0 auto;
}

.nav-date-filters:hover {
    border-color: #3b82f6;
}

.nav-date-filters label {
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    margin: 0;
}

.nav-date-filters label i {
    font-size: 10px;
    color: #38bdf8;
}

.nav-date-filters .date-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-date-filters select {
    background: #0b0f19;
    color: #f8fafc;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0 4px;
    font-size: 9.5px;
    font-weight: 500;
    height: 22px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.nav-date-filters select:hover,
.nav-date-filters select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 5px rgba(56, 189, 248, 0.25);
}

.nav-date-filters input[type="date"] {
    background-color: #0b0f19;
    border: 1px solid #334155;
    color: #ffffff;
    padding: 0 3px;
    border-radius: 4px;
    font-size: 10px;
    height: 22px;
    width: 136px; /* Espaço suficiente para DD/MM/AAAA e ícone de calendário nativo sem cortar os dígitos do ano */
    outline: none;
    transition: all 0.2s;
    letter-spacing: -0.2px;
}

.nav-date-filters input[type="date"]:hover,
.nav-date-filters input[type="date"]:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 5px rgba(56, 189, 248, 0.25);
}

.nav-date-filters .date-separator {
    font-size: 9px;
    color: #64748b;
    font-weight: 500;
    margin: 0 2px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    justify-content: flex-end;
}

.version-toggle-group, .flow-toggle-group {
    background-color: #111827;
    padding: 2px;
    border-radius: 5px;
    display: inline-flex;
    border: 1px solid #233148;
    gap: 2px;
    align-items: center;
    height: 24px;
    box-sizing: border-box;
}

.btn-toggle {
    background: transparent;
    color: #94a3b8;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3.5px;
    height: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-toggle:hover:not(.active) {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.btn-toggle.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

#btn-import {
    background-color: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 500;
    height: 24px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#btn-import:hover {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}

#btn-import i {
    font-size: 9.5px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 5px;
    border-left: 1px solid #233148;
    padding-left: 8px;
    color: #cbd5e1;
    font-size: 11px;
}

.user-profile i.fa-circle-user {
    font-size: 13.5px;
    color: #94a3b8;
}

.btn-icon {
    background: transparent;
    color: #f87171;
    font-size: 12px;
    padding: 2px 3px;
    margin-left: 3px;
    border: none;
    cursor: pointer;
}
.btn-icon:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* FILTERS BAR */
.filters-bar {
    background-color: #121826;
    border-bottom: 1px solid #1e293b;
    padding: 10px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs input[type="date"] {
    background-color: #0b0e17;
    border: 1px solid #1e293b;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.adjustments-group {
    flex-grow: 1;
    justify-content: flex-end;
}

.adjustment-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #0b0e17;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #1e293b;
}

.adj-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.adj-field span {
    color: #94a3b8;
}

.adj-field input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #334155;
    color: #ffffff;
    width: 100px;
    padding: 2px 4px;
    font-size: 13px;
    outline: none;
    font-weight: 500;
}
.adj-field input:focus {
    border-color: #2563eb;
}

/* SUMMARY CARDS (SINGLE HORIZONTAL LINE - 7 CARDS) */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    padding: 16px 24px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.card {
    background-color: #121826;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, border-color 0.2s;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
}

.summary-cards .card {
    height: 60px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.card:hover {
    transform: translateY(-2px);
    border-color: #334155;
    z-index: 11;
}


.card-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.card-anterior .card-icon { background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
.card-receber .card-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.card-pagar .card-icon { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.card-final .card-icon { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.card-emprestimos .card-icon { background: rgba(99, 102, 241, 0.12); color: #818cf8; }
.card-mutuo .card-icon { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.card-titulos-trocados .card-icon { background: rgba(20, 184, 166, 0.12); color: #2dd4bf; }

.custom-card-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    z-index: 50000;
    pointer-events: none;
}

#tooltip-saldo-dia {
    min-width: 250px;
    max-width: 320px;
    white-space: normal;
    padding: 8px 12px;
}

.card-anterior:not(.tooltip-disabled):hover .custom-card-tooltip,
.card-emprestimos:hover .custom-card-tooltip,
.card-mutuo:hover .custom-card-tooltip,
.card-titulos-trocados:hover .custom-card-tooltip {
    display: block;
}

.card-info {
    min-width: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 1 auto;
}

.card-info h3 {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
    margin: 0 0 2px 0;
    white-space: nowrap;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: visible;
}

.card-info h3 .title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.card-info h3 i {
    flex-shrink: 0;
    display: inline-block;
}

.card-info p {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

@media (max-width: 1300px) {
    .summary-cards {
        grid-template-columns: repeat(7, minmax(140px, 1fr));
        overflow-x: auto;
        padding-bottom: 8px;
    }
}

.card-final p {
    color: #a855f7;
}

/* TABS SYSTEM */
.tabs-container {
    padding: 0 24px;
    position: relative;
    z-index: 1 !important;
}

.tab-headers {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 20px;
    gap: 6px;
    align-items: center;
    padding-bottom: 6px;
}

.tab-btn {
    background: rgba(30, 41, 59, 0.4);
    color: #94a3b8;
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #ffffff;
    background-color: #1e293b;
    border-color: #334155;
}

.tab-btn.active {
    color: #38bdf8;
    font-weight: 600;
    border-color: rgba(56, 189, 248, 0.5);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* UI Visibility Admin Toggle Switches */
.visibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.visibility-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.visibility-card:hover {
    border-color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.visibility-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.visibility-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.visibility-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.visibility-desc {
    font-size: 11px;
    color: #94a3b8;
}

/* Custom Toggle Switch */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .3s;
    border-radius: 26px;
    border: 1px solid #475569;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
    background-color: #10b981;
    border-color: #059669;
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(22px);
    background-color: #ffffff;
}

.tab-content .tab-pane {
    display: none;
}

.tab-content .tab-pane.active {
    display: block;
}

/* GRID LAYOUTS FOR TAB CONTENT */
.chart-table-grid,
#tab-daily .chart-table-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

.card-table, .card-chart, .card-simulator {
    background-color: #121826;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    min-width: 0;
    max-width: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 12px;
}

.card-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: #cbd5e1;
}

/* TABLE WRAPPERS */
.table-wrapper {
    overflow-x: auto;
    max-height: 480px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background-color: #1e293b;
    color: #94a3b8;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
}

#tab-daily .card-table {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#tab-daily .card-table .table-wrapper {
    overflow-x: auto !important;
    overflow-y: visible;
    max-height: 480px;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #38bdf8 #0f172a;
    -webkit-overflow-scrolling: touch;
}

#tab-daily .card-table .table-wrapper::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

#tab-daily .card-table .table-wrapper::-webkit-scrollbar-track {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 6px;
}

#tab-daily .card-table .table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    border-radius: 6px;
    border: 2px solid #0f172a;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
    cursor: pointer;
}

#tab-daily .card-table .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

#card-table-daily-container .table-wrapper {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
}

#table-daily,
#table-daily.table-fixed {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0;
}

#table-daily th {
    background-color: #1e293b;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 11.5px;
    padding: 10px 14px !important;
    white-space: nowrap !important;
    border-bottom: 2px solid #334155;
    text-align: right;
    line-height: 1.25;
    min-width: 120px;
}

#table-daily th.sticky-col,
#table-daily td.sticky-col {
    position: sticky !important;
    left: 0 !important;
    z-index: 10;
    background-color: #0f172a !important;
    border-right: 2px solid #334155 !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.4) !important;
    width: 220px !important;
    min-width: 200px !important;
    max-width: 240px !important;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px !important;
    white-space: nowrap !important;
    font-size: 12px;
}

#table-daily th.sticky-col {
    background-color: #1e293b !important;
    color: #f1f5f9;
    z-index: 15;
}

#table-daily td {
    padding: 10px 14px !important;
    font-size: 12px;
    white-space: nowrap !important;
    border-bottom: 1px solid #1e293b;
    text-align: right;
    min-width: 120px;
}

#table-daily tr:hover td:not(.sticky-col) {
    background-color: rgba(255, 255, 255, 0.04);
}

#table-daily tr.border-top-highlight td {
    border-top: 1px solid #334155 !important;
}

#table-daily th:last-child,
#table-daily td:last-child {
    padding-right: 24px !important;
    border-right: 2px solid #334155;
}

.card-anterior:not(.tooltip-disabled):hover .custom-card-tooltip,
.card-emprestimos:hover .custom-card-tooltip,
.card-mutuo:hover .custom-card-tooltip,
.card-titulos-trocados:hover .custom-card-tooltip {
    display: block;
}


td {
    padding: 10px 12px;
    border-bottom: 1px solid #1e293b;
}

tbody tr:hover {
    background-color: rgba(254, 254, 254, 0.02);
}

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

/* CHART WRAPPER */
.chart-wrapper {
    height: 400px;
    position: relative;
}

/* HIERARCHICAL TREE DESIGN */
.tree-wrapper {
    overflow: visible;
    max-height: none;
    padding: 0;
}

.tree-node {
    margin-bottom: 4px;
}

.node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background-color: #1e293b;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    font-weight: 500;
}

.node-header:hover {
    background-color: #334155;
}

.node-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.node-icon-toggle {
    width: 16px;
    text-align: center;
    color: #94a3b8;
    transition: transform 0.2s;
}

.node-header.collapsed .node-icon-toggle {
    transform: rotate(-90deg);
}

.node-children {
    padding-left: 20px;
    border-left: 1px dashed #334155;
    margin-left: 18px;
    margin-top: 4px;
    transition: max-height 0.3s ease-out;
}

.node-header.collapsed + .node-children {
    display: none;
}

/* Specific levels colors */
.level-1 > .node-header {
    background-color: #1e2538;
    border: 1px solid #334155;
    font-size: 14px;
    font-weight: 600;
}
.level-1.receber > .node-header { border-left: 4px solid #10b981; }
.level-1.pagar > .node-header { border-left: 4px solid #ef4444; }

.level-2 > .node-header {
    background-color: #171d2b;
    font-size: 13px;
    color: #cbd5e1;
}

.level-3 > .node-header {
    background-color: #121620;
    font-size: 12px;
    color: #94a3b8;
}

.level-4 > .node-header {
    background-color: #0e111a;
    font-size: 12px;
    color: #cbd5e1;
}

/* Leaves / Titles list */
.leaves-table-wrapper {
    background-color: #080a10;
    border-radius: 6px;
    padding: 8px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.leaves-table {
    font-size: 11px;
}

.leaves-table th {
    background-color: #0f1322;
    padding: 6px 8px;
}

.leaves-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #121826;
    color: #94a3b8;
}

/* TOAST NOTIFICATION */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-left: 4px solid #2563eb;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.success { border-left-color: #10b981; }
.toast-notification.error { border-left-color: #ef4444; }
.toast-notification.warning { border-left-color: #f59e0b; }

/* ANALYSIS GRID & SIMULATOR */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

.card-simulator {
    background-color: #121826;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.simulator-wrapper {
    display: flex;
    flex-direction: column;
}

.simulator-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.simulator-item {
    background-color: #1a202c;
    border: 1px solid #2d3748;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s, background-color 0.2s;
}

.simulator-item:hover {
    border-color: #3182ce;
    background-color: #232c3f;
}

.sim-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 60%;
}

.sim-title {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sim-meta {
    font-size: 11px;
    color: #a0aec0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sim-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-value {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.sim-date-input {
    background-color: #0d1117;
    border: 1px solid #4a5568;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    width: 120px;
    text-align: center;
}

.sim-date-input:focus {
    border-color: #3182ce;
}

/* Date Picker Calendar Contrast */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Logo & Footer Styles */
.brand-logo {
    max-height: 32px;
    width: auto;
    object-fit: contain;
}

.login-logo {
    max-height: 48px;
    width: auto;
    object-fit: contain;
    margin-bottom: 12px;
}

.dashboard-footer {
    margin-top: 40px;
    padding: 16px 24px;
    background-color: #0f1322;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 12px;
}

.footer-credits {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo {
    height: 20px;
    width: auto;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-version {
    color: #64748b;
    font-weight: 500;
}

/* MATRIX PIVOT GRID STYLES */
.matrix-container {
    width: 100%;
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border: 1px solid #1e293b;
    border-radius: 12px;
    background-color: #0f172a;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5px;
    color: #e2e8f0;
}

.matrix-table th, .matrix-table td {
    padding: 5px 6px;
    border-bottom: 1px solid #1e293b;
    white-space: nowrap;
}

.matrix-table th {
    background-color: #0f172a !important;
    color: #94a3b8;
    font-weight: 600;
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Sticky First Column ("Contas") */
.matrix-table th.col-accounts,
.matrix-table td.col-accounts {
    position: sticky !important;
    left: 0 !important;
    background-color: #0f172a !important;
    z-index: 10 !important;
    border-right: 1px solid #1e293b;
    min-width: 160px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matrix-table th.col-accounts {
    background-color: #0f172a !important;
    top: 0 !important;
    left: 0 !important;
    position: sticky !important;
    z-index: 30 !important;
}

/* Extrato Admin Sticky Header */
#extrato-table thead th {
    position: sticky !important;
    top: 0 !important;
    background-color: #1e293b !important;
    z-index: 20 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Sticky Last Column ("Total") */
.matrix-table th.col-total,
.matrix-table td.col-total,
.matrix-table th.col-total-seasonality,
.matrix-table td.col-total-seasonality {
    position: sticky !important;
    right: 0 !important;
    background-color: #121826 !important;
    z-index: 10 !important;
    border-left: 1px solid #1e293b;
    font-weight: 600;
}

.matrix-table th.col-total,
.matrix-table th.col-total-seasonality {
    background-color: #1e293b !important;
    top: -1px !important;
    z-index: 30 !important;
}

.matrix-table tr:hover td {
    background-color: rgba(254, 254, 254, 0.02);
}

.matrix-table tr:hover td.col-accounts {
    background-color: #1e2536;
}

.matrix-table tr:hover td.col-total,
.matrix-table tr:hover td.col-total-seasonality {
    background-color: #1e2536;
}

/* Indentation levels */
.matrix-row.level-1 td.col-accounts { font-weight: 600; font-size: 12px; padding-left: 12px; }
.matrix-row.level-2 td.col-accounts { padding-left: 28px; }
.matrix-row.level-3 td.col-accounts { padding-left: 44px; color: #94a3b8; }
.matrix-row.level-4 td.col-accounts { padding-left: 60px; color: #cbd5e1; }
.matrix-row.level-5 td.col-accounts { padding-left: 76px; color: #94a3b8; font-size: 11px; }

.matrix-row.level-5 {
    background-color: rgba(15, 23, 42, 0.45);
    font-size: 11px;
}
.matrix-row.level-5 td {
    padding: 3px 4px;
    border-bottom: 1px dotted rgba(51, 65, 85, 0.6);
}
.matrix-row.level-5:hover td {
    background-color: rgba(56, 189, 248, 0.08) !important;
}

/* Expanded / Collapsed styles */
.matrix-row .node-icon-toggle {
    display: inline-block;
    width: 16px;
    margin-right: 6px;
    color: #64748b;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}

.matrix-row.collapsed .node-icon-toggle {
    transform: rotate(-90deg);
}

.matrix-row .node-name {
    font-weight: 500;
}

/* Row colors based on RECEBER, PAGAR or TROCADOS */
.matrix-row.receber td.col-accounts {
    border-left: 4px solid #10b981;
}
.matrix-row.trocados td.col-accounts {
    border-left: 4px solid #2dd4bf;
}
.matrix-row.pagar td.col-accounts {
    border-left: 4px solid #ef4444;
}

/* Details row spanning all columns */
.matrix-details-row td {
    padding: 0;
    background-color: #0b0e17;
}

.matrix-details-container {
    padding: 12px 20px;
    border-bottom: 1px solid #1e293b;
}

.matrix-details-container .leaves-table-wrapper {
    background-color: #121826;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 8px;
    overflow-x: auto;
}

/* Bottom Matrix Total Row */
.matrix-total-row {
    background-color: #1e293b !important;
    font-weight: 600;
}

.matrix-total-row td {
    border-top: 2px solid #334155;
    border-bottom: 2px solid #334155;
}

.matrix-total-row td.col-accounts {
    background-color: #1e293b !important;
    font-weight: 600;
}

.matrix-total-row td.col-total {
    background-color: #1e293b !important;
    font-weight: 600;
}
/* Comparative Dashboard & Widget Customization Styles */
.comparison-summary-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 24px !important;
}
@media (max-width: 900px) {
    .comparison-summary-row {
        grid-template-columns: 1fr !important;
    }
}

.widgets-container-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.modal-overlay {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.modal-card {
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.widget-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -10px rgba(0, 0, 0, 0.5);
}

.progress-bar-container {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
}

.custom-tooltip {
    z-index: 99999999 !important;
}

/* ==========================================================================
   Admin Card & Chart Visibility Controls (Ativação / Desativação p/ Usuários)
   ========================================================================== */
.card-admin-vis-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 5px;
    z-index: 12;
    transition: all 0.2s ease;
    user-select: none;
}
.card-admin-vis-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.card-admin-vis-badge.vis-active {
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(6, 78, 59, 0.4);
}
.card-admin-vis-badge.vis-hidden {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(120, 53, 15, 0.4);
}
.card.admin-hidden-card {
    border: 1px dashed #f59e0b !important;
    position: relative;
}
.card.admin-hidden-card::after {
    content: "Oculto p/ Usuários";
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 9px;
    color: #f59e0b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.admin-vis-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.admin-vis-btn.vis-active {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}
.admin-vis-btn.vis-hidden {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}
.admin-vis-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.vis-filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}
.vis-filter-pill:hover, .vis-filter-pill.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

/* ==========================================================================
   Admin In-Place Visibility Toggle Controls (Botões Claros de Ativação/Reativação)
   ========================================================================== */

/* Ajuste nos Cards de Indicadores do Topo para Admin */
body.is-admin-user .summary-cards .card {
    height: 70px;
    padding: 8px 10px;
    position: relative;
}
body.is-admin-user .summary-cards .card .card-info h3 {
    padding-right: 58px;
    font-size: 11px;
    line-height: 1.2;
}

/* Botão Compacto e Elegante para os 7 Cards Topo (KPIs) */
.card-admin-action-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none; /* Ativado via JS para Admin */
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    border: 1px solid transparent;
    user-select: none;
    line-height: 1.3;
}
.card-admin-action-btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
}
.card-admin-action-btn.is-active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
}
.card-admin-action-btn.is-active:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #f87171;
}
.card-admin-action-btn.is-hidden {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    color: #fbbf24;
}
.card-admin-action-btn.is-hidden:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    color: #34d399;
}

/* Botão para os Cards de Resumo Comparativo (Projetado x Realizado) */
.comp-card-admin-vis-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.comp-card-admin-vis-btn.is-active {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
}
.comp-card-admin-vis-btn.is-active:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}
.comp-card-admin-vis-btn.is-hidden {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fbbf24;
}
.comp-card-admin-vis-btn.is-hidden:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
}
.comp-card-admin-vis-btn .btn-badge {
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Botão Claro para Subcards Internos (Ex: Empréstimos Bancários e Mútuo da Ocorrência Temporal) */
.subcard-admin-vis-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    user-select: none;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}
.subcard-admin-vis-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}
.subcard-admin-vis-btn.is-active {
    background: rgba(16, 185, 129, 0.18);
    border-color: #10b981;
    color: #34d399;
}
.subcard-admin-vis-btn.is-active:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #f87171;
}
.subcard-admin-vis-btn.is-active:hover .btn-badge {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
}
.subcard-admin-vis-btn.is-hidden {
    background: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    color: #fbbf24;
}
.subcard-admin-vis-btn.is-hidden:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: #10b981;
    color: #34d399;
}
.subcard-admin-vis-btn.is-hidden:hover .btn-badge {
    background: rgba(16, 185, 129, 0.4);
    color: #fff;
}
.subcard-admin-vis-btn .btn-badge {
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Botão Claro para Cabeçalhos de Gráficos, Tabelas e Painéis Principais */
.section-admin-vis-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.section-admin-vis-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.section-admin-vis-btn.is-active {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
}
.section-admin-vis-btn.is-active:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}
.section-admin-vis-btn.is-active:hover .btn-badge {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
}
.section-admin-vis-btn.is-hidden {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fbbf24;
}
.section-admin-vis-btn.is-hidden:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
}
.section-admin-vis-btn.is-hidden:hover .btn-badge {
    background: rgba(16, 185, 129, 0.4);
    color: #fff;
}
.section-admin-vis-btn .btn-badge {
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

/* Card Ocultado pelo Admin - Destaque Visual Imediato */
.card.admin-hidden-card,
.card-chart.admin-hidden-card,
.card-table.admin-hidden-card,
.card-table-subcard.admin-hidden-card,
.comparison-summary-row.admin-hidden-card {
    border: 2px dashed #f59e0b !important;
    position: relative !important;
    background: rgba(245, 158, 11, 0.05) !important;
}

/* Banner de Aviso de Ocultação */
.admin-hidden-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 14px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    font-size: 11.5px;
    font-weight: 600;
}

.btn-reactivate-mini {
    background: #f59e0b;
    color: #0f172a;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-reactivate-mini:hover {
    background: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

